Use zenity file selection for "Other" downgrades (Linux only)

This commit is contained in:
LukeZGD 2021-09-01 07:57:25 +08:00
parent 8f7603c602
commit c053bb5569
2 changed files with 20 additions and 12 deletions

View File

@ -107,7 +107,7 @@ InstallDepends() {
read -s read -s
fi fi
if [[ $ID == "arch" || $ID_LIKE == "arch" || $ID == "artix" ]]; then if [[ $ID == "arch" || $ID_LIKE == "arch" || $ID == "artix" ]]; then
sudo pacman -Syu --noconfirm --needed base-devel bsdiff curl libcurl-compat libpng12 libimobiledevice libzip openssh openssl-1.0 python2 unzip usbutils sudo pacman -Syu --noconfirm --needed base-devel bsdiff curl libcurl-compat libpng12 libimobiledevice libzip openssh openssl-1.0 python2 unzip usbutils zenity
ln -sf /usr/lib/libcurl.so.3 ../resources/lib/libcurl.so.3 ln -sf /usr/lib/libcurl.so.3 ../resources/lib/libcurl.so.3
ln -sf /usr/lib/libzip.so.5 ../resources/lib/libzip.so.4 ln -sf /usr/lib/libzip.so.5 ../resources/lib/libzip.so.4
@ -115,7 +115,7 @@ InstallDepends() {
[[ $VERSION == "11 (bullseye)" || $PRETTY_NAME == "Debian"*"sid" ]]; then [[ $VERSION == "11 (bullseye)" || $PRETTY_NAME == "Debian"*"sid" ]]; then
[[ ! -z $UBUNTU_CODENAME ]] && sudo add-apt-repository -y universe [[ ! -z $UBUNTU_CODENAME ]] && sudo add-apt-repository -y universe
sudo apt update sudo apt update
sudo apt install -y bsdiff curl git libimobiledevice6 openssh-client python2 unzip usbmuxd usbutils sudo apt install -y bsdiff curl git libimobiledevice6 openssh-client python2 unzip usbmuxd usbutils zenity
SavePkg SavePkg
cp libcrypto.so.1.0.0 libcurl.so.3 libpng12.so.0 libssl.so.1.0.0 ../resources/lib cp libcrypto.so.1.0.0 libcurl.so.3 libpng12.so.0 libssl.so.1.0.0 ../resources/lib
if [[ $VERSION_ID == "20"* ]]; then if [[ $VERSION_ID == "20"* ]]; then
@ -125,7 +125,7 @@ InstallDepends() {
fi fi
elif [[ $ID == "fedora" ]] && (( $VERSION_ID >= 33 )); then elif [[ $ID == "fedora" ]] && (( $VERSION_ID >= 33 )); then
sudo dnf install -y bsdiff git libimobiledevice libpng12 libzip perl-Digest-SHA python2 sudo dnf install -y bsdiff git libimobiledevice libpng12 libzip perl-Digest-SHA python2 zenity
SavePkg SavePkg
cp libcrypto.so.1.0.0 libssl.so.1.0.0 ../resources/lib cp libcrypto.so.1.0.0 libssl.so.1.0.0 ../resources/lib
ln -sf /usr/lib64/libzip.so.5 ../resources/lib/libzip.so.4 ln -sf /usr/lib64/libzip.so.5 ../resources/lib/libzip.so.4
@ -138,7 +138,7 @@ InstallDepends() {
libimobiledevice="libimobiledevice6" libimobiledevice="libimobiledevice6"
ln -sf /lib64/libreadline.so.7 ../resources/lib/libreadline.so.8 ln -sf /lib64/libreadline.so.7 ../resources/lib/libreadline.so.8
fi fi
sudo zypper -n in bsdiff curl git $libimobiledevice libpng12-0 libopenssl1_0_0 libzip5 python-base sudo zypper -n in bsdiff curl git $libimobiledevice libpng12-0 libopenssl1_0_0 libzip5 python-base zenity
ln -sf /usr/lib64/libzip.so.5 ../resources/lib/libzip.so.4 ln -sf /usr/lib64/libzip.so.5 ../resources/lib/libzip.so.4
elif [[ $platform == "macos" ]]; then elif [[ $platform == "macos" ]]; then
@ -157,7 +157,6 @@ InstallDepends() {
libimobiledevice=("https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/tools/libimobiledevice_linux.zip" "4344b3ca95d7433d5a49dcacc840d47770ba34c4") libimobiledevice=("https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/tools/libimobiledevice_linux.zip" "4344b3ca95d7433d5a49dcacc840d47770ba34c4")
fi fi
if [[ ! -d ../resources/libimobiledevice_$platform && $MPath == "./resources"* ]]; then if [[ ! -d ../resources/libimobiledevice_$platform && $MPath == "./resources"* ]]; then
Log "Downloading libimobiledevice..." Log "Downloading libimobiledevice..."
SaveFile ${libimobiledevice[0]} libimobiledevice.zip ${libimobiledevice[1]} SaveFile ${libimobiledevice[0]} libimobiledevice.zip ${libimobiledevice[1]}

View File

@ -70,11 +70,20 @@ Downgrade() {
local Verify local Verify
if [[ $OSVer == "Other" ]]; then if [[ $OSVer == "Other" ]]; then
Echo "* Move/copy the IPSW and SHSH to the directory where the script is located" if [[ $platform == "linux" ]]; then
Echo "* Remember to create a backup of the SHSH" IPSW="$(zenity --file-selection --file-filter='IPSW | *.ipsw' --title="Select IPSW file")"
read -p "$(Input 'Path to IPSW (drag IPSW to terminal window):')" IPSW IPSW="${IPSW%?????}"
IPSW="$(basename $IPSW .ipsw)" Log "Selected IPSW file: $IPSW"
read -p "$(Input 'Path to SHSH (drag SHSH to terminal window):')" SHSH SHSH="$(zenity --file-selection --file-filter='SHSH | *.shsh *.shsh2' --title="Select SHSH file")"
Log "Selected SHSH file: $SHSH"
else
Echo "* Move/copy the IPSW and SHSH files to the directory where the script is located"
Echo "* When entering the names of IPSW and SHSH, enter the full name including the file extension"
Echo "* Remember to create a backup of the SHSH"
read -p "$(Input 'Enter name of IPSW file:')" IPSW
IPSW="$(basename $IPSW .ipsw)"
read -p "$(Input 'Enter name of SHSH file:')" SHSH
fi
elif [[ $Mode == "Downgrade" && $DeviceProc != 7 ]]; then elif [[ $Mode == "Downgrade" && $DeviceProc != 7 ]]; then
read -p "$(Input 'Jailbreak the selected iOS version? (Y/n):')" Jailbreak read -p "$(Input 'Jailbreak the selected iOS version? (Y/n):')" Jailbreak