Legacy-iOS-Kit/resources/blobs.sh

60 lines
2.2 KiB
Bash
Raw Normal View History

#!/bin/bash
SaveOTABlobs() {
local APNonce=$1
2021-07-12 07:39:48 +02:00
local ExtraArgs
2022-07-18 13:53:45 +02:00
local SHSHChk=${UniqueChipID}_${ProductType}_${HWModel}ap_${OSVer}-${BuildVer}*.shsh*
BuildManifest="resources/manifests/BuildManifest_${ProductType}_${OSVer}.plist"
if [[ $(ls saved/shsh/$SHSHChk 2>/dev/null) ]]; then
Log "Found existing saved $OSVer blobs."
2022-07-21 01:45:13 +02:00
SHSH=$(ls saved/shsh/$SHSHChk)
2022-07-18 13:53:45 +02:00
return
fi
Log "Saving iOS $OSVer blobs with tsschecker..."
ExtraArgs="-d $ProductType -i $OSVer -e $UniqueChipID -m $BuildManifest -o -s -B ${HWModel}ap -b "
[[ -n $APNonce ]] && ExtraArgs+="--apnonce $APNonce" || ExtraArgs+="-g 0x1111111111111111"
2021-07-12 07:39:48 +02:00
$tsschecker $ExtraArgs
SHSH=$(ls $SHSHChk)
2022-07-18 13:53:45 +02:00
if [[ -n $SHSH ]]; then
mkdir -p saved/shsh 2>/dev/null
[[ -z $APNonce ]] && cp "$SHSH" saved/shsh
Log "Successfully saved $OSVer blobs."
2022-07-18 13:53:45 +02:00
else
Error "Saving $OSVer blobs failed. Please run the script again" \
"It is also possible that $OSVer for $ProductType is no longer signed"
fi
}
Save712Blobs() {
local SHSHChk
2022-07-18 13:53:45 +02:00
BuildManifest="saved/$ProductType/BuildManifest.plist"
SHSH="saved/shsh/${UniqueChipID}-${ProductType}-7.1.2.shsh"
2022-07-18 13:53:45 +02:00
if [[ -e $SHSH ]]; then
Log "Found existing saved 7.1.2 blobs."
return
fi
if [[ ! -e $BuildManifest && -e $IPSW7.ipsw ]]; then
Log "Extracting BuildManifest from 7.1.2 IPSW..."
unzip -o -j $IPSW7.ipsw BuildManifest.plist -d .
2022-07-18 13:53:45 +02:00
mkdir -p saved/$ProductType 2>/dev/null
mv BuildManifest.plist $BuildManifest
elif [[ ! -e $BuildManifest ]]; then
Log "Downloading BuildManifest for 7.1.2..."
$partialzip $BasebandURL BuildManifest.plist BuildManifest.plist
mkdir -p saved/$ProductType 2>/dev/null
mv BuildManifest.plist $BuildManifest
fi
Log "Saving 7.1.2 blobs with tsschecker..."
$tsschecker -d $ProductType -i 7.1.2 -e $UniqueChipID -m $BuildManifest -s -b
SHSHChk=$(ls ${UniqueChipID}_${ProductType}_7.1.2-11D257_*.shsh2)
2022-07-18 13:53:45 +02:00
[[ -z $SHSHChk ]] && Error "Saving $OSVer blobs failed. Please run the script again"
mkdir saved/shsh 2>/dev/null
2022-05-30 16:17:56 +02:00
mv $SHSHChk $SHSH
Log "Successfully saved 7.1.2 blobs."
}