From cb049d4a01e0ee5e69eeb5c8836af3e48ec5f8ed Mon Sep 17 00:00:00 2001 From: LukeZGD Date: Wed, 8 Jun 2022 23:04:56 +0800 Subject: [PATCH] Update some stuff - update readme - remove latest ios version check, just disable bbupdate for ipad2,3 - if jailbreak option is disabled, do not set custom ipsw - change where iphone3,1 buildmanifest is saved - remove pwndfu option for iphone4down - download ipwndfu on linux only --- README.md | 22 ++++++++-------------- resources/blobs.sh | 38 ++++++-------------------------------- resources/device.sh | 13 +++++++------ resources/downgrade.sh | 4 +++- resources/ipsw.sh | 10 ++++++---- restore.sh | 5 ++--- 6 files changed, 32 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index 2d65f8f..7f553d8 100644 --- a/README.md +++ b/README.md @@ -77,29 +77,23 @@ ## Tools and other stuff used - cURL - bspatch +- python2 (ipwndfu, rmsigchks, SimpleHTTPServer), python3 (http.server) - [ch3rryflower](https://web.archive.org/web/20200708040313/https://github.com/dora2-iOS/ch3rryflower) - dora2ios - [ipwndfu](https://github.com/LukeZGD/ipwndfu) - LukeZGD fork - [iPwnder32](https://github.com/dora2-iOS/iPwnder32) - dora2ios - [ipwnder_lite](https://github.com/dora2-iOS/ipwnder_lite) - dora2ios -- [daibutsuCFW](https://github.com/dora2-iOS/daibutsuCFW) - dora2ios -- [libimobiledevice](https://github.com/libimobiledevice/libimobiledevice) - libimobiledevice -- [libirecovery](https://github.com/libimobiledevice/libirecovery) - libimobiledevice -- [imobiledevice-net](https://github.com/libimobiledevice-win32/imobiledevice-net) - libimobiledevice-win32 (macOS/Windows builds) -- ipsw tool from [xpwn](https://github.com/LukeZGD/xpwn) - LukeZGD fork -- Python 2 (for ipwndfu, rmsigchks, SimpleHTTPServer) -- Python 3 (http.server) -- [tsschecker](https://github.com/tihmstar/tsschecker) - tihmstar -- [tsschecker](https://github.com/1Conan/tsschecker) - 1Conan fork -- [futurerestore](https://github.com/futurerestore/futurerestore) - futurerestore 194 and beta +- [daibutsuCFW](https://github.com/dora2-iOS/daibutsuCFW) - dora2ios ([LukeZGD fork](https://github.com/LukeZGD/daibutsuCFW)) +- [libimobiledevice](https://github.com/libimobiledevice/libimobiledevice), [libirecovery](https://github.com/libimobiledevice/libirecovery) - libimobiledevice ([macOS/Windows builds](https://github.com/libimobiledevice-win32/imobiledevice-net)) +- [tsschecker](https://github.com/tihmstar/tsschecker) - tihmstar ([1Conan fork](https://github.com/1Conan/tsschecker)) +- [futurerestore](https://github.com/futurerestore/futurerestore) - futurerestore beta (194 used for Windows only) - [idevicerestore](https://github.com/LukeeGD/idevicerestore) - LukeZGD fork - [kloader](https://www.youtube.com/watch?v=fh0tB6fp0Sc) - [kloader5 for iOS 5](https://www.pmbonneau.com/cydia/com.pmbonneau.kloader5_1.2_iphoneos-arm.deb) - [kloader_hgsp for iOS 10](https://twitter.com/nyan_satan/status/945203180522045440) - [partial-zip](https://github.com/matteyeux/partial-zip) -- [zenity](https://github.com/GNOME/zenity) -- [zenity](https://github.com/ncruces/zenity) (macOS/Windows builds) -- 32-bit bundles from [OdysseusOTA](https://www.youtube.com/watch?v=Wo7mGdMcjxw), [OdysseusOTA2](https://www.youtube.com/watch?v=fh0tB6fp0Sc), [alitek12](https://www.mediafire.com/folder/b1z64roy512wd/FirmwareBundles), [gjest](https://www.reddit.com/r/jailbreak/comments/6yrzzj/release_firmware_bundles_for_ios_841_ipad21234567/) -- A7 patches from [MatthewPierson](https://github.com/MatthewPierson/iPhone-5s-OTA-Downgrade-Patches) +- [zenity](https://github.com/GNOME/zenity) ([macOS/Windows builds](https://github.com/ncruces/zenity)) +- 32-bit bundles from [OdysseusOTA](https://www.youtube.com/watch?v=Wo7mGdMcjxw), [OdysseusOTA2](https://www.youtube.com/watch?v=fh0tB6fp0Sc), [alitek12](https://www.mediafire.com/folder/b1z64roy512wd/FirmwareBundles), [gjest](https://www.reddit.com/r/jailbreak/comments/6yrzzj/release_firmware_bundles_for_ios_841_ipad21234567/) (modified bundles for daibutsuCFW) +- A7 patches from [MatthewPierson](https://github.com/MatthewPierson/iPhone-5s-OTA-Downgrade-Patches) (patches used for Windows only) - [EtasonJB](https://www.theiphonewiki.com/wiki/EtasonJB) - [evasi0n](https://www.theiphonewiki.com/wiki/Evasi0n) - [evasi0n7](https://www.theiphonewiki.com/wiki/Evasi0n7) diff --git a/resources/blobs.sh b/resources/blobs.sh index 53f15a1..9d06e32 100755 --- a/resources/blobs.sh +++ b/resources/blobs.sh @@ -7,32 +7,6 @@ SaveOTABlobs() { local SHSHContinue local SHSHLatest local SHSHExisting - - if [[ $DeviceProc != 7 && $Baseband != 0 && $platform != "win" ]]; then - if [[ ! -e saved/$ProductType/BuildManifest.plist ]]; then - Log "Downloading BuildManifest of iOS $LatestVer..." - $partialzip $BasebandURL BuildManifest.plist BuildManifest.plist - mkdir -p saved/$ProductType 2>/dev/null - mv BuildManifest.plist saved/$ProductType - fi - if [[ ! -e saved/$ProductType/BuildManifest.plist ]]; then - Error "Downloading/verifying BuildManifest failed. Please run the script again" - fi - Log "Checking signing status of iOS $LatestVer..." - SHSHChk=*_${ProductType}_${HWModel}ap_${LatestVer}*.shsh* - $tsschecker -d $ProductType -i $LatestVer -e $UniqueChipID -m saved/$ProductType/BuildManifest.plist -s -B ${HWModel}ap - SHSHLatest=$(ls $SHSHChk 2>/dev/null) - if [[ -e $SHSHLatest ]]; then - Log "Latest version for $ProductType (iOS $LatestVer) is signed." - else - Log "For some reason, the latest version for your device (iOS $LatestVer) is not signed." - Log "Disabling baseband update for the custom IPSW." - BBUpdate=0 - [[ $Jailbreak != 1 ]] && IPSWCustom+="N" - IPSWCustom+="B" - fi - rm $SHSHLatest 2>/dev/null - fi Log "Saving iOS $OSVer blobs with tsschecker..." BuildManifest="resources/manifests/BuildManifest_${ProductType}_${OSVer}.plist" @@ -63,14 +37,14 @@ SaveOTABlobs() { Save712Blobs() { local SHSHChk - SHSH7="${UniqueChipID}-${ProductType}-7.1.2.shsh" - SHSH="saved/shsh/$SHSH7" - BuildManifest="BuildManifest_${ProductType}_7.1.2.plist" + BuildManifest="saved/iPhone3,1/BuildManifest.plist" + SHSH="saved/shsh/${UniqueChipID}-${ProductType}-7.1.2.shsh" - if [[ ! -e resources/manifests/$BuildManifest ]]; then + if [[ ! -e $BuildManifest ]]; then Log "Extracting BuildManifest from 7.1.2 IPSW..." unzip -o -j $IPSW7.ipsw BuildManifest.plist -d . - mv BuildManifest.plist resources/manifests/$BuildManifest + mkdir -p saved/iPhone3,1 2>/dev/null + mv BuildManifest.plist $BuildManifest fi if [[ -e $SHSH ]]; then @@ -78,7 +52,7 @@ Save712Blobs() { return fi Log "Saving 7.1.2 blobs with tsschecker..." - $tsschecker -d $ProductType -i 7.1.2 -e $UniqueChipID -m resources/manifests/BuildManifest_${ProductType}_7.1.2.plist -s -b + $tsschecker -d $ProductType -i 7.1.2 -e $UniqueChipID -m $BuildManifest -s -b SHSHChk=$(ls ${UniqueChipID}_${ProductType}_7.1.2-11D257_*.shsh2) [[ ! $SHSHChk ]] && Error "Saving $OSVer blobs failed. Please run the script again" mkdir saved/shsh 2>/dev/null diff --git a/resources/device.sh b/resources/device.sh index 81fc9a0..d22226e 100755 --- a/resources/device.sh +++ b/resources/device.sh @@ -204,9 +204,10 @@ EnterPwnDFU() { local pwnDFUDevice local pwnD=1 - if [[ $platform == "macos" || $ProductType == "iPhone3,1" ]]; then + if [[ $ProductType == "iPhone3,1" ]]; then + pwnDFUTool="$pwnedDFU" + elif [[ $platform == "macos" ]]; then Selection=("ipwnder_lite" "iPwnder32") - [[ $ProductType == "iPhone3,1" ]] && Selection=("pwnedDFU" "ipwndfu") Input "PwnDFU Tool Option" Echo "* This option selects what tool to use to put your device in pwnDFU mode." Echo "* If unsure, select 1. Select 2 if 1 does not work." @@ -216,15 +217,13 @@ EnterPwnDFU() { case $opt in "ipwnder_lite" ) pwnDFUTool="$ipwnder_lite"; break;; "iPwnder32" ) pwnDFUTool="$ipwnder32"; break;; - "ipwndfu" ) pwnDFUTool="ipwndfu"; break;; - "pwnedDFU" ) pwnDFUTool="$pwnedDFU"; break;; esac done else pwnDFUTool="ipwndfu" fi - Log "Entering pwnDFU mode with $pwnDFUTool..." + Log "Entering pwnDFU mode with: $pwnDFUTool..." if [[ $pwnDFUTool == "ipwndfu" ]]; then cd resources/ipwndfu Echo "* Enter your user password when prompted" @@ -245,7 +244,9 @@ EnterPwnDFU() { [[ $DeviceProc == 7 ]] && pwnD=$($irecovery -q | grep -c "PWND") [[ $DeviceProc == 4 ]] && SendiBSS=1 - if [[ $pwnDFUDevice != 0 && $pwnD != 1 ]]; then + if [[ $pwnDFUDevice != 0 && $ProductType == "iPhone3,1" ]]; then + Error "Failed to enter pwnDFU mode. Please run the script again" + elif [[ $pwnDFUDevice != 0 && $pwnD != 1 ]]; then echo -e "\n${Color_R}[Error] Failed to enter pwnDFU mode. Please run the script again ${Color_N}" echo "${Color_Y}* If the screen is black, exit DFU mode first by holding the TOP and HOME buttons for 15 seconds. ${Color_N}" echo "${Color_Y}* This step may fail a lot, especially on Linux, and unfortunately there is nothing I can do about the low success rates. ${Color_N}" diff --git a/resources/downgrade.sh b/resources/downgrade.sh index 78ec366..8012422 100755 --- a/resources/downgrade.sh +++ b/resources/downgrade.sh @@ -114,8 +114,10 @@ DowngradeOTA() { SaveOTABlobs IPSWFindVerify kDFU - if [[ $Jailbreak == 1 || $BBUpdate == 0 ]]; then + if [[ $Jailbreak == 1 ]]; then IPSW32 + else + IPSWCustom=0 fi IPSWSetExtract FutureRestore diff --git a/resources/ipsw.sh b/resources/ipsw.sh index 1a4779d..fc23c58 100755 --- a/resources/ipsw.sh +++ b/resources/ipsw.sh @@ -140,11 +140,11 @@ IPSWSetExtract() { } IPSW32() { - local Bundle="Down_${ProductType}_${OSVer}_${BuildVer}.bundle" local ExtraArgs local JBFiles local JBFiles2 local JBSHA1 + BBUpdate="-bbupdate" if [[ -e $IPSWCustom.ipsw ]]; then Log "Found existing Custom IPSW. Skipping IPSW creation." @@ -197,8 +197,10 @@ IPSW32() { fi if [[ $platform == "win" ]]; then WinBundles="windows/" - elif [[ $BBUpdate != 0 ]]; then - ExtraArgs+="-bbupdate" + elif [[ $ProductType == "iPad2,3" ]]; then + BBUpdate= + [[ $Jailbreak != 1 ]] && IPSWCustom+="N" + IPSWCustom+="B" fi if [[ ! -e $IPSWCustom.ipsw ]]; then @@ -209,7 +211,7 @@ IPSW32() { else cp -R ../resources/firmware/${WinBundles}FirmwareBundles FirmwareBundles fi - $ipsw ./../$IPSW.ipsw ./../$IPSWCustom.ipsw $ExtraArgs $JBMemory ${JBFiles[@]} + $ipsw ./../$IPSW.ipsw ./../$IPSWCustom.ipsw $ExtraArgs $BBUpdate $JBMemory ${JBFiles[@]} cd .. fi diff --git a/restore.sh b/restore.sh index fc550dc..74236f4 100755 --- a/restore.sh +++ b/restore.sh @@ -78,7 +78,7 @@ Main() { Error "Platform unknown/not supported." fi - chmod +x ./resources/*.sh ./resources/tools/* + chmod +x ./resources/*.sh ./resources/tools/* ./resources/libimobiledevice_$platform/* if [[ $? != 0 ]]; then Error "A problem with file permissions has been detected, cannot proceed." fi @@ -107,7 +107,7 @@ Main() { ExitWin 0 fi - if [[ $platform != "win" ]]; then + if [[ $platform == "linux" ]]; then SaveExternal LukeZGD ipwndfu fi GetDeviceValues $1 @@ -178,7 +178,6 @@ Main() { fi fi - SaveOTABlobs IPSWFindVerify if [[ $DeviceProc == 4 ]]; then IPSWFindVerify 712