Custom IPSW option

This commit is contained in:
LukeZGD 2021-10-25 14:57:24 +08:00
parent f28130e5ec
commit fe3e6f0f00
5 changed files with 26 additions and 7 deletions

View File

@ -43,7 +43,7 @@ SaveOTABlobs() {
if [[ ! -z $SHSH && $SHSHContinue != 1 ]]; then
mkdir -p saved/shsh 2>/dev/null
[[ -z $APNonce ]] && cp "$SHSH" saved/shsh
[[ -z $APNonce && ! $SHSHExisting ]] && cp "$SHSH" saved/shsh
Log "Successfully saved $OSVer blobs."
fi
}

View File

@ -9,6 +9,7 @@ SetToolPaths() {
MPath+="$platform"
bspatch="$(which bspatch)"
futurerestore="sudo LD_LIBRARY_PATH=./resources/lib ./resources/tools/futurerestore_linux"
futurerestore2="sudo LD_LIBRARY_PATH=./resources/lib ./resources/tools/futurerestore2_linux"
idevicerestore="sudo LD_LIBRARY_PATH=./resources/lib ./resources/tools/idevicerestore_linux"
python="$(which python2)"
ipwndfu="sudo $python ipwndfu"
@ -32,6 +33,7 @@ SetToolPaths() {
bspatch="/usr/bin/bspatch"
futurerestore="./resources/tools/futurerestore_macos_$(uname -m)"
[[ ! -e $futurerestore ]] && futurerestore="./resources/tools/futurerestore_macos_arm64"
futurerestore2="./resources/tools/futurerestore2_macos"
idevicerestore="./resources/tools/idevicerestore_macos"
ipwnder32="./resources/tools/ipwnder32_macos"
python="/usr/bin/python"

View File

@ -64,6 +64,16 @@ FutureRestore() {
fi
}
SetIPSWCustomW() {
if [[ $DeviceProc == 7 ]]; then
IPSWCustomW=2
futurerestore=$futurerestore2
else
IPSWCustom="${IPSWCustom}W"
IPSWCustomW=1
fi
}
Downgrade() {
local IPSWExtract
local IPSWSHA1
@ -143,12 +153,17 @@ Downgrade() {
IPSWCustom="${IPSWType}_${OSVer}_${BuildVer}_Custom"
if [[ $Jailbreak != 1 && $platform == "win" ]]; then
if [[ $DeviceProc == 7 ]]; then
IPSWCustomW=2
else
IPSWCustom="${IPSWCustom}W"
IPSWCustomW=1
SetIPSWCustomW
elif [[ $Jailbreak != 1 ]]; then
Input "Custom IPSW Option"
Echo "* When this option is enabled, a custom IPSW will be made for the restore."
Echo "* Enable this option later if you experience issues with futurerestore."
Echo "* This option is disabled by default (N)."
read -p "$(Input 'Enable this option? (y/N):')" IPSWCustomW
if [[ $IPSWCustomW == 'Y' || $IPSWCustomW == 'y' ]]; then
SetIPSWCustomW
fi
echo
fi
if [[ $Jailbreak == 1 || ! -z $IPSWCustomW ]]; then
@ -208,6 +223,8 @@ Downgrade() {
if [[ $Jailbreak == 1 || $IPSWCustomW == 1 ]]; then
IPSW32
IPSWExtract="$IPSWCustom"
elif [[ $IPSWCustomW == 2 && $Verify != 1 ]]; then
IPSWExtract="$IPSWCustom"
else
IPSWExtract="$IPSW"
fi
@ -233,7 +250,7 @@ Downgrade() {
Log "Setting restore IPSW to: $IPSW.ipsw"
IPSWRestore="$IPSW"
fi
if [[ $Jailbreak == 1 || $IPSWCustomW == 1 ]]; then
iDeviceRestore
else

Binary file not shown.

Binary file not shown.