From 091f8662702802b2e1d401c8c4975efdc51dc888 Mon Sep 17 00:00:00 2001 From: LukeZGD Date: Fri, 20 Aug 2021 09:58:17 +0800 Subject: [PATCH] Update (for #113 and #114) --- README.md | 1 + resources/depends.sh | 6 ++++++ resources/device.sh | 8 +++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a6fd2b..65a6871 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ - macOS users may have to install libimobiledevice and libirecovery from [Homebrew](https://brew.sh/) with this command: `brew install libimobiledevice libirecovery` - The script will detect this automatically and will use the Homebrew versions of the tools - Use an Intel or Apple Silicon PC/Mac as entering pwnDFU (checkm8) may be a lot more unreliable on AMD devices + - Apple Silicon Mac users running macOS 11.3 and newer may encounter issues entering pwnDFU mode (see issue [#114](https://github.com/LukeZGD/iOS-OTA-Downgrader/issues/114)) - Other than the above, unfortunately there is not much else I can do to help regarding entering pwnDFU mode. - **For 32-bit devices:** - To make sure that SSH is successful, try these steps: Reinstall OpenSSH/Dropbear, reboot and rejailbreak, then reinstall them again diff --git a/resources/depends.sh b/resources/depends.sh index 5b5c81d..f41b52e 100755 --- a/resources/depends.sh +++ b/resources/depends.sh @@ -102,6 +102,12 @@ InstallDepends() { cd ../tmp Log "Installing dependencies..." + if [[ $platform == "linux" ]]; then + Echo "* iOS-OTA-Downgrader will be installing dependencies from your distribution's package manager" + Echo "* Enter root password of your PC when prompted" + Input "Press Enter/Return to continue (or press Ctrl+C to cancel)" + read -s + fi if [[ $ID == "arch" || $ID_LIKE == "arch" ]]; then sudo pacman -Syu --noconfirm --needed base-devel bsdiff curl libcurl-compat libpng12 libimobiledevice libzip openssh openssl-1.0 python2 unzip usbutils ln -sf /usr/lib/libcurl.so.3 ../resources/lib/libcurl.so.3 diff --git a/resources/device.sh b/resources/device.sh index 500d3fb..5cf2c10 100755 --- a/resources/device.sh +++ b/resources/device.sh @@ -148,6 +148,7 @@ GetDeviceValues() { CheckM8() { local pwnDFUTool local pwnDFUDevice + local pwnD=1 if [[ $platform == "macos" && $(uname -m) != "x86_64" ]]; then pwnDFUTool="iPwnder32" @@ -172,6 +173,7 @@ CheckM8() { Log "Running rmsigchks.py..." $rmsigchks pwnDFUDevice=$? + pwnD=$($irecovery -q | grep -c "PWND") cd ../.. else cd ../.. @@ -183,7 +185,7 @@ CheckM8() { $ipwnder32 -p fi - if [[ $pwnDFUDevice != 0 && $($irecovery -q | grep -c "PWND") != 1 ]]; then + if [[ $pwnDFUDevice != 0 && $pwnD != 1 ]]; then echo -e "\n${Color_R}[Error] Failed to enter pwnDFU mode. Please run the script again: ./restore.sh Downgrade ${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}" echo "${Color_Y}* The only option is to make sure you are using an Intel or Apple Silicon device, and to try multiple times ${Color_N}" @@ -191,6 +193,10 @@ CheckM8() { exit 1 elif [[ $pwnDFUDevice == 0 ]]; then Log "Device in pwnDFU mode detected." + else + Log "Warning - Failed to detect device in pwnDFU mode." + Echo "* If the device entered pwnDFU mode successfully, you may continue" + Echo "* If entering pwnDFU failed, you may have to force restart your device and start over" fi }