Some changes

This commit is contained in:
LukeZGD 2022-07-07 14:21:53 +08:00
parent d151d71aac
commit 8942de72ea
4 changed files with 44 additions and 26 deletions

View File

@ -79,8 +79,7 @@ SetToolPaths() {
if [[ $platform == "linux" ]]; then if [[ $platform == "linux" ]]; then
irecovery="env LD_LIBRARY_PATH=./resources/lib $irecovery" irecovery="env LD_LIBRARY_PATH=./resources/lib $irecovery"
irecovery2="env LD_LIBRARY_PATH=./resources/lib $irecovery2" irecovery2="env LD_LIBRARY_PATH=../lib $irecovery2"
# openssl
opensslver=$(openssl version | awk '{print $2}' | cut -c -3) opensslver=$(openssl version | awk '{print $2}' | cut -c -3)
if [[ $opensslver == "3"* ]]; then if [[ $opensslver == "3"* ]]; then
cherrybin="env LD_LIBRARY_PATH=../resources/lib $cherrybin" cherrybin="env LD_LIBRARY_PATH=../resources/lib $cherrybin"
@ -103,14 +102,26 @@ SetToolPaths() {
} }
SaveExternal() { SaveExternal() {
if [[ -d ./resources/$2 ]]; then 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
fi
if [[ -d ./resources/$Name ]]; then
return return
fi fi
cd tmp cd tmp
SaveFile $1 $2.zip $3 SaveFile $Link $Name.zip $SHA1
cd ../resources cd ../resources
unzip -q ../tmp/$2.zip -d . unzip -q ../tmp/$Name.zip -d .
mv $2* $2 mv $Name* $Name
cd .. cd ..
} }
@ -130,7 +141,7 @@ InstallDepends() {
mkdir resources/lib tmp 2>/dev/null mkdir resources/lib tmp 2>/dev/null
cd resources cd resources
cp lib/*.so.1.1 ../tmp 2>/dev/null cp lib/*.so.1.1 ../tmp 2>/dev/null
rm -rf ipwndfu lib/* rm -rf lib/*
cp ../tmp/*.so.1.1 lib/ 2>/dev/null cp ../tmp/*.so.1.1 lib/ 2>/dev/null
cd ../tmp cd ../tmp
@ -173,9 +184,8 @@ InstallDepends() {
xcode-select --install xcode-select --install
libimobiledevice=("https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/tools/libimobiledevice_macos.zip" "66a49e4f69757a3d9dc51109a8e4651020bfacb8") libimobiledevice=("https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/tools/libimobiledevice_macos.zip" "66a49e4f69757a3d9dc51109a8e4651020bfacb8")
Echo "* iOS-OTA-Downgrader provides a copy of libimobiledevice and libirecovery by default" Echo "* iOS-OTA-Downgrader provides a copy of libimobiledevice and libirecovery by default"
Echo "* In case that problems occur, try installing them from Homebrew" 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 versions of the tools" Echo "* The script will detect this automatically and will use the Homebrew/MacPorts versions of the tools"
Echo "* Install using this command: 'brew install libimobiledevice libirecovery'"
elif [[ $platform == "win" ]]; then elif [[ $platform == "win" ]]; then
pacman -Sy --noconfirm --needed ca-certificates curl openssh unzip zip pacman -Sy --noconfirm --needed ca-certificates curl openssh unzip zip

View File

@ -137,10 +137,6 @@ GetDeviceValues() {
BasebandURL=$(cat $Firmware/11D257/url) BasebandURL=$(cat $Firmware/11D257/url)
Baseband="ICE3_04.12.09_BOOT_02.13.Release.bbfw" Baseband="ICE3_04.12.09_BOOT_02.13.Release.bbfw"
BasebandSHA1="007365a5655ac2f9fbd1e5b6dba8f4be0513e364" BasebandSHA1="007365a5655ac2f9fbd1e5b6dba8f4be0513e364"
if [[ $ProductType == "iPhone3,1" ]]; then
Log "iPhone 4 GSM detected. iPhone4Down functions enabled."
Echo "* This script uses ch3rryflower by dora2iOS"
fi
elif [[ $ProductType == "iPad2"* || $ProductType == "iPad3"* || $ProductType == "iPad4,1" || elif [[ $ProductType == "iPad2"* || $ProductType == "iPad3"* || $ProductType == "iPad4,1" ||
$ProductType == "iPad4,4" || $ProductType == "iPod5,1" ]]; then $ProductType == "iPad4,4" || $ProductType == "iPod5,1" ]]; then
@ -151,7 +147,10 @@ GetDeviceValues() {
if [[ $ProductType == "iPhone3"* ]]; then if [[ $ProductType == "iPhone3"* ]]; then
DeviceProc=4 DeviceProc=4
if [[ $ProductType != "iPhone3,1" ]]; then if [[ $ProductType == "iPhone3,1" ]]; then
Log "iPhone 4 GSM detected. iPhone4Down functions enabled."
Echo "* This script uses ch3rryflower by dora2iOS"
else
Log "$ProductType detected. Your device is not supported by ch3rryflower." Log "$ProductType detected. Your device is not supported by ch3rryflower."
Echo "* Functions will be limited to entering kDFU and restoring with blobs." Echo "* Functions will be limited to entering kDFU and restoring with blobs."
fi fi
@ -220,7 +219,7 @@ EnterPwnDFU() {
done done
else else
pwnDFUTool="ipwndfu" pwnDFUTool="ipwndfu"
SaveExternal https://github.com/LukeZGD/ipwndfu/archive/6e67c9e28a5f7f63f179dea670f7f858712350a0.zip ipwndfu 61333249eb58faebbb380c4709384034ce0e019a SaveExternal ipwndfu
fi fi
Log "Entering pwnDFU mode with: $pwnDFUTool" Log "Entering pwnDFU mode with: $pwnDFUTool"
@ -232,10 +231,11 @@ EnterPwnDFU() {
Log "Running rmsigchks.py..." Log "Running rmsigchks.py..."
$rmsigchks $rmsigchks
pwnDFUDevice=$? pwnDFUDevice=$?
else
SendiBSS=1
fi
cd ../.. cd ../..
else
cd ../..
SendPwnediBSS
fi
else else
$pwnDFUTool -p $pwnDFUTool -p
pwnDFUDevice=$? pwnDFUDevice=$?
@ -268,6 +268,8 @@ EnterPwnDFU() {
Log "Warning - Failed to detect device in pwnDFU mode." Log "Warning - Failed to detect device in pwnDFU mode."
Echo "* If the device entered pwnDFU mode successfully, you may continue" Echo "* If the device entered pwnDFU mode successfully, you may continue"
Echo "* If entering pwnDFU failed, you may have to force restart your device and start over" Echo "* If entering pwnDFU failed, you may have to force restart your device and start over"
Input "Press Enter/Return to continue (or press Ctrl+C to cancel)"
read -s
fi fi
} }
@ -285,7 +287,7 @@ Recovery() {
if [[ $RecoveryDFU == 'N' || $RecoveryDFU == 'n' ]]; then if [[ $RecoveryDFU == 'N' || $RecoveryDFU == 'n' ]]; then
Log "Exiting recovery mode." Log "Exiting recovery mode."
$irecovery -n $irecovery -n
exit 0 ExitWin 0
fi fi
Echo "* Hold TOP and HOME buttons for 10 seconds." Echo "* Hold TOP and HOME buttons for 10 seconds."
@ -310,7 +312,7 @@ RecoveryExit() {
Log "Exiting recovery mode." Log "Exiting recovery mode."
$irecovery -n $irecovery -n
fi fi
exit 0 ExitWin 0
} }
PatchiBSS() { PatchiBSS() {
@ -335,7 +337,7 @@ PatchiBSS() {
$bspatch saved/$ProductType/$iBSS.dfu tmp/pwnediBSS resources/patches/$iBSS.patch $bspatch saved/$ProductType/$iBSS.dfu tmp/pwnediBSS resources/patches/$iBSS.patch
} }
SendPwnediBSS() { SendPwnediBSSA5() {
Echo "* Make sure that your device is in pwnDFU mode using an Arduino+USB Host Shield!" Echo "* Make sure that your device is in pwnDFU mode using an Arduino+USB Host Shield!"
Echo "* This option will not work if your device is not in pwnDFU mode." Echo "* This option will not work if your device is not in pwnDFU mode."
Input "Press Enter/Return to continue (or press Ctrl+C to cancel)" Input "Press Enter/Return to continue (or press Ctrl+C to cancel)"
@ -348,12 +350,11 @@ SendPwnediBSS() {
Log "No iBSS option enabled by user." Log "No iBSS option enabled by user."
return return
fi fi
echo echo
Input "Send iBSS Option" Input "Send iBSS Option"
Echo "* To send pwned iBSS using ipwndfu, select Y. (does not work on ARM Macs)" Echo "* To send pwned iBSS using ipwndfu, select Y. (does not work on ARM Macs)"
Echo "* To let futurerestore send iBSS, select N. (likely does not work)" Echo "* To let futurerestore send iBSS, select N. (likely does not work)"
Echo "* For macOS >=12.3, install python2 first before selecting ipwndfu." Echo "* For macOS 12 and newer, install python2 first before selecting ipwndfu."
Echo "* This option is enabled by default (Y)." Echo "* This option is enabled by default (Y)."
read -p "$(Input 'Enable this option? (Y/n):')" SendiBSS read -p "$(Input 'Enable this option? (Y/n):')" SendiBSS
if [[ $SendiBSS == 'N' || $SendiBSS == 'n' ]]; then if [[ $SendiBSS == 'N' || $SendiBSS == 'n' ]]; then
@ -361,8 +362,11 @@ SendPwnediBSS() {
SendiBSS=1 SendiBSS=1
return return
fi fi
SendPwnediBSS
}
SaveExternal https://github.com/LukeZGD/ipwndfu/archive/6e67c9e28a5f7f63f179dea670f7f858712350a0.zip ipwndfu 61333249eb58faebbb380c4709384034ce0e019a SendPwnediBSS() {
SaveExternal ipwndfu
PatchiBSS PatchiBSS
cd resources/ipwndfu cd resources/ipwndfu
Log "Sending iBSS..." Log "Sending iBSS..."

View File

@ -98,6 +98,10 @@ DowngradeOther() {
Log "Getting firmware keys for $ProductType-$BuildVer" Log "Getting firmware keys for $ProductType-$BuildVer"
mkdir -p resources/firmware/$ProductType/$BuildVer 2>/dev/null mkdir -p resources/firmware/$ProductType/$BuildVer 2>/dev/null
curl -L https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/raw/master/$ProductType/$BuildVer/index.html -o tmp/index.html curl -L https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/raw/master/$ProductType/$BuildVer/index.html -o tmp/index.html
if [[ $(cat tmp/index.html | grep -c "$BuildVer") != 1 ]]; then
curl -L https://api.m1sta.xyz/wikiproxy/$ProductType/$BuildVer -o tmp/index.html
[[ $(cat tmp/index.html | grep -c "$BuildVer") != 1 ]] && Error "Failed to download firmware keys, cannot proceed."
fi
mv tmp/index.html resources/firmware/$ProductType/$BuildVer mv tmp/index.html resources/firmware/$ProductType/$BuildVer
fi fi

View File

@ -112,7 +112,7 @@ Main() {
mkdir tmp mkdir tmp
if [[ $ProductType == "iPhone3,1" ]]; then if [[ $ProductType == "iPhone3,1" ]]; then
SaveExternal https://web.archive.org/web/20210529174714if_/https://codeload.github.com/dora2-iOS/ch3rryflower/zip/316d2cdc5351c918e9db9650247b91632af3f11f ch3rryflower 790d56db354151b9740c929e52c097ba57f2929d SaveExternal ch3rryflower
fi fi
if [[ -n $1 && $1 != "NoColor" && $1 != "NoDevice" && $1 != "PwnedDevice" ]]; then if [[ -n $1 && $1 != "NoColor" && $1 != "NoDevice" && $1 != "PwnedDevice" ]]; then
@ -258,7 +258,7 @@ Main() {
case $opt in case $opt in
"kDFU mode" ) break;; "kDFU mode" ) break;;
"DFU mode (A4/A6)" ) EnterPwnDFU; break;; "DFU mode (A4/A6)" ) EnterPwnDFU; break;;
"pwnDFU mode (A5)" ) SendPwnediBSS; break;; "pwnDFU mode (A5)" ) SendPwnediBSSA5; break;;
* ) exit 0;; * ) exit 0;;
esac esac
done done