mirror of
https://github.com/LukeZGD/Legacy-iOS-Kit.git
synced 2024-11-23 16:39:17 +01:00
Fix update check
and follow some shellcheck stuff
This commit is contained in:
parent
f1247bbf21
commit
02eb3162e8
34
restore.sh
34
restore.sh
@ -164,13 +164,13 @@ set_tool_paths() {
|
|||||||
# live cd/usb check
|
# live cd/usb check
|
||||||
if [[ $(id -u $USER) == 999 || $USER == "liveuser" ]]; then
|
if [[ $(id -u $USER) == 999 || $USER == "liveuser" ]]; then
|
||||||
live_cdusb=1
|
live_cdusb=1
|
||||||
live_cdusb_r="Live"
|
live_cdusb_str="Live"
|
||||||
log "Linux Live CD/USB detected."
|
log "Linux Live CD/USB detected."
|
||||||
if [[ $(pwd) == "/home"* ]]; then
|
if [[ $(pwd) == "/home"* ]]; then
|
||||||
df . -h
|
df . -h
|
||||||
if [[ $(lsblk -o label | grep -c "casper-rw") == 1 || $(lsblk -o label | grep -c "persistence") == 1 ]]; then
|
if [[ $(lsblk -o label | grep -c "casper-rw") == 1 || $(lsblk -o label | grep -c "persistence") == 1 ]]; then
|
||||||
log "Detected Legacy iOS Kit running on persistent storage."
|
log "Detected Legacy iOS Kit running on persistent storage."
|
||||||
live_cdusb_r="Live - Persistent storage"
|
live_cdusb_str="Live - Persistent storage"
|
||||||
else
|
else
|
||||||
warn "Detected Legacy iOS Kit running on temporary storage."
|
warn "Detected Legacy iOS Kit running on temporary storage."
|
||||||
print "* You may run out of space and get errors during the downgrade process."
|
print "* You may run out of space and get errors during the downgrade process."
|
||||||
@ -178,7 +178,7 @@ set_tool_paths() {
|
|||||||
print "* This means using another external HDD/flash drive to store Legacy iOS Kit on."
|
print "* This means using another external HDD/flash drive to store Legacy iOS Kit on."
|
||||||
print "* To be able to use one USB drive only, make sure to enable Persistent Storage for the live USB."
|
print "* To be able to use one USB drive only, make sure to enable Persistent Storage for the live USB."
|
||||||
pause
|
pause
|
||||||
live_cdusb_r="Live - Temporary storage"
|
live_cdusb_str="Live - Temporary storage"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -388,8 +388,10 @@ install_depends() {
|
|||||||
version_get() {
|
version_get() {
|
||||||
log "Checking for updates..."
|
log "Checking for updates..."
|
||||||
github_api=$(curl https://api.github.com/repos/LukeZGD/Legacy-iOS-Kit/releases/latest 2>/dev/null)
|
github_api=$(curl https://api.github.com/repos/LukeZGD/Legacy-iOS-Kit/releases/latest 2>/dev/null)
|
||||||
|
pushd "$(dirname "$0")/tmp" >/dev/null
|
||||||
version_latest=$(echo "$github_api" | $jq -r '.assets[] | select(.name|test("complete")) | .name' | cut -c 25- | cut -c -9)
|
version_latest=$(echo "$github_api" | $jq -r '.assets[] | select(.name|test("complete")) | .name' | cut -c 25- | cut -c -9)
|
||||||
git_hash_latest=$(echo "$github_api" | $jq -r '.assets[] | select(.name|test("git-hash")) | .name' | cut -c 21- | cut -c -7)
|
git_hash_latest=$(echo "$github_api" | $jq -r '.assets[] | select(.name|test("git-hash")) | .name' | cut -c 21- | cut -c -7)
|
||||||
|
popd >/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
version_update() {
|
version_update() {
|
||||||
@ -431,7 +433,7 @@ version_check() {
|
|||||||
if [[ -d .git ]]; then
|
if [[ -d .git ]]; then
|
||||||
git_hash=$(git rev-parse HEAD | cut -c -7)
|
git_hash=$(git rev-parse HEAD | cut -c -7)
|
||||||
local dm=$(git log -1 --format=%ci | cut -c 3- | cut -c -5)
|
local dm=$(git log -1 --format=%ci | cut -c 3- | cut -c -5)
|
||||||
version_current=v$(echo "$dm" | sed 's/-/./g').
|
version_current=v${dm//-/.}.
|
||||||
dm="20$dm"
|
dm="20$dm"
|
||||||
if [[ $platform == "macos" ]]; then
|
if [[ $platform == "macos" ]]; then
|
||||||
dm="$(date -j -f "%Y-%m-%d %H:%M:%S" "${dm}-01 00:00:00" +%s)"
|
dm="$(date -j -f "%Y-%m-%d %H:%M:%S" "${dm}-01 00:00:00" +%s)"
|
||||||
@ -2312,7 +2314,7 @@ restore_idevicerestore() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
restore_futurerestore() {
|
restore_futurerestore() {
|
||||||
local ExtraArgs=()
|
local ExtraArr=()
|
||||||
local futurerestore2="$futurerestore"
|
local futurerestore2="$futurerestore"
|
||||||
local mac_ver=0
|
local mac_ver=0
|
||||||
local port=8888
|
local port=8888
|
||||||
@ -2341,20 +2343,20 @@ restore_futurerestore() {
|
|||||||
restore_download_bbsep
|
restore_download_bbsep
|
||||||
# baseband args
|
# baseband args
|
||||||
if [[ $restore_baseband == 0 ]]; then
|
if [[ $restore_baseband == 0 ]]; then
|
||||||
ExtraArgs+=("--no-baseband")
|
ExtraArr+=("--no-baseband")
|
||||||
else
|
else
|
||||||
ExtraArgs+=("-b" "$restore_baseband" "-p" "$restore_manifest")
|
ExtraArr+=("-b" "$restore_baseband" "-p" "$restore_manifest")
|
||||||
fi
|
fi
|
||||||
if [[ -n $restore_sep ]]; then
|
if [[ -n $restore_sep ]]; then
|
||||||
# sep args for 64bit
|
# sep args for 64bit
|
||||||
ExtraArgs+=("-s" "$restore_sep" "-m" "$restore_manifest")
|
ExtraArr+=("-s" "$restore_sep" "-m" "$restore_manifest")
|
||||||
fi
|
fi
|
||||||
if [[ -n "$1" ]]; then
|
if [[ -n "$1" ]]; then
|
||||||
# custom arg, either --use-pwndfu or --skip-blob
|
# custom arg, either --use-pwndfu or --skip-blob
|
||||||
ExtraArgs+=("$1")
|
ExtraArr+=("$1")
|
||||||
fi
|
fi
|
||||||
if [[ $debug_mode == 1 ]]; then
|
if [[ $debug_mode == 1 ]]; then
|
||||||
ExtraArgs+=("-d")
|
ExtraArr+=("-d")
|
||||||
fi
|
fi
|
||||||
if (( device_proc < 7 )); then
|
if (( device_proc < 7 )); then
|
||||||
futurerestore2+="_old"
|
futurerestore2+="_old"
|
||||||
@ -2365,11 +2367,11 @@ restore_futurerestore() {
|
|||||||
$device_target_vers == "10.3.3" && $device_proc == 7 ]]; then
|
$device_target_vers == "10.3.3" && $device_proc == 7 ]]; then
|
||||||
ipsw_path="$ipsw_custom"
|
ipsw_path="$ipsw_custom"
|
||||||
fi
|
fi
|
||||||
ExtraArgs+=("-t" "$shsh_path" "$ipsw_path.ipsw")
|
ExtraArr+=("-t" "$shsh_path" "$ipsw_path.ipsw")
|
||||||
ipsw_extract
|
ipsw_extract
|
||||||
|
|
||||||
log "Running futurerestore with command: $futurerestore2 ${ExtraArgs[*]}"
|
log "Running futurerestore with command: $futurerestore2 ${ExtraArr[*]}"
|
||||||
$futurerestore2 "${ExtraArgs[@]}"
|
$futurerestore2 "${ExtraArr[@]}"
|
||||||
log "Restoring done! Read the message below if any error has occurred:"
|
log "Restoring done! Read the message below if any error has occurred:"
|
||||||
print "* Please read the \"Troubleshooting\" wiki page in GitHub before opening any issue!"
|
print "* Please read the \"Troubleshooting\" wiki page in GitHub before opening any issue!"
|
||||||
print "* Your problem may have already been addressed within the wiki page."
|
print "* Your problem may have already been addressed within the wiki page."
|
||||||
@ -2945,7 +2947,7 @@ shsh_save_cydia() {
|
|||||||
if [[ $build == "10"* && $build != "10B329" && $build != "10B350" ]]; then
|
if [[ $build == "10"* && $build != "10B329" && $build != "10B350" ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
printf "\n$build "
|
printf "\n%s " "$build"
|
||||||
"$dir/tsschecker" -d $device_type -e $device_ecid --server-url "http://cydia.saurik.com/TSS/controller?action=2/" -s -g 0x1111111111111111 --buildid $build >/dev/null
|
"$dir/tsschecker" -d $device_type -e $device_ecid --server-url "http://cydia.saurik.com/TSS/controller?action=2/" -s -g 0x1111111111111111 --buildid $build >/dev/null
|
||||||
if [[ $(ls *$build* 2>/dev/null) ]]; then
|
if [[ $(ls *$build* 2>/dev/null) ]]; then
|
||||||
printf "saved"
|
printf "saved"
|
||||||
@ -2973,7 +2975,7 @@ menu_print_info() {
|
|||||||
if [[ $git_hash_latest != "$git_hash" ]]; then
|
if [[ $git_hash_latest != "$git_hash" ]]; then
|
||||||
warn "Current version is newer/different than remote: $version_latest ($git_hash_latest)"
|
warn "Current version is newer/different than remote: $version_latest ($git_hash_latest)"
|
||||||
fi
|
fi
|
||||||
print "* Platform: $platform ($platform_ver) $live_cdusb_r"
|
print "* Platform: $platform ($platform_ver) $live_cdusb_str"
|
||||||
if [[ $platform == "windows" ]]; then
|
if [[ $platform == "windows" ]]; then
|
||||||
warn "Using Legacy iOS Kit on Windows is not recommended."
|
warn "Using Legacy iOS Kit on Windows is not recommended."
|
||||||
print "* iTunes version: $itunes_ver"
|
print "* iTunes version: $itunes_ver"
|
||||||
@ -3771,7 +3773,7 @@ if [[ $no_color != 1 ]]; then
|
|||||||
color_R=$(tput setaf 9)
|
color_R=$(tput setaf 9)
|
||||||
color_G=$(tput setaf 10)
|
color_G=$(tput setaf 10)
|
||||||
color_B=$(tput setaf 12)
|
color_B=$(tput setaf 12)
|
||||||
color_Y=$(tput setaf 11)
|
color_Y=$(tput setaf 208)
|
||||||
color_N=$(tput sgr0)
|
color_N=$(tput sgr0)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user