mirror of
https://github.com/LukeZGD/Legacy-iOS-Kit.git
synced 2024-12-24 15:21:49 +01:00
Update restore.sh
This commit is contained in:
parent
f68f3d4fae
commit
0b27bfc474
45
restore.sh
45
restore.sh
@ -236,6 +236,10 @@ set_tool_paths() {
|
|||||||
$'\n* For MacPorts: sudo port install bash libimobiledevice libirecovery'
|
$'\n* For MacPorts: sudo port install bash libimobiledevice libirecovery'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $(uname -m) != "x86_64" && ! $(/usr/bin/pgrep oahd >/dev/null 2>&1) ]]; then
|
||||||
|
error "Rosetta 2 does not seem to be installed. Please install Rosetta 2 to continue."
|
||||||
|
fi
|
||||||
|
|
||||||
elif [[ $OSTYPE == "msys" ]]; then
|
elif [[ $OSTYPE == "msys" ]]; then
|
||||||
platform="windows"
|
platform="windows"
|
||||||
platform_ver="$(uname)"
|
platform_ver="$(uname)"
|
||||||
@ -244,6 +248,10 @@ set_tool_paths() {
|
|||||||
ping="ping -n 1"
|
ping="ping -n 1"
|
||||||
|
|
||||||
warn "Using Legacy iOS Kit on Windows is not recommended."
|
warn "Using Legacy iOS Kit on Windows is not recommended."
|
||||||
|
print "* Please switch to a Linux or Mac machine to avoid issues."
|
||||||
|
print "* Read the How to Use page: https://github.com/LukeZGD/Legacy-iOS-Kit/wiki/How-to-Use"
|
||||||
|
sleep 5
|
||||||
|
pause
|
||||||
# itunes version check
|
# itunes version check
|
||||||
itunes_ver="Unknown"
|
itunes_ver="Unknown"
|
||||||
if [[ -e "/c/Program Files/iTunes/iTunes.exe" ]]; then
|
if [[ -e "/c/Program Files/iTunes/iTunes.exe" ]]; then
|
||||||
@ -259,6 +267,7 @@ set_tool_paths() {
|
|||||||
warn "Detected a newer iTunes version."
|
warn "Detected a newer iTunes version."
|
||||||
print "* Please downgrade iTunes to 12.6.5, 12.4.3, or older."
|
print "* Please downgrade iTunes to 12.6.5, 12.4.3, or older."
|
||||||
print "* You may still continue, but you might encounter issues with restoring the device."
|
print "* You may still continue, but you might encounter issues with restoring the device."
|
||||||
|
sleep 5
|
||||||
pause
|
pause
|
||||||
itunes_ver+=" (please downgrade to 12.6.5 or older)"
|
itunes_ver+=" (please downgrade to 12.6.5 or older)"
|
||||||
fi
|
fi
|
||||||
@ -838,14 +847,17 @@ device_enter_mode() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $platform == "windows" ]]; then
|
if [[ $platform == "windows" ]]; then
|
||||||
print "* Make sure that your device is in PWNED DFU or kDFU mode."
|
print "* Place your device in PWNED DFU or kDFU mode using Legacy iOS Kit on Linux or Mac."
|
||||||
print "* For 32-bit devices, pwned iBSS/kDFU must be already booted."
|
print "* Do not use pwning tools on Windows, they will NOT work for Legacy iOS Kit."
|
||||||
print "* For A7 devices, signature checks must be already disabled."
|
print "* You can also do pwning using another iOS Device with iPwnder Lite."
|
||||||
|
print "* If you do not know what you are doing, exit now and restart your device in normal mode."
|
||||||
|
print "* Troubleshooting links:"
|
||||||
|
print " - https://github.com/LukeZGD/Legacy-iOS-Kit/wiki/Troubleshooting#windows"
|
||||||
|
print " - https://github.com/LukeZGD/Legacy-iOS-Kit/wiki/Pwning-Using-Another-iOS-Device"
|
||||||
if [[ $device_mode == "DFU" ]]; then
|
if [[ $device_mode == "DFU" ]]; then
|
||||||
pause
|
pause
|
||||||
return
|
return
|
||||||
elif [[ $device_mode == "Recovery" ]]; then
|
elif [[ $device_mode == "Recovery" ]]; then
|
||||||
print "* If you do not know what you are doing, exit now and restart your device in normal mode."
|
|
||||||
read -p "$(input 'Select Y to exit recovery mode (Y/n) ')" opt
|
read -p "$(input 'Select Y to exit recovery mode (Y/n) ')" opt
|
||||||
if [[ $opt != 'N' && $opt != 'n' ]]; then
|
if [[ $opt != 'N' && $opt != 'n' ]]; then
|
||||||
log "Exiting recovery mode."
|
log "Exiting recovery mode."
|
||||||
@ -866,7 +878,12 @@ device_enter_mode() {
|
|||||||
log "Pwned iBSS/kDFU mode specified by user."
|
log "Pwned iBSS/kDFU mode specified by user."
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
elif [[ $irec_pwned == 1 ]] && (( device_proc >= 7 )); then
|
elif [[ $irec_pwned == 1 && $device_proc == 7 ]]; then
|
||||||
|
if [[ $platform == "macos" ]]; then
|
||||||
|
$ipwnder
|
||||||
|
else
|
||||||
|
device_ipwndfu rmsigchks
|
||||||
|
fi
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -925,8 +942,7 @@ device_enter_mode() {
|
|||||||
# irec_pwned is instances of "PWND" in serial, must be 1
|
# irec_pwned is instances of "PWND" in serial, must be 1
|
||||||
# tool_pwned is error code of pwn tool, must be 0
|
# tool_pwned is error code of pwn tool, must be 0
|
||||||
if [[ $irec_pwned != 1 && $tool_pwned != 0 ]]; then
|
if [[ $irec_pwned != 1 && $tool_pwned != 0 ]]; then
|
||||||
error "Failed to enter pwnDFU mode. Please run the script again." \
|
device_pwnerror
|
||||||
"* Exit DFU mode first by holding the TOP and HOME buttons for about 15 seconds."
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $platform == "macos" && $opt != "$gaster pwn" ]]; then
|
if [[ $platform == "macos" && $opt != "$gaster pwn" ]]; then
|
||||||
@ -942,6 +958,18 @@ device_enter_mode() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
device_pwnerror() {
|
||||||
|
local error_msg=$'\n* Exit DFU mode first by holding the TOP and HOME buttons for 15 seconds.'
|
||||||
|
error_msg+=$'\n* If you have an AMD CPU, you may have to try again on a machine with an Intel CPU.'
|
||||||
|
if [[ $platform == "linux" && $device_proc != 4 ]]; then
|
||||||
|
error_msg+=$'\n* Unfortunately, success rates for checkm8 are low on Linux.'
|
||||||
|
error_msg+=$'\n* Pwning with a Mac or another iOS device are better options.'
|
||||||
|
fi
|
||||||
|
error_msg+=$'\n* For more details, read the "Troubleshooting" wiki page in GitHub'
|
||||||
|
error_msg+=$'\n* Troubleshooting link: https://github.com/LukeZGD/Legacy-iOS-Kit/wiki/Troubleshooting'
|
||||||
|
error "Failed to enter pwnDFU mode. Please run the script again." "$error_msg"
|
||||||
|
}
|
||||||
|
|
||||||
device_ipwndfu() {
|
device_ipwndfu() {
|
||||||
local tool_pwned=0
|
local tool_pwned=0
|
||||||
local mac_ver=0
|
local mac_ver=0
|
||||||
@ -994,8 +1022,7 @@ device_ipwndfu() {
|
|||||||
$python2 ipwndfu -p
|
$python2 ipwndfu -p
|
||||||
tool_pwned=$?
|
tool_pwned=$?
|
||||||
if [[ $tool_pwned != 0 ]]; then
|
if [[ $tool_pwned != 0 ]]; then
|
||||||
error "Failed to enter pwnDFU mode. Please run the script again." \
|
device_pwnerror
|
||||||
"* Exit DFU mode first by holding the TOP and HOME buttons for about 15 seconds."
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user