Add latest version signing check and fix other stuff

This commit is contained in:
LukeZGD 2021-11-18 18:33:15 +08:00
parent 83087e0fdc
commit 4c3b850772
4 changed files with 33 additions and 22 deletions

View File

@ -4,31 +4,37 @@ SaveOTABlobs() {
local ExtraArgs local ExtraArgs
local SHSHChk local SHSHChk
local SHSHContinue local SHSHContinue
local SHSHLatest
local SHSHExisting local SHSHExisting
Log "Saving $OSVer blobs with tsschecker..." if [[ $DeviceProc != 7 && $Baseband != 0 && $Baseband8 != 1 ]]; then
Log "Checking signing status of iOS $LatestVer..."
SHSHChk=*_${ProductType}_${HWModel}ap_${LatestVer}*.shsh*
$tsschecker -d $ProductType -i $LatestVer -e $UniqueChipID -s -B ${HWModel}ap
SHSHLatest=$(ls $SHSHChk)
if [[ ! -e $SHSHLatest ]]; then
Error "For some reason, the latest version for your device (iOS $LatestVer) is not signed. Cannot continue."
fi
Log "Latest version for $ProductType (iOS $LatestVer) is signed."
rm $SHSHLatest
fi
Log "Saving iOS $OSVer blobs with tsschecker..."
BuildManifest="resources/manifests/BuildManifest_${ProductType}_${OSVer}.plist" BuildManifest="resources/manifests/BuildManifest_${ProductType}_${OSVer}.plist"
ExtraArgs="-d $ProductType -i $OSVer -e $UniqueChipID -m $BuildManifest -o -s -B ${HWModel}ap" ExtraArgs="-d $ProductType -i $OSVer -e $UniqueChipID -m $BuildManifest -o -s -B ${HWModel}ap --generator 0x1111111111111111"
SHSHChk=${UniqueChipID}_${ProductType}_${HWModel}ap_${OSVer}-${BuildVer}*.shsh* SHSHChk=${UniqueChipID}_${ProductType}_${HWModel}ap_${OSVer}-${BuildVer}_3a88b7c3802f2f0510abc432104a15ebd8bd7154.shsh*
if [[ $DeviceProc == 7 ]]; then if [[ $Baseband8 != 1 ]]; then
ExtraArgs+=" --generator 0x1111111111111111" ExtraArgs+=" --no-baseband"
fi fi
$tsschecker $ExtraArgs $tsschecker $ExtraArgs
SHSH=$(ls $SHSHChk) SHSH=$(ls $SHSHChk)
SHSHExisting=$(ls saved/shsh/$SHSHChk 2>/dev/null) SHSHExisting=$(ls saved/shsh/$SHSHChk 2>/dev/null)
if [[ ! $SHSH && ! $SHSHExisting ]]; then if [[ ! -e $SHSH && ! -e $SHSHExisting ]]; then
Log "Saving $OSVer blobs failed. Trying again with fallback..."
ExtraArgs+=" --no-baseband"
$tsschecker $ExtraArgs
SHSH=$(ls $SHSHChk)
if [[ ! $SHSH ]]; then
Error "Saving $OSVer blobs failed. Please run the script again" \ Error "Saving $OSVer blobs failed. Please run the script again" \
"It is also possible that $OSVer for $ProductType is no longer signed" "It is also possible that $OSVer for $ProductType is no longer signed"
fi
elif [[ ! $SHSH ]]; then elif [[ ! -e $SHSH ]]; then
Log "Saving $OSVer blobs failed, but found existing saved SHSH blobs. Continuing..." Log "Saving $OSVer blobs failed, but found existing saved SHSH blobs. Continuing..."
cp $SHSHExisting . cp $SHSHExisting .
SHSH=$(ls $SHSHChk) SHSH=$(ls $SHSHChk)
@ -37,7 +43,7 @@ SaveOTABlobs() {
if [[ -n $SHSH && $SHSHContinue != 1 ]]; then if [[ -n $SHSH && $SHSHContinue != 1 ]]; then
mkdir -p saved/shsh 2>/dev/null mkdir -p saved/shsh 2>/dev/null
[[ ! $SHSHExisting ]] && cp "$SHSH" saved/shsh cp "$SHSH" saved/shsh
Log "Successfully saved $OSVer blobs." Log "Successfully saved $OSVer blobs."
fi fi
} }

View File

