Fix some errors on 32-bit downgrades

This commit is contained in:
LukeeGD 2020-07-25 11:23:31 +08:00
parent 94bc19244a
commit 96e5fb6b14

View File

@ -178,7 +178,7 @@ function Action {
function SaveOTABlobs { function SaveOTABlobs {
Log "Saving $OSVer blobs with tsschecker..." Log "Saving $OSVer blobs with tsschecker..."
BuildManifest="resources/manifests/BuildManifest_${ProductType}_${OSVer}.plist" BuildManifest="resources/manifests/BuildManifest_${ProductType}_${OSVer}.plist"
if [ $A7Device == 1 ]; then if [[ $A7Device == 1 ]]; then
APNonce=$(sudo LD_LIBRARY_PATH=/usr/local/lib irecovery -q | grep 'NONC' | cut -c 7-) APNonce=$(sudo LD_LIBRARY_PATH=/usr/local/lib irecovery -q | grep 'NONC' | cut -c 7-)
echo "* APNonce: $APNonce" echo "* APNonce: $APNonce"
env LD_LIBRARY_PATH=/usr/local/lib resources/tools/tsschecker_$platform -d $ProductType -B ${HWModel}ap -i $OSVer -e $UniqueChipID -m $BuildManifest --apnonce $APNonce -o -s env LD_LIBRARY_PATH=/usr/local/lib resources/tools/tsschecker_$platform -d $ProductType -B ${HWModel}ap -i $OSVer -e $UniqueChipID -m $BuildManifest --apnonce $APNonce -o -s
@ -342,7 +342,7 @@ function Downgrade {
else else
IPSW=$IPSWCustom IPSW=$IPSWCustom
fi fi
if [ ! $DFUManual ]; then if [ ! $DFUManual ] && [[ $iBSSBuildVer == $BuildVer ]]; then
Log "Extracting iBSS from IPSW..." Log "Extracting iBSS from IPSW..."
mkdir -p saved/$ProductType 2>/dev/null mkdir -p saved/$ProductType 2>/dev/null
unzip -o -j $IPSW.ipsw Firmware/dfu/$iBSS.dfu -d saved/$ProductType unzip -o -j $IPSW.ipsw Firmware/dfu/$iBSS.dfu -d saved/$ProductType
@ -354,7 +354,7 @@ function Downgrade {
Log "Extracting IPSW..." Log "Extracting IPSW..."
unzip -q $IPSW.ipsw -d $IPSW/ unzip -q $IPSW.ipsw -d $IPSW/
if [ $A7Device == 1 ]; then if [[ $A7Device == 1 ]]; then
if [ ! -e $IPSWCustom.ipsw ]; then if [ ! -e $IPSWCustom.ipsw ]; then
Log "Preparing custom IPSW..." Log "Preparing custom IPSW..."
cp $IPSW/Firmware/all_flash/$SEP . cp $IPSW/Firmware/all_flash/$SEP .
@ -391,13 +391,13 @@ function Downgrade {
if [ $Baseband == 0 ]; then if [ $Baseband == 0 ]; then
Log "Device $ProductType has no baseband" Log "Device $ProductType has no baseband"
Log "Proceeding to futurerestore..." Log "Proceeding to futurerestore..."
if [ $A7Device == 1 ]; then if [[ $A7Device == 1 ]]; then
sudo LD_LIBRARY_PATH=/usr/local/lib resources/tools/futurerestore249_$platform -t $SHSH -s $SEP -m $BuildManifest --no-baseband $IPSW.ipsw sudo LD_LIBRARY_PATH=/usr/local/lib resources/tools/futurerestore249_$platform -t $SHSH -s $SEP -m $BuildManifest --no-baseband $IPSW.ipsw
else else
sudo LD_PRELOAD=libcurl.so.3 resources/tools/futurerestore152_$platform -t $SHSH --no-baseband --use-pwndfu $IPSW.ipsw sudo LD_PRELOAD=libcurl.so.3 resources/tools/futurerestore152_$platform -t $SHSH --no-baseband --use-pwndfu $IPSW.ipsw
fi fi
else else
if [ $A7Device == 1 ]; then if [[ $A7Device == 1 ]]; then
cp $IPSW/Firmware/$Baseband . cp $IPSW/Firmware/$Baseband .
elif [ ! saved/$ProductType/*.bbfw ]; then elif [ ! saved/$ProductType/*.bbfw ]; then
Log "Downloading baseband..." Log "Downloading baseband..."
@ -417,12 +417,12 @@ function Downgrade {
echo "* Proceeding to futurerestore in 10 seconds (Press Ctrl+C to cancel)" echo "* Proceeding to futurerestore in 10 seconds (Press Ctrl+C to cancel)"
sleep 10 sleep 10
Log "Proceeding to futurerestore..." Log "Proceeding to futurerestore..."
if [ $A7Device == 1 ]; then if [[ $A7Device == 1 ]]; then
sudo LD_LIBRARY_PATH=/usr/local/lib resources/tools/futurerestore249_$platform -t $SHSH -s $SEP -m $BuildManifest --latest-baseband $IPSW.ipsw sudo LD_LIBRARY_PATH=/usr/local/lib resources/tools/futurerestore249_$platform -t $SHSH -s $SEP -m $BuildManifest --latest-baseband $IPSW.ipsw
else else
sudo LD_PRELOAD=libcurl.so.3 resources/tools/futurerestore152_$platform -t $SHSH --latest-baseband --use-pwndfu $IPSW.ipsw sudo LD_PRELOAD=libcurl.so.3 resources/tools/futurerestore152_$platform -t $SHSH --latest-baseband --use-pwndfu $IPSW.ipsw
fi fi
elif [ $A7Device == 1 ]; then elif [[ $A7Device == 1 ]]; then
Log "Proceeding to futurerestore..." Log "Proceeding to futurerestore..."
sudo LD_LIBRARY_PATH=/usr/local/lib resources/tools/futurerestore249_$platform -t $SHSH -s $SEP -m $BuildManifest -b $Baseband -p $BuildManifest $IPSW.ipsw sudo LD_LIBRARY_PATH=/usr/local/lib resources/tools/futurerestore249_$platform -t $SHSH -s $SEP -m $BuildManifest -b $Baseband -p $BuildManifest $IPSW.ipsw
else else