diff --git a/README.md b/README.md index 07dde17..e74d99d 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,9 @@ - For iPad 4, only 7.0.x blobs can be used - Restoring to other unsigned versions without blobs is supported on the following devices and target versions: - iPhone 3GS - iOS 3.1.3, 4.1, 4.3.3, 5.0.1, 5.1.1 - - iPod touch 2 - iOS 3.1.3, 4.1 + - iPod touch 2 - iOS 2.1.1 to 3.0, 3.1.3, 4.1 + - iPhone 2G, 3G, iPod touch 1 - all versions + - iOS 1 doesn't seem to work and may require usage of [ZiPhone](https://github.com/Zibri/ZiPhone), [more info here](https://nitter.net/tihmstar/status/1734620913071542435) ## Supported OS versions/distros diff --git a/bin/linux/arm64/ideviceactivation b/bin/linux/arm64/ideviceactivation index 516d668..4fe2a8f 100755 Binary files a/bin/linux/arm64/ideviceactivation and b/bin/linux/arm64/ideviceactivation differ diff --git a/bin/linux/arm64/idevicediagnostics b/bin/linux/arm64/idevicediagnostics index 2163d58..3dafba4 100755 Binary files a/bin/linux/arm64/idevicediagnostics and b/bin/linux/arm64/idevicediagnostics differ diff --git a/bin/linux/arm64/ideviceenterrecovery b/bin/linux/arm64/ideviceenterrecovery index ee3db60..b353f34 100755 Binary files a/bin/linux/arm64/ideviceenterrecovery and b/bin/linux/arm64/ideviceenterrecovery differ diff --git a/bin/linux/arm64/ideviceinfo b/bin/linux/arm64/ideviceinfo index 14ca228..e704701 100755 Binary files a/bin/linux/arm64/ideviceinfo and b/bin/linux/arm64/ideviceinfo differ diff --git a/bin/linux/arm64/idevicepair b/bin/linux/arm64/idevicepair index 8bca234..5ebcf04 100755 Binary files a/bin/linux/arm64/idevicepair and b/bin/linux/arm64/idevicepair differ diff --git a/bin/linux/arm64/idevicererestore b/bin/linux/arm64/idevicererestore index b93ca45..0435b90 100755 Binary files a/bin/linux/arm64/idevicererestore and b/bin/linux/arm64/idevicererestore differ diff --git a/bin/linux/arm64/idevicerestore b/bin/linux/arm64/idevicerestore index 5a953ba..bc5a412 100755 Binary files a/bin/linux/arm64/idevicerestore and b/bin/linux/arm64/idevicerestore differ diff --git a/bin/linux/arm64/iproxy b/bin/linux/arm64/iproxy index 0d6ce9b..2381d16 100755 Binary files a/bin/linux/arm64/iproxy and b/bin/linux/arm64/iproxy differ diff --git a/bin/linux/arm64/irecovery b/bin/linux/arm64/irecovery index defd10e..2666b4f 100755 Binary files a/bin/linux/arm64/irecovery and b/bin/linux/arm64/irecovery differ diff --git a/bin/linux/armhf/ideviceactivation b/bin/linux/armhf/ideviceactivation index 49d5bf5..d69bf5e 100755 Binary files a/bin/linux/armhf/ideviceactivation and b/bin/linux/armhf/ideviceactivation differ diff --git a/bin/linux/armhf/idevicediagnostics b/bin/linux/armhf/idevicediagnostics index 2ff652a..ac2327e 100755 Binary files a/bin/linux/armhf/idevicediagnostics and b/bin/linux/armhf/idevicediagnostics differ diff --git a/bin/linux/armhf/ideviceenterrecovery b/bin/linux/armhf/ideviceenterrecovery index 09c8963..b42e147 100755 Binary files a/bin/linux/armhf/ideviceenterrecovery and b/bin/linux/armhf/ideviceenterrecovery differ diff --git a/bin/linux/armhf/ideviceinfo b/bin/linux/armhf/ideviceinfo index 2859a2d..a821069 100755 Binary files a/bin/linux/armhf/ideviceinfo and b/bin/linux/armhf/ideviceinfo differ diff --git a/bin/linux/armhf/idevicepair b/bin/linux/armhf/idevicepair index 38719d8..c36177d 100755 Binary files a/bin/linux/armhf/idevicepair and b/bin/linux/armhf/idevicepair differ diff --git a/bin/linux/armhf/idevicererestore b/bin/linux/armhf/idevicererestore index ef7aafa..838329a 100755 Binary files a/bin/linux/armhf/idevicererestore and b/bin/linux/armhf/idevicererestore differ diff --git a/bin/linux/armhf/idevicerestore b/bin/linux/armhf/idevicerestore index 6b4b946..1b1abe4 100755 Binary files a/bin/linux/armhf/idevicerestore and b/bin/linux/armhf/idevicerestore differ diff --git a/bin/linux/armhf/iproxy b/bin/linux/armhf/iproxy index 19967a6..75f8125 100755 Binary files a/bin/linux/armhf/iproxy and b/bin/linux/armhf/iproxy differ diff --git a/bin/linux/armhf/irecovery b/bin/linux/armhf/irecovery index 546012f..769a73a 100755 Binary files a/bin/linux/armhf/irecovery and b/bin/linux/armhf/irecovery differ diff --git a/bin/linux/x86_64/ideviceactivation b/bin/linux/x86_64/ideviceactivation index 22e21fb..749a39e 100755 Binary files a/bin/linux/x86_64/ideviceactivation and b/bin/linux/x86_64/ideviceactivation differ diff --git a/bin/linux/x86_64/idevicediagnostics b/bin/linux/x86_64/idevicediagnostics index 9b68f55..93dd84e 100755 Binary files a/bin/linux/x86_64/idevicediagnostics and b/bin/linux/x86_64/idevicediagnostics differ diff --git a/bin/linux/x86_64/ideviceenterrecovery b/bin/linux/x86_64/ideviceenterrecovery index 7353fb1..e2faeec 100755 Binary files a/bin/linux/x86_64/ideviceenterrecovery and b/bin/linux/x86_64/ideviceenterrecovery differ diff --git a/bin/linux/x86_64/ideviceinfo b/bin/linux/x86_64/ideviceinfo index 5eaf3f2..0db14cf 100755 Binary files a/bin/linux/x86_64/ideviceinfo and b/bin/linux/x86_64/ideviceinfo differ diff --git a/bin/linux/x86_64/ideviceinstaller b/bin/linux/x86_64/ideviceinstaller index 326405e..d66b6ad 100755 Binary files a/bin/linux/x86_64/ideviceinstaller and b/bin/linux/x86_64/ideviceinstaller differ diff --git a/bin/linux/x86_64/idevicepair b/bin/linux/x86_64/idevicepair index 56261fd..b960e24 100755 Binary files a/bin/linux/x86_64/idevicepair and b/bin/linux/x86_64/idevicepair differ diff --git a/bin/linux/x86_64/idevicererestore b/bin/linux/x86_64/idevicererestore index c486254..4950997 100755 Binary files a/bin/linux/x86_64/idevicererestore and b/bin/linux/x86_64/idevicererestore differ diff --git a/bin/linux/x86_64/idevicerestore b/bin/linux/x86_64/idevicerestore index 3a9c38c..589f223 100755 Binary files a/bin/linux/x86_64/idevicerestore and b/bin/linux/x86_64/idevicerestore differ diff --git a/bin/linux/x86_64/iproxy b/bin/linux/x86_64/iproxy index 177ff5d..8fd5781 100755 Binary files a/bin/linux/x86_64/iproxy and b/bin/linux/x86_64/iproxy differ diff --git a/bin/linux/x86_64/irecovery b/bin/linux/x86_64/irecovery index ec2ff4d..b25e1f8 100755 Binary files a/bin/linux/x86_64/irecovery and b/bin/linux/x86_64/irecovery differ diff --git a/bin/macos/idevicediagnostics b/bin/macos/idevicediagnostics index 63a9f90..021aa42 100755 Binary files a/bin/macos/idevicediagnostics and b/bin/macos/idevicediagnostics differ diff --git a/bin/macos/ideviceenterrecovery b/bin/macos/ideviceenterrecovery index 0044c68..2258d7e 100755 Binary files a/bin/macos/ideviceenterrecovery and b/bin/macos/ideviceenterrecovery differ diff --git a/bin/macos/ideviceinfo b/bin/macos/ideviceinfo index a7f9b5e..bf1fb14 100755 Binary files a/bin/macos/ideviceinfo and b/bin/macos/ideviceinfo differ diff --git a/bin/macos/ideviceinstaller b/bin/macos/ideviceinstaller index 269510c..294fc6b 100755 Binary files a/bin/macos/ideviceinstaller and b/bin/macos/ideviceinstaller differ diff --git a/bin/macos/idevicepair b/bin/macos/idevicepair index 053636c..626790e 100755 Binary files a/bin/macos/idevicepair and b/bin/macos/idevicepair differ diff --git a/bin/macos/idevicererestore b/bin/macos/idevicererestore index 8ddbe2c..975e9fc 100755 Binary files a/bin/macos/idevicererestore and b/bin/macos/idevicererestore differ diff --git a/bin/macos/idevicerestore b/bin/macos/idevicerestore index 6470e8b..5c0a261 100755 Binary files a/bin/macos/idevicerestore and b/bin/macos/idevicerestore differ diff --git a/bin/macos/iproxy b/bin/macos/iproxy index 730f1dc..36b882c 100755 Binary files a/bin/macos/iproxy and b/bin/macos/iproxy differ diff --git a/bin/macos/irecovery b/bin/macos/irecovery index df51486..d123fab 100755 Binary files a/bin/macos/irecovery and b/bin/macos/irecovery differ diff --git a/bin/macos/lib/libideviceactivation-1.0.2.dylib b/bin/macos/lib/libideviceactivation-1.0.2.dylib index b897835..860f209 100755 Binary files a/bin/macos/lib/libideviceactivation-1.0.2.dylib and b/bin/macos/lib/libideviceactivation-1.0.2.dylib differ diff --git a/bin/macos/lib/libimobiledevice-1.0.6.dylib b/bin/macos/lib/libimobiledevice-1.0.6.dylib index 058d98c..61b6f92 100755 Binary files a/bin/macos/lib/libimobiledevice-1.0.6.dylib and b/bin/macos/lib/libimobiledevice-1.0.6.dylib differ diff --git a/bin/macos/lib/libimobiledevice-glue-1.0.0.dylib b/bin/macos/lib/libimobiledevice-glue-1.0.0.dylib index 3778a7a..022da43 100755 Binary files a/bin/macos/lib/libimobiledevice-glue-1.0.0.dylib and b/bin/macos/lib/libimobiledevice-glue-1.0.0.dylib differ diff --git a/bin/macos/lib/libirecovery-1.0.3.dylib b/bin/macos/lib/libirecovery-1.0.3.dylib index c986969..6388688 100755 Binary files a/bin/macos/lib/libirecovery-1.0.3.dylib and b/bin/macos/lib/libirecovery-1.0.3.dylib differ diff --git a/bin/macos/lib/libplist-2.0.4.dylib b/bin/macos/lib/libplist-2.0.4.dylib index ca10379..468ec63 100755 Binary files a/bin/macos/lib/libplist-2.0.4.dylib and b/bin/macos/lib/libplist-2.0.4.dylib differ diff --git a/bin/macos/lib/libusbmuxd-2.0.6.dylib b/bin/macos/lib/libusbmuxd-2.0.6.dylib index 9eb5a3c..3a2ced5 100755 Binary files a/bin/macos/lib/libusbmuxd-2.0.6.dylib and b/bin/macos/lib/libusbmuxd-2.0.6.dylib differ diff --git a/restore.sh b/restore.sh index b195f27..c79709f 100755 --- a/restore.sh +++ b/restore.sh @@ -575,8 +575,9 @@ device_get_info() { log "Getting device info..." if [[ $device_mode == "WTF" ]]; then - device_s5l8900xall + device_proc=1 device_wtfexit=1 + device_s5l8900xall fi case $device_mode in "DFU" | "Recovery" ) @@ -863,6 +864,7 @@ device_find_mode() { local i=0 local device_in local mode="$1" + local wtfreal if [[ $mode == "Restore" ]]; then : @@ -873,6 +875,9 @@ device_find_mode() { if [[ $mode == "DFUreal" ]]; then mode="DFU" usb=1227 + elif [[ $mode == "WTFreal" ]]; then + mode="WTF" + wtfreal=1 elif [[ $mode == "DFU" ]]; then mode="WTF" fi @@ -913,7 +918,7 @@ device_find_mode() { error "Failed to find device in $mode mode (Timed out). Please run the script again." fi return 1 - elif [[ $mode == "WTF" ]]; then + elif [[ $mode == "WTF" && $wtfreal != 1 ]]; then device_s5l8900xall fi } @@ -1012,7 +1017,11 @@ device_dfuhelper() { sleep 1 done echo - device_find_mode DFU + if [[ $2 == "WTFreal" ]]; then + device_find_mode WTFreal + else + device_find_mode DFU + fi } device_enter_mode() { @@ -1020,6 +1029,22 @@ device_enter_mode() { # attempt to enter given mode, and device_find_mode function will then set device_mode variable local opt case $1 in + "WTFreal" ) + if [[ $device_mode == "WTF" ]]; then + return + elif [[ $device_mode == "Normal" ]]; then + device_enter_mode Recovery + fi + if [[ $device_mode == "Recovery" ]]; then + device_dfuhelper norec WTFreal + return + fi + log "Found an S5L8900 device in $device_mode mode. Your device needs to be in WTF mode to continue." + print "* iOS 1 restores require WTF mode." + print "* Force restart your device and place it in normal or recovery mode, then re-enter WTF mode." + device_find_mode WTFreal 100 + ;; + "Recovery" ) if [[ $device_mode == "Normal" ]]; then print "* The device needs to be in recovery/DFU mode before proceeding." @@ -1176,6 +1201,10 @@ device_enter_mode() { local irec_pwned local tool_pwned + if [[ $device_proc == 1 ]]; then + device_enter_mode DFU + return + fi if [[ $device_mode == "DFU" ]]; then irec_pwned=$($irecovery -q | grep -c "PWND") fi @@ -3050,7 +3079,12 @@ ipsw_prepare_custom() { mv options.plist options.$device_model.plist fi if [[ $device_target_vers == "3"* ]]; then - RootSize=520 + case $device_type in + iPhone1,[12] ) RootSize=420;; + iPhone2,1 ) RootSize=530;; + iPod1,1 ) RootSize=413;; + iPod2,1 ) RootSize=450;; + esac elif [[ $platform == "macos" ]]; then plutil -extract 'SystemPartitionSize' xml1 options.$device_model.plist -o size RootSize=$(cat size | sed -ne '//,/<\/integer>/p' | sed -e "s///" | sed "s/<\/integer>//" | sed '2d') @@ -3280,7 +3314,7 @@ restore_idevicerestore() { echo log "Restoring done! Read the message below if any error has occurred:" case $device_target_vers in - 3* | 4* ) print "* For device activation, go to: Other Utilities -> Attempt Activation";; + 1* | 2* | 3* | 4* ) print "* For device activation, go to: Other Utilities -> Attempt Activation";; esac if [[ $opt != 0 ]]; then print "* If the restore failed on updating baseband:" @@ -3415,25 +3449,24 @@ restore_latest() { device_enter_mode Recovery ipsw_extract fi + if [[ $debug_mode == 1 ]]; then + ExtraArgs+="d" + fi log "Running idevicerestore with command: $idevicerestore2 $ExtraArgs \"$ipsw_path.ipsw\"" $idevicerestore2 $ExtraArgs "$ipsw_path.ipsw" opt=$? if [[ $1 == "custom" ]]; then log "Restoring done! Read the message below if any error has occurred:" - if [[ $opt != 0 ]]; then - print "* If you are getting the error \"unable to find AppleNANDFTL\":" - print " -> This means that your device is not compatible with $device_target_vers" - fi print "* Please read the \"Troubleshooting\" wiki page in GitHub before opening any issue!" print "* Your problem may have already been addressed within the wiki page." print "* If opening an issue in GitHub, please provide a FULL log/output. Otherwise, your issue may be dismissed." fi case $device_target_vers in - 3* | 4* ) print "* For device activation, go to: Other Utilities -> Attempt Activation";; + 1* | 2* | 3* | 4* ) print "* For device activation, go to: Other Utilities -> Attempt Activation";; esac if [[ $ipsw_jailbreak == 1 ]]; then case $device_target_vers in - 4* | 3* ) warn "Do not uninstall Cydia Substrate and Substrate Safe Mode in Cydia!";; + 3* | 4* ) warn "Do not uninstall Cydia Substrate and Substrate Safe Mode in Cydia!";; esac fi } @@ -3491,11 +3524,10 @@ restore_prepare() { case $device_proc in 1 ) device_enter_mode DFU - if [[ $ipsw_jailbreak == 1 ]]; then - restore_latest custom - else - restore_latest + if [[ $ipsw_jailbreak != 1 ]]; then + ipsw_custom="$ipsw_path" fi + restore_latest custom ;; 4 ) @@ -4481,16 +4513,16 @@ menu_restore() { iPhone1,2 | iPod2,1 ) menu_items+=("4.1" "3.1.3");; esac + case $device_type in + iPhone3,[13] | iPad1,1 | iPod3,1 ) + menu_items+=("powdersn0w (any iOS)");; + esac if (( device_proc < 7 )); then menu_items+=("Latest iOS ($device_latest_vers)") fi case $device_type in iPhone4,1 | iPhone5,[1234] | iPad2,4 | iPad3,[456] | iPod5,1 ) menu_items+=("Other (powdersn0w 7.x blobs)");; - iPhone3,[13] | iPad1,1 | iPod3,1 ) - menu_items+=("powdersn0w (any iOS)");; - esac - case $device_type in iPhone1,[12] | iPhone2,1 | iPod[12],1 ) if [[ -z $1 ]]; then menu_items+=("Other (Custom IPSW)") @@ -4505,7 +4537,8 @@ menu_restore() { menu_items+=("Other (Tethered)") fi case $device_type in - iPhone3,2 | iPod4,1 ) menu_items+=("Other (Tethered)");; + iPhone3,2 | iPod4,1 ) + menu_items+=("Other (Tethered)");; esac if (( device_proc < 7 )); then menu_items+=("DFU IPSW") @@ -4518,6 +4551,17 @@ menu_restore() { else print " > Main Menu > Restore/Downgrade" fi + if [[ -z $1 ]]; then + if [[ $device_proc == 1 ]]; then + print "* Select \"Other (Custom IPSW)\" to restore to any iOS version" + print "* iOS 1 may require the usage of ZiPhone: https://nitter.net/tihmstar/status/1734620913071542435" + echo + fi + if [[ $device_type == "iPod2,1" ]]; then + print "* Select \"Other (Custom IPSW)\" to restore to any iOS version (2.1.1 to 3.0)" + echo + fi + fi input "Select an option:" select opt in "${menu_items[@]}"; do selected="$opt" @@ -5128,18 +5172,16 @@ device_jailbreakrd() { print "* Supported versions are: 3.1.3 to 9.3.4 (excluding 9.0.x)" ;; esac - if [[ $device_proc == 5 ]]; then - case $device_vers in - 8.2 | 8.1* | 8.0* ) + case $device_vers in + 8.2 | 8.1* | 8.0* ) + if [[ $device_proc == 5 ]]; then warn "This version ($device_vers) is broken for daibutsu A5(X)." print "* Supported iOS 8 versions for A5(X) are 8.3 to 8.4.1 only for now." print "* For this version, use Home Depot patched with ohd." print "* https://ios.cfw.guide/installing-homedepot/" return - ;; - esac - fi - case $device_vers in + fi + ;; 9.0* ) print "* For this version, use Pangu9, or download openpwnage and sideload it to your device." print "* https://ios.cfw.guide/installing-pangu9/" @@ -5261,14 +5303,13 @@ restore_customipsw() { if [[ -z $ipsw_path ]]; then error "No IPSW selected, cannot continue." fi - device_enter_mode pwnDFU - ipsw_extract - log "Running idevicerestore with command: $idevicerestore -ce \"$ipsw_path.ipsw\"" - $idevicerestore -ce "$ipsw_path.ipsw" - log "Restoring done!" - case $device_target_vers in - 3* | 4* ) print "* For device activation, go to: Other Utilities -> Attempt Activation";; - esac + if [[ $device_target_vers == "1"* ]]; then + device_enter_mode WTFreal + else + device_enter_mode pwnDFU + fi + ipsw_custom="$ipsw_path" + restore_latest custom } restore_dfuipsw() {