@ -83,11 +83,13 @@ GetDeviceValues() {
Firmware=resources/firmware/$ProductType Firmware=resources/firmware/$ProductType
Baseband=0 Baseband=0
BasebandURL=$(cat $Firmware/13G37/url 2>/dev/null) BasebandURL=$(cat $Firmware/13G37/url 2>/dev/null)
LatestVer="9.3.6"
if [[ $ProductType == "iPad2,2" ]]; then if [[ $ProductType == "iPad2,2" ]]; then
BasebandURL=$(cat $Firmware/13G36/url) BasebandURL=$(cat $Firmware/13G36/url)
Baseband="ICE3_04.12.09_BOOT_02.13.Release.bbfw" Baseband="ICE3_04.12.09_BOOT_02.13.Release.bbfw"
BasebandSHA1="e6f54acc5d5652d39a0ef9af5589681df39e0aca" BasebandSHA1="e6f54acc5d5652d39a0ef9af5589681df39e0aca"
LatestVer="9.3.5"
elif [[ $ProductType == "iPad2,3" ]]; then elif [[ $ProductType == "iPad2,3" ]]; then
Baseband="Phoenix-3.6.03.Release.bbfw" Baseband="Phoenix-3.6.03.Release.bbfw"
@ -110,6 +112,7 @@ GetDeviceValues() {
BasebandURL=$(cat $Firmware/14G61/url) BasebandURL=$(cat $Firmware/14G61/url)
Baseband="Mav5-11.80.00.Release.bbfw" Baseband="Mav5-11.80.00.Release.bbfw"
BasebandSHA1="8951cf09f16029c5c0533e951eb4c06609d0ba7f" BasebandSHA1="8951cf09f16029c5c0533e951eb4c06609d0ba7f"
LatestVer="10.3.4"
elif [[ $ProductType == "iPad4,2" || $ProductType == "iPad4,3" || $ProductType == "iPad4,5" || elif [[ $ProductType == "iPad4,2" || $ProductType == "iPad4,3" || $ProductType == "iPad4,5" ||
$ProductType == "iPhone6,1" || $ProductType == "iPhone6,2" ]]; then $ProductType == "iPhone6,1" || $ProductType == "iPhone6,2" ]]; then
@ -165,7 +168,9 @@ GetDeviceValues() {
} }
Baseband841() { Baseband841() {
Baseband8=1
BasebandURL=$(cat $Firmware/12H321/url) BasebandURL=$(cat $Firmware/12H321/url)
if [[ $ProductType == "iPad2,3" ]]; then if [[ $ProductType == "iPad2,3" ]]; then
Baseband="Phoenix-3.0.04.Release.bbfw" Baseband="Phoenix-3.0.04.Release.bbfw"
BasebandSHA1="a507ee2fe061dfbf8bee7e512df52ade8777e113" BasebandSHA1="a507ee2fe061dfbf8bee7e512df52ade8777e113"

View File

@ -3,7 +3,7 @@
FRBaseband() { FRBaseband() {
local BasebandSHA1L local BasebandSHA1L
if [[ $DeviceProc == 7 ]] || [[ $Baseband5 != 0 && $OSVer == "8.4.1" ]]; then if [[ $DeviceProc == 7 ]] || [[ $Baseband8 == 1 && $OSVer == "8.4.1" ]]; then
mkdir -p saved/baseband 2>/dev/null mkdir -p saved/baseband 2>/dev/null
cp -f $IPSWRestore/Firmware/$Baseband saved/baseband cp -f $IPSWRestore/Firmware/$Baseband saved/baseband
fi fi
@ -16,7 +16,7 @@ FRBaseband() {
mv $Baseband saved/baseband mv $Baseband saved/baseband
mv BuildManifest.plist saved/$ProductType mv BuildManifest.plist saved/$ProductType
BuildManifest="saved/$ProductType/BuildManifest.plist" BuildManifest="saved/$ProductType/BuildManifest.plist"
elif [[ $Baseband5 == 0 ]]; then elif [[ $Baseband8 != 1 ]]; then
BuildManifest="saved/$ProductType/BuildManifest.plist" BuildManifest="saved/$ProductType/BuildManifest.plist"
fi fi
@ -89,12 +89,11 @@ Downgrade() {
Echo "* I recommend to disable the option for these devices to flash the iOS 8.4.1 baseband." Echo "* I recommend to disable the option for these devices to flash the iOS 8.4.1 baseband."
fi fi
Echo "* This option is enabled by default (Y)." Echo "* This option is enabled by default (Y)."
read -p "$(Input 'Enable this option? (Y/n):')" Baseband5 read -p "$(Input 'Enable this option? (Y/n):')" Baseband8
if [[ $Baseband5 == 'N' || $Baseband5 == 'n' ]]; then if [[ $Baseband8 == 'N' || $Baseband8 == 'n' ]]; then
Baseband841 Baseband841
Log "Latest baseband disabled by user. Using iOS 8.4.1 baseband" Log "Latest baseband disabled by user. Using iOS 8.4.1 baseband"
else else
Baseband5=0
Log "Latest baseband enabled." Log "Latest baseband enabled."
fi fi
echo echo

View File

@ -140,6 +140,7 @@ Main() {
Echo "* This custom IPSW has a jailbreak built in ($JBName)" Echo "* This custom IPSW has a jailbreak built in ($JBName)"
Echo "* Run the script again and select Downgrade Device to use the custom IPSW." Echo "* Run the script again and select Downgrade Device to use the custom IPSW."
Echo "* You may also use futurerestore manually (make sure to use the latest beta)" Echo "* You may also use futurerestore manually (make sure to use the latest beta)"
exit 0
elif [[ $Mode != "Downgrade" ]]; then elif [[ $Mode != "Downgrade" ]]; then
$Mode $Mode