diff --git a/README.md b/README.md index 9bb9a8a..49e3c58 100644 --- a/README.md +++ b/README.md @@ -131,9 +131,8 @@ - ipsw tool from [xpwn](https://github.com/LukeeGD/xpwn) (OdysseusOTA/2) - Python 2 (for ipwndfu, rmsigchks, SimpleHTTPServer) - [tsschecker](https://github.com/tihmstar/tsschecker) -- [futurerestore 152](http://api.tihmstar.net/builds/futurerestore/futurerestore-latest.zip) (32-bit) -- [futurerestore 251 (Linux)](https://github.com/LukeeGD/futurerestore) (A7) -- [futurerestore 245 (macOS)](https://github.com/MatthewPierson/Vieux/blob/master/resources/bin/futurerestore) (A7) +- [futurerestore](http://api.tihmstar.net/builds/futurerestore/futurerestore-latest.zip) used for 32-bit devices +- [futurerestore](https://github.com/m1stadev/futurerestore) used for A7 devices - [kloader](https://www.youtube.com/watch?v=fh0tB6fp0Sc) - [kloader5 for iOS 5](https://www.pmbonneau.com/cydia/com.pmbonneau.kloader5_1.2_iphoneos-arm.deb) - [kloader_hgsp for iOS 10](https://twitter.com/nyan_satan/status/945203180522045440) diff --git a/resources/depends.sh b/resources/depends.sh index c4c4361..484f20f 100755 --- a/resources/depends.sh +++ b/resources/depends.sh @@ -6,6 +6,7 @@ SetToolPaths() { platform="linux" platformver="$PRETTY_NAME" + bspatch="$(which bspatch)" futurerestore1="sudo LD_PRELOAD=./resources/lib/libcurl.so.3 LD_LIBRARY_PATH=./resources/lib ./resources/tools/futurerestore1_linux" futurerestore2="sudo LD_LIBRARY_PATH=./resources/lib ./resources/tools/futurerestore2_linux" idevicerestore="sudo LD_LIBRARY_PATH=./resources/lib ./resources/tools/idevicerestore_linux" @@ -13,11 +14,12 @@ SetToolPaths() { ipwndfu="sudo $python ipwndfu" rmsigchks="sudo $python rmsigchks.py" SimpleHTTPServer="sudo $python -m SimpleHTTPServer 80" - + elif [[ $OSTYPE == "darwin"* ]]; then platform="macos" platformver="${1:-$(sw_vers -productVersion)}" + bspatch="/usr/bin/bspatch" futurerestore1="./resources/tools/futurerestore1_macos" futurerestore2="./resources/tools/futurerestore2_macos" idevicerestore="./resources/tools/idevicerestore_macos" @@ -27,7 +29,6 @@ SetToolPaths() { rmsigchks="$python rmsigchks.py" SimpleHTTPServer="$python -m SimpleHTTPServer 80" fi - bspatch="$(which bspatch)" git="$(which git)" ideviceenterrecovery="./resources/libimobiledevice_$platform/ideviceenterrecovery" ideviceinfo="./resources/libimobiledevice_$platform/ideviceinfo" diff --git a/resources/downgrade.sh b/resources/downgrade.sh index 7818c1a..a5c66d1 100755 --- a/resources/downgrade.sh +++ b/resources/downgrade.sh @@ -62,6 +62,7 @@ FutureRestore() { } Downgrade() { + local IPSWCustomW local IPSWExtract local IPSWSHA1 local IPSWSHA1L @@ -76,9 +77,9 @@ Downgrade() { read -p "$(Input 'Path to SHSH (drag SHSH to terminal window):')" SHSH elif [[ $Mode == "Downgrade" && $DeviceProc != 7 ]]; then - read -p "$(Input 'Jailbreak the selected iOS version? (y/N):')" Jailbreak + read -p "$(Input 'Jailbreak the selected iOS version? (Y/n):')" Jailbreak - if [[ $Jailbreak == 'Y' || $Jailbreak == 'y' ]]; then + if [[ $Jailbreak != 'N' && $Jailbreak != 'n' ]]; then Jailbreak=1 if [[ $ProductType == "iPad2,5" || $ProductType == "iPad2,6" || $ProductType == "iPad2,7" || $ProductType == "iPod5,1" ]]; then @@ -108,6 +109,19 @@ Downgrade() { IPSW="${IPSWType}_${OSVer}_${BuildVer}_Restore" IPSWCustom="${IPSWType}_${OSVer}_${BuildVer}_Custom" + if [[ $Jailbreak != 1 && $DeviceProc != 7 ]]; then + Selection=("futurerestore" "idevicerestore") + Echo "* Select 1 (futurerestore) if unsure" + Echo "* Select 2 (idevicerestore) if you experience issues with futurerestore" + Input "Select restore tool to use:" + select opt in "${Selection[@]}"; do + case $opt in + "idevicerestore" ) IPSWCustom="${IPSWCustom}W"; IPSWCustomW=1; break;; + *) break;; + esac + done + fi + if [[ ! -e "$IPSW.ipsw" && ! -e "$IPSWCustom.ipsw" ]]; then Log "iOS $OSVer IPSW cannot be found." Echo "* If you already downloaded the IPSW, did you put it in the same directory as the script?" @@ -117,9 +131,11 @@ Downgrade() { mv tmp/$IPSW.ipsw . fi - if [[ $Jailbreak == 1 || $DeviceProc == 7 ]]; then + if [[ ! -e "$IPSWCustom.ipsw" && $IPSWCustomW == 1 ]]; then + Verify=1 + elif [[ $Jailbreak == 1 || $DeviceProc == 7 ]]; then [[ ! -e "$IPSWCustom.ipsw" ]] && Verify=1 - elif [[ $Jailbreak != 1 ]]; then + elif [[ $Jailbreak != 1 && $IPSWCustomW != 1 ]]; then Verify=1 fi @@ -131,7 +147,7 @@ Downgrade() { Error "Verifying IPSW failed. Your IPSW may be corrupted or incomplete." \ "Delete/replace the IPSW and run the script again" fi - elif [[ $Jailbreak == 1 && -e "$IPSWCustom.ipsw" ]]; then + elif [[ -e "$IPSWCustom.ipsw" ]]; then Log "Found existing Custom IPSW. Skipping verification." Log "Setting restore IPSW to: $IPSWCustom.ipsw" IPSWRestore=$IPSWCustom @@ -146,8 +162,8 @@ Downgrade() { [[ $DeviceState == "Normal" ]] && kDFU - if [[ $Jailbreak == 1 || $IPSWRestore == $IPSWCustom ]]; then - [[ $Jailbreak == 1 ]] && IPSW32 + if [[ $Jailbreak == 1 || $IPSWRestore == $IPSWCustom || $IPSWCustomW == 1 ]]; then + [[ $Jailbreak == 1 || $IPSWCustomW == 1 ]] && IPSW32 IPSWExtract=$IPSWCustom else IPSWExtract=$IPSW @@ -160,7 +176,7 @@ Downgrade() { IPSW64 pwnREC SaveOTABlobs - elif [[ $Jailbreak != 1 && $OSVer != "Other" ]]; then + elif [[ $Jailbreak != 1 && $OSVer != "Other" && $IPSWCustomW != 1 ]]; then Log "Preparing for futurerestore... (Enter root password of your PC/Mac when prompted)" cd resources $SimpleHTTPServer & @@ -173,7 +189,7 @@ Downgrade() { IPSWRestore="$IPSW" fi - if [[ $Jailbreak == 1 ]]; then + if [[ $Jailbreak == 1 || $IPSWCustomW == 1 ]]; then iDeviceRestore else FutureRestore diff --git a/resources/ipsw.sh b/resources/ipsw.sh index 06fd8b4..9fa748a 100755 --- a/resources/ipsw.sh +++ b/resources/ipsw.sh @@ -11,25 +11,27 @@ IPSW32() { return fi - if [[ $OSVer == 8.4.1 ]]; then - JBFiles=("fstab.tar" "etasonJB-untether.tar" "Cydia8.tar") - JBSHA1="6459dbcbfe871056e6244d23b33c9b99aaeca970" - JBPartSize=2305 - else - JBFiles=("fstab_rw.tar" "p0sixspwn.tar" "Cydia6.tar") - JBSHA1="1d5a351016d2546aa9558bc86ce39186054dc281" - JBPartSize=1260 + if [[ $Jailbreak == 1 ]]; then + if [[ $OSVer == 8.4.1 ]]; then + JBFiles=("fstab.tar" "etasonJB-untether.tar" "Cydia8.tar") + JBSHA1="6459dbcbfe871056e6244d23b33c9b99aaeca970" + JBPartSize="-s 2305" + else + JBFiles=("fstab_rw.tar" "p0sixspwn.tar" "Cydia6.tar") + JBSHA1="1d5a351016d2546aa9558bc86ce39186054dc281" + JBPartSize="-s 1260" + fi + if [[ ! -e resources/jailbreak/${JBFiles[2]} ]]; then + cd tmp + Log "Downloading jailbreak files..." + SaveFile https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/jailbreak/${JBFiles[2]} ${JBFiles[2]} $JBSHA1 + mv ${JBFiles[2]} ../resources/jailbreak + cd .. + fi + for i in {0..2}; do + JBFiles[$i]=jailbreak/${JBFiles[$i]} + done fi - if [[ ! -e resources/jailbreak/${JBFiles[2]} ]]; then - cd tmp - Log "Downloading jailbreak files..." - SaveFile https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/jailbreak/${JBFiles[2]} ${JBFiles[2]} $JBSHA1 - mv ${JBFiles[2]} ../resources/jailbreak - cd .. - fi - for i in {0..2}; do - JBFiles[$i]=jailbreak/${JBFiles[$i]} - done if [[ ! -e $IPSWCustom.ipsw ]]; then Echo "* By default, memory option is set to Y, you may select N later if you encounter problems" Echo "* If it doesn't work with both, you might not have enough RAM and/or tmp storage" @@ -38,7 +40,7 @@ IPSW32() { Log "Preparing custom IPSW..." cd resources ln -sf firmware/FirmwareBundles FirmwareBundles - $ipsw ../$IPSW.ipsw ../$IPSWCustom.ipsw $JBMemory -bbupdate -s $JBPartSize ${JBFiles[@]} + $ipsw ./../$IPSW.ipsw ./../$IPSWCustom.ipsw $JBMemory -bbupdate $JBPartSize ${JBFiles[@]} cd .. fi if [[ ! -e $IPSWCustom.ipsw ]]; then diff --git a/resources/tools/futurerestore2_linux b/resources/tools/futurerestore2_linux index 20e53bc..5d8f48f 100755 Binary files a/resources/tools/futurerestore2_linux and b/resources/tools/futurerestore2_linux differ diff --git a/resources/tools/futurerestore2_macos b/resources/tools/futurerestore2_macos index 0665fa2..ef6c34c 100755 Binary files a/resources/tools/futurerestore2_macos and b/resources/tools/futurerestore2_macos differ diff --git a/restore.sh b/restore.sh index a435885..9c1c019 100755 --- a/restore.sh +++ b/restore.sh @@ -89,8 +89,8 @@ Main() { Error "Only 64-bit (x86_64) distributions are supported." fi - if [[ $1 == "Install" || ! $bspatch || ! $git || - ! $ideviceinfo || ! $irecoverychk || ! $python ]]; then + if [[ $1 == "Install" || ! $bspatch || ! $git || ! $ideviceinfo || ! $irecoverychk || ! $python || + ! -d ./resources/libimobiledevice_$platform ]]; then Clean InstallDepends fi