Add 32-bit SHSH downgrades for Linux ARM, Windows

This commit is contained in:
LukeZGD 2022-12-27 08:18:55 +08:00
parent 644d155adf
commit 76020404db
31 changed files with 314 additions and 3022 deletions

View File

@ -46,7 +46,16 @@ jobs:
chmod +x ./resources/libimobiledevice_linux/*
- name: Zip linux files
run: zip -r ${{ github.event.repository.name }}_linux_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip resources/ restore.sh README.md
run: zip -r ${{ github.event.repository.name }}_linux_x86_64_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip resources/ restore.sh README.md
- name: Move linux binaries and other files
run: |
mv ./resources/lib/* ./exclude/lib
mv ./resources/tools/*linux* ./exclude/tools
mv ./resources/libimobiledevice_linux ./exclude
mv ./resources/firmware/FirmwareBundles ./resources/firmware/JailbreakBundles ./exclude/firmware
mkdir ./resources/firmware/FirmwareBundles
mv ./exclude/firmware/FirmwareBundles/Down_iPhone3* ./resources/firmware/FirmwareBundles
- name: Download and extract tools_linux_arm
run: |
@ -58,12 +67,10 @@ jobs:
- name: Move linux arm binaries and other files
run: |
mv ./resources/lib/* ./exclude/lib
mv ./resources/lib/arm ./exclude/lib
mv ./resources/tools/*linux* ./exclude/tools
mv ./resources/libimobiledevice_linux ./exclude
mv ./resources/firmware/FirmwareBundles ./resources/firmware/JailbreakBundles ./exclude/firmware
mkdir ./resources/firmware/FirmwareBundles
mv ./exclude/firmware/FirmwareBundles/Down_iPhone3* ./resources/firmware/FirmwareBundles
mv ./resources/libimobiledevice_linux/* ./exclude/libimobiledevice_linux
rm -r ./resources/libimobiledevice_linux
- name: Download and extract libimobiledevice_win
run: |
@ -97,6 +104,6 @@ jobs:
files: |
${{ github.event.repository.name }}_complete_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip
${{ github.event.repository.name }}_macos_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip
${{ github.event.repository.name }}_linux_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip
${{ github.event.repository.name }}_linux_arm_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip
${{ github.event.repository.name }}_linux_x86_64_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip
${{ github.event.repository.name }}_win_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip

View File

@ -1,20 +1,21 @@
# iOS-OTA-Downgrader
- **Downgrade/restore and jailbreak supported iOS devices to signed OTA firmwares**
- **Downgrade/restore and jailbreak supported legacy iOS devices to signed OTA firmwares**
- **iPhone4Down: Downgrade your iPhone 4 on Linux/Windows (using powdersn0w)**
- **Linux and macOS** are supported
- **Partial support for Windows** - usage is not recommended
- iPhone4Down is focused on Linux only - macOS and Windows are only partially supported
- **Linux, macOS, and Windows** are supported
- Windows usage is not recommended
- iPhone4Down focuses on Linux support - use [cherryflowerJB](https://web.archive.org/web/20210701000000*/https://dora2ios.web.app/CFJB/) or [powdersn0w](https://dora2ios.web.app/konayuki/index.html) on macOS instead
- **Read the ["How to Use" wiki page](https://github.com/LukeZGD/iOS-OTA-Downgrader/wiki/How-to-Use) for a step-by-step tutorial**
- **Read the ["Troubleshooting" wiki page](https://github.com/LukeZGD/iOS-OTA-Downgrader/wiki/Troubleshooting) for tips, frequent questions, and troubleshooting**
## Other features
- iOS 6.1.3 and 8.4.1 downgrades have the option to **jailbreak** the install
- For iOS 10.3.3, use [TotallyNotSpyware](https://totally-not.spyware.lol) or [sockH3lix](https://github.com/SongXiaoXi/sockH3lix) to jailbreak
- This script can also restore your device to other iOS versions that you have SHSH blobs for (32-bit devices only, iOS 5 and newer only)
- For iOS 10.3.3 downgrades, use [TotallyNotSpyware](https://totally-not.spyware.lol)
- This script can also restore your device to other iOS versions that you have SHSH blobs for (32-bit devices only)
- The latest baseband will always be used for 32-bit devices that have baseband. For iPhone 5C and A7 devices, iOS 10.3.3 baseband will be used
- This script can also be used to just enter kDFU mode (32-bit devices only)
- This script can also be used to restore your iPhone 4 back to iOS 7.1.2 with the option to jailbreak the install
- This script can also be used to restore 32-bit devices to their latest versions
## Supported devices
- [Identify your device here](https://ipsw.me/device-finder)
@ -22,6 +23,7 @@
- iPhone 5C can still be restored to versions that you have SHSH blobs for
- iPhone 4 devices also support restoring with SHSH blobs
- **iPhone4Down supports iPhone 4 GSM and CDMA (iPhone3,1 and iPhone3,3)**
- iPhone3,3 support is not tested. Use [powdersn0w](https://dora2ios.web.app/konayuki/index.html) on macOS instead
<table>
<thead>
@ -66,7 +68,7 @@
<details>
<summary>For Pangu 32-bit users:</summary>
<ul><li>For 32-bit users using Pangu and normal method, install the latest untether for your iOS version <a href="https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/tag/untether">here</a></li></ul>
<ul><li>For 32-bit users using Pangu and jailbroken method, install the latest untether for your iOS version <a href="https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/tag/untether">here</a></li></ul>
</details>
## Supported OS versions/distros
@ -83,7 +85,7 @@
- cURL
- bspatch
- python2 (ipwndfu, rmsigchks, SimpleHTTPServer), python3 (http.server)
- [powdersn0w](https://github.com/dora2-iOS/powdersn0w_pub) - dora2ios; [LukeZGD fork](https://github.com/LukeZGD/powdersn0w_pub)
- [powdersn0w_pub](https://github.com/dora2-iOS/powdersn0w_pub) - dora2ios; [LukeZGD fork](https://github.com/LukeZGD/powdersn0w_pub)
- [ch3rryflower](https://web.archive.org/web/20200708040313/https://github.com/dora2-iOS/ch3rryflower) - dora2ios (used for iOS 4.3.x only)
- [ipwndfu](https://github.com/LukeZGD/ipwndfu) - LukeZGD fork
- [iPwnder32](https://github.com/dora2-iOS/iPwnder32) - dora2ios
@ -93,7 +95,7 @@
- [tsschecker](https://github.com/tihmstar/tsschecker) - tihmstar; [1Conan fork](https://github.com/1Conan/tsschecker)
- [futurerestore](https://github.com/futurerestore/futurerestore) - futurerestore beta (and 194)
- [idevicerestore](https://github.com/libimobiledevice/idevicerestore) - libimobiledevice; [LukeZGD fork](https://github.com/LukeZGD/idevicerestore)
- [idevicererestore](https://github.com/LukeZGD/daibutsuCFW) from daibutsuCFW (used for Windows OTA restores only)
- [idevicererestore](https://github.com/LukeZGD/daibutsuCFW) from daibutsuCFW (used on Linux ARM/Windows restores for 32-bit devices)
- [kloader](https://www.youtube.com/watch?v=fh0tB6fp0Sc)
- [kloader5 for iOS 5](https://www.pmbonneau.com/cydia/com.pmbonneau.kloader5_1.2_iphoneos-arm.deb)
- [kloader_hgsp for iOS 10](https://twitter.com/nyan_satan/status/945203180522045440)

View File

@ -14,8 +14,6 @@ SetToolPaths() {
cherry="./resources/ch3rryflower/Tools/ubuntu/UNTETHERED"
futurerestore="./resources/tools/futurerestore_linux"
python="$(which python3)"
xmlstarlet="$(which xmlstarlet)"
zenity="$(which zenity)"
elif [[ $OSTYPE == "darwin"* ]]; then
platform="macos"
@ -49,7 +47,6 @@ SetToolPaths() {
ipwnder32="./resources/tools/ipwnder32_macos"
ipwnder_lite="./resources/tools/ipwnder_macos"
python="/usr/bin/python"
zenity="./resources/tools/zenity_macos"
elif [[ $OSTYPE == "msys" ]]; then
platform="win"
@ -61,6 +58,7 @@ SetToolPaths() {
fi
cherrybin="../$cherry/cherry"
hfsplus="../resources/tools/hfsplus_$platform"
ideviceenterrecovery="$MPath/ideviceenterrecovery"
ideviceinfo="$MPath/ideviceinfo"
idevicerestore="./resources/tools/idevicerestore_$platform"
@ -70,6 +68,7 @@ SetToolPaths() {
ipwndfu="$python ipwndfu"
irecoverychk="$MPath/irecovery"
irecovery="$irecoverychk"
jq="./resources/tools/jq_$platform"
partialzip="./resources/tools/partialzip_$platform"
ping="ping -c1"
powdersn0w="../resources/tools/powdersn0w_$platform"
@ -77,29 +76,40 @@ SetToolPaths() {
python2="$(which python2 2>/dev/null)"
rmsigchks="$python rmsigchks.py"
sha1sum="$(which sha1sum 2>/dev/null)"
sha256sum="$(which sha256sum 2>/dev/null)"
SimpleHTTPServer="$python -m SimpleHTTPServer 8888"
SSH="-F ./resources/ssh_config"
SCP="$(which scp) $SSH"
SSH="$(which ssh) $SSH"
tsschecker="./resources/tools/tsschecker_$platform"
xmlstarlet="./resources/tools/xmlstarlet_$platform"
xpwntool="../resources/tools/xpwntool_$platform"
zenity="./resources/tools/zenity_$platform"
if [[ $platform == "linux" ]]; then
irecovery="env LD_LIBRARY_PATH=./resources/lib $irecovery"
opensslver=$(openssl version | awk '{print $2}' | cut -c -3)
if [[ $opensslver == "3"* ]]; then
cherrybin="env LD_LIBRARY_PATH=../resources/lib $cherrybin"
idevicerestore="env LD_LIBRARY_PATH=../resources/lib $idevicerestore"
fi
ipwndfu="$python2 ipwndfu"
jq="$(which jq)"
rmsigchks="$python2 rmsigchks.py"
SimpleHTTPServer="$python -m http.server 8888"
xmlstarlet="$(which xmlstarlet)"
zenity="$(which zenity)"
#if [[ $(uname -m) == "a"* ]]; then
if [[ $(uname -m) == "a"* && $(getconf LONG_BIT) != 64 ]]; then
LinuxARMType="arm"
# these still need sudo even with the udev rule for some reason
idevicerestore="sudo ${idevicerestore}_arm"
idevicererestore="sudo ${idevicererestore}_arm"
futurerestore="${futurerestore}_arm"
idevicerestore="${idevicerestore}_arm"
idevicererestore="${idevicererestore}_arm"
irecovery="sudo ${irecovery}_arm"
pwnedDFU="sudo ${pwnedDFU}_arm"
hfsplus="${hfsplus}_arm"
ideviceenterrecovery="${ideviceenterrecovery}_arm"
ideviceinfo="${ideviceinfo}_arm"
iproxy="${iproxy}_arm"
@ -109,10 +119,36 @@ SetToolPaths() {
powdersn0w="${powdersn0w}_arm"
tsschecker="${tsschecker}_arm"
xpwntool="${xpwntool}_arm"
: '
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"
fi
elif [[ $platform == "macos" ]]; then
sha1sum="$(which shasum)"
sha256sum="$sha1sum -a 256"
if (( ${platformver:0:2} > 11 )); then
# for macOS 12 and newer
python="/usr/bin/python3"
@ -205,28 +241,28 @@ InstallDepends() {
if [[ $ID == "arch" || $ID_LIKE == "arch" || $ID == "artix" ]]; then
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"
sudo pacman -Sy --noconfirm --needed base-devel bsdiff curl libimobiledevice openssh python udev unzip usbmuxd usbutils vim xmlstarlet zenity zip
sudo pacman -Sy --noconfirm --needed base-devel bsdiff curl jq libimobiledevice openssh python udev unzip usbmuxd usbutils vim xmlstarlet zenity zip
elif [[ $ID == "gentoo" || $ID_LIKE == "gentoo" || $ID == "pentoo" ]]; then
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"
sudo emerge -av bsdiff net-misc/curl libimobiledevice openssh python udev unzip usbmuxd usbutils vim xmlstarlet zenity zip
sudo emerge -av bsdiff net-misc/curl jq libimobiledevice openssh python udev unzip usbmuxd usbutils vim xmlstarlet zenity zip
elif [[ -n $UBUNTU_CODENAME && $VERSION_ID == "2"* ]] ||
(( DebianVer >= 11 )) || [[ $DebianVer == "sid" ]]; then
[[ -n $UBUNTU_CODENAME ]] && sudo add-apt-repository -y universe
sudo apt update
sudo apt install -y bsdiff curl libimobiledevice6 openssh-client python2 python3 unzip usbmuxd usbutils xmlstarlet xxd zenity zip
sudo apt install -y bsdiff curl jq libimobiledevice6 openssh-client python2 python3 unzip usbmuxd usbutils xmlstarlet xxd zenity zip
sudo systemctl enable --now udev systemd-udevd usbmuxd 2>/dev/null
elif [[ $ID == "fedora" || $ID == "nobara" ]] && (( VERSION_ID >= 36 )); then
ln -sf /usr/lib64/libbz2.so.1.* ../resources/lib/libbz2.so.1.0
sudo dnf install -y bsdiff ca-certificates libimobiledevice openssl python2 python3 systemd udev usbmuxd vim-common xmlstarlet zenity zip
sudo dnf install -y bsdiff ca-certificates jq libimobiledevice openssl python2 python3 systemd udev usbmuxd vim-common xmlstarlet zenity zip
sudo ln -sf /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-certificates.crt
elif [[ $ID == "opensuse-tumbleweed" || $PRETTY_NAME == *"Leap 15.4" ]]; then
[[ $ID == "opensuse-leap" ]] && ln -sf /lib64/libreadline.so.7 ../resources/lib/libreadline.so.8
sudo zypper -n in bsdiff curl libimobiledevice-1_0-6 openssl python-base python3 usbmuxd unzip vim xmlstarlet zenity zip
sudo zypper -n in bsdiff curl jq libimobiledevice-1_0-6 openssl python-base python3 usbmuxd unzip vim xmlstarlet zenity zip
elif [[ $platform == "macos" ]]; then
xcode-select --install
@ -236,10 +272,14 @@ InstallDepends() {
Echo "* The script will detect this automatically and will use the Homebrew/MacPorts versions of the tools"
elif [[ $platform == "win" ]]; then
cd ..
rm -r tmp
pacman -Syu --noconfirm --needed ca-certificates curl libcurl openssh unzip zip
mkdir tmp
cd tmp
libimobiledevice=("https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/tools/libimobiledevice_win.zip" "75ae3af3347b89107f0f6b7e41fde42e6ccdd404")
if [[ ! $(ls ../resources/tools/*win*) ]]; then
SaveFile https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/tools/tools_win.zip tools_win.zip 4436d23034e9bec1b855aabb69ae0013fec5e2cb
SaveFile https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/tools/tools_win.zip tools_win.zip fcaa14e420885c7a0e854aad3119e8a29362813b
Log "Extracting Windows tools..."
unzip -oq tools_win.zip -d ../resources
fi
@ -269,9 +309,12 @@ InstallDepends() {
fi
if [[ $platform == "linux" && $(uname -m) == "a"* && ! $(ls ../resources/tools/*linux_arm*) ]]; then
SaveFile https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/tools/tools_linux_arm.zip tools_linux_arm.zip b95b2bc1589ff1fe1e16ab7ac43e9d88d9880296
SaveFile https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/tools/tools_linux_arm.zip tools_linux_arm.zip 59c16f684310bde75e12d4719bb918d448d47630
Log "Extracting Linux ARM tools..."
unzip -oq tools_linux_arm.zip -d ../resources
#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
fi
touch ../resources/first_run

View File

@ -83,20 +83,25 @@ DowngradeOther() {
Input "Select your IPSW file in the file selection window."
IPSW="$($zenity --file-selection --file-filter='IPSW | *.ipsw' --title="Select IPSW file")"
[[ ! -s "$IPSW" ]] && read -p "$(Input 'Enter path to IPSW file:')" IPSW
[[ ! -s "$IPSW" ]] && Error "No IPSW selected, or IPSW file not found."
IPSW="${IPSW%?????}"
Log "Selected IPSW file: $IPSW.ipsw"
Input "Select your SHSH file in the file selection window."
SHSH="$($zenity --file-selection --file-filter='SHSH | *.shsh *.shsh2' --title="Select SHSH file")"
[[ ! -s "$SHSH" ]] && read -p "$(Input 'Enter path to SHSH file:')" SHSH
[[ ! -s "$SHSH" ]] && Error "No SHSH selected, or SHSH file not found."
Log "Selected SHSH file: $SHSH"
Log "Getting build version from IPSW"
Log "Getting version from IPSW"
unzip -o -j "$IPSW.ipsw" Restore.plist -d tmp
if [[ $platform == "macos" ]]; then
plutil -extract 'ProductVersion' xml1 tmp/Restore.plist -o tmp/OSVer
OSVer=$(cat tmp/OSVer | sed -ne '/<string>/,/<\/string>/p' | sed -e "s/<string>//" | sed "s/<\/string>//" | sed '2d')
plutil -extract 'ProductBuildVersion' xml1 tmp/Restore.plist -o tmp/BuildVer
BuildVer=$(cat tmp/BuildVer | sed -ne '/<string>/,/<\/string>/p' | sed -e "s/<string>//" | sed "s/<\/string>//" | sed '2d')
else
OSVer=$(cat tmp/Restore.plist | grep -i ProductVersion -A 1 | grep -oPm1 "(?<=<string>)[^<]+")
BuildVer=$(cat tmp/Restore.plist | grep -i ProductBuildVersion -A 1 | grep -oPm1 "(?<=<string>)[^<]+")
fi
@ -128,6 +133,15 @@ DowngradeOther() {
fi
kDFU
if [[ $(echo $BuildVer | cut -c 1) == 8 ]]; then
IPSWSetExtract
iDeviceRestore latest
elif [[ $platform == "win" || $LinuxARM == 1 ]]; then
IPSW32Other
IPSWSetExtract
iDeviceRestore
return
fi
IPSWSetExtract
FutureRestore
}
@ -135,7 +149,7 @@ DowngradeOther() {
iDeviceRestore() {
mkdir shsh
cp $SHSH shsh/${UniqueChipID}-${ProductType}-${OSVer}.shsh
cp "$SHSH" shsh/${UniqueChipID}-${ProductType}-${OSVer}.shsh 2>/dev/null
Log "Proceeding to idevicerestore..."
ExtraArgs="-e -w"
if [[ $1 == "latest" ]]; then
@ -258,12 +272,12 @@ Downgrade() {
IPSWCustomA7
fi
if [[ $platform == "win" || $LinuxARM == 1 || $IPSWA7 == 1 ]]; then
DowngradeOTAWin
return
elif [[ $OSVer == "Other" ]]; then
if [[ $OSVer == "Other" ]]; then
DowngradeOther
return
elif [[ $platform == "win" || $LinuxARM == 1 || $IPSWA7 == 1 ]]; then
DowngradeOTAWin
return
fi
DowngradeOTA
}
@ -292,11 +306,7 @@ RestoreLatest() {
elif [[ $DeviceProc == 6 && $ProductType == "iPad3"* ]]; then
IPSWType="iPad_32bit"
fi
IPSWA7=1
SendiBSS=1
IPSWFindVerify
IPSWSetExtract
Recovery only
SaveLatestBlobs
FutureRestore latest
iDeviceRestore latest
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>FilesystemJailbreak</key>
<false/>
<key>needPref</key>
<false/>
<key>iBootPatches</key>
<dict>
<key>debugEnabled</key>
<false/>
<key>bootArgsInjection</key>
<false/>
<key>bootArgsString</key>
<string>-v</string>
</dict>
</dict>
</plist>

View File

@ -488,3 +488,173 @@ IPSW64() {
Error "Failed to find custom IPSW. Please run the script again"
fi
}
IPSW32Other() {
local BBUpdate="-bbupdate"
IPSWCustom="${IPSWType}_${OSVer}_${BuildVer}_CustomW"
if [[ -e $IPSWCustom.ipsw ]]; then
Log "Found existing Custom IPSW. Skipping IPSW creation."
return
fi
if [[ $platform != "win" ]]; then
Input "Memory Option for creating custom IPSW"
Echo "* This option makes creating the custom IPSW faster, but it requires at least 8GB of RAM."
Echo "* If you do not have enough RAM, disable this option and make sure that you have enough storage space."
Echo "* This option is enabled by default (Y)."
read -p "$(Input 'Enable this option? (Y/n):')" JBMemory
if [[ $JBMemory == 'N' || $JBMemory == 'n' ]]; then
Log "Memory option disabled by user."
JBMemory=
else
Log "Memory option enabled."
JBMemory="-memory"
fi
echo
fi
if [[ $ProductType == "$DisableBBUpdate" ]]; then
BBUpdate=
Log "Baseband update will be disabled for the custom IPSW."
if [[ $ProductType != "iPad2,3" ]]; then
Log "WARNING - With baseband update disabled, activation errors might occur."
Echo "* If you do not have other means for activation, this is not recommended."
Input "Press Enter/Return to continue anyway (or press Ctrl+C to cancel)"
read -s
fi
Baseband=0
IPSWCustom+="B"
fi
Log "Generating firmware bundle..."
local IPSWSHA256=$($sha256sum "$IPSW.ipsw")
[[ $platform == "win" ]] && IPSWSHA256=$(echo $IPSWSHA256 | cut -c 2-)
local FirmwareBundle=FirmwareBundles/${IPSWType}_${OSVer}_${BuildVer}.bundle
local NewPlist=tmp/$FirmwareBundle/Info.plist
mkdir -p tmp/$FirmwareBundle
cp resources/firmware/powdersn0wBundles/config2.plist tmp/FirmwareBundles/config.plist
unzip -j "$IPSW.ipsw" Firmware/all_flash/all_flash.${HWModel}ap.production/manifest
mv manifest tmp/$FirmwareBundle/
local FWKey=$(cat $FWKeys/index.html)
local RamdiskName=$(echo $FWKey | $jq -j '.keys[] | select(.image | startswith("RestoreRamdisk")) | .filename')
local RamdiskIV=$(echo $FWKey | $jq -j '.keys[] | select(.image | startswith("RestoreRamdisk")) | .iv')
local RamdiskKey=$(echo $FWKey | $jq -j '.keys[] | select(.image | startswith("RestoreRamdisk")) | .key')
cd tmp
unzip -j "$IPSW.ipsw" $RamdiskName
$xpwntool $RamdiskName Ramdisk.dec -iv $RamdiskIV -k $RamdiskKey -decrypt
$xpwntool Ramdisk.dec Ramdisk.raw
$hfsplus Ramdisk.raw extract usr/local/share/restore/options.$HWModel.plist
cd ..
local RootSize=$($xmlstarlet sel -t -m "plist/dict/key[.='SystemPartitionSize']" -v "following-sibling::integer[1]" tmp/options.$HWModel.plist)
printf '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Filename</key>
<string>'>$NewPlist;printf "$IPSW.ipsw">>$NewPlist;printf '</string>
<key>RootFilesystem</key>
<string>'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("RootFS")) | .filename'>>$NewPlist;printf '</string>
<key>RootFilesystemKey</key>
<string>'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("RootFS")) | .key'>>$NewPlist;printf '</string>
<key>RootFilesystemSize</key>
<integer>'>>$NewPlist;printf $RootSize>>$NewPlist;printf '</integer>
<key>RamdiskOptionsPath</key>
<string>/usr/local/share/restore/options.'>>$NewPlist;printf $HWModel>>$NewPlist;printf '.plist</string>
<key>SHA256</key>
<string>'>>$NewPlist;printf $IPSWSHA256>>$NewPlist;printf '</string>
<key>FilesystemPackage</key>
<dict/>
<key>RamdiskPackage</key>
<dict/>
<key>Firmware</key>
<dict>
<key>iBSS</key>
<dict>
<key>File</key>
<string>Firmware/dfu/'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("iBSS")) | .filename'>>$NewPlist;printf '</string>
<key>IV</key>
<string>'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("iBSS")) | .iv'>>$NewPlist;printf '</string>
<key>Key</key>
<string>'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("iBSS")) | .key'>>$NewPlist;printf '</string>
<key>Decrypt</key>
<true/>
<key>Patch</key>
<true/>
</dict>
<key>iBEC</key>
<dict>
<key>File</key>
<string>Firmware/dfu/'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("iBEC")) | .filename'>>$NewPlist;printf '</string>
<key>IV</key>
<string>'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("iBEC")) | .iv'>>$NewPlist;printf '</string>
<key>Key</key>
<string>'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("iBEC")) | .key'>>$NewPlist;printf '</string>
<key>Decrypt</key>
<true/>
<key>Patch</key>
<true/>
</dict>
<key>Restore Ramdisk</key>
<dict>
<key>File</key>
<string>'>>$NewPlist;printf $RamdiskName>>$NewPlist;printf '</string>
<key>IV</key>
<string>'>>$NewPlist;printf $RamdiskIV>>$NewPlist;printf '</string>
<key>Key</key>
<string>'>>$NewPlist;printf $RamdiskKey>>$NewPlist;printf '</string>
<key>Decrypt</key>
<true/>
</dict>
<key>RestoreDeviceTree</key>
<dict>
<key>File</key>
<string>Firmware/all_flash/all_flash.'>>$NewPlist;printf $HWModel>>$NewPlist;printf 'ap.production/'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("DeviceTree")) | .filename'>>$NewPlist;printf '</string>
<key>IV</key>
<string>'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("DeviceTree")) | .iv'>>$NewPlist;printf '</string>
<key>Key</key>
<string>'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("DeviceTree")) | .key'>>$NewPlist;printf '</string>
<key>DecryptPath</key>
<string>Downgrade/'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("DeviceTree")) | .filename'>>$NewPlist;printf '</string>
</dict>
<key>RestoreLogo</key>
<dict>
<key>File</key>
<string>Firmware/all_flash/all_flash.'>>$NewPlist;printf $HWModel>>$NewPlist;printf 'ap.production/'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("AppleLogo")) | .filename'>>$NewPlist;printf '</string>
<key>IV</key>
<string>'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("AppleLogo")) | .iv'>>$NewPlist;printf '</string>
<key>Key</key>
<string>'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("AppleLogo")) | .key'>>$NewPlist;printf '</string>
<key>DecryptPath</key>
<string>Downgrade/'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("AppleLogo")) | .filename'>>$NewPlist;printf '</string>
</dict>
<key>RestoreKernelCache</key>
<dict>
<key>File</key>
<string>'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("Kernelcache")) | .filename'>>$NewPlist;printf '</string>
<key>IV</key>
<string>'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("Kernelcache")) | .iv'>>$NewPlist;printf '</string>
<key>Key</key>
<string>'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("Kernelcache")) | .key'>>$NewPlist;printf '</string>
<key>DecryptPath</key>
<string>Downgrade/'>>$NewPlist;echo $FWKey | $jq -j '.keys[] | select(.image | startswith("Kernelcache")) | .filename'>>$NewPlist;printf '</string>
<key>Decrypt</key>
<true/>
<key>Patch</key>
<false/>
</dict>
</dict>
</dict>
</plist>\n'>>$NewPlist
cat $NewPlist
Log "Preparing custom IPSW..."
cd tmp
$powdersn0w "$IPSW.ipsw" ../$IPSWCustom.ipsw $BBUpdate $JBMemory
cd ..
if [[ ! -e $IPSWCustom.ipsw ]]; then
Error "Failed to find custom IPSW. Please run the script again"
fi
}

Binary file not shown.

BIN
resources/lib/libssl.so.1.1 Normal file

Binary file not shown.

Binary file not shown.

View File

@ -144,7 +144,6 @@ Main() {
Echo "* Note that only 32-bit (armhf) is compiled natively for now. For 64-bit, box64 might work."
if [[ $(getconf LONG_BIT) != 64 ]]; then
LinuxARM=1
Echo "* 32-bit Linux ARM support is also very limited."
fi
elif [[ $(uname -m) != "x86_64" ]]; then
@ -177,7 +176,7 @@ Main() {
if [[ $DeviceProc != 7 ]]; then
Selection+=("Create Custom IPSW")
[[ $DeviceState == "Normal" ]] && Selection+=("Put Device in kDFU Mode")
[[ $DeviceProc != 4 && $platform != "win" && $LinuxARM != 1 ]] && Selection+=("Restore to latest iOS")
[[ $DeviceProc != 4 ]] && Selection+=("Restore to latest iOS")
fi
Selection+=("(Re-)Install Dependencies" "(Any other key to exit)")
@ -239,9 +238,7 @@ Main() {
ExitWin 0
fi
if [[ $DeviceProc == 7 && $LinuxARM == 1 ]]; then
Error "Restoring A7 devices is not supported on Linux ARM 32-bit."
elif [[ $DeviceProc == 7 && $platform == "win" ]]; then
if [[ $DeviceProc == 7 && $platform == "win" ]]; then
local Message="If you want to restore your A7 device on Windows, put the device in pwnDFU mode."
if [[ $DeviceState == "Normal" ]]; then
Error "$Message"
@ -389,7 +386,7 @@ SelectVersion() {
fi
fi
if [[ $platform != "win" && $LinuxARM != 1 && $Mode == "Downgrade"* ]]; then
if [[ $Mode == "Downgrade"* ]]; then
Selection+=("Other (use SHSH blobs)")
fi
Selection+=("(Any other key to exit)")