Update message

messages after idevicerestore, and message to exit on windows
This commit is contained in:
LukeZGD 2022-06-05 09:14:07 +08:00
parent 0afe0bc7a1
commit fc105905f7
4 changed files with 19 additions and 22 deletions

View File

@ -213,6 +213,4 @@ InstallDepends() {
cd .. cd ..
Log "Install script done! Please run the script again to proceed" Log "Install script done! Please run the script again to proceed"
ExitWin
exit 0
} }

View File

@ -80,8 +80,7 @@ GetDeviceValues() {
echo "${Color_Y}* Recovery or DFU mode is also applicable. ${Color_N}" echo "${Color_Y}* Recovery or DFU mode is also applicable. ${Color_N}"
echo "${Color_Y}* To perform operations without an iOS device connected, add NoDevice as an argument. ${Color_N}" echo "${Color_Y}* To perform operations without an iOS device connected, add NoDevice as an argument. ${Color_N}"
echo "${Color_Y}* For more details, read the \"Troubleshooting\" wiki page in GitHub ${Color_N}" echo "${Color_Y}* For more details, read the \"Troubleshooting\" wiki page in GitHub ${Color_N}"
ExitWin ExitWin 1
exit 1
elif [[ -n $DeviceState ]]; then elif [[ -n $DeviceState ]]; then
if [[ ! $ProductType ]]; then if [[ ! $ProductType ]]; then
read -p "$(Input 'Enter ProductType (eg. iPad2,1):')" ProductType read -p "$(Input 'Enter ProductType (eg. iPad2,1):')" ProductType
@ -252,7 +251,7 @@ EnterPwnDFU() {
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}* 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}" 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}"
Echo "* For more details, read the \"Troubleshooting\" wiki page in GitHub" Echo "* For more details, read the \"Troubleshooting\" wiki page in GitHub"
exit 1 ExitWin 1
elif [[ $pwnDFUDevice == 0 ]]; then elif [[ $pwnDFUDevice == 0 ]]; then
Log "Device in pwnDFU mode detected." Log "Device in pwnDFU mode detected."
else else

View File

