mirror of
https://github.com/LukeZGD/Legacy-iOS-Kit.git
synced 2025-02-09 05:13:30 +01:00
Some more updates
- Add [Log], [Input], [Error] to echo outputs - ifuse is now a dependency to 10.x downgrades only - kDFUOnly is now within kDFU function - kDFU first before extracting IPSW - Code improvements
This commit is contained in:
parent
c8b4c408fc
commit
77a4c51a9e
@ -56,7 +56,7 @@
|
|||||||
- [kloader](https://www.youtube.com/watch?v=fh0tB6fp0Sc)
|
- [kloader](https://www.youtube.com/watch?v=fh0tB6fp0Sc)
|
||||||
- [kloader5 (iOS 5)](http://www.pmbonneau.com/cydia/)
|
- [kloader5 (iOS 5)](http://www.pmbonneau.com/cydia/)
|
||||||
- [kloader_hgsp (iOS 10)](https://twitter.com/nyan_satan/status/945203180522045440)
|
- [kloader_hgsp (iOS 10)](https://twitter.com/nyan_satan/status/945203180522045440)
|
||||||
- [partialZipBrowser](https://github.com/tihmstar/partialZipBrowser) (used on buildmanifestsaver.sh)
|
- [partialZipBrowser](https://github.com/tihmstar/partialZipBrowser)
|
||||||
- python3 (http.server)
|
- python3 (http.server)
|
||||||
|
|
||||||
- iBSS patches are from [OdysseusOTA](https://www.youtube.com/watch?v=Wo7mGdMcjxw), [OdysseusOTA2](https://www.youtube.com/watch?v=fh0tB6fp0Sc), [alitek12](https://www.mediafire.com/folder/b1z64roy512wd/FirmwareBundles), [gjest](https://files.fm/u/fcbqqdnw)
|
- iBSS patches are from [OdysseusOTA](https://www.youtube.com/watch?v=Wo7mGdMcjxw), [OdysseusOTA2](https://www.youtube.com/watch?v=fh0tB6fp0Sc), [alitek12](https://www.mediafire.com/folder/b1z64roy512wd/FirmwareBundles), [gjest](https://files.fm/u/fcbqqdnw)
|
||||||
|
164
restore.sh
164
restore.sh
@ -70,7 +70,8 @@ iv_n94_613=d3fe01e99bd0967e80dccfc0739f93d5
|
|||||||
key_n94_613=35343d5139e0313c81ee59dbae292da26e739ed75b3da5db9da7d4d26046498c
|
key_n94_613=35343d5139e0313c81ee59dbae292da26e739ed75b3da5db9da7d4d26046498c
|
||||||
|
|
||||||
function BasebandDetect {
|
function BasebandDetect {
|
||||||
if [ $ProductType == iPad2,1 ] || [ $ProductType == iPad2,4 ] || [ $ProductType == iPad2,5 ] || [ $ProductType == iPad3,1 ] || [ $ProductType == iPad3,4 ] || [ $ProductType == iPod5,1 ]; then
|
if [ $ProductType == iPad2,1 ] || [ $ProductType == iPad2,4 ] || [ $ProductType == iPad2,5 ] ||
|
||||||
|
[ $ProductType == iPad3,1 ] || [ $ProductType == iPad3,4 ] || [ $ProductType == iPod5,1 ]; then
|
||||||
NoBaseband=1
|
NoBaseband=1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -84,24 +85,22 @@ function MainMenu {
|
|||||||
mkdir tmp
|
mkdir tmp
|
||||||
|
|
||||||
if [ $(lsusb | grep -c "1227") == 1 ]; then
|
if [ $(lsusb | grep -c "1227") == 1 ]; then
|
||||||
echo "Device in DFU mode detected. Is your device in kDFU mode? (y/N)"
|
read -p "[Input] Device in DFU mode detected. Is your device in kDFU mode? (y/N) " kDFUManual
|
||||||
read kDFUManual
|
|
||||||
if [[ $kDFUManual == y ]] || [[ $kDFUManual == Y ]]; then
|
if [[ $kDFUManual == y ]] || [[ $kDFUManual == Y ]]; then
|
||||||
read -p "Enter ProductType (eg. iPad2,1): " ProductType
|
read -p "[Input] Enter ProductType (eg. iPad2,1): " ProductType
|
||||||
read -p "Enter UniqueChipID (ECID): " UniqueChipID
|
read -p "[Input] Enter UniqueChipID (ECID): " UniqueChipID
|
||||||
BasebandDetect
|
BasebandDetect
|
||||||
echo "Will now downgrade device $ProductType in kDFU mode..."
|
echo "[Log] Will now downgrade device $ProductType in kDFU mode..."
|
||||||
Mode='Downgrade'
|
Mode='Downgrade'
|
||||||
SelectVersion
|
SelectVersion
|
||||||
else
|
else
|
||||||
echo "Please put your device in normal mode and jailbroken before proceeding"
|
echo "[Error] Please put the device in normal mode and jailbroken before proceeding"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
elif [ ! $ProductType ]; then
|
elif [ ! $ProductType ]; then
|
||||||
echo "Please plug the device in and trust this computer before proceeding"
|
echo "[Error] Please plug the device in and trust this computer before proceeding"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BasebandDetect
|
BasebandDetect
|
||||||
|
|
||||||
echo "Main Menu"
|
echo "Main Menu"
|
||||||
@ -111,11 +110,12 @@ function MainMenu {
|
|||||||
echo "ProductVersion: $ProductVersion"
|
echo "ProductVersion: $ProductVersion"
|
||||||
echo "UniqueChipID (ECID): $UniqueChipID"
|
echo "UniqueChipID (ECID): $UniqueChipID"
|
||||||
echo
|
echo
|
||||||
|
echo "[Input] Select an option:"
|
||||||
select opt in "Downgrade device" "Save OTA blobs" "Just put device in kDFU mode" "(Re-)Install Dependencies" "Exit"; do
|
select opt in "Downgrade device" "Save OTA blobs" "Just put device in kDFU mode" "(Re-)Install Dependencies" "Exit"; do
|
||||||
case $opt in
|
case $opt in
|
||||||
"Downgrade device" ) Mode='Downgrade'; SelectVersion; break;;
|
"Downgrade device" ) Mode='Downgrade'; SelectVersion; break;;
|
||||||
"Save OTA blobs" ) Mode='SaveOTABlobs'; SelectVersion; break;;
|
"Save OTA blobs" ) Mode='SaveOTABlobs'; SelectVersion; break;;
|
||||||
"Just put device in kDFU mode" ) Mode='kDFUOnly'; Select841; break;;
|
"Just put device in kDFU mode" ) Mode='kDFU'; Select841; break;;
|
||||||
"(Re-)Install Dependencies" ) InstallDependencies; break;;
|
"(Re-)Install Dependencies" ) InstallDependencies; break;;
|
||||||
"Exit" ) exit;;
|
"Exit" ) exit;;
|
||||||
*) MainMenu;;
|
*) MainMenu;;
|
||||||
@ -124,8 +124,9 @@ function MainMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function SelectVersion {
|
function SelectVersion {
|
||||||
if [ $ProductType == iPad2,1 ] || [ $ProductType == iPad2,2 ] || [ $ProductType == iPad2,3 ] || [ $ProductType == iPhone4,1 ]; then
|
if [ $ProductType == iPad2,1 ] || [ $ProductType == iPad2,2 ] ||
|
||||||
echo "Select iOS version:"
|
[ $ProductType == iPad2,3 ] || [ $ProductType == iPhone4,1 ]; then
|
||||||
|
echo "[Input] Select iOS version:"
|
||||||
if [[ $Mode == 'Downgrade' ]]; then
|
if [[ $Mode == 'Downgrade' ]]; then
|
||||||
select opt in "iOS 8.4.1" "iOS 6.1.3" "Other" "Back"; do
|
select opt in "iOS 8.4.1" "iOS 6.1.3" "Other" "Back"; do
|
||||||
case $opt in
|
case $opt in
|
||||||
@ -182,19 +183,13 @@ function Select613 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function SelectOther {
|
function SelectOther {
|
||||||
|
echo "Other $Mode"
|
||||||
iBSS="iBSS.$HardwareModelLower.RELEASE"
|
iBSS="iBSS.$HardwareModelLower.RELEASE"
|
||||||
iv=iv_$HardwareModelLower
|
iv=iv_$HardwareModelLower
|
||||||
key=key_$HardwareModelLower
|
key=key_$HardwareModelLower
|
||||||
NotOTA=1
|
NotOTA=1
|
||||||
echo "Downgrade to other version with SHSH blobs"
|
read -p "[Input] Path to IPSW (drag IPSW to terminal window): " IPSW
|
||||||
echo "Depends on partialZipBrowser! https://github.com/tihmstar/partialZipBrowser"
|
read -p "[Input] Path to SHSH (drag SHSH to terminal window): " SHSH
|
||||||
read -p "Path to IPSW (drag IPSW to terminal window):" IPSW
|
|
||||||
read -p "Path to SHSH (drag SHSH to terminal window):" SHSH
|
|
||||||
echo "Downloading iBSS..."
|
|
||||||
dllink=$(curl -I -Ls -o /dev/null -w %{url_effective} https://api.ipsw.me/v4/ipsw/download/${ProductType}/12H321)
|
|
||||||
pzb -g Firmware/dfu/${iBSS}.dfu -o $iBSS.dfu $dllink
|
|
||||||
mv $iBSS.dfu tmp/
|
|
||||||
echo "Other $Mode"
|
|
||||||
Downgrade
|
Downgrade
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,8 +198,8 @@ function Action {
|
|||||||
Downgrade
|
Downgrade
|
||||||
elif [[ $Mode == 'SaveOTABlobs' ]]; then
|
elif [[ $Mode == 'SaveOTABlobs' ]]; then
|
||||||
SaveOTABlobs
|
SaveOTABlobs
|
||||||
elif [[ $Mode == 'kDFUOnly' ]]; then
|
elif [[ $Mode == 'kDFU' ]]; then
|
||||||
kDFUOnly
|
kDFU
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,11 +207,11 @@ function SaveOTABlobs {
|
|||||||
BuildManifest="resources/manifests/BuildManifest_${ProductType}_${DowngradeVersion}.plist"
|
BuildManifest="resources/manifests/BuildManifest_${ProductType}_${DowngradeVersion}.plist"
|
||||||
|
|
||||||
if [ ! -e resources/ota.json ]; then
|
if [ ! -e resources/ota.json ]; then
|
||||||
echo "Downloading ota.json..."
|
echo "[Log] Downloading ota.json..."
|
||||||
curl -L "https://api.ipsw.me/v2.1/ota.json/condensed" -o "resources/ota.json"
|
curl -L "https://api.ipsw.me/v2.1/ota.json/condensed" -o "resources/ota.json"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Copying ota.json to tmp..."
|
echo "[Log] Copying ota.json to tmp..."
|
||||||
if [ $platform == macos ]; then
|
if [ $platform == macos ]; then
|
||||||
cp resources/ota.json $TMPDIR
|
cp resources/ota.json $TMPDIR
|
||||||
else
|
else
|
||||||
@ -225,51 +220,56 @@ function SaveOTABlobs {
|
|||||||
echo
|
echo
|
||||||
|
|
||||||
if [ ! -e /tmp/ota.json ] && [ ! -e $TMPDIR/ota.json ]; then
|
if [ ! -e /tmp/ota.json ] && [ ! -e $TMPDIR/ota.json ]; then
|
||||||
echo "Download ota.json failed. Please run the script again"
|
echo "[Error] Download ota.json failed. Please run the script again"
|
||||||
Clean
|
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Saving $DowngradeVersion blobs with tsschecker..."
|
echo "[Log] Saving $DowngradeVersion blobs with tsschecker..."
|
||||||
env "LD_PRELOAD=libcurl.so.3" resources/tools/tsschecker_$platform -d $ProductType -i $DowngradeVersion -o -s -e $UniqueChipID -m $BuildManifest
|
env "LD_PRELOAD=libcurl.so.3" resources/tools/tsschecker_$platform -d $ProductType -i $DowngradeVersion -o -s -e $UniqueChipID -m $BuildManifest
|
||||||
echo
|
echo
|
||||||
SHSH=$(ls *.shsh2)
|
SHSH=$(ls *.shsh2)
|
||||||
if [ ! -e $SHSH ]; then
|
if [ ! -e $SHSH ]; then
|
||||||
echo "Saving $DowngradeVersion blobs failed. Please run the script again"
|
echo "[Error] Saving $DowngradeVersion blobs failed. Please run the script again"
|
||||||
Clean
|
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function kDFUOnly {
|
function kDFU {
|
||||||
echo "Depends on partialZipBrowser! https://github.com/tihmstar/partialZipBrowser"
|
if [ ! -e tmp/$iBSS.dfu ]; then
|
||||||
|
if [ ! $(which pzb) ]; then
|
||||||
|
echo "[Error] pzb not found! Depends on partialZipBrowser: https://github.com/tihmstar/partialZipBrowser"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
echo "[Log] Downloading iBSS..."
|
||||||
dllink=$(curl -I -Ls -o /dev/null -w %{url_effective} https://api.ipsw.me/v4/ipsw/download/${ProductType}/12H321)
|
dllink=$(curl -I -Ls -o /dev/null -w %{url_effective} https://api.ipsw.me/v4/ipsw/download/${ProductType}/12H321)
|
||||||
pzb -g Firmware/dfu/${iBSS}.dfu -o $iBSS.dfu $dllink
|
pzb -g Firmware/dfu/${iBSS}.dfu -o $iBSS.dfu $dllink
|
||||||
mv $iBSS.dfu tmp/
|
mv $iBSS.dfu tmp/
|
||||||
kDFU
|
fi
|
||||||
}
|
echo "[Log] Decrypting iBSS..."
|
||||||
|
|
||||||
function kDFU {
|
|
||||||
echo "Decrypting iBSS..."
|
|
||||||
echo "IV = ${!iv}"
|
echo "IV = ${!iv}"
|
||||||
echo "Key = ${!key}"
|
echo "Key = ${!key}"
|
||||||
resources/tools/xpwntool_$platform "tmp/${iBSS}.dfu" tmp/iBSS.dec -k ${!key} -iv ${!iv} -decrypt
|
resources/tools/xpwntool_$platform "tmp/${iBSS}.dfu" tmp/iBSS.dec -k ${!key} -iv ${!iv} -decrypt
|
||||||
dd bs=64 skip=1 if=tmp/iBSS.dec of=tmp/iBSS.dec2
|
dd bs=64 skip=1 if=tmp/iBSS.dec of=tmp/iBSS.dec2
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo "Patching iBSS..."
|
echo "[Log] Patching iBSS..."
|
||||||
bspatch tmp/iBSS.dec2 tmp/pwnediBSS resources/patches/$iBSS.patch
|
bspatch tmp/iBSS.dec2 tmp/pwnediBSS resources/patches/$iBSS.patch
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if [[ $VersionDetect == 1 ]]; then
|
if [[ $VersionDetect == 1 ]]; then
|
||||||
kloader="kloader_hgsp"
|
kloader='kloader_hgsp'
|
||||||
elif [[ $VersionDetect == 5 ]]; then
|
elif [[ $VersionDetect == 5 ]]; then
|
||||||
kloader="kloader5"
|
kloader='kloader5'
|
||||||
else
|
else
|
||||||
kloader="kloader"
|
kloader='kloader'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $VersionDetect == 1 ]]; then
|
if [[ $VersionDetect == 1 ]]; then
|
||||||
|
if [ ! $(which ifuse) ]; then
|
||||||
|
echo "[Error] ifuse not found. Please re-install dependencies and try again"
|
||||||
|
echo "For macOS systems, install osxfuse and ifuse using brew"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
WifiAddr=$(ideviceinfo -s | grep 'WiFiAddress' | cut -c 14-)
|
WifiAddr=$(ideviceinfo -s | grep 'WiFiAddress' | cut -c 14-)
|
||||||
WifiAddrDecr=$(echo $(printf "%x\n" $(expr $(printf "%d\n" 0x$(echo "${WifiAddr}" | tr -d ':')) - 1)) | sed 's/\(..\)/\1:/g;s/:$//')
|
WifiAddrDecr=$(echo $(printf "%x\n" $(expr $(printf "%d\n" 0x$(echo "${WifiAddr}" | tr -d ':')) - 1)) | sed 's/\(..\)/\1:/g;s/:$//')
|
||||||
echo '#!/bin/bash' > tmp/pwn.sh
|
echo '#!/bin/bash' > tmp/pwn.sh
|
||||||
@ -277,15 +277,15 @@ function kDFU {
|
|||||||
chmod 755 kloader_hgsp
|
chmod 755 kloader_hgsp
|
||||||
./kloader_hgsp pwnediBSS" >> tmp/pwn.sh
|
./kloader_hgsp pwnediBSS" >> tmp/pwn.sh
|
||||||
mkdir mount
|
mkdir mount
|
||||||
echo "Mounting device using ifuse..."
|
echo "[Log] Mounting device using ifuse..."
|
||||||
ifuse mount
|
ifuse mount
|
||||||
echo "Copying stuff to device..."
|
echo "[Log] Copying stuff to device..."
|
||||||
cp "tmp/pwn.sh" "resources/tools/$kloader" "tmp/pwnediBSS" "mount/"
|
cp "tmp/pwn.sh" "resources/tools/$kloader" "tmp/pwnediBSS" "mount/"
|
||||||
echo "Unmounting device..."
|
echo "[Log] Unmounting device..."
|
||||||
sudo umount mount
|
sudo umount mount
|
||||||
#rm -r mount
|
#rm -r mount
|
||||||
echo
|
echo
|
||||||
echo "Enter MTerminal and run these commands:"
|
echo "Open MTerminal and run these commands:"
|
||||||
echo
|
echo
|
||||||
echo '$ su'
|
echo '$ su'
|
||||||
echo "(enter root password, default is 'alpine')"
|
echo "(enter root password, default is 'alpine')"
|
||||||
@ -299,14 +299,14 @@ function kDFU {
|
|||||||
echo "Will now connect to device using SSH"
|
echo "Will now connect to device using SSH"
|
||||||
echo "Please enter root password when prompted (default is 'alpine')"
|
echo "Please enter root password when prompted (default is 'alpine')"
|
||||||
echo
|
echo
|
||||||
echo "Copying stuff to device..."
|
echo "[Input] Copying stuff to device..."
|
||||||
scp resources/tools/$kloader tmp/pwnediBSS root@$IPAddress:/
|
scp resources/tools/$kloader tmp/pwnediBSS root@$IPAddress:/
|
||||||
if [ $? == 1 ]; then
|
if [ $? == 1 ]; then
|
||||||
echo "Cannot connect to device via SSH! Please check your known_hosts file and try again"
|
echo "[Error] Cannot connect to device via SSH. Please check your ~/.ssh/known_hosts file and try again"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
echo "Entering kDFU mode..."
|
echo "[Log] Entering kDFU mode..."
|
||||||
ssh root@$IPAddress "chmod 755 /$kloader && /$kloader /pwnediBSS" &
|
ssh root@$IPAddress "chmod 755 /$kloader && /$kloader /pwnediBSS" &
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
@ -315,18 +315,18 @@ function kDFU {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function FindDFU {
|
function FindDFU {
|
||||||
echo "Finding device in DFU mode..."
|
echo "[Log] Finding device in DFU mode..."
|
||||||
while [[ $DFUDevice != 1 ]]; do
|
while [[ $DFUDevice != 1 ]]; do
|
||||||
DFUDevice=$(lsusb | grep -c "1227")
|
DFUDevice=$(lsusb | grep -c "1227")
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
echo "Found device in DFU mode."
|
echo "[Log] Found device in DFU mode."
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
function Downgrade {
|
function Downgrade {
|
||||||
if [ ! -e resources/firmware ]; then
|
if [ ! -e resources/firmware ]; then
|
||||||
echo "Firmware keys missing, downloading firmware keys..."
|
echo "[Log] Firmware keys missing, downloading firmware keys..."
|
||||||
curl -L https://github.com/LukeZGD/32bit-OTA-Downgrader/archive/firmware.zip -o tmp/firmware.zip
|
curl -L https://github.com/LukeZGD/32bit-OTA-Downgrader/archive/firmware.zip -o tmp/firmware.zip
|
||||||
mkdir resources/firmware
|
mkdir resources/firmware
|
||||||
unzip -q tmp/firmware.zip -d resources
|
unzip -q tmp/firmware.zip -d resources
|
||||||
@ -337,51 +337,49 @@ function Downgrade {
|
|||||||
if [ ! $NotOTA ]; then
|
if [ ! $NotOTA ]; then
|
||||||
SaveOTABlobs
|
SaveOTABlobs
|
||||||
IPSW="${ProductType}_${DowngradeVersion}_${DowngradeBuildVer}_Restore"
|
IPSW="${ProductType}_${DowngradeVersion}_${DowngradeBuildVer}_Restore"
|
||||||
if [ ! -e ${IPSW}.ipsw ]; then
|
if [ ! -e $IPSW.ipsw ]; then
|
||||||
echo "iOS $DowngradeVersion IPSW is missing, downloading IPSW..."
|
echo "[Log] iOS $DowngradeVersion IPSW is missing, downloading IPSW..."
|
||||||
curl -L https://api.ipsw.me/v4/ipsw/download/$ProductType/$DowngradeBuildVer -o $IPSW.ipsw
|
curl -L https://api.ipsw.me/v4/ipsw/download/$ProductType/$DowngradeBuildVer -o $IPSW.ipsw
|
||||||
fi
|
fi
|
||||||
|
cp $IPSW/Firmware/dfu/$iBSS.dfu tmp/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Extracting $DowngradeVersion IPSW..."
|
if [ ! $kDFUManual ]; then
|
||||||
unzip -q ${IPSW}.ipsw -d "$IPSW/"
|
|
||||||
cp $IPSW/Firmware/dfu/$iBSS.dfu tmp/
|
|
||||||
echo
|
|
||||||
|
|
||||||
if [[ ! $kDFUManual ]]; then
|
|
||||||
kDFU
|
kDFU
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Preparing for futurerestore (starting local server)..."
|
echo "[Log] Extracting IPSW..."
|
||||||
|
unzip -q $IPSW.ipsw -d "$IPSW/"
|
||||||
|
|
||||||
|
echo "[Log] Preparing for futurerestore (starting local server)..."
|
||||||
cd resources
|
cd resources
|
||||||
sudo python3 -m http.server 80 &
|
sudo python3 -m http.server 80 &
|
||||||
pythonPID=$!
|
pythonPID=$!
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
echo "Will now proceed to futurerestore..."
|
echo "[Log] Will now proceed to futurerestore..."
|
||||||
echo
|
echo
|
||||||
|
|
||||||
while [[ $ScriptDone != 1 ]]; do
|
while [[ $ScriptDone != 1 ]]; do
|
||||||
if [[ ! $NoBaseband ]]; then
|
if [ ! $NoBaseband ]; then
|
||||||
sudo env "LD_PRELOAD=libcurl.so.3" resources/tools/futurerestore_$platform -t $SHSH --latest-baseband --use-pwndfu ${IPSW}.ipsw
|
sudo env "LD_PRELOAD=libcurl.so.3" resources/tools/futurerestore_$platform -t $SHSH --latest-baseband --use-pwndfu $IPSW.ipsw
|
||||||
else
|
else
|
||||||
echo "Device $ProductType has no baseband"
|
echo "[Log] Device $ProductType has no baseband"
|
||||||
sudo env "LD_PRELOAD=libcurl.so.3" resources/tools/futurerestore_$platform -t $SHSH --no-baseband --use-pwndfu ${IPSW}.ipsw
|
sudo env "LD_PRELOAD=libcurl.so.3" resources/tools/futurerestore_$platform -t $SHSH --no-baseband --use-pwndfu $IPSW.ipsw
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "futurerestore done!"
|
echo "futurerestore done!"
|
||||||
echo "If futurerestore failed to download baseband or for some reason, you can choose to retry"
|
echo "If futurerestore failed to download baseband or for some reason, you can choose to retry"
|
||||||
read -p "Retry? (y/N)" Retry
|
read -p "[Input] Retry? (y/N) " Retry
|
||||||
if [[ Retry != y ]] && [[ Retry != Y ]]; then
|
if [[ Retry != y ]] && [[ Retry != Y ]]; then
|
||||||
ScriptDone=1
|
ScriptDone=1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Stopping local server..."
|
echo "[Log] Stopping local server..."
|
||||||
sudo kill $pythonPID
|
sudo kill $pythonPID
|
||||||
echo "Downgrade script done!"
|
echo "[Log] Downgrade script done!"
|
||||||
Clean
|
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -399,7 +397,7 @@ function InstallDependencies {
|
|||||||
elif [[ $OSTYPE == "darwin"* ]]; then
|
elif [[ $OSTYPE == "darwin"* ]]; then
|
||||||
macOS
|
macOS
|
||||||
else
|
else
|
||||||
echo "Distro not detected/supported. Please select manually"
|
echo "[Input] Distro not detected/supported. Please select manually"
|
||||||
select opt in "Ubuntu Xenial" "Ubuntu Bionic" "Arch Linux" "macOS"; do
|
select opt in "Ubuntu Xenial" "Ubuntu Bionic" "Arch Linux" "macOS"; do
|
||||||
case $opt in
|
case $opt in
|
||||||
"Ubuntu Xenial" ) Ubuntu; break;;
|
"Ubuntu Xenial" ) Ubuntu; break;;
|
||||||
@ -409,7 +407,7 @@ function InstallDependencies {
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
echo "Install script done! Please run the script again to proceed"
|
echo "[Log] Install script done! Please run the script again to proceed"
|
||||||
}
|
}
|
||||||
|
|
||||||
function Arch {
|
function Arch {
|
||||||
@ -419,6 +417,12 @@ function Arch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function macOS {
|
function macOS {
|
||||||
|
read -p "[Input] Warning: macOS dependency install script is not fully tested and supported. Continue anyway? (y/N) " Continue
|
||||||
|
if [[ $Continue != y ]] && [[ $Continue != Y ]]; then
|
||||||
|
echo "Please install these dependencies manually using brew to proceed:"
|
||||||
|
echo "libimobiledevice, usbmuxd, libzip, lsusb, osxfuse, ifuse"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
if [[ ! $(which brew) ]]; then
|
if [[ ! $(which brew) ]]; then
|
||||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
||||||
fi
|
fi
|
||||||
@ -450,32 +454,32 @@ function Ubuntu1804 {
|
|||||||
apt download -o=dir::cache=. libcurl3
|
apt download -o=dir::cache=. libcurl3
|
||||||
ar x libcurl3* data.tar.xz
|
ar x libcurl3* data.tar.xz
|
||||||
tar xf data.tar.xz
|
tar xf data.tar.xz
|
||||||
sudo cp usr/lib/${mname}-linux-gnu/libcurl.so.4.* /usr/lib/libcurl.so.3
|
sudo cp usr/lib/$mname-linux-gnu/libcurl.so.4.* /usr/lib/libcurl.so.3
|
||||||
curl -L http://mirrors.edge.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1.1_${mname}.deb -o libpng12.deb
|
curl -L http://mirrors.edge.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1.1_$mname.deb -o libpng12.deb
|
||||||
sudo dpkg -i libpng12.deb
|
sudo dpkg -i libpng12.deb
|
||||||
cd ..
|
cd ..
|
||||||
Clean
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# ----------------
|
# ----------------
|
||||||
|
|
||||||
|
trap Clean INT TERM EXIT
|
||||||
clear
|
clear
|
||||||
echo "******* 32bit-OTA-Downgrader *******"
|
echo "******* 32bit-OTA-Downgrader *******"
|
||||||
echo " Downgrade script by LukeZGD "
|
echo " Downgrade script by LukeZGD "
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if [[ $OSTYPE == "linux-gnu" ]]; then
|
if [[ $OSTYPE == "linux-gnu" ]]; then
|
||||||
platform="linux"
|
platform='linux'
|
||||||
elif [[ $OSTYPE == "darwin"* ]]; then
|
elif [[ $OSTYPE == "darwin"* ]]; then
|
||||||
platform="macos"
|
platform='macos'
|
||||||
else
|
else
|
||||||
echo "OSTYPE unknown/not supported, sorry!"
|
echo "[Error] OSTYPE unknown/not supported"
|
||||||
echo "Supports macOS and Linux only"
|
echo "Supports Linux and macOS only"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! $(ping -c1 google.com 2>/dev/null) ]]; then
|
if [[ ! $(ping -c1 google.com 2>/dev/null) ]]; then
|
||||||
echo "Please check your Internet connection before proceeding"
|
echo "[Error] Please check your Internet connection before proceeding"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -487,7 +491,7 @@ ProductVersion=$(ideviceinfo -s | grep 'ProductVersion' | cut -c 17-)
|
|||||||
VersionDetect=$(echo $ProductVersion | cut -c 1)
|
VersionDetect=$(echo $ProductVersion | cut -c 1)
|
||||||
UniqueChipID=$(ideviceinfo -s | grep 'UniqueChipID' | cut -c 15-)
|
UniqueChipID=$(ideviceinfo -s | grep 'UniqueChipID' | cut -c 15-)
|
||||||
|
|
||||||
if [ ! $(which bspatch) ] || [ ! $(which ideviceinfo) ] || [ ! $(which ifuse) ] || [ ! $(which lsusb) ] || [ ! $(which ssh) ]; then
|
if [ ! $(which bspatch) ] || [ ! $(which ideviceinfo) ] || [ ! $(which lsusb) ] || [ ! $(which ssh) ] || [ ! $(which python3) ]; then
|
||||||
InstallDependencies
|
InstallDependencies
|
||||||
else
|
else
|
||||||
chmod +x resources/tools/*
|
chmod +x resources/tools/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user