-
Notifications
You must be signed in to change notification settings - Fork 0
/
bypassr1n.sh
executable file
·724 lines (616 loc) · 23.2 KB
/
bypassr1n.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
#!/usr/bin/env bash
mkdir -p logs
mkdir -p boot
set -e
log="last".log
cd logs
touch "$log"
cd ..
{
echo "[*] Command ran:`if [ $EUID = 0 ]; then echo " sudo"; fi` ./bypassra1n.sh $@"
# =========
# Variables
# =========
version="3.0"
os=$(uname)
dir="$(pwd)/binaries/$os"
max_args=1
arg_count=0
disk=8
if [ ! -d "ramdisk/" ]; then
git clone https://github.com/dualra1n/ramdisk.git
fi
# =========
# Functions
# =========
remote_cmd() {
sleep 1
"$dir"/sshpass -p 'alpine' ssh -o StrictHostKeyChecking=no -p2222 root@localhost "$@"
}
remote_cp() {
sleep 1
"$dir"/sshpass -p 'alpine' scp -r -o StrictHostKeyChecking=no -P2222 $@
}
step() {
rm -f .entered_dfu
for i in $(seq "$1" -1 0); do
if [[ -e .entered_dfu ]]; then
rm -f .entered_dfu
break
fi
if [[ $(get_device_mode) == "dfu" || ($1 == "10" && $(get_device_mode) != "none") ]]; then
touch .entered_dfu
fi &
printf '\r\e[K\e[1;36m%s (%d)' "$2" "$i"
sleep 1
done
printf '\e[0m\n'
}
print_help() {
cat << EOF
Usage: $0 [Options] [ subcommand | on ios 15 you have to use palera1n to jailbreak it when you jailbreak it you can bypass it
./bypass
Options:
--dualboot if you want bypass icloud in the dualboot use this ./bypassr1n.sh --bypass 14.3 --dualboot
--jail_palera1n Use this only when you already jailbroken with semitethered palera1n to avoid disk errors on bypass dualboot. ./bypassr1n.sh --bypass 14.3 --dualboot --jail_palera1n
--tethered bypass the main ios 13,14,15, use this if you have checkra1n or palera1n tethered jailbreak or semitethered (the device will bootloop if you try to boot without jailbreak). ./bypassra1n.sh --bypass 14.3, also if you want to bring back icloud you can use ./bypassra1n.sh --bypass 14.3 --back
--debug Debug the script
--backup-activations this command will save your activations files into activationsBackup/.
--restore-activations this command will put your activations files into the device.
Subcommands:
clean Deletes the created boot files
The iOS version argument should be the iOS version of your device.
It is required when starting from DFU mode.
EOF
}
parse_opt() {
case "$1" in
--)
no_more_opts=1
;;
--dualboot)
dualboot=1
;;
--tethered)
tethered=1
;;
--back)
back=1
;;
--jail_palera1n)
jail_palera1n=1
;;
--debug)
debug=1
;;
--backup-activations)
backup_activations=1
;;
--restore-activations)
restore_activations=1
;;
--help)
print_help
exit 0
;;
*)
echo "[-] Unknown option $1. Use $0 --help for help."
exit 1;
esac
}
parse_arg() {
arg_count=$((arg_count + 1))
case "$1" in
dfuhelper)
dfuhelper=1
;;
clean)
clean=1
;;
*)
version="$1"
;;
esac
}
parse_cmdline() {
for arg in $@; do
if [[ "$arg" == --* ]] && [ -z "$no_more_opts" ]; then
parse_opt "$arg";
elif [ "$arg_count" -lt "$max_args" ]; then
parse_arg "$arg";
else
echo "[-] Too many arguments. Use $0 --help for help.";
exit 1;
fi
done
}
recovery_fix_auto_boot() {
"$dir"/irecovery -c "setenv auto-boot true"
"$dir"/irecovery -c "saveenv"
}
_info() {
if [ "$1" = 'recovery' ]; then
echo $("$dir"/irecovery -q | grep "$2" | sed "s/$2: //")
elif [ "$1" = 'normal' ]; then
echo $("$dir"/ideviceinfo | grep "$2: " | sed "s/$2: //")
fi
}
_pwn() {
pwnd=$(_info recovery PWND)
if [ "$pwnd" = "" ]; then
echo "[*] Pwning device"
"$dir"/gaster pwn
sleep 2
#"$dir"/gaster reset
#sleep 1
fi
}
_reset() {
echo "[*] Resetting DFU state"
"$dir"/gaster reset
}
get_device_mode() {
if [ "$os" = "Darwin" ]; then
sp="$(system_profiler SPUSBDataType 2> /dev/null)"
apples="$(printf '%s' "$sp" | grep -B1 'Vendor ID: 0x05ac' | grep 'Product ID:' | cut -dx -f2 | cut -d' ' -f1 | tail -r)"
elif [ "$os" = "Linux" ]; then
apples="$(lsusb | cut -d' ' -f6 | grep '05ac:' | cut -d: -f2)"
fi
local device_count=0
local usbserials=""
for apple in $apples; do
case "$apple" in
12a8|12aa|12ab)
device_mode=normal
device_count=$((device_count+1))
;;
1281)
device_mode=recovery
device_count=$((device_count+1))
;;
1227)
device_mode=dfu
device_count=$((device_count+1))
;;
1222)
device_mode=diag
device_count=$((device_count+1))
;;
1338)
device_mode=checkra1n_stage2
device_count=$((device_count+1))
;;
4141)
device_mode=pongo
device_count=$((device_count+1))
;;
esac
done
if [ "$device_count" = "0" ]; then
device_mode=none
elif [ "$device_count" -ge "2" ]; then
echo "[-] Please attach only one device" > /dev/tty
kill -30 0
exit 1;
fi
if [ "$os" = "Linux" ]; then
usbserials=$(cat /sys/bus/usb/devices/*/serial)
elif [ "$os" = "Darwin" ]; then
usbserials=$(printf '%s' "$sp" | grep 'Serial Number' | cut -d: -f2- | sed 's/ //')
fi
if grep -qE '(ramdisk tool|SSHRD_Script) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [0-9]{1,2} [0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2}' <<< "$usbserials"; then
device_mode=ramdisk
fi
echo "$device_mode"
}
_wait() {
if [ "$(get_device_mode)" != "$1" ]; then
echo "[*] Waiting for device in $1 mode"
fi
while [ "$(get_device_mode)" != "$1" ]; do
sleep 1
done
if [ "$1" = 'recovery' ]; then
recovery_fix_auto_boot;
fi
}
_dfuhelper() {
local step_one;
deviceid=$( [ -z "$deviceid" ] && _info normal ProductType || echo $deviceid )
if [[ "$1" = 0x801* && "$deviceid" != *"iPad"* ]]; then
step_one="Hold volume down + side button"
else
step_one="Hold home + power button"
fi
echo "[*] To get into DFU mode, you will be guided through 2 steps:"
echo "[*] Press any key when ready for DFU mode"
read -n 1 -s
step 3 "Get ready"
step 4 "$step_one" &
sleep 3
"$dir"/irecovery -c "reset" &
sleep 1
if [[ "$1" = 0x801* && "$deviceid" != *"iPad"* ]]; then
step 10 'Release side button, but keep holding volume down'
else
step 10 'Release power button, but keep holding home button'
fi
sleep 1
if [ "$(get_device_mode)" = "recovery" ]; then
_dfuhelper
fi
if [ "$(get_device_mode)" = "dfu" ]; then
echo "[*] Device entered DFU!"
else
echo "[-] Device did not enter DFU mode, rerun the script and try again"
return -1
fi
}
_kill_if_running() {
if (pgrep -u root -x "$1" &> /dev/null > /dev/null); then
# yes, it's running as root. kill it
sudo killall $1 &> /dev/null
else
if (pgrep -x "$1" &> /dev/null > /dev/null); then
killall $1 &> /dev/null
fi
fi
}
ask_reboot_or_exit() {
while true; do
echo -n "Would you like to reboot your device or exit? (reboot/exit): "
read -r choice
case $choice in
reboot)
echo "[*] Rebooting the device..."
remote_cmd "/usr/sbin/nvram auto-boot=true"
remote_cmd "/sbin/reboot"
break
;;
exit)
echo "[*] Exiting the script..."
break;
;;
*)
echo "[!] Invalid option. Please enter 'reboot' or 'exit'."
;;
esac
done
}
_exit_handler() {
if [ "$os" = "Darwin" ]; then
killall -CONT AMPDevicesAgent AMPDeviceDiscoveryAgent MobileDeviceUpdater || true
fi
[ $? -eq 0 ] && exit
echo "[-] An error occurred"
if [ -d "logs" ]; then
cd logs
mv "$log" FAIL_${log}
cd ..
fi
echo "[*] A failure log has been made. If you're going ask for help, please attach the latest log."
}
trap _exit_handler EXIT
# ===========
# Fixes
# ===========
# Prevent Finder from complaning
if [ "$os" = "Linux" ]; then
/bin/chmod +x getSSHOnLinux.sh
sudo bash ./getSSHOnLinux.sh &
fi
if [ "$os" = 'Linux' ]; then
linux_cmds='lsusb'
fi
for cmd in curl unzip python3 git ssh scp killall sudo grep pgrep ${linux_cmds}; do
if ! command -v "${cmd}" > /dev/null; then
echo "[-] Command '${cmd}' not installed, please install it!";
cmd_not_found=1
fi
done
if [ "$cmd_not_found" = "1" ]; then
exit 1
fi
# Check for pyimg4
if ! python3 -c 'import pkgutil; exit(not pkgutil.find_loader("pyimg4"))'; then
echo '[-] pyimg4 not installed. Press any key to install it, or press ctrl + c to cancel'
read -n 1 -s
python3 -m pip install pyimg4
fi
# ============disk0s1s
# Prep
# ============
# Update submodules
git submodule update --init --recursive
# Re-create work dir if it exists, else, make it
if [ -e work ]; then
rm -rf work
mkdir work
else
mkdir work
fi
/bin/chmod +x "$dir"/*
#if [ "$os" = 'Darwin' ]; then
# xattr -d com.apple.quarantine "$dir"/*
#fi
# ============
# Start
# ============
echo "dualboot | Bypass :)"
echo "Written by edwin "
echo ""
parse_cmdline "$@"
if [ "$debug" = "1" ]; then
set -o xtrace
fi
if [ "$clean" = "1" ]; then
rm -rf work blobs/ boot/$deviceid/ ipsw/*
echo "[*] Removed the created boot files"
exit
fi
# Get device's iOS version from ideviceinfo if in normal mode
echo "[*] Waiting for devices"
while [ "$(get_device_mode)" = "none" ]; do
sleep 1;
done
echo $(echo "[*] Detected $(get_device_mode) mode device" | sed 's/dfu/DFU/')
if grep -E 'pongo|checkra1n_stage2|diag' <<< "$(get_device_mode)"; then
echo "[-] Detected device in unsupported mode '$(get_device_mode)'"
exit 1;
fi
if [ "$(get_device_mode)" != "normal" ] && [ -z "$version" ] && [ "$dfuhelper" != "1" ]; then
echo "[-] You must pass the version your device is on when not starting from normal mode"
exit
fi
if [ "$(get_device_mode)" = "ramdisk" ]; then
# If a device is in ramdisk mode, perhaps iproxy is still running?
_kill_if_running iproxy
echo "[*] Rebooting device in SSH Ramdisk"
if [ "$os" = 'Linux' ]; then
sudo "$dir"/iproxy 2222 22 >/dev/null &
else
"$dir"/iproxy 2222 22 >/dev/null &
fi
sleep 1
remote_cmd "/sbin/reboot"
_kill_if_running iproxy
_wait recovery
fi
if [ "$(get_device_mode)" = "normal" ]; then
version=${version:-$(_info normal ProductVersion)}
arch=$(_info normal CPUArchitecture)
if [ "$arch" = "arm64e" ]; then
echo "[-] BYPASS doesn't, and never will, work on non-checkm8 devices"
exit
fi
echo "Hello, $(_info normal ProductType) on $version!"
echo "[*] Switching device into recovery mode..."
"$dir"/ideviceenterrecovery $(_info normal UniqueDeviceID)
_wait recovery
fi
# Grab more info
echo "[*] Getting device info..."
cpid=$(_info recovery CPID)
model=$(_info recovery MODEL)
deviceid=$(_info recovery PRODUCT)
ECID=$(_info recovery ECID)
echo "$cpid"
echo "$model"
echo "$deviceid"
if [ "$dfuhelper" = "1" ]; then
echo "[*] Running DFU helper"
_dfuhelper "$cpid"
exit
fi
# Have the user put the device into DFU
if [ "$(get_device_mode)" != "dfu" ]; then
recovery_fix_auto_boot;
_dfuhelper "$cpid" || {
echo "[-] failed to enter DFU mode, run bypassra1n.sh again"
exit -1
}
fi
sleep 2
# ============
# Ramdisk
# ============
# Dump blobs, and install pogo if needed
if [ true ]; then
mkdir -p blobs
cd ramdisk
/bin/chmod +x sshrd.sh
echo "[*] Creating ramdisk"
./sshrd.sh $(if [[ $version == 16.* ]]; then echo "16.0.3"; else echo "15.6"; fi)
echo "[*] Booting ramdisk"
./sshrd.sh boot
cd ..
# remove special lines from known_hosts
if [ -f ~/.ssh/known_hosts ]; then
if [ "$os" = "Darwin" ]; then
sed -i.bak '/localhost/d' ~/.ssh/known_hosts
sed -i.bak '/127\.0\.0\.1/d' ~/.ssh/known_hosts
elif [ "$os" = "Linux" ]; then
sed -i '/localhost/d' ~/.ssh/known_hosts
sed -i '/127\.0\.0\.1/d' ~/.ssh/known_hosts
fi
fi
# Execute the commands once the rd is booted
if [ "$os" = 'Linux' ]; then
sudo "$dir"/iproxy 2222 22 >/dev/null &
else
"$dir"/iproxy 2222 22 >/dev/null &
fi
if ! ("$dir"/sshpass -p 'alpine' ssh -o StrictHostKeyChecking=no -p2222 root@localhost "echo connected" &> /dev/null); then
echo "[*] Waiting for the ramdisk to finish booting"
fi
i=1
while ! ("$dir"/sshpass -p 'alpine' ssh -o StrictHostKeyChecking=no -p2222 root@localhost "echo connected" &> /dev/null); do
sleep 1
i=$((i+1))
if [ "$i" == 15 ]; then
if [ "$os" = 'Linux' ]; then
echo -e "as a sudo user or your user, you should execute in another terminal: \e[1;37mssh-keygen -f /root/.ssh/known_hosts -R \"[localhost]:2222\"\e[0m"
read -p "Press [ENTER] to continue"
else
echo "mmm that looks like that ssh it's not working try to reboot your computer or send the log file trough discord"
read -p "Press [ENTER] to continue"
fi
fi
done
echo $disk
echo "[*] Testing for baseband presence"
if [ "$(remote_cmd "/usr/bin/mgask HasBaseband | grep -E 'true|false'")" = "true" ] && [[ "${cpid}" == *"0x700"* ]]; then # checking if your device has baseband
disk=7
elif [ "$(remote_cmd "/usr/bin/mgask HasBaseband | grep -E 'true|false'")" = "false" ]; then
if [[ "${cpid}" == *"0x700"* ]]; then
disk=6
else
disk=7
fi
fi
# that is in order to know the partitions needed
if [ "$dualboot" = "1" ]; then
if [ "$jail_palera1n" = "1" ]; then
disk=$(($disk + 1)) # if you have the palera1n jailbreak that will create + 1 partition for example your jailbreak is installed on disk0s1s8 that will create a new partition on disk0s1s9 so only you have to use it if you have palera1n
fi
fi
echo $disk
dataB=$(($disk + 1))
prebootB=$(($dataB + 1))
echo $dataB
echo $prebootB
if [ "$backup_activations" = "1" ] || [ "$restore_activations" = "1" ] && [ "$dualboot" = "1" ]; then
remote_cmd "/sbin/mount_apfs /dev/disk0s1s${disk} /mnt1/"
remote_cmd "/sbin/mount_apfs /dev/disk0s1s${dataB} /mnt2/"
else
remote_cmd "/usr/bin/mount_filesystems"
fi
if [ "$backup_activations" = "1" ]; then
echo "[*] backup activations files ..."
activationsDir=$(remote_cmd 'find /mnt2/containers/Data/System/ -type d | grep internal | sed "s|/internal.*||"')
if ! remote_cmd "[ -f "$activationsDir/activation_records/activation_record.plist" ]"; then
echo "[*] sadly we couldn't find the activation file, it could be because your device is not activated"
ask_reboot_or_exit
exit;
fi
echo "[*] activation file detected"
echo "[*] backuping up ..."
remote_cmd "mkdir -p /mnt1/activationsBackup/"
remote_cmd "cp -rf $activationsDir/activation_records /mnt1/activationsBackup"
remote_cmd "cp -rf $activationsDir/internal /mnt1/activationsBackup"
remote_cmd "cp -rf /mnt2/mobile/Library/FairPlay /mnt1/activationsBackup"
remote_cmd "cp -rf /mnt2/wireless/Library/Preferences/com.apple.commcenter.device_specific_nobackup.plist /mnt1/activationsBackup"
mkdir -p activationsBackup/
mkdir -p "activationsBackup/$ECID/"
remote_cp root@localhost:/mnt1/activationsBackup/ "activationsBackup/$ECID/"
echo "[*] we saved activations files in activationsBackup/$ECID/"
echo "[*] Rebooting the device..."
remote_cmd "/usr/sbin/nvram auto-boot=true"
remote_cmd "/sbin/reboot"
exit 0;
fi
if [ "$restore_activations" = "1" ]; then
if [ ! -f "activationsBackup/$ECID/activationsBackup/activation_records/activation_record.plist" ]; then
echo "[!] it looks like you don't have activations files saved in activationsBackup/$ECID"
ask_reboot_or_exit
exit;
fi
echo "[*] restoring activations files ..."
activationsDir=$(remote_cmd 'find /mnt2/containers/Data/System/ -type d | grep internal | sed "s|/internal.*||"')
if ! remote_cmd "[ ! -f \"$activationsDir/internal\" ]"; then
echo "[*] sadly we couldn't find the activaton directory in /mnt2/containers/Data/System/"
ask_reboot_or_exit
exit
fi
echo "[*] activation directory detected in $activationsDir"
echo "[*] copying activations files"
remote_cmd "
if [ -d \"$activationsDir/activation_records/\" ]; then
chflags -fR nouchg \"$activationsDir/activation_records/\";
fi
if [ -f \"$activationsDir/internal/data_ark.plist\" ]; then
chflags -fR nouchg \"$activationsDir/internal/data_ark.plist\";
fi
if [ -f \"/mnt2/wireless/Library/Preferences/com.apple.commcenter.device_specific_nobackup.plist\" ]; then
chflags -fR nouchg \"/mnt2/wireless/Library/Preferences/com.apple.commcenter.device_specific_nobackup.plist\";
fi
"
remote_cmd "mkdir -p /mnt2/mobile/Media/Downloads/activationsBackup"
remote_cp activationsBackup/"$ECID"/activationsBackup root@localhost:/mnt2/mobile/Media/Downloads/
remote_cmd "chflags -fR nouchg /mnt2/mobile/Media/Downloads/activationsBackup"
remote_cmd "/usr/sbin/chown -R mobile:mobile /mnt2/mobile/Media/Downloads/activationsBackup"
remote_cmd "/bin/chmod -R 755 /mnt2/mobile/Media/Downloads/activationsBackup"
remote_cmd "/bin/chmod 644 /mnt2/mobile/Media/Downloads/activationsBackup/internal/data_ark.plist /mnt2/mobile/Media/Downloads/activationsBackup/activation_records/activation_record.plist /mnt2/mobile/Media/Downloads/activationsBackup/com.apple.commcenter.device_specific_nobackup.plist"
remote_cmd "/bin/chmod 664 /mnt2/mobile/Media/Downloads/activationsBackup/FairPlay/iTunes_Control/iTunes/IC-Info.sisv"
remote_cmd "cp -rf /mnt2/mobile/Media/Downloads/activationsBackup/activation_records $activationsDir/"
remote_cmd "cp -rf /mnt2/mobile/Media/Downloads/activationsBackup/internal $activationsDir/"
remote_cmd "cp -rf /mnt2/mobile/Media/Downloads/activationsBackup/FairPlay /mnt2/mobile/Library/"
remote_cmd "cp -rf /mnt2/mobile/Media/Downloads/activationsBackup/com.apple.commcenter.device_specific_nobackup.plist /mnt2/wireless/Library/Preferences/com.apple.commcenter.device_specific_nobackup.plist"
remote_cmd "/bin/chmod -R 755 /mnt2/mobile/Library/FairPlay/"
remote_cmd "/usr/sbin/chown -R mobile:mobile /mnt2/mobile/Library/FairPlay/"
remote_cmd "/bin/chmod 664 /mnt2/mobile/Library/FairPlay/iTunes_Control/iTunes/IC-Info.sisv"
remote_cmd "/bin/chmod -R 777 $activationsDir/activation_records/"
remote_cmd "chflags -R uchg $activationsDir/activation_records/"
remote_cmd "/bin/chmod 755 $activationsDir/internal/data_ark.plist"
remote_cmd "chflags -R uchg $activationsDir/internal/data_ark.plist"
remote_cmd "/usr/sbin/chown root:mobile /mnt2/wireless/Library/Preferences/com.apple.commcenter.device_specific_nobackup.plist"
remote_cmd "/bin/chmod 755 /mnt2/wireless/Library/Preferences/com.apple.commcenter.device_specific_nobackup.plist"
remote_cmd "chflags uchg /mnt2/wireless/Library/Preferences/com.apple.commcenter.device_specific_nobackup.plist"
echo "[*] we restored activation files from activationsBackup/$ECID/"
echo "[*] Rebooting the device..."
remote_cmd "/usr/sbin/nvram auto-boot=true"
remote_cmd "/sbin/reboot"
exit 0;
fi
has_active=$(remote_cmd "ls /mnt6/active" 2> /dev/null)
if [ ! "$has_active" = "/mnt6/active" ]; then
echo "[!] Active file does not exist! Please use SSH to create it"
echo " /mnt6/active should contain the name of the UUID in /mnt6"
echo " When done, type reboot in the SSH session, then rerun the script"
echo " ssh root@localhost -p 2222"
exit
fi
active=$(remote_cmd "cat /mnt6/active" 2> /dev/null)
if [ "$dualboot" = "1" ]; then
remote_cmd "/sbin/mount_apfs /dev/disk0s1s${disk} /mnt8/"
remote_cmd "/sbin/mount_apfs /dev/disk0s1s${dataB} /mnt9/"
if [ "$back" = "1" ]; then
remote_cmd "mv /mnt8/usr/libexec/mobileactivationdBackup /mnt8/usr/libexec/mobileactivationd "
echo "DONE. bring BACK icloud " # that will bring back the normal icloud
remote_cmd "/sbin/reboot"
exit;
fi
if [ $(remote_cmd "cp -av /mnt2/root/Library/Lockdown/* /mnt9/root/Library/Lockdown/.") ]; then
echo "[*] GOT IT, COPIED THE LOCKDOWN FROM THE MAIN IOS ..."
fi
remote_cmd "mv /mnt8/usr/libexec/mobileactivationd /mnt8/usr/libexec/mobileactivationdBackup " # that will remplace mobileactivationd hacked
remote_cp other/mobileactivationd root@localhost:/mnt8/usr/libexec/
remote_cmd "ldid -e /mnt8/usr/libexec/mobileactivationdBackup > /mnt8/mob.plist"
remote_cmd "ldid -S/mnt8/mob.plist /mnt8/usr/libexec/mobileactivationd"
remote_cmd "rm -rv /mnt8/mob.plist"
remote_cmd "/usr/sbin/nvram auto-boot=true"
echo "thank you for share mobileactivationd @matty"
echo "[*] DONE ... now reboot and boot using dualra1n"
remote_cmd "/sbin/reboot"
exit;
fi
if [ "$tethered" = "1" ]; then # use this if you just have tethered jailbreak
if [ "$back" = "1" ]; then
remote_cmd "mv /mnt1/usr/libexec/mobileactivationdBackup /mnt1/usr/libexec/mobileactivationd "
echo "DONE. bring BACK icloud " # that will bring back the normal icloud
remote_cmd "/sbin/reboot"
exit;
fi
remote_cmd "mv -i /mnt1/usr/libexec/mobileactivationd /mnt1/usr/libexec/mobileactivationdBackup " # that will remplace mobileactivationd hacked
remote_cp other/mobileactivationd root@localhost:/mnt1/usr/libexec/
remote_cmd "ldid -e /mnt1/usr/libexec/mobileactivationdBackup > /mnt1/mob.plist"
remote_cmd "ldid -S/mnt1/mob.plist /mnt1/usr/libexec/mobileactivationd"
remote_cmd "rm -rv /mnt1/mob.plist"
remote_cmd "/usr/sbin/nvram auto-boot=false"
echo "[*] Thank you for share the mobileactivationd @Hacktivation"
echo "[*] Please now try to boot jailbroke in order to that the bypass work"
echo "[*] DONE ... now reboot and boot jailbroken using palera1n or checkra1n"
remote_cmd "/sbin/reboot"
fi
fi
} 2>&1 | tee logs/${log}