@ -94,9 +94,9 @@ DowngradeOther() {
Log "Selected SHSH file: $SHSH" Log "Selected SHSH file: $SHSH"
if [[ ! -e resources/firmware/$ProductType/$BuildVer/index.html ]]; then if [[ ! -e resources/firmware/$ProductType/$BuildVer/index.html ]]; then
Log "Getting firmware keys for $ProductType-$BuildVer"
unzip -o -j "$IPSW.ipsw" Restore.plist -d tmp unzip -o -j "$IPSW.ipsw" Restore.plist -d tmp
BuildVer=$(cat tmp/Restore.plist | grep -i ProductBuildVersion -A 1 | grep -oPm1 "(?<=<string>)[^<]+") BuildVer=$(cat tmp/Restore.plist | grep -i ProductBuildVersion -A 1 | grep -oPm1 "(?<=<string>)[^<]+")
Log "Getting firmware keys for $ProductType-$BuildVer"
mkdir -p resources/firmware/$ProductType/$BuildVer 2>/dev/null mkdir -p resources/firmware/$ProductType/$BuildVer 2>/dev/null
curl -L https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/raw/master/$ProductType/$BuildVer/index.html -o tmp/index.html curl -L https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/raw/master/$ProductType/$BuildVer/index.html -o tmp/index.html
mv tmp/index.html resources/firmware/$ProductType/$BuildVer mv tmp/index.html resources/firmware/$ProductType/$BuildVer
@ -167,14 +167,15 @@ iDeviceRestore() {
[[ $1 == "latest" ]] && ExtraArgs="-ey" || ExtraArgs="-ewy" [[ $1 == "latest" ]] && ExtraArgs="-ey" || ExtraArgs="-ewy"
$idevicerestore $ExtraArgs "$IPSWRestore.ipsw" $idevicerestore $ExtraArgs "$IPSWRestore.ipsw"
if [[ $platform == "macos" && $? != 0 ]]; then if [[ $platform == "macos" && $? != 0 ]]; then
Log "An error seems to have occurred in idevicerestore." Log "Restoring done! Read the message below if any error has occured:"
Echo "* If this is the \"Killed: 9\" error or similar, try these steps:" Echo "* If the \"Killed: 9\" or other similar error pops up, try these steps:"
Echo "* Using Terminal, cd to where the script is located, then run" Echo "* Using Terminal, cd to where the script is located, then run"
Echo "* sudo codesign --sign - --force --deep resources/tools/idevicerestore_macos" Echo "* sudo codesign --sign - --force --deep resources/tools/idevicerestore_macos"
Echo "* For more details, read the \"Troubleshooting\" wiki page in GitHub"
elif [[ $platform == "win" && $? != 0 ]]; then elif [[ $platform == "win" && $? != 0 ]]; then
Log "An error seems to have occurred in idevicerestore." Log "Restoring done! Read the message below if any error has occured:"
Echo "* Windows users may encounter errors like \"Unable to send APTicket\" or \"Unable to send iBEC\" in the restore process." Echo "* Windows users may encounter errors like \"Unable to send APTicket\" or \"Unable to send iBEC\" in the restore process."
Echo "* To fix this, follow troubleshooting steps here: https://github.com/LukeZGD/iOS-OTA-Downgrader/wiki/Troubleshooting#windows" Echo "* To fix this, follow troubleshooting steps from here: https://github.com/LukeZGD/iOS-OTA-Downgrader/wiki/Troubleshooting#windows"
else else
echo echo
Log "Restoring done!" Log "Restoring done!"

View File

@ -32,8 +32,7 @@ Error() {
echo -e "\n${Color_R}[Error] $1 ${Color_N}" echo -e "\n${Color_R}[Error] $1 ${Color_N}"
[[ -n $2 ]] && echo "${Color_R}* $2 ${Color_N}" [[ -n $2 ]] && echo "${Color_R}* $2 ${Color_N}"
echo echo
ExitWin ExitWin 1
exit 1
} }
Input() { Input() {
@ -46,9 +45,11 @@ Log() {
ExitWin() { ExitWin() {
if [[ $platform == "win" ]]; then if [[ $platform == "win" ]]; then
echo
Input "Press Enter/Return to exit." Input "Press Enter/Return to exit."
read -s read -s
fi fi
exit $1
} }
Main() { Main() {
@ -103,6 +104,7 @@ Main() {
fi fi
Clean Clean
InstallDepends InstallDepends
ExitWin 0
fi fi
if [[ $platform != "win" ]]; then if [[ $platform != "win" ]]; then
@ -165,14 +167,14 @@ Main() {
if [[ -e "$IPSWCustom.ipsw" ]]; then if [[ -e "$IPSWCustom.ipsw" ]]; then
Log "Found existing Custom IPSW, stopping here." Log "Found existing Custom IPSW, stopping here."
Echo "* If you want to re-create the custom IPSW, move/delete the existing one first." Echo "* If you want to re-create the custom IPSW, move/delete the existing one first."
exit 0 ExitWin 0
elif [[ $Jailbreak != 1 && $platform != "win" ]]; then elif [[ $Jailbreak != 1 && $platform != "win" ]]; then
if [[ $DeviceProc == 4 && $OSVer == "7.1.2" ]]; then if [[ $DeviceProc == 4 && $OSVer == "7.1.2" ]]; then
Log "Creating custom IPSW is not needed for non-jailbroken 7.1.2 restores." Log "Creating custom IPSW is not needed for non-jailbroken 7.1.2 restores."
exit 0 ExitWin 0
else else
Log "Creating custom IPSW is not needed for non-jailbroken restores on your device." Log "Creating custom IPSW is not needed for non-jailbroken restores on your device."
exit 0 ExitWin 0
fi fi
fi fi
@ -190,13 +192,11 @@ Main() {
if [[ $DeviceProc != 4 && $platform != "win" ]]; then if [[ $DeviceProc != 4 && $platform != "win" ]]; then
Echo "* You may also use futurerestore manually (make sure to use the latest beta)" Echo "* You may also use futurerestore manually (make sure to use the latest beta)"
fi fi
ExitWin ExitWin 0
exit 0
elif [[ $Mode != "Downgrade"* && $Mode != *"4" ]]; then elif [[ $Mode != "Downgrade"* && $Mode != *"4" ]]; then
$Mode $Mode
ExitWin ExitWin 0
exit 0
fi fi
if [[ $DeviceProc == 4 && $platform == "win" ]]; then if [[ $DeviceProc == 4 && $platform == "win" ]]; then
@ -240,7 +240,7 @@ Main() {
echo "${Color_Y}* Exit DFU mode by holding the TOP and HOME buttons for 15 seconds. ${Color_N}" echo "${Color_Y}* Exit DFU mode by holding the TOP and HOME buttons for 15 seconds. ${Color_N}"
echo "${Color_Y}* For usage of the DFU Advanced Menu, add PwnedDevice as an argument. ${Color_N}" echo "${Color_Y}* For usage of the DFU Advanced Menu, add PwnedDevice as an argument. ${Color_N}"
echo "${Color_Y}* For more details, read the \"Troubleshooting\" wiki page in GitHub ${Color_N}" echo "${Color_Y}* For more details, read the \"Troubleshooting\" wiki page in GitHub ${Color_N}"
exit 1 ExitWin 1
fi fi
echo echo
Echo "* DFU Advanced Menu" Echo "* DFU Advanced Menu"
@ -281,8 +281,7 @@ Main() {
fi fi
Downgrade Downgrade
ExitWin ExitWin 0
exit 0
} }
SelectVersion() { SelectVersion() {