An update (fix some stuff)

This commit is contained in:
LukeZGD 2022-05-30 22:17:56 +08:00
parent c456b386dd
commit 3c6a500ad7
5 changed files with 37 additions and 17 deletions

View File

@ -68,7 +68,7 @@ Save712Blobs() {
mv BuildManifest.plist resources/manifests/$BuildManifest mv BuildManifest.plist resources/manifests/$BuildManifest
fi fi
if [[ -e saved/shsh/$SHSH7 ]]; then if [[ -e $SHSH ]]; then
Log "Found existing saved 7.1.2 blobs." Log "Found existing saved 7.1.2 blobs."
return return
fi fi
@ -77,6 +77,6 @@ Save712Blobs() {
SHSHChk=$(ls ${UniqueChipID}_${ProductType}_7.1.2-11D257_*.shsh2) SHSHChk=$(ls ${UniqueChipID}_${ProductType}_7.1.2-11D257_*.shsh2)
[[ ! $SHSHChk ]] && Error "Saving $OSVer blobs failed. Please run the script again" [[ ! $SHSHChk ]] && Error "Saving $OSVer blobs failed. Please run the script again"
mkdir saved/shsh 2>/dev/null mkdir saved/shsh 2>/dev/null
mv $SHSHChk saved/shsh/$SHSH7 mv $SHSHChk $SHSH
Log "Successfully saved 7.1.2 blobs." Log "Successfully saved 7.1.2 blobs."
} }

View File

@ -190,6 +190,9 @@ GetDeviceValues() {
iBSSBuildVer="12H321" iBSSBuildVer="12H321"
fi fi
[[ ! $IPSWType ]] && IPSWType="$ProductType" [[ ! $IPSWType ]] && IPSWType="$ProductType"
iBEC="iBEC.$iBSS.RELEASE"
iBECb="iBEC.${iBSS}b.RELEASE"
iBSSb="iBSS.${iBSS}b.RELEASE"
iBSS="iBSS.$iBSS.RELEASE" iBSS="iBSS.$iBSS.RELEASE"
SEP="sep-firmware.$HWModel.RELEASE.im4p" SEP="sep-firmware.$HWModel.RELEASE.im4p"
@ -489,7 +492,7 @@ EnterPwnREC() {
iBSS=$iBSSb iBSS=$iBSSb
fi fi
while (( $Attempt < 4 )); do while (( Attempt < 4 )); do
Log "Entering pwnREC mode... (Attempt $Attempt)" Log "Entering pwnREC mode... (Attempt $Attempt)"
Log "Sending iBSS..." Log "Sending iBSS..."
$irecovery -f $IPSWCustom/Firmware/dfu/$iBSS.im4p $irecovery -f $IPSWCustom/Firmware/dfu/$iBSS.im4p
@ -502,7 +505,7 @@ EnterPwnREC() {
((Attempt++)) ((Attempt++))
done done
if (( $Attempt == 4 )); then if (( Attempt == 4 )); then
Error "Failed to enter pwnREC mode. You may have to force restart your device and start over entering pwnDFU mode again" Error "Failed to enter pwnREC mode. You may have to force restart your device and start over entering pwnDFU mode again"
fi fi
} }

View File

@ -33,11 +33,12 @@ FRBaseband() {
} }
FutureRestore() { FutureRestore() {
local ExtraArgs=("--use-pwndfu") local ExtraArgs=()
Log "Proceeding to futurerestore..." Log "Proceeding to futurerestore..."
[[ $platform == "linux" ]] && Echo "* Enter your user password when prompted" [[ $platform == "linux" ]] && Echo "* Enter your user password when prompted"
if [[ $platform != "win" ]]; then if [[ $platform != "win" ]]; then
ExtraArgs+=("--use-pwndfu")
cd resources cd resources
$SimpleHTTPServer & $SimpleHTTPServer &
ServerPID=$! ServerPID=$!
@ -122,7 +123,7 @@ DowngradeOTAWin() {
fi fi
IPSWFindVerify IPSWFindVerify
if [[ $DeviceProc == 7 ]]; then if [[ $DeviceProc == 7 ]]; then
IPSWSetExtract extract IPSWSetExtract
IPSW64 IPSW64
EnterPwnREC EnterPwnREC
local APNonce=$($irecovery -q | grep "NONC" | cut -c 7-) local APNonce=$($irecovery -q | grep "NONC" | cut -c 7-)

View File

@ -124,7 +124,6 @@ IPSWFindVerify() {
} }
IPSWSetExtract() { IPSWSetExtract() {
if [[ $1 != "extract" ]]; then
if [[ -e "$IPSWCustom.ipsw" ]]; then if [[ -e "$IPSWCustom.ipsw" ]]; then
Log "Setting restore IPSW to: $IPSWCustom.ipsw" Log "Setting restore IPSW to: $IPSWCustom.ipsw"
IPSWRestore="$IPSWCustom" IPSWRestore="$IPSWCustom"
@ -132,12 +131,12 @@ IPSWSetExtract() {
Log "Setting restore IPSW to: $IPSW.ipsw" Log "Setting restore IPSW to: $IPSW.ipsw"
IPSWRestore="$IPSW" IPSWRestore="$IPSW"
fi fi
fi
if [[ $1 != "set" ]]; then if [[ $1 == "set" ]]; then
return
fi
Log "Extracting IPSW: $IPSWRestore.ipsw" Log "Extracting IPSW: $IPSWRestore.ipsw"
unzip -oq "$IPSWRestore.ipsw" -d "$IPSWRestore"/ unzip -oq "$IPSWRestore.ipsw" -d "$IPSWRestore"/
fi
} }
IPSW32() { IPSW32() {

View File

@ -1,4 +1,21 @@
@echo off @echo off
if not exist "C:\Program Files\iTunes\iTunes.exe" (
echo [Error] iTunes does not seem to be installed.
echo * Please install iTunes 12.6.5 first before proceeding.
echo * Read the "How to Use" wiki page in GitHub for more details.
pause >nul
exit
)
if not exist "C:\msys64\msys2.exe" (
echo [Error] MSYS2 does not seem to be installed.
echo * Please install MSYS2 first before proceeding.
echo * Read the "How to Use" wiki page in GitHub for more details.
pause >nul
exit
)
C:\msys64\msys2.exe "./restore.sh" C:\msys64\msys2.exe "./restore.sh"
rem Add the argument at the end of the line above if needed rem Add the argument at the end of the line above if needed