Skip to content

Commit 5f3ebdc

Browse files
committed
auto-enable activation record stitching on 9900 imei devices only, and other changes
- auto-enable activation record stitching only on devices where imei starts with 9900 - update ipwndfu - bump 18.x version to 18.7.1, all >18 just get from ipsw.me api - re-enable device_find_all on macos, use ioreg iousb instead of system_profiler spusbdatatype - some other small changes - detect appletv and watch (close #869)
1 parent 7796f1b commit 5f3ebdc

File tree

2 files changed

+45
-31
lines changed

2 files changed

+45
-31
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
run: |
2929
mkdir -p saved/firmware
3030
pushd resources
31-
curl -L https://github.com/LukeZGD/ipwndfu/archive/624763e9903e523bcc0de8a9b44e35053ce72ac6.zip -o ipwndfu_python3.zip
32-
curl -L https://github.com/LukeZGD/ipwndfu/archive/01108dc5dbd5353b4c93d9694d75d020187dfbb5.zip -o ipwndfu.zip
31+
curl -L https://github.com/LukeZGD/ipwndfu/archive/ea998f27d737611a30e0d10fbf251d66967022f6.zip -o ipwndfu_python3.zip
32+
curl -L https://github.com/LukeZGD/ipwndfu/archive/2bc68605dd0dd31ab27fa720452e4ccd4e638d0d.zip -o ipwndfu.zip
3333
curl -L https://github.com/LukeZGD/Legacy-iOS-Kit-Keys/archive/refs/heads/master.zip -o keys.zip
3434
unzip keys.zip -d .
3535
cp -r Legacy-iOS-Kit-Keys-master/* ../saved/firmware
@@ -38,8 +38,8 @@ jobs:
3838
unzip ipwndfu.zip -d .
3939
mv ipwndfu*/ ../saved/ipwndfu
4040
rm -rf Legacy-iOS-Kit-Keys-master/ ipwndfu*.zip keys.zip
41-
echo "398b1e74317373d0c9fdd2711581913810ced270" > ../saved/ipwndfu_python3/sha1check
42-
echo "9aff74dbe947fec8ed8bda9c261c3526df3ca6e9" > ../saved/ipwndfu/sha1check
41+
echo "7eb59cc50d31078fa7bbc2fddb1e76f74e43c040" > ../saved/ipwndfu_python3/sha1check
42+
echo "88d8a39c3250d0603086c5ce6911c3df1b43e9cd" > ../saved/ipwndfu/sha1check
4343
popd
4444
4545
- name: Move linux binaries

restore.sh

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,6 +1213,7 @@ device_get_info() {
12131213
device_serial="$($ideviceinfo -k SerialNumber | cut -c 3- | cut -c -3)"
12141214
fi
12151215
device_unactivated=$($ideviceactivation state | grep -c "Unactivated")
1216+
device_imei=$($ideviceinfo -k InternationalMobileEquipmentIdentity)
12161217
fi
12171218
;;
12181219
esac
@@ -1436,7 +1437,9 @@ device_get_info() {
14361437
device_det=1
14371438
fi
14381439
fi
1439-
if [[ -z $device_name || -z $device_proc ]]; then
1440+
if [[ $device_type == "AppleTV"* || $device_type == "Watch"* ]]; then
1441+
device_proc=11
1442+
elif [[ -z $device_name || -z $device_proc ]]; then
14401443
error "Unrecognized device $device_type. Enter the device type properly."
14411444
fi
14421445
if (( device_proc > 10 )); then
@@ -1520,12 +1523,20 @@ device_get_info() {
15201523
device_latest_vers="17.7.10"
15211524
device_latest_build="21H450"
15221525
;;
1523-
iPad7,1[12] )
1524-
device_latest_vers="18.7"
1525-
device_latest_build="22H20"
1526+
iPad7,1[12] | iPhone11,* )
1527+
device_latest_vers="18.7.1"
1528+
device_latest_build="22H31"
15261529
;;
15271530
esac
1528-
if (( device_proc > 10 )) && [[ $platform == "linux" ]]; then
1531+
# if latest vers is not set, copy use vers to latest
1532+
if [[ -z $device_latest_vers ]]; then
1533+
device_latest_vers=$device_use_vers
1534+
device_latest_build=$device_use_build
1535+
device_latest_bb=$device_use_bb
1536+
device_latest_bb_sha1=$device_use_bb_sha1
1537+
fi
1538+
# if still not set and on linux, get from ipsw.me
1539+
if [[ -z $device_latest_vers && $platform == "linux" ]]; then
15291540
log "Getting latest iOS version for $device_type"
15301541
rm -f tmp.json
15311542
$aria2c "https://api.ipsw.me/v4/device/$device_type?type=ipsw" -o tmp.json
@@ -1568,22 +1579,14 @@ device_get_info() {
15681579
fi
15691580
# enable activation records flag if device is a5(x)/a6(x), normal mode, and activated
15701581
if [[ $device_proc == 5 || $device_proc == 6 ]] && [[ -z $device_disable_actrec ]]; then
1571-
if [[ $device_mode == "Normal" && $device_unactivated != 1 ]]; then
1582+
if [[ $device_mode == "Normal" && $device_unactivated != 1 && $device_imei == "9900"* ]]; then
15721583
device_actrec=1
15731584
device_auto_actrec=1
15741585
elif [[ -s ../saved/$device_type/activation-$device_ecid.tar ]]; then
15751586
device_actrec=1
15761587
device_auto_actrec=2
15771588
fi
15781589
fi
1579-
# if latest vers is not set, copy use vers to latest
1580-
if [[ -z $device_latest_vers || -z $device_latest_build ]]; then
1581-
device_latest_vers=$device_use_vers
1582-
device_latest_build=$device_use_build
1583-
device_latest_bb=$device_use_bb
1584-
device_latest_bb_sha1=$device_use_bb_sha1
1585-
fi
1586-
15871590
if [[ $device_argmode == "none" ]]; then
15881591
device_mode="none"
15891592
device_vers="Unknown"
@@ -1702,11 +1705,11 @@ device_iproxy() {
17021705
device_find_all() {
17031706
# find device stuff from palera1n legacy
17041707
local opt
1705-
if [[ $1 == "norec" || $platform == "macos" || $mode == "device_dfuhelper" ]]; then
1708+
if [[ $1 == "norec" || $mode == "device_dfuhelper" ]]; then
17061709
return
17071710
fi
17081711
if [[ $platform == "macos" ]]; then
1709-
opt="$(system_profiler SPUSBDataType 2> /dev/null | grep -B1 'Vendor ID: 0x05ac' | grep 'Product ID:' | cut -dx -f2 | cut -d' ' -f1 | tail -r)"
1712+
opt="$(ioreg -p IOUSB -l 2>/dev/null | awk -F'= ' '/idVendor/ {v=$2} /idProduct/ {p=$2; if (v == 1452) printf "%04x\n", p}')"
17101713
elif [[ $platform == "linux" ]]; then
17111714
opt="$(lsusb | cut -d' ' -f6 | grep '05ac:' | cut -d: -f2)"
17121715
fi
@@ -2218,16 +2221,16 @@ device_send_meowing_ibss() {
22182221
}
22192222

22202223
ipwndfu_init() {
2221-
local ipwndfu_comm="624763e9903e523bcc0de8a9b44e35053ce72ac6"
2222-
local ipwndfu_sha1="398b1e74317373d0c9fdd2711581913810ced270"
2224+
local ipwndfu_comm="ea998f27d737611a30e0d10fbf251d66967022f6"
2225+
local ipwndfu_sha1="7eb59cc50d31078fa7bbc2fddb1e76f74e43c040"
22232226
ipwndfu="ipwndfu_python3"
22242227
if [[ $device_sudoloop == 1 ]]; then
22252228
psudo="sudo"
22262229
fi
22272230
if [[ $platform == "macos" ]] && (( mac_majver <= 11 )); then
22282231
ipwndfu="ipwndfu"
2229-
ipwndfu_comm="01108dc5dbd5353b4c93d9694d75d020187dfbb5"
2230-
ipwndfu_sha1="9aff74dbe947fec8ed8bda9c261c3526df3ca6e9"
2232+
ipwndfu_comm="2bc68605dd0dd31ab27fa720452e4ccd4e638d0d"
2233+
ipwndfu_sha1="88d8a39c3250d0603086c5ce6911c3df1b43e9cd"
22312234
fi
22322235
if [[ ! -s ../saved/$ipwndfu/ipwndfu || $(cat ../saved/$ipwndfu/sha1check) != "$ipwndfu_sha1" ]]; then
22332236
rm -rf ../saved/$ipwndfu
@@ -7213,8 +7216,11 @@ menu_print_info() {
72137216
warn "Jailbreak flag detected. Jailbreak option enabled."
72147217
fi
72157218
if [[ $device_proc != 1 ]] && (( device_proc < 7 )); then
7219+
case $device_proc in
7220+
[56] ) [[ $device_imei == "9900"* ]] && warn "Your device's IMEI starts with 9900. These devices are affected by an activation looping issue."
7221+
esac
72167222
if [[ $device_auto_actrec == 1 ]]; then
7217-
print "* Activated A${device_proc}(X) device detected. Activation record stitching enabled."
7223+
print "* Activated A${device_proc}(X) device with 9900 IMEI detected. Activation record stitching enabled."
72187224
elif [[ $device_auto_actrec == 2 ]]; then
72197225
print "* Existing activation records detected. Activation record stitching enabled."
72207226
elif [[ $device_actrec == 1 ]]; then
@@ -7289,7 +7295,7 @@ menu_main() {
72897295
iPad2,[123] ) menu_items+=("FourThree Utility");;
72907296
esac
72917297
fi
7292-
if [[ $device_proc != 1 && $device_type != "iPod2,1" ]]; then
7298+
if [[ $device_proc != 1 && $device_type != "iPod2,1" ]] && (( device_proc < 11 )); then
72937299
menu_items+=("Save SHSH Blobs")
72947300
fi
72957301
if [[ $device_mode == "Normal" ]]; then
@@ -7393,7 +7399,14 @@ menu_datamanage() {
73937399
selected="${menu_items[$?]}"
73947400
case $selected in
73957401
"Go Back" ) back=1;;
7396-
"Backup" ) mode="device_backup_create";;
7402+
"Backup" )
7403+
print "* A backup of your device will be created. Please see the notes above."
7404+
select_yesno
7405+
if [[ $? != 1 ]]; then
7406+
continue
7407+
fi
7408+
mode="device_backup_create"
7409+
;;
73977410
"Restore" ) menu_backup_restore;;
73987411
"Erase All Content and Settings" ) mode="device_erase";;
73997412
"Mount Device"* )
@@ -9266,9 +9279,12 @@ menu_usefulutilities() {
92669279
menu_items+=("Enter pwnDFU Mode")
92679280
fi
92689281
if (( device_proc <= 10 )) && [[ $device_latest_vers != "16"* && $device_checkm8ipad != 1 ]]; then
9269-
menu_items+=("SSH Ramdisk")
9282+
menu_items+=("SSH Ramdisk" "Update DateTime")
92709283
fi
9271-
menu_items+=("Run uicache" "Update DateTime" "DFU Mode Helper")
9284+
if [[ $device_mode == "Normal" ]]; then
9285+
menu_items+=("Run uicache")
9286+
fi
9287+
menu_items+=("DFU Mode Helper")
92729288
menu_items+=("Go Back")
92739289
menu_print_info
92749290
# other utilities menu
@@ -10473,8 +10489,6 @@ device_uicache() {
1047310489
}
1047410490

1047510491
device_backup_create() {
10476-
print "* A backup of your device will be created. Please see the notes above."
10477-
pause
1047810492
device_backup="../saved/backups/${device_ecid}_${device_type}/$(date +%Y-%m-%d-%H%M)"
1047910493
mkdir -p $device_backup
1048010494
pushd "$(dirname $device_backup)"

0 commit comments

Comments
 (0)