2021-05-29 13:26:08 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
SetToolPaths() {
|
2021-11-06 15:10:04 +01:00
|
|
|
local Detect="Detected libimobiledevice and libirecovery installed from "
|
2021-11-07 14:29:31 +01:00
|
|
|
MPath="./resources/libimobiledevice_"
|
2022-05-28 12:56:10 +02:00
|
|
|
cherrymac="./resources/ch3rryflower/Tools/macos/UNTETHERED"
|
2021-11-06 15:10:04 +01:00
|
|
|
|
2021-05-29 13:26:08 +02:00
|
|
|
if [[ $OSTYPE == "linux"* ]]; then
|
|
|
|
. /etc/os-release 2>/dev/null
|
|
|
|
platform="linux"
|
2021-06-07 07:49:58 +02:00
|
|
|
platformver="$PRETTY_NAME"
|
2021-07-12 16:36:51 +02:00
|
|
|
MPath+="$platform"
|
2021-06-20 11:45:53 +02:00
|
|
|
bspatch="$(which bspatch)"
|
2022-05-28 12:56:10 +02:00
|
|
|
cherry="./resources/ch3rryflower/Tools/ubuntu/UNTETHERED"
|
2021-11-06 15:10:04 +01:00
|
|
|
futurerestore="./resources/tools/futurerestore_linux"
|
2022-09-24 03:42:57 +02:00
|
|
|
python="$(which python3)"
|
2021-09-29 07:33:34 +02:00
|
|
|
|
2021-05-29 13:26:08 +02:00
|
|
|
elif [[ $OSTYPE == "darwin"* ]]; then
|
|
|
|
platform="macos"
|
2021-06-07 07:49:58 +02:00
|
|
|
platformver="${1:-$(sw_vers -productVersion)}"
|
2022-12-17 06:41:00 +01:00
|
|
|
if [[ $(echo $platformver | cut -c -2) == 10 ]]; then
|
|
|
|
local macver=$(echo $platformver | cut -c 4-)
|
|
|
|
macver=${macver%.*}
|
|
|
|
if (( macver < 13 )); then
|
|
|
|
Error "Your macOS version ($platformver) is not supported." \
|
|
|
|
"You need to be on macOS 10.13 or newer to continue."
|
|
|
|
fi
|
|
|
|
fi
|
2021-07-12 16:36:51 +02:00
|
|
|
MPath+="$platform"
|
|
|
|
if [[ -e /usr/local/bin/idevicedate && -e /usr/local/bin/irecovery ]]; then
|
2021-11-06 15:10:04 +01:00
|
|
|
Detect+="Homebrew (Intel Mac)"
|
2021-07-12 16:36:51 +02:00
|
|
|
MPath="/usr/local/bin"
|
|
|
|
elif [[ -e /opt/homebrew/bin/idevicedate && -e /opt/homebrew/bin/irecovery ]]; then
|
2021-11-06 15:10:04 +01:00
|
|
|
Detect+="Homebrew (Apple Silicon)"
|
2021-07-12 16:36:51 +02:00
|
|
|
MPath="/opt/homebrew/bin"
|
2021-09-09 04:20:19 +02:00
|
|
|
elif [[ -e /opt/local/bin/idevicedate && -e /opt/local/bin/irecovery ]]; then
|
2021-11-06 15:10:04 +01:00
|
|
|
Detect+="MacPorts"
|
2021-09-09 04:20:19 +02:00
|
|
|
MPath="/opt/local/bin"
|
2021-11-06 15:10:04 +01:00
|
|
|
else
|
|
|
|
Detect=
|
2021-07-12 16:36:51 +02:00
|
|
|
fi
|
2021-11-17 07:37:02 +01:00
|
|
|
[[ -n $Detect ]] && Log "$Detect"
|
2021-06-20 11:45:53 +02:00
|
|
|
bspatch="/usr/bin/bspatch"
|
2022-05-28 12:56:10 +02:00
|
|
|
cherry="$cherrymac"
|
2021-10-21 13:42:50 +02:00
|
|
|
futurerestore="./resources/tools/futurerestore_macos_$(uname -m)"
|
|
|
|
[[ ! -e $futurerestore ]] && futurerestore="./resources/tools/futurerestore_macos_arm64"
|
2021-05-29 13:26:08 +02:00
|
|
|
ipwnder32="./resources/tools/ipwnder32_macos"
|
2022-02-14 09:08:57 +01:00
|
|
|
ipwnder_lite="./resources/tools/ipwnder_macos"
|
2021-05-29 13:26:08 +02:00
|
|
|
python="/usr/bin/python"
|
2022-05-29 16:57:53 +02:00
|
|
|
|
|
|
|
elif [[ $OSTYPE == "msys" ]]; then
|
|
|
|
platform="win"
|
2022-12-21 09:57:20 +01:00
|
|
|
platformver="$(uname)"
|
2022-05-29 16:57:53 +02:00
|
|
|
MPath+="$platform"
|
|
|
|
bspatch="./resources/tools/bspatch_win"
|
|
|
|
futurerestore="./resources/tools/futurerestore_win"
|
|
|
|
python=/
|
2021-05-29 13:26:08 +02:00
|
|
|
fi
|
2021-11-06 15:10:04 +01:00
|
|
|
|
2022-06-29 04:48:17 +02:00
|
|
|
cherrybin="../$cherry/cherry"
|
2022-12-27 01:18:55 +01:00
|
|
|
hfsplus="../resources/tools/hfsplus_$platform"
|
2021-07-12 16:36:51 +02:00
|
|
|
ideviceenterrecovery="$MPath/ideviceenterrecovery"
|
|
|
|
ideviceinfo="$MPath/ideviceinfo"
|
2022-05-28 12:56:10 +02:00
|
|
|
idevicerestore="./resources/tools/idevicerestore_$platform"
|
2022-08-27 17:30:44 +02:00
|
|
|
idevicererestore="./resources/tools/idevicererestore_$platform"
|
2021-07-12 16:36:51 +02:00
|
|
|
iproxy="$MPath/iproxy"
|
2022-05-28 12:21:26 +02:00
|
|
|
ipsw="../resources/tools/ipsw_$platform"
|
2021-11-06 15:10:04 +01:00
|
|
|
ipwndfu="$python ipwndfu"
|
2021-07-12 16:36:51 +02:00
|
|
|
irecoverychk="$MPath/irecovery"
|
2021-05-29 13:26:08 +02:00
|
|
|
irecovery="$irecoverychk"
|
2022-12-27 01:18:55 +01:00
|
|
|
jq="./resources/tools/jq_$platform"
|
2021-06-01 09:21:37 +02:00
|
|
|
partialzip="./resources/tools/partialzip_$platform"
|
2022-05-28 12:21:26 +02:00
|
|
|
ping="ping -c1"
|
2022-07-20 12:21:30 +02:00
|
|
|
powdersn0w="../resources/tools/powdersn0w_$platform"
|
|
|
|
pwnedDFU="./resources/tools/pwnedDFU_$platform"
|
2022-09-24 03:42:57 +02:00
|
|
|
python2="$(which python2 2>/dev/null)"
|
2021-11-06 15:10:04 +01:00
|
|
|
rmsigchks="$python rmsigchks.py"
|
2022-07-28 07:41:50 +02:00
|
|
|
sha1sum="$(which sha1sum 2>/dev/null)"
|
2022-12-27 01:18:55 +01:00
|
|
|
sha256sum="$(which sha256sum 2>/dev/null)"
|
2021-11-06 15:10:04 +01:00
|
|
|
SimpleHTTPServer="$python -m SimpleHTTPServer 8888"
|
2021-05-29 13:26:08 +02:00
|
|
|
SSH="-F ./resources/ssh_config"
|
|
|
|
SCP="$(which scp) $SSH"
|
|
|
|
SSH="$(which ssh) $SSH"
|
2021-05-30 05:03:39 +02:00
|
|
|
tsschecker="./resources/tools/tsschecker_$platform"
|
2022-12-27 01:18:55 +01:00
|
|
|
xmlstarlet="./resources/tools/xmlstarlet_$platform"
|
2022-06-29 07:00:32 +02:00
|
|
|
xpwntool="../resources/tools/xpwntool_$platform"
|
2022-12-27 01:18:55 +01:00
|
|
|
zenity="./resources/tools/zenity_$platform"
|
2021-09-29 07:33:34 +02:00
|
|
|
|
2021-11-06 15:10:04 +01:00
|
|
|
if [[ $platform == "linux" ]]; then
|
2022-07-02 05:48:25 +02:00
|
|
|
irecovery="env LD_LIBRARY_PATH=./resources/lib $irecovery"
|
2022-06-29 07:00:32 +02:00
|
|
|
opensslver=$(openssl version | awk '{print $2}' | cut -c -3)
|
|
|
|
if [[ $opensslver == "3"* ]]; then
|
|
|
|
cherrybin="env LD_LIBRARY_PATH=../resources/lib $cherrybin"
|
2022-12-27 01:18:55 +01:00
|
|
|
idevicerestore="env LD_LIBRARY_PATH=../resources/lib $idevicerestore"
|
2022-06-29 07:00:32 +02:00
|
|
|
fi
|
2022-09-24 03:42:57 +02:00
|
|
|
ipwndfu="$python2 ipwndfu"
|
2022-12-27 01:18:55 +01:00
|
|
|
jq="$(which jq)"
|
2022-09-24 03:42:57 +02:00
|
|
|
rmsigchks="$python2 rmsigchks.py"
|
|
|
|
SimpleHTTPServer="$python -m http.server 8888"
|
2022-12-27 01:18:55 +01:00
|
|
|
xmlstarlet="$(which xmlstarlet)"
|
|
|
|
zenity="$(which zenity)"
|
|
|
|
#if [[ $(uname -m) == "a"* ]]; then
|
2022-12-24 04:49:22 +01:00
|
|
|
if [[ $(uname -m) == "a"* && $(getconf LONG_BIT) != 64 ]]; then
|
2022-12-27 01:18:55 +01:00
|
|
|
LinuxARMType="arm"
|
2022-12-24 04:49:22 +01:00
|
|
|
# these still need sudo even with the udev rule for some reason
|
2022-12-27 01:18:55 +01:00
|
|
|
futurerestore="${futurerestore}_arm"
|
|
|
|
idevicerestore="${idevicerestore}_arm"
|
|
|
|
idevicererestore="${idevicererestore}_arm"
|
2022-12-24 04:49:22 +01:00
|
|
|
irecovery="sudo ${irecovery}_arm"
|
|
|
|
pwnedDFU="sudo ${pwnedDFU}_arm"
|
|
|
|
|
2022-12-27 01:18:55 +01:00
|
|
|
hfsplus="${hfsplus}_arm"
|
2022-12-24 04:49:22 +01:00
|
|
|
ideviceenterrecovery="${ideviceenterrecovery}_arm"
|
|
|
|
ideviceinfo="${ideviceinfo}_arm"
|
|
|
|
iproxy="${iproxy}_arm"
|
|
|
|
ipsw="${ipsw}_arm"
|
2022-12-24 05:22:27 +01:00
|
|
|
irecoverychk="${irecoverychk}_arm"
|
2022-12-24 04:49:22 +01:00
|
|
|
partialzip="${partialzip}_arm"
|
|
|
|
powdersn0w="${powdersn0w}_arm"
|
|
|
|
tsschecker="${tsschecker}_arm"
|
|
|
|
xpwntool="${xpwntool}_arm"
|
2022-12-27 01:18:55 +01:00
|
|
|
|
|
|
|
: '
|
|
|
|
if [[ $(getconf LONG_BIT) == 64 ]]; then
|
|
|
|
LinuxARMType="arm64"
|
|
|
|
futurerestore="${futurerestore}64"
|
|
|
|
hfsplus="${hfsplus}64"
|
|
|
|
idevicerestore="${idevicerestore}64"
|
|
|
|
idevicererestore="${idevicererestore}64"
|
|
|
|
irecovery="${irecovery}64"
|
|
|
|
pwnedDFU="${pwnedDFU}64"
|
|
|
|
ideviceenterrecovery="${ideviceenterrecovery}_arm"
|
|
|
|
ideviceinfo="${ideviceinfo}64"
|
|
|
|
iproxy="${iproxy}64"
|
|
|
|
ipsw="${ipsw}64"
|
|
|
|
irecoverychk="${irecoverychk}64"
|
|
|
|
partialzip="${partialzip}64"
|
|
|
|
powdersn0w="${powdersn0w}64"
|
|
|
|
tsschecker="${tsschecker}64"
|
|
|
|
xpwntool="${xpwntool}64"
|
|
|
|
fi
|
|
|
|
'
|
|
|
|
|
|
|
|
futurerestore="sudo LD_LIBRARY_PATH=./resources/lib/$LinuxARMType $futurerestore"
|
|
|
|
idevicerestore="sudo LD_LIBRARY_PATH=./resources/lib/$LinuxARMType $idevicerestore"
|
|
|
|
idevicererestore="sudo LD_LIBRARY_PATH=./resources/lib/$LinuxARMType $idevicererestore"
|
2022-12-24 04:49:22 +01:00
|
|
|
fi
|
2022-06-29 04:48:17 +02:00
|
|
|
|
2022-03-16 04:42:58 +01:00
|
|
|
elif [[ $platform == "macos" ]]; then
|
2022-07-28 07:41:50 +02:00
|
|
|
sha1sum="$(which shasum)"
|
2022-12-27 01:18:55 +01:00
|
|
|
sha256sum="$sha1sum -a 256"
|
2022-07-01 13:22:10 +02:00
|
|
|
if (( ${platformver:0:2} > 11 )); then
|
2022-07-28 07:41:50 +02:00
|
|
|
# for macOS 12 and newer
|
2022-03-16 04:42:58 +01:00
|
|
|
python="/usr/bin/python3"
|
2022-09-24 03:42:57 +02:00
|
|
|
ipwndfu="$python2 ipwndfu"
|
|
|
|
rmsigchks="$python2 rmsigchks.py"
|
2022-03-16 04:42:58 +01:00
|
|
|
SimpleHTTPServer="$python -m http.server 8888"
|
|
|
|
fi
|
2022-08-07 09:52:20 +02:00
|
|
|
elif [[ $platform == "win" ]]; then
|
2022-05-29 16:57:53 +02:00
|
|
|
ping="ping -n 1"
|
2022-12-22 06:02:03 +01:00
|
|
|
Log "WARNING - Using iOS-OTA-Downgrader on Windows is not recommended."
|
2022-08-07 09:52:20 +02:00
|
|
|
Echo "* Please use it on Linux or macOS instead."
|
2022-12-22 06:02:03 +01:00
|
|
|
Echo "* You may still continue, but you might encounter issues with restoring the device."
|
2022-08-07 09:52:20 +02:00
|
|
|
Input "Press Enter/Return to continue anyway (or press Ctrl+C to cancel)"
|
|
|
|
read -s
|
2021-11-06 15:10:04 +01:00
|
|
|
fi
|
|
|
|
|
2021-06-07 07:49:58 +02:00
|
|
|
Log "Running on platform: $platform ($platformver)"
|
2021-05-29 13:26:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
SaveExternal() {
|
2022-07-07 08:21:53 +02:00
|
|
|
local Link
|
|
|
|
local Name
|
|
|
|
local SHA1
|
|
|
|
if [[ $1 == "ipwndfu" ]]; then
|
|
|
|
Link=https://github.com/LukeZGD/ipwndfu/archive/6e67c9e28a5f7f63f179dea670f7f858712350a0.zip
|
|
|
|
Name=ipwndfu
|
|
|
|
SHA1=61333249eb58faebbb380c4709384034ce0e019a
|
|
|
|
elif [[ $1 == "ch3rryflower" ]]; then
|
|
|
|
Link=https://web.archive.org/web/20210529174714if_/https://codeload.github.com/dora2-iOS/ch3rryflower/zip/316d2cdc5351c918e9db9650247b91632af3f11f
|
|
|
|
Name=ch3rryflower
|
|
|
|
SHA1=790d56db354151b9740c929e52c097ba57f2929d
|
2022-09-20 14:29:49 +02:00
|
|
|
elif [[ $1 == "powdersn0w" ]]; then
|
2023-01-04 09:25:18 +01:00
|
|
|
Link=https://web.archive.org/web/20220802230119if_/https://dora2ios.github.io/download/konayuki/powdersn0w_v2.0b3.zip
|
2022-09-20 14:29:49 +02:00
|
|
|
Name=powdersn0w
|
|
|
|
SHA1=c733aac4a0833558ef9f5517f2a11ca547110b6e
|
2022-07-07 08:21:53 +02:00
|
|
|
fi
|
|
|
|
if [[ -d ./resources/$Name ]]; then
|
2022-06-16 18:13:54 +02:00
|
|
|
return
|
2021-05-29 13:26:08 +02:00
|
|
|
fi
|
2022-06-16 18:13:54 +02:00
|
|
|
cd tmp
|
2022-07-07 08:21:53 +02:00
|
|
|
SaveFile $Link $Name.zip $SHA1
|
2022-06-16 18:13:54 +02:00
|
|
|
cd ../resources
|
2022-07-07 08:21:53 +02:00
|
|
|
unzip -q ../tmp/$Name.zip -d .
|
2022-10-11 03:41:07 +02:00
|
|
|
mv $Name*/ $Name/
|
2021-05-29 13:26:08 +02:00
|
|
|
cd ..
|
|
|
|
}
|
|
|
|
|
|
|
|
SaveFile() {
|
2022-06-18 14:22:46 +02:00
|
|
|
Log "Downloading $2..."
|
2021-05-29 13:26:08 +02:00
|
|
|
curl -L $1 -o $2
|
2022-07-28 07:41:50 +02:00
|
|
|
local SHA1=$($sha1sum $2 | awk '{print $1}')
|
2021-09-29 11:26:04 +02:00
|
|
|
if [[ $SHA1 != $3 ]]; then
|
|
|
|
Error "Verifying $2 failed. The downloaded file may be corrupted or incomplete. Please run the script again" \
|
|
|
|
"SHA1sum mismatch. Expected $3, got $SHA1"
|
2021-05-29 13:26:08 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
InstallDepends() {
|
|
|
|
local libimobiledevice
|
2021-09-29 07:33:34 +02:00
|
|
|
|
2021-05-29 13:26:08 +02:00
|
|
|
mkdir resources/lib tmp 2>/dev/null
|
|
|
|
cd resources
|
2022-10-11 03:41:07 +02:00
|
|
|
cp lib/*.so.1.1 ../tmp/ 2>/dev/null
|
2022-07-07 08:21:53 +02:00
|
|
|
rm -rf lib/*
|
2022-07-04 12:24:13 +02:00
|
|
|
cp ../tmp/*.so.1.1 lib/ 2>/dev/null
|
2021-05-29 13:26:08 +02:00
|
|
|
cd ../tmp
|
2021-09-29 07:33:34 +02:00
|
|
|
|
2021-05-29 13:26:08 +02:00
|
|
|
Log "Installing dependencies..."
|
2021-08-20 03:58:17 +02:00
|
|
|
if [[ $platform == "linux" ]]; then
|
|
|
|
Echo "* iOS-OTA-Downgrader will be installing dependencies from your distribution's package manager"
|
2022-03-05 12:57:23 +01:00
|
|
|
Echo "* Enter your user password when prompted"
|
2021-08-20 03:58:17 +02:00
|
|
|
Input "Press Enter/Return to continue (or press Ctrl+C to cancel)"
|
|
|
|
read -s
|
2022-12-24 05:05:01 +01:00
|
|
|
elif [[ $platform == "win" ]]; then
|
|
|
|
Echo "* iOS-OTA-Downgrader will be installing dependencies from MSYS2"
|
|
|
|
Echo "* Note that you may have to run the script more than once"
|
|
|
|
Input "Press Enter/Return to continue (or press Ctrl+C to cancel)"
|
|
|
|
read -s
|
2021-08-20 03:58:17 +02:00
|
|
|
fi
|
2022-05-12 09:57:33 +02:00
|
|
|
|
|
|
|
if [[ -e /etc/debian_version ]]; then
|
|
|
|
DebianVer=$(cat /etc/debian_version)
|
|
|
|
if [[ $DebianVer == *"sid" ]]; then
|
|
|
|
DebianVer="sid"
|
|
|
|
else
|
|
|
|
DebianVer="$(echo $DebianVer | cut -c -2)"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-08-26 13:41:52 +02:00
|
|
|
if [[ $ID == "arch" || $ID_LIKE == "arch" || $ID == "artix" ]]; then
|
2022-09-24 11:01:48 +02:00
|
|
|
Echo "* Arch Linux repos do not ship python2, which is needed for ipwndfu"
|
|
|
|
Echo "* If you need to use ipwndfu, python2 can be installed from the AUR"
|
2022-12-27 01:18:55 +01:00
|
|
|
sudo pacman -Sy --noconfirm --needed base-devel bsdiff curl jq libimobiledevice openssh python udev unzip usbmuxd usbutils vim xmlstarlet zenity zip
|
2022-12-24 04:49:22 +01:00
|
|
|
|
2022-10-03 06:22:41 +02:00
|
|
|
elif [[ $ID == "gentoo" || $ID_LIKE == "gentoo" || $ID == "pentoo" ]]; then
|
2022-10-03 06:32:40 +02:00
|
|
|
Echo "* Gentoo repos do not ship python2, which is needed for ipwndfu"
|
|
|
|
Echo "* If you need to use ipwndfu, python2 can be installed from the official site"
|
2022-12-27 01:18:55 +01:00
|
|
|
sudo emerge -av bsdiff net-misc/curl jq libimobiledevice openssh python udev unzip usbmuxd usbutils vim xmlstarlet zenity zip
|
2022-12-24 04:49:22 +01:00
|
|
|
|
2021-11-17 07:37:02 +01:00
|
|
|
elif [[ -n $UBUNTU_CODENAME && $VERSION_ID == "2"* ]] ||
|
2022-05-12 09:57:33 +02:00
|
|
|
(( DebianVer >= 11 )) || [[ $DebianVer == "sid" ]]; then
|
2022-07-27 14:25:34 +02:00
|
|
|
[[ -n $UBUNTU_CODENAME ]] && sudo add-apt-repository -y universe
|
2021-05-29 13:26:08 +02:00
|
|
|
sudo apt update
|
2023-01-04 09:25:18 +01:00
|
|
|
sudo apt install -y bsdiff curl jq libimobiledevice6 openssh-client python3 unzip usbmuxd usbutils xmlstarlet xxd zenity zip
|
|
|
|
[[ $DebianVer != "sid" ]] && sudo apt install -y python2
|
2022-07-02 05:48:25 +02:00
|
|
|
sudo systemctl enable --now udev systemd-udevd usbmuxd 2>/dev/null
|
2021-09-29 07:33:34 +02:00
|
|
|
|
2022-11-26 14:38:37 +01:00
|
|
|
elif [[ $ID == "fedora" || $ID == "nobara" ]] && (( VERSION_ID >= 36 )); then
|
2021-05-29 13:26:08 +02:00
|
|
|
ln -sf /usr/lib64/libbz2.so.1.* ../resources/lib/libbz2.so.1.0
|
2022-12-27 01:18:55 +01:00
|
|
|
sudo dnf install -y bsdiff ca-certificates jq libimobiledevice openssl python2 python3 systemd udev usbmuxd vim-common xmlstarlet zenity zip
|
2022-07-02 05:48:25 +02:00
|
|
|
sudo ln -sf /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-certificates.crt
|
2021-09-29 07:33:34 +02:00
|
|
|
|
2022-06-29 04:48:17 +02:00
|
|
|
elif [[ $ID == "opensuse-tumbleweed" || $PRETTY_NAME == *"Leap 15.4" ]]; then
|
|
|
|
[[ $ID == "opensuse-leap" ]] && ln -sf /lib64/libreadline.so.7 ../resources/lib/libreadline.so.8
|
2022-12-27 01:18:55 +01:00
|
|
|
sudo zypper -n in bsdiff curl jq libimobiledevice-1_0-6 openssl python-base python3 usbmuxd unzip vim xmlstarlet zenity zip
|
2021-09-29 07:33:34 +02:00
|
|
|
|
2021-05-29 13:26:08 +02:00
|
|
|
elif [[ $platform == "macos" ]]; then
|
|
|
|
xcode-select --install
|
2022-05-28 12:21:26 +02:00
|
|
|
libimobiledevice=("https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/tools/libimobiledevice_macos.zip" "66a49e4f69757a3d9dc51109a8e4651020bfacb8")
|
2021-07-12 16:36:51 +02:00
|
|
|
Echo "* iOS-OTA-Downgrader provides a copy of libimobiledevice and libirecovery by default"
|
2022-07-07 08:21:53 +02:00
|
|
|
Echo "* In case that problems occur, try installing them from Homebrew or MacPorts"
|
|
|
|
Echo "* The script will detect this automatically and will use the Homebrew/MacPorts versions of the tools"
|
2021-09-29 07:33:34 +02:00
|
|
|
|
2022-05-29 16:57:53 +02:00
|
|
|
elif [[ $platform == "win" ]]; then
|
2022-12-27 01:18:55 +01:00
|
|
|
cd ..
|
|
|
|
rm -r tmp
|
2023-01-03 02:30:57 +01:00
|
|
|
pacman -Syu --noconfirm --needed ca-certificates curl libcurl libopenssl openssh openssl unzip zip
|
2022-12-27 01:18:55 +01:00
|
|
|
mkdir tmp
|
|
|
|
cd tmp
|
2022-05-29 16:57:53 +02:00
|
|
|
libimobiledevice=("https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/tools/libimobiledevice_win.zip" "75ae3af3347b89107f0f6b7e41fde42e6ccdd404")
|
2022-07-04 13:58:45 +02:00
|
|
|
if [[ ! $(ls ../resources/tools/*win*) ]]; then
|
2022-12-27 01:18:55 +01:00
|
|
|
SaveFile https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/tools/tools_win.zip tools_win.zip fcaa14e420885c7a0e854aad3119e8a29362813b
|
2022-07-04 13:58:45 +02:00
|
|
|
Log "Extracting Windows tools..."
|
|
|
|
unzip -oq tools_win.zip -d ../resources
|
|
|
|
fi
|
2022-05-29 16:57:53 +02:00
|
|
|
|
2021-05-29 13:26:08 +02:00
|
|
|
else
|
|
|
|
Error "Distro not detected/supported by the install script." "See the repo README for supported OS versions/distros"
|
|
|
|
fi
|
2021-09-29 07:33:34 +02:00
|
|
|
|
2021-05-29 13:26:08 +02:00
|
|
|
if [[ $platform == "linux" ]]; then
|
2022-04-29 10:16:31 +02:00
|
|
|
libimobiledevice=("https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/tools/libimobiledevice_linux.zip" "fc5e714adf6fa72328d3e1ddea4e633f370559a4")
|
2022-07-02 05:48:25 +02:00
|
|
|
# from linux_fix script by Cryptiiiic
|
|
|
|
sudo systemctl enable --now systemd-udevd usbmuxd 2>/dev/null
|
2022-09-09 15:34:08 +02:00
|
|
|
echo "QUNUSU9OPT0iYWRkIiwgU1VCU1lTVEVNPT0idXNiIiwgQVRUUntpZFZlbmRvcn09PSIwNWFjIiwgQVRUUntpZFByb2R1Y3R9PT0iMTIyWzI3XXwxMjhbMC0zXSIsIE9XTkVSPSJyb290IiwgR1JPVVA9InVzYm11eGQiLCBNT0RFPSIwNjYwIiwgVEFHKz0idWFjY2VzcyIKCkFDVElPTj09ImFkZCIsIFNVQlNZU1RFTT09InVzYiIsIEFUVFJ7aWRWZW5kb3J9PT0iMDVhYyIsIEFUVFJ7aWRQcm9kdWN0fT09IjEzMzgiLCBPV05FUj0icm9vdCIsIEdST1VQPSJ1c2JtdXhkIiwgTU9ERT0iMDY2MCIsIFRBRys9InVhY2Nlc3MiCgoK" | base64 -d | sudo tee /etc/udev/rules.d/39-libirecovery.rules >/dev/null 2>/dev/null
|
|
|
|
sudo chown root:root /etc/udev/rules.d/39-libirecovery.rules
|
|
|
|
sudo chmod 0644 /etc/udev/rules.d/39-libirecovery.rules
|
2022-07-02 05:48:25 +02:00
|
|
|
sudo udevadm control --reload-rules
|
2021-05-29 13:26:08 +02:00
|
|
|
fi
|
2021-09-29 07:33:34 +02:00
|
|
|
|
2021-07-31 10:58:19 +02:00
|
|
|
if [[ ! -d ../resources/libimobiledevice_$platform && $MPath == "./resources"* ]]; then
|
2021-05-29 13:26:08 +02:00
|
|
|
SaveFile ${libimobiledevice[0]} libimobiledevice.zip ${libimobiledevice[1]}
|
2021-08-31 19:12:39 +02:00
|
|
|
mkdir ../resources/libimobiledevice_$platform
|
2021-07-12 16:36:51 +02:00
|
|
|
Log "Extracting libimobiledevice..."
|
|
|
|
unzip -q libimobiledevice.zip -d ../resources/libimobiledevice_$platform
|
2021-05-29 13:26:08 +02:00
|
|
|
chmod +x ../resources/libimobiledevice_$platform/*
|
2021-08-31 19:12:39 +02:00
|
|
|
elif [[ $MPath != "./resources"* ]]; then
|
|
|
|
mkdir ../resources/libimobiledevice_$platform
|
2021-05-29 13:26:08 +02:00
|
|
|
fi
|
2021-09-29 07:33:34 +02:00
|
|
|
|
2022-12-24 04:49:22 +01:00
|
|
|
if [[ $platform == "linux" && $(uname -m) == "a"* && ! $(ls ../resources/tools/*linux_arm*) ]]; then
|
2022-12-27 01:18:55 +01:00
|
|
|
SaveFile https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/tools/tools_linux_arm.zip tools_linux_arm.zip 59c16f684310bde75e12d4719bb918d448d47630
|
2022-12-24 04:49:22 +01:00
|
|
|
Log "Extracting Linux ARM tools..."
|
|
|
|
unzip -oq tools_linux_arm.zip -d ../resources
|
2022-12-27 01:18:55 +01:00
|
|
|
#SaveFile https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/tools/tools_linux_arm64.zip tools_linux_arm64.zip b95b2bc1589ff1fe1e16ab7ac43e9d88d9880296
|
|
|
|
#Log "Extracting Linux ARM64 tools..."
|
|
|
|
#unzip -oq tools_linux_arm64.zip -d ../resources
|
2022-12-24 04:49:22 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
touch ../resources/first_run
|
2021-05-29 13:26:08 +02:00
|
|
|
Log "Install script done! Please run the script again to proceed"
|
2022-07-02 05:48:25 +02:00
|
|
|
Log "If your iOS device is plugged in, unplug and replug your device"
|
2022-07-18 13:53:45 +02:00
|
|
|
ExitWin 0
|
2021-05-29 13:26:08 +02:00
|
|
|
}
|