Use idevicererestore for Windows OTA

Properly flash latest baseband, hopefully fixes activation issues
This commit is contained in:
LukeZGD 2022-08-27 23:30:44 +08:00
parent ba2af83749
commit 8cd5ce1d35
4 changed files with 21 additions and 10 deletions

View File

@ -56,6 +56,7 @@ SetToolPaths() {
ideviceenterrecovery="$MPath/ideviceenterrecovery"
ideviceinfo="$MPath/ideviceinfo"
idevicerestore="./resources/tools/idevicerestore_$platform"
idevicererestore="./resources/tools/idevicererestore_$platform"
iproxy="$MPath/iproxy"
ipsw="../resources/tools/ipsw_$platform"
ipwndfu="$python ipwndfu"
@ -94,7 +95,7 @@ SetToolPaths() {
ping="ping -n 1"
Log "WARNING - Using iOS-OTA-Downgrader on Windows is highly discouraged."
Echo "* Please use it on Linux or macOS instead."
Echo "* You may still continue, but you may encounter problems with restoring and activation."
Echo "* You may still continue, but you might encounter problems with restoring and activation."
Echo "* You have been warned."
sleep 5
Input "Press Enter/Return to continue anyway (or press Ctrl+C to cancel)"
@ -195,7 +196,7 @@ InstallDepends() {
pacman -Sy --noconfirm --needed ca-certificates curl openssh unzip zip
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 30597bc091b1a2fa80350febdfd97a24b28fbdd5
SaveFile https://github.com/LukeZGD/iOS-OTA-Downgrader-Keys/releases/download/tools/tools_win.zip tools_win.zip b8b727b74d3bbba2093bef5a156e30cb29d6eac7
Log "Extracting Windows tools..."
unzip -oq tools_win.zip -d ../resources
fi

View File

@ -23,7 +23,7 @@ FRBaseband() {
BasebandSHA1L=$($sha1sum saved/baseband/$Baseband | awk '{print $1}')
if [[ ! -e $(ls saved/baseband/$Baseband) || $BasebandSHA1L != $BasebandSHA1 ]]; then
rm -f saved/baseband/$Baseband saved/$ProductType/BuildManifest.plist
if [[ $DeviceProc == 7 ]]; then
if [[ $DeviceProc == 7 || $platform == "win" ]]; then
Error "Downloading/verifying baseband failed. Please run the script again"
else
Log "Downloading/verifying baseband failed, will proceed with --latest-baseband flag"
@ -138,7 +138,20 @@ iDeviceRestore() {
mkdir shsh
cp $SHSH shsh/${UniqueChipID}-${ProductType}-${OSVer}.shsh
Log "Proceeding to idevicerestore..."
[[ $1 == "latest" ]] && ExtraArgs="-e" || ExtraArgs="-e -w"
ExtraArgs="-e -w"
if [[ $1 == "latest" ]]; then
ExtraArgs="-e"
elif [[ $platform == "win" && $ProductType != "iPhone3"* ]]; then
ExtraArgs="-r"
idevicerestore="$idevicererestore"
if [[ $Baseband == 0 ]]; then
Log "Device $ProductType has no baseband"
else
FRBaseband
cp saved/baseband/$Baseband tmp/bbfw.tmp
cp $BuildManifest tmp/BuildManifest.plist
fi
fi
Log "Running idevicerestore with command: $idevicerestore $ExtraArgs \"$IPSWRestore.ipsw\""
$idevicerestore $ExtraArgs "$IPSWRestore.ipsw"
echo
@ -200,7 +213,7 @@ DowngradeOTA() {
}
DowngradeOTAWin() {
IPSWCustom="${IPSWType}_${OSVer}_${BuildVer}_CustomWin"
IPSWCustom="${IPSWType}_${OSVer}_${BuildVer}_CustomW"
if [[ $DeviceProc != 7 ]]; then
JailbreakOption
SaveOTABlobs

View File

@ -220,10 +220,7 @@ IPSW32() {
done
fi
[[ $ProductType == "$DisableBBUpdate" ]] && BBUpdate=
if [[ $platform == "win" ]]; then
BBUpdate=
WinBundles="windows/"
fi
[[ $platform == "win" ]] && WinBundles="windows/"
if [[ ! -e $IPSWCustom.ipsw ]]; then
Log "Preparing custom IPSW..."

View File

@ -171,7 +171,7 @@ Main() {
if [[ $Mode == "IPSW32" ]]; then
echo
[[ $platform == "win" ]] && IPSWCustom="${IPSWType}_${OSVer}_${BuildVer}_CustomWin"
[[ $platform == "win" ]] && IPSWCustom="${IPSWType}_${OSVer}_${BuildVer}_CustomW"
JailbreakOption
if [[ -e "$IPSWCustom.ipsw" ]]; then
Log "Found existing Custom IPSW, stopping here."