mirror of
https://github.com/LukeZGD/Legacy-iOS-Kit.git
synced 2025-02-28 22:13:41 +01:00
Changes
This commit is contained in:
parent
d39578e61b
commit
ee263637e0
96
restore.sh
96
restore.sh
@ -72,10 +72,11 @@ clean_usbmuxd() {
|
|||||||
if [[ $(ls "$(dirname "$0")" | grep -v tmp$$ | grep -c tmp) != 0 ]]; then
|
if [[ $(ls "$(dirname "$0")" | grep -v tmp$$ | grep -c tmp) != 0 ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
sudo killall usbmuxd usbmuxd2 2>/dev/null
|
sudo killall -9 usbmuxd usbmuxd2 2>/dev/null
|
||||||
if [[ $(command -v systemctl) ]]; then
|
if [[ $(command -v systemctl) ]]; then
|
||||||
sleep 1
|
|
||||||
sudo systemctl restart usbmuxd
|
sudo systemctl restart usbmuxd
|
||||||
|
elif [[ $(command -v rc-service) ]]; then
|
||||||
|
sudo rc-service usbmuxd start
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,6 +99,8 @@ List of options:
|
|||||||
--no-device Enable no device mode
|
--no-device Enable no device mode
|
||||||
--no-version-check Disable script version checking
|
--no-version-check Disable script version checking
|
||||||
--pwn Pwn the connected device
|
--pwn Pwn the connected device
|
||||||
|
--sshrd Enter SSH ramdisk mode (requires additional arguments)
|
||||||
|
--sshrd-menu Re-enter SSH ramdisk menu (device must be in SSH ramdisk mode)
|
||||||
|
|
||||||
For 32-bit devices compatible with restores/downgrades (see README):
|
For 32-bit devices compatible with restores/downgrades (see README):
|
||||||
--activation-records Enable dumping/stitching activation records
|
--activation-records Enable dumping/stitching activation records
|
||||||
@ -291,6 +294,10 @@ set_tool_paths() {
|
|||||||
if [[ $othertmp == 0 ]]; then
|
if [[ $othertmp == 0 ]]; then
|
||||||
if [[ $(command -v systemctl) ]]; then
|
if [[ $(command -v systemctl) ]]; then
|
||||||
sudo systemctl stop usbmuxd
|
sudo systemctl stop usbmuxd
|
||||||
|
elif [[ $(command -v rc-service) ]]; then
|
||||||
|
sudo rc-service usbmuxd zap
|
||||||
|
else
|
||||||
|
sudo killall -9 usbmuxd
|
||||||
fi
|
fi
|
||||||
#sudo killall usbmuxd 2>/dev/null
|
#sudo killall usbmuxd 2>/dev/null
|
||||||
#sleep 1
|
#sleep 1
|
||||||
@ -614,7 +621,7 @@ device_entry() {
|
|||||||
until [[ -n $device_type ]]; do
|
until [[ -n $device_type ]]; do
|
||||||
read -p "$(input 'Enter device type (eg. iPad2,1): ')" device_type
|
read -p "$(input 'Enter device type (eg. iPad2,1): ')" device_type
|
||||||
done
|
done
|
||||||
if [[ $main_argmode == "device_justboot" ]]; then
|
if [[ $main_argmode == "device_justboot" || $main_argmode == "device_enter_ramdisk"* ]]; then
|
||||||
:
|
:
|
||||||
elif [[ $device_type != "iPhone1"* && $device_type != "iPod1,1" ]]; then
|
elif [[ $device_type != "iPhone1"* && $device_type != "iPod1,1" ]]; then
|
||||||
until [[ -n $device_ecid ]] && [ "$device_ecid" -eq "$device_ecid" ]; do
|
until [[ -n $device_ecid ]] && [ "$device_ecid" -eq "$device_ecid" ]; do
|
||||||
@ -859,6 +866,9 @@ device_get_info() {
|
|||||||
log "No device mode is enabled."
|
log "No device mode is enabled."
|
||||||
device_mode="none"
|
device_mode="none"
|
||||||
device_vers="Unknown"
|
device_vers="Unknown"
|
||||||
|
elif [[ $main_argmode == "device_enter_ramdisk_menu" ]]; then
|
||||||
|
log "sshrd-menu flag detected, assuming device is in SSH ramdisk mode"
|
||||||
|
device_mode="Normal"
|
||||||
else
|
else
|
||||||
log "Finding device in Normal mode..."
|
log "Finding device in Normal mode..."
|
||||||
if [[ $platform == "linux" ]]; then
|
if [[ $platform == "linux" ]]; then
|
||||||
@ -867,8 +877,6 @@ device_get_info() {
|
|||||||
print "* If it fails to detect devices, try to delete all \"tmp\" folders in your Legacy iOS Kit folder"
|
print "* If it fails to detect devices, try to delete all \"tmp\" folders in your Legacy iOS Kit folder"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
$ideviceinfo -s >/dev/null
|
$ideviceinfo -s >/dev/null
|
||||||
if [[ $? == 0 ]]; then
|
if [[ $? == 0 ]]; then
|
||||||
device_mode="Normal"
|
device_mode="Normal"
|
||||||
@ -878,6 +886,7 @@ device_get_info() {
|
|||||||
device_mode="Normal"
|
device_mode="Normal"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -z $device_mode ]]; then
|
if [[ -z $device_mode ]]; then
|
||||||
log "Finding device in Recovery/DFU mode..."
|
log "Finding device in Recovery/DFU mode..."
|
||||||
@ -1319,10 +1328,10 @@ device_iproxy() {
|
|||||||
port=$2
|
port=$2
|
||||||
fi
|
fi
|
||||||
if [[ $1 == "no-logging" && $debug_mode != 1 ]]; then
|
if [[ $1 == "no-logging" && $debug_mode != 1 ]]; then
|
||||||
"$dir/iproxy" $ssh_port $port >/dev/null &
|
"$dir/iproxy" $ssh_port $port -s 127.0.0.1 >/dev/null &
|
||||||
iproxy_pid=$!
|
iproxy_pid=$!
|
||||||
else
|
else
|
||||||
"$dir/iproxy" $ssh_port $port &
|
"$dir/iproxy" $ssh_port $port -s 127.0.0.1 &
|
||||||
iproxy_pid=$!
|
iproxy_pid=$!
|
||||||
fi
|
fi
|
||||||
log "iproxy PID: $iproxy_pid"
|
log "iproxy PID: $iproxy_pid"
|
||||||
@ -1766,7 +1775,14 @@ device_enter_mode() {
|
|||||||
"ipwndfu" ) device_ipwndfu pwn; tool_pwned=$?; break;;
|
"ipwndfu" ) device_ipwndfu pwn; tool_pwned=$?; break;;
|
||||||
"ipwnder (SHAtter)" ) $ipwnder -s; tool_pwned=$?; break;;
|
"ipwnder (SHAtter)" ) $ipwnder -s; tool_pwned=$?; break;;
|
||||||
"ipwnder (limera1n)" ) $ipwnder -p; tool_pwned=$?; break;;
|
"ipwnder (limera1n)" ) $ipwnder -p; tool_pwned=$?; break;;
|
||||||
"ipwnder" ) $ipwnder -d; tool_pwned=$?; break;;
|
"ipwnder" )
|
||||||
|
mkdir image3 ../saved/image3 2>/dev/null
|
||||||
|
cp ../saved/image3/* image3/ 2>/dev/null
|
||||||
|
$ipwnder -d
|
||||||
|
tool_pwned=$?
|
||||||
|
cp image3/* ../saved/image3/
|
||||||
|
break
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
elif [[ $platform == "linux" ]]; then
|
elif [[ $platform == "linux" ]]; then
|
||||||
@ -1776,8 +1792,11 @@ device_enter_mode() {
|
|||||||
elif [[ $device_proc == 6 ]]; then
|
elif [[ $device_proc == 6 ]]; then
|
||||||
# A6 asi mac uses ipwnder_lite
|
# A6 asi mac uses ipwnder_lite
|
||||||
log "Placing device to pwnDFU mode using ipwnder_lite"
|
log "Placing device to pwnDFU mode using ipwnder_lite"
|
||||||
|
mkdir image3 ../saved/image3 2>/dev/null
|
||||||
|
cp ../saved/image3/* image3/ 2>/dev/null
|
||||||
$ipwnder -d
|
$ipwnder -d
|
||||||
tool_pwned=$?
|
tool_pwned=$?
|
||||||
|
cp image3/* ../saved/image3/
|
||||||
elif [[ $platform_arch == "arm64" ]]; then
|
elif [[ $platform_arch == "arm64" ]]; then
|
||||||
# A7 asi mac uses ipwnder_lite
|
# A7 asi mac uses ipwnder_lite
|
||||||
log "Placing device to pwnDFU mode using ipwnder_lite"
|
log "Placing device to pwnDFU mode using ipwnder_lite"
|
||||||
@ -4044,7 +4063,7 @@ ipsw_prepare_multipatch() {
|
|||||||
"$dir/hfsplus" RestoreRamdisk.dec grow 30000000
|
"$dir/hfsplus" RestoreRamdisk.dec grow 30000000
|
||||||
|
|
||||||
log "Patch ASR"
|
log "Patch ASR"
|
||||||
if [[ $ipsw_prepare_usepowder == 1 ]]; then
|
if [[ $ipsw_prepare_usepowder == 1 && $ipsw_gasgauge_patch != 1 ]]; then
|
||||||
rm -f asr
|
rm -f asr
|
||||||
"$dir/hfsplus" ramdisk2.dec extract usr/sbin/asr
|
"$dir/hfsplus" ramdisk2.dec extract usr/sbin/asr
|
||||||
"$dir/hfsplus" RestoreRamdisk.dec rm usr/sbin/asr
|
"$dir/hfsplus" RestoreRamdisk.dec rm usr/sbin/asr
|
||||||
@ -5414,22 +5433,8 @@ device_ramdisk64() {
|
|||||||
build_id="18C66"
|
build_id="18C66"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $1 == "jailbreak" ]]; then
|
if [[ $device_ramdisk_ios8 == 1 ]]; then
|
||||||
ios8=1
|
ios8=1
|
||||||
elif (( device_proc <= 8 )) && [[ $device_type != "iPad5,1" && $device_type != "iPad5,2" ]]; then
|
|
||||||
local ver="12"
|
|
||||||
if [[ $device_type == "iPad5"* ]]; then
|
|
||||||
ver="14"
|
|
||||||
fi
|
|
||||||
device_ramdiskver="$ver"
|
|
||||||
input "Version Select Option"
|
|
||||||
print "* The version of the SSH Ramdisk is set to iOS $ver by default. This is the recommended option."
|
|
||||||
print "* There is also an option to use iOS 8 ramdisk. This can be used to fix devices on iOS 7 not booting after using iOS $ver ramdisk."
|
|
||||||
print "* If not sure, just press Enter/Return. This will select the default version."
|
|
||||||
read -p "$(input "Select Y to use iOS $ver, select N to use iOS 8 (Y/n) ")" opt
|
|
||||||
if [[ $opt == 'n' || $opt == 'N' ]]; then
|
|
||||||
ios8=1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $ios8 == 1 ]]; then
|
if [[ $ios8 == 1 ]]; then
|
||||||
@ -9026,18 +9031,48 @@ device_justboot() {
|
|||||||
|
|
||||||
device_enter_ramdisk() {
|
device_enter_ramdisk() {
|
||||||
if (( device_proc >= 7 )); then
|
if (( device_proc >= 7 )); then
|
||||||
device_ramdisk64
|
if (( device_proc <= 8 )) && [[ $device_type != "iPad5,1" && $device_type != "iPad5,2" ]]; then
|
||||||
return
|
device_ramdiskver="12"
|
||||||
|
if [[ $device_type == "iPad5"* ]]; then
|
||||||
|
device_ramdiskver="14"
|
||||||
|
fi
|
||||||
|
local ver="$device_ramdiskver"
|
||||||
|
input "Version Select Option"
|
||||||
|
print "* The version of the SSH Ramdisk is set to iOS $ver by default. This is the recommended option."
|
||||||
|
print "* There is also an option to use iOS 8 ramdisk. This can be used to fix devices on iOS 7 not booting after using iOS $ver ramdisk."
|
||||||
|
print "* If not sure, just press Enter/Return. This will select the default version."
|
||||||
|
read -p "$(input "Select Y to use iOS $ver, select N to use iOS 8 (Y/n) ")" opt
|
||||||
|
if [[ $opt == 'n' || $opt == 'N' ]]; then
|
||||||
|
device_ramdisk_ios8=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
elif (( device_proc >= 5 )) && [[ $device_vers == "9"* || $device_vers == "10"* ]]; then
|
elif (( device_proc >= 5 )) && [[ $device_vers == "9"* || $device_vers == "10"* ]]; then
|
||||||
device_rd_build="13A452"
|
device_rd_build="13A452"
|
||||||
elif (( device_proc >= 5 )) && (( device_det <= 8 )) && [[ $device_mode == "Normal" ]]; then
|
elif (( device_proc >= 5 )) && (( device_det <= 8 )) && [[ $device_mode == "Normal" ]]; then
|
||||||
:
|
:
|
||||||
elif (( device_proc >= 5 )); then
|
elif (( device_proc >= 5 )) && [[ -z $device_rd_build ]]; then
|
||||||
print "* To mount /var (/mnt2) for iOS 9-10, I recommend using 9.0.2 (13A452)."
|
print "* To mount /var (/mnt2) for iOS 9-10, I recommend using 9.0.2 (13A452)."
|
||||||
print "* If not sure, just press Enter/Return. This will select the default version."
|
print "* If not sure, just press Enter/Return. This will select the default version."
|
||||||
device_enter_build
|
device_enter_build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $1 == "menu" ]]; then
|
||||||
|
clear
|
||||||
|
device_iproxy
|
||||||
|
device_sshpass alpine
|
||||||
|
menu_ramdisk
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( device_proc >= 7 )); then
|
||||||
|
device_ramdisk64
|
||||||
|
else
|
||||||
device_ramdisk $1
|
device_ramdisk $1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
device_enter_ramdisk_menu() {
|
||||||
|
device_enter_ramdisk menu
|
||||||
}
|
}
|
||||||
|
|
||||||
device_ideviceinstaller() {
|
device_ideviceinstaller() {
|
||||||
@ -9296,9 +9331,9 @@ device_fourthree_check() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
device_backup_create() {
|
device_backup_create() {
|
||||||
device_backup="../saved/backups/${device_ecid}_${device_type}/$(date +%Y-%m-%d-%H%M)"
|
|
||||||
print "* A backup of your device will be created using idevicebackup2. Please see the notes above."
|
print "* A backup of your device will be created using idevicebackup2. Please see the notes above."
|
||||||
pause
|
pause
|
||||||
|
device_backup="../saved/backups/${device_ecid}_${device_type}/$(date +%Y-%m-%d-%H%M)"
|
||||||
mkdir -p $device_backup
|
mkdir -p $device_backup
|
||||||
pushd "$(dirname $device_backup)"
|
pushd "$(dirname $device_backup)"
|
||||||
dir="../../$dir"
|
dir="../../$dir"
|
||||||
@ -9516,6 +9551,11 @@ case $1 in
|
|||||||
main_argmode="device_justboot"
|
main_argmode="device_justboot"
|
||||||
;;
|
;;
|
||||||
"--pwn" ) main_argmode="pwned-ibss";;
|
"--pwn" ) main_argmode="pwned-ibss";;
|
||||||
|
"--sshrd" ) main_argmode="device_enter_ramdisk";;
|
||||||
|
"--sshrd-menu" )
|
||||||
|
device_argmode="entry"
|
||||||
|
main_argmode="device_enter_ramdisk_menu"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
trap "clean" EXIT
|
trap "clean" EXIT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user