#!/usr/bin/env bash device_disable_bbupdate="iPad2,3" # Disable baseband update for this device. You can also change this to your device if needed. ipsw_openssh=1 # OpenSSH will be added to custom IPSW if set to 1. (may not work on 8.4.1 etason) device_ramdisk_build="" # You can change the version of SSH Ramdisk and Pwned iBSS/iBEC here. (default is 10B329 for most devices) print() { echo "${color_B}${1}${color_N}" } input() { echo "${color_Y}[Input] ${1}${color_N}" } log() { echo "${color_G}[Log] ${1}${color_N}" } warn() { echo "${color_Y}[WARNING] ${1}${color_N}" } error() { echo -e "${color_R}[Error] ${1}\n${color_Y}${*:2}${color_N}" exit 1 } pause() { input "Press Enter/Return to continue (or press Ctrl+C to cancel)" read -s } clean() { rm -rf "$(dirname "$0")/tmp/"* "$(dirname "$0")/iP"*/ "$(dirname "$0")/tmp/" if [[ $device_sudoloop == 1 ]]; then sudo rm -rf /tmp/futurerestore /tmp/*.json "$(dirname "$0")/tmp/"* "$(dirname "$0")/iP"*/ "$(dirname "$0")/tmp/" sudo systemctl restart usbmuxd fi } clean_and_exit() { if [[ $platform == "windows" ]]; then input "Press Enter/Return to exit." read -s fi kill $httpserver_pid $iproxy_pid $sudoloop_pid $usbmuxd_pid 2>/dev/null clean } bash_version=$(/usr/bin/env bash -c 'echo ${BASH_VERSINFO[0]}') if (( bash_version < 5 )); then error "Your bash version ($bash_version) is too old. Install a newer version of bash to continue." \ "* For macOS users, install bash, libimobiledevice, and libirecovery from Homebrew or MacPorts" \ $'\n* For Homebrew: brew install bash libimobiledevice libirecovery' \ $'\n* For MacPorts: sudo port install bash libimobiledevice libirecovery' fi display_help() { echo ' *** Legacy iOS Kit *** - Script by LukeZGD - Usage: ./restore.sh [Options] List of options: --debug For script debugging (set -x and debug mode) --disable-bbupdate Disable baseband update --entry-device Enable manual device and ECID entry --help Display this help message --no-color Disable colors for script output --no-device Enable no device mode --no-version-check Disable script version checking For devices compatible with powdersn0w and OTA restores (see README): --ipsw-verbose Enable verbose boot option (powdersn0w only) --jailbreak Enable jailbreak option --memory Enable memory option for creating IPSW * Default IPSW path: