Add restore tool selection, switch to m1stadev futurerestore, other fixes

- Restore selection is for 32-bit restores without jailbreak option
- In case that futurerestore fails, users can select 2 (idevicerestore) and create custom IPSW without jailbreak
- Switch to m1stadev fork of futurerestore (194), I tested it and works for 10.3.3 A7 restores, hopefully it works fine for others as well
- Other fixes in the scripts
This commit is contained in:
LukeZGD 2021-06-20 17:45:53 +08:00
parent 5e34ef5f94
commit 0a3d69fda3
7 changed files with 53 additions and 35 deletions

View File

@ -131,9 +131,8 @@
- ipsw tool from [xpwn](https://github.com/LukeeGD/xpwn) (OdysseusOTA/2) - ipsw tool from [xpwn](https://github.com/LukeeGD/xpwn) (OdysseusOTA/2)
- Python 2 (for ipwndfu, rmsigchks, SimpleHTTPServer) - Python 2 (for ipwndfu, rmsigchks, SimpleHTTPServer)
- [tsschecker](https://github.com/tihmstar/tsschecker) - [tsschecker](https://github.com/tihmstar/tsschecker)
- [futurerestore 152](http://api.tihmstar.net/builds/futurerestore/futurerestore-latest.zip) (32-bit) - [futurerestore](http://api.tihmstar.net/builds/futurerestore/futurerestore-latest.zip) used for 32-bit devices
- [futurerestore 251 (Linux)](https://github.com/LukeeGD/futurerestore) (A7) - [futurerestore](https://github.com/m1stadev/futurerestore) used for A7 devices
- [futurerestore 245 (macOS)](https://github.com/MatthewPierson/Vieux/blob/master/resources/bin/futurerestore) (A7)
- [kloader](https://www.youtube.com/watch?v=fh0tB6fp0Sc) - [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) - [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) - [kloader_hgsp for iOS 10](https://twitter.com/nyan_satan/status/945203180522045440)

View File

@ -6,6 +6,7 @@ SetToolPaths() {
platform="linux" platform="linux"
platformver="$PRETTY_NAME" platformver="$PRETTY_NAME"
bspatch="$(which bspatch)"
futurerestore1="sudo LD_PRELOAD=./resources/lib/libcurl.so.3 LD_LIBRARY_PATH=./resources/lib ./resources/tools/futurerestore1_linux" 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" futurerestore2="sudo LD_LIBRARY_PATH=./resources/lib ./resources/tools/futurerestore2_linux"
idevicerestore="sudo LD_LIBRARY_PATH=./resources/lib ./resources/tools/idevicerestore_linux" idevicerestore="sudo LD_LIBRARY_PATH=./resources/lib ./resources/tools/idevicerestore_linux"
@ -18,6 +19,7 @@ SetToolPaths() {
platform="macos" platform="macos"
platformver="${1:-$(sw_vers -productVersion)}" platformver="${1:-$(sw_vers -productVersion)}"
bspatch="/usr/bin/bspatch"
futurerestore1="./resources/tools/futurerestore1_macos" futurerestore1="./resources/tools/futurerestore1_macos"
futurerestore2="./resources/tools/futurerestore2_macos" futurerestore2="./resources/tools/futurerestore2_macos"
idevicerestore="./resources/tools/idevicerestore_macos" idevicerestore="./resources/tools/idevicerestore_macos"
@ -27,7 +29,6 @@ SetToolPaths() {
rmsigchks="$python rmsigchks.py" rmsigchks="$python rmsigchks.py"
SimpleHTTPServer="$python -m SimpleHTTPServer 80" SimpleHTTPServer="$python -m SimpleHTTPServer 80"
fi fi
bspatch="$(which bspatch)"
git="$(which git)" git="$(which git)"
ideviceenterrecovery="./resources/libimobiledevice_$platform/ideviceenterrecovery" ideviceenterrecovery="./resources/libimobiledevice_$platform/ideviceenterrecovery"
ideviceinfo="./resources/libimobiledevice_$platform/ideviceinfo" ideviceinfo="./resources/libimobiledevice_$platform/ideviceinfo"

View File

@ -62,6 +62,7 @@ FutureRestore() {
} }
Downgrade() { Downgrade() {
local IPSWCustomW
local IPSWExtract local IPSWExtract
local IPSWSHA1 local IPSWSHA1
local IPSWSHA1L local IPSWSHA1L
@ -76,9 +77,9 @@ Downgrade() {
read -p "$(Input 'Path to SHSH (drag SHSH to terminal window):')" SHSH read -p "$(Input 'Path to SHSH (drag SHSH to terminal window):')" SHSH
elif [[ $Mode == "Downgrade" && $DeviceProc != 7 ]]; then 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 Jailbreak=1
if [[ $ProductType == "iPad2,5" || $ProductType == "iPad2,6" || if [[ $ProductType == "iPad2,5" || $ProductType == "iPad2,6" ||
$ProductType == "iPad2,7" || $ProductType == "iPod5,1" ]]; then $ProductType == "iPad2,7" || $ProductType == "iPod5,1" ]]; then
@ -108,6 +109,19 @@ Downgrade() {
IPSW="${IPSWType}_${OSVer}_${BuildVer}_Restore" IPSW="${IPSWType}_${OSVer}_${BuildVer}_Restore"
IPSWCustom="${IPSWType}_${OSVer}_${BuildVer}_Custom" 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 if [[ ! -e "$IPSW.ipsw" && ! -e "$IPSWCustom.ipsw" ]]; then
Log "iOS $OSVer IPSW cannot be found." 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?" 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 . mv tmp/$IPSW.ipsw .
fi 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 [[ ! -e "$IPSWCustom.ipsw" ]] && Verify=1
elif [[ $Jailbreak != 1 ]]; then elif [[ $Jailbreak != 1 && $IPSWCustomW != 1 ]]; then
Verify=1 Verify=1
fi fi
@ -131,7 +147,7 @@ Downgrade() {
Error "Verifying IPSW failed. Your IPSW may be corrupted or incomplete." \ Error "Verifying IPSW failed. Your IPSW may be corrupted or incomplete." \
"Delete/replace the IPSW and run the script again" "Delete/replace the IPSW and run the script again"
fi fi
elif [[ $Jailbreak == 1 && -e "$IPSWCustom.ipsw" ]]; then elif [[ -e "$IPSWCustom.ipsw" ]]; then
Log "Found existing Custom IPSW. Skipping verification." Log "Found existing Custom IPSW. Skipping verification."
Log "Setting restore IPSW to: $IPSWCustom.ipsw" Log "Setting restore IPSW to: $IPSWCustom.ipsw"
IPSWRestore=$IPSWCustom IPSWRestore=$IPSWCustom
@ -146,8 +162,8 @@ Downgrade() {
[[ $DeviceState == "Normal" ]] && kDFU [[ $DeviceState == "Normal" ]] && kDFU
if [[ $Jailbreak == 1 || $IPSWRestore == $IPSWCustom ]]; then if [[ $Jailbreak == 1 || $IPSWRestore == $IPSWCustom || $IPSWCustomW == 1 ]]; then
[[ $Jailbreak == 1 ]] && IPSW32 [[ $Jailbreak == 1 || $IPSWCustomW == 1 ]] && IPSW32
IPSWExtract=$IPSWCustom IPSWExtract=$IPSWCustom
else else
IPSWExtract=$IPSW IPSWExtract=$IPSW
@ -160,7 +176,7 @@ Downgrade() {
IPSW64 IPSW64
pwnREC pwnREC
SaveOTABlobs 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)" Log "Preparing for futurerestore... (Enter root password of your PC/Mac when prompted)"
cd resources cd resources
$SimpleHTTPServer & $SimpleHTTPServer &
@ -173,7 +189,7 @@ Downgrade() {
IPSWRestore="$IPSW" IPSWRestore="$IPSW"
fi fi
if [[ $Jailbreak == 1 ]]; then if [[ $Jailbreak == 1 || $IPSWCustomW == 1 ]]; then
iDeviceRestore iDeviceRestore
else else
FutureRestore FutureRestore

View File

@ -11,25 +11,27 @@ IPSW32() {
return return
fi fi
if [[ $OSVer == 8.4.1 ]]; then if [[ $Jailbreak == 1 ]]; then
JBFiles=("fstab.tar" "etasonJB-untether.tar" "Cydia8.tar") if [[ $OSVer == 8.4.1 ]]; then
JBSHA1="6459dbcbfe871056e6244d23b33c9b99aaeca970" JBFiles=("fstab.tar" "etasonJB-untether.tar" "Cydia8.tar")
JBPartSize=2305 JBSHA1="6459dbcbfe871056e6244d23b33c9b99aaeca970"
else JBPartSize="-s 2305"
JBFiles=("fstab_rw.tar" "p0sixspwn.tar" "Cydia6.tar") else
JBSHA1="1d5a351016d2546aa9558bc86ce39186054dc281" JBFiles=("fstab_rw.tar" "p0sixspwn.tar" "Cydia6.tar")
JBPartSize=1260 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 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 if [[ ! -e $IPSWCustom.ipsw ]]; then
Echo "* By default, memory option is set to Y, you may select N later if you encounter problems" 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" 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..." Log "Preparing custom IPSW..."
cd resources cd resources
ln -sf firmware/FirmwareBundles FirmwareBundles 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 .. cd ..
fi fi
if [[ ! -e $IPSWCustom.ipsw ]]; then if [[ ! -e $IPSWCustom.ipsw ]]; then

Binary file not shown.

Binary file not shown.

View File

@ -89,8 +89,8 @@ Main() {
Error "Only 64-bit (x86_64) distributions are supported." Error "Only 64-bit (x86_64) distributions are supported."
fi fi
if [[ $1 == "Install" || ! $bspatch || ! $git || if [[ $1 == "Install" || ! $bspatch || ! $git || ! $ideviceinfo || ! $irecoverychk || ! $python ||
! $ideviceinfo || ! $irecoverychk || ! $python ]]; then ! -d ./resources/libimobiledevice_$platform ]]; then
Clean Clean
InstallDepends InstallDepends
fi fi