diff --git a/resources/blobs.sh b/resources/blobs.sh index b381498..97c6e6c 100755 --- a/resources/blobs.sh +++ b/resources/blobs.sh @@ -1,30 +1,44 @@ #!/bin/bash SaveOTABlobs() { + local ExtraArgs local SHSHChk + local SHSHContinue local SHSHExisting Log "Saving $OSVer blobs with tsschecker..." BuildManifest="resources/manifests/BuildManifest_${ProductType}_${OSVer}.plist" + ExtraArgs="-d $ProductType -i $OSVer -e $UniqueChipID -m $BuildManifest -o -s" if [[ $DeviceProc == 7 ]]; then local APNonce=$($irecovery -q | grep "NONC" | cut -c 7-) Log "APNonce: $APNonce" - $tsschecker -d $ProductType -B ${HWModel}ap -i $OSVer -e $UniqueChipID -m $BuildManifest --apnonce $APNonce -o -s + ExtraArgs+=" -B ${HWModel}ap --apnonce $APNonce" SHSHChk=${UniqueChipID}_${ProductType}_${HWModel}ap_${OSVer}-${BuildVer}_${APNonce}.shsh* else - $tsschecker -d $ProductType -i $OSVer -e $UniqueChipID -m $BuildManifest -o -s SHSHChk=${UniqueChipID}_${ProductType}_${OSVer}-${BuildVer}*.shsh* fi + $tsschecker $ExtraArgs + SHSH=$(ls $SHSHChk) SHSHExisting=$(ls saved/shsh/$SHSHChk 2>/dev/null) if [[ ! $SHSH && ! $SHSHExisting ]]; then - Error "Saving $OSVer blobs failed. Please run the script again" \ - "It is also possible that $OSVer for $ProductType is no longer signed" + Log "Saving $OSVer blobs failed. Trying again with fallback tsschecker..." + $tsschecker2 $ExtraArgs + + SHSH=$(ls $SHSHChk) + if [[ ! $SHSH ]]; then + Error "Saving $OSVer blobs failed. Please run the script again" \ + "It is also possible that $OSVer for $ProductType is no longer signed" + fi + elif [[ ! $SHSH ]]; then Log "Saving $OSVer blobs failed, but found existing saved SHSH blobs. Continuing..." cp $SHSHExisting . SHSH=$(ls $SHSHChk) - else + SHSHContinue=1 + fi + + if [[ ! -z $SHSH && $SHSHContinue != 1 ]]; then mkdir -p saved/shsh 2>/dev/null [[ ! $SHSHExisting ]] && cp "$SHSH" saved/shsh Log "Successfully saved $OSVer blobs." diff --git a/resources/depends.sh b/resources/depends.sh index 3d0bc18..1a05594 100755 --- a/resources/depends.sh +++ b/resources/depends.sh @@ -14,6 +14,7 @@ SetToolPaths() { ipwndfu="sudo $python ipwndfu" rmsigchks="sudo $python rmsigchks.py" SimpleHTTPServer="sudo -b $python -m SimpleHTTPServer 80" + tsschecker2="env LD_PRELOAD=./resources/lib/libcurl.so.3 LD_LIBRARY_PATH=./resources/lib ./resources/tools/tsschecker2_linux" elif [[ $OSTYPE == "darwin"* ]]; then platform="macos" @@ -28,6 +29,7 @@ SetToolPaths() { ipwndfu="$python ipwndfu" rmsigchks="$python rmsigchks.py" SimpleHTTPServer="$python -m SimpleHTTPServer 80" + tsschecker2="./resources/tools/tsschecker2_macos" fi git="$(which git)" ideviceenterrecovery="./resources/libimobiledevice_$platform/ideviceenterrecovery" diff --git a/resources/tools/tsschecker2_linux b/resources/tools/tsschecker2_linux new file mode 100755 index 0000000..8622031 Binary files /dev/null and b/resources/tools/tsschecker2_linux differ diff --git a/resources/tools/tsschecker2_macos b/resources/tools/tsschecker2_macos new file mode 100755 index 0000000..b8c6527 Binary files /dev/null and b/resources/tools/tsschecker2_macos differ