From e102281af4da09ab7203ed8e6db36997d41472d9 Mon Sep 17 00:00:00 2001 From: LukeZGD Date: Mon, 21 Jun 2021 19:53:02 +0800 Subject: [PATCH] Some fixes --- resources/depends.sh | 2 +- resources/device.sh | 24 +++++++++++------------- resources/downgrade.sh | 2 +- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/resources/depends.sh b/resources/depends.sh index 484f20f..3d0bc18 100755 --- a/resources/depends.sh +++ b/resources/depends.sh @@ -13,7 +13,7 @@ SetToolPaths() { python="$(which python2)" ipwndfu="sudo $python ipwndfu" rmsigchks="sudo $python rmsigchks.py" - SimpleHTTPServer="sudo $python -m SimpleHTTPServer 80" + SimpleHTTPServer="sudo -b $python -m SimpleHTTPServer 80" elif [[ $OSTYPE == "darwin"* ]]; then platform="macos" diff --git a/resources/device.sh b/resources/device.sh index 487f086..7be2fc2 100755 --- a/resources/device.sh +++ b/resources/device.sh @@ -141,23 +141,21 @@ CheckM8() { if [[ $pwnDFUTool == "ipwndfu" ]]; then cd resources/ipwndfu $ipwndfu -p + if [[ $DeviceProc == 7 ]]; then + Log "Running rmsigchks.py..." + $rmsigchks + else + Log "Sending iBSS..." + kDFU iBSS || echo + fi + pwnDFUDevice=$? + cd ../.. elif [[ $pwnDFUTool == "iPwnder32" ]]; then $ipwnder32 -p - cd resources/ipwndfu - fi - - if [[ $DeviceProc == 7 ]]; then - Log "Running rmsigchks.py..." - $rmsigchks - pwnDFUDevice=$? - cd ../.. - else - cd ../.. - [[ $pwnDFUTool == "ipwndfu" ]] && kDFU iBSS || echo pwnDFUDevice=$? fi - if [[ $pwnDFUDevice == 1 || $pwnDFUDevice == 255 ]]; then + if [[ $pwnDFUDevice != 0 ]]; 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 device, and to try multiple times ${Color_N}" @@ -177,7 +175,7 @@ Recovery() { FindDevice "Recovery" fi - Log "Get ready to enter DFU mode." + Echo "Get ready to enter DFU mode." read -p "$(Input 'Select Y to continue, N to exit recovery (Y/n)')" RecoveryDFU if [[ $RecoveryDFU == 'N' || $RecoveryDFU == 'n' ]]; then Log "Exiting recovery mode." diff --git a/resources/downgrade.sh b/resources/downgrade.sh index a5c66d1..478a8ba 100755 --- a/resources/downgrade.sh +++ b/resources/downgrade.sh @@ -179,7 +179,7 @@ Downgrade() { elif [[ $Jailbreak != 1 && $OSVer != "Other" && $IPSWCustomW != 1 ]]; then Log "Preparing for futurerestore... (Enter root password of your PC/Mac when prompted)" cd resources - $SimpleHTTPServer & + [[ $platform == "linux" ]] && $SimpleHTTPServer || $SimpleHTTPServer & ServerRunning=1 cd .. fi