#!/usr/bin/env bash ipsw_openssh=1 # OpenSSH will be added to jailbreak/custom IPSW if set to 1. device_ramdisk_build="" # You can change the version of SSH Ramdisk and Pwned iBSS/iBEC here. (default is 10B329 for most devices) device_verbose_boot=0 # By setting this to 1 and changing the build version above, the SSH Ramdisk option turns to tethered verbose boot. jelbrek="../resources/jailbreak" 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() { kill $httpserver_pid $iproxy_pid 2>/dev/null popd &>/dev/null rm -rf "$(dirname "$0")/tmp/"* "$(dirname "$0")/iP"*/ "$(dirname "$0")/tmp/" 2>/dev/null } clean_sudo() { clean sudo rm -rf /tmp/futurerestore /tmp/*.json "$(dirname "$0")/tmp/"* "$(dirname "$0")/iP"*/ "$(dirname "$0")/tmp/" sudo kill $sudoloop_pid } clean_usbmuxd() { clean_sudo ps aux | awk '/usbmuxd/ {print "sudo kill "$2" 2>/dev/null"}' | bash sudo systemctl restart usbmuxd } bash_version=$(/usr/bin/env bash -c 'echo ${BASH_VERSINFO[0]}') if (( bash_version > 3 )); then shopt -s compat32 fi display_help() { echo ' *** Legacy iOS Kit *** - Script by LukeZGD - Usage: ./restore.sh [Options] List of options: --activation-records Enable dumping/stitching activation records --debug For script debugging (set -x and debug mode) --disable-bbupdate Disable bbupdate and enable dumping/stitching baseband --disable-sudoloop Disable running tools as root for Linux --disable-usbmuxd Disable running usbmuxd as root for Linux --entry-device Enable manual device and ECID entry --help Display this help message --ipsw-hacktivate Enable hacktivation for creating IPSW (iPhone 3GS only) --no-color Disable colors for script output --no-device Enable no device mode --no-version-check Disable script version checking For 32-bit devices compatible with restores/downgrades (see README): --ipsw-verbose Enable verbose boot option (powdersn0w only) --jailbreak Enable jailbreak option --memory Enable memory option for creating IPSW * Default IPSW path: