#!/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) 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 if [[ $platform == "macos" ]]; then killall -CONT AMPDevicesAgent AMPDeviceDiscoveryAgent MobileDeviceUpdater fi } 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 sudo systemctl restart usbmuxd 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: --debug For script debugging (set -x and debug mode) --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 --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): --disable-bbupdate Disable bbupdate and enable dumping/stitching baseband --ipsw-hacktivate Enable hacktivation for creating IPSW (iPhone 2G/3G/3GS only) --ipsw-verbose Enable verbose boot option (powdersn0w only) --jailbreak Enable jailbreak option --memory Enable memory option for creating IPSW * Default IPSW path: