-
Notifications
You must be signed in to change notification settings - Fork 13
/
save.sh
49 lines (33 loc) · 1.57 KB
/
save.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
#!/bin/bash
rm -rf ~/.ssh/known_hosts
cd "$(dirname "$0")" || exit
run_ssh_command() {
./device/sshpass -p 'alpine' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@localhost -p2222 "$@"
}
copy_files() {
./device/sshpass -p 'alpine' scp -rP 2222 -o StrictHostKeyChecking=no root@localhost:"$1" "$2"
}
mkdir -p ./files
./device/iproxy 2222:22 > /dev/null 2>&1 &
echo "Mounting"
if ! run_ssh_command 'mount_filesystems'; then
osascript -e 'display dialog "Error: Failed to mount filesystems" with title "Error"'
fi
echo "Mounted!"
if ! copy_files "/mnt2/containers/Data/System/*/Library/activation_records/activation_record.plist" ./files/; then
osascript -e 'display dialog "Error: Failed to copy activation_record.plist" with title "Error"'
fi
if ! copy_files "/mnt2/containers/Data/System/*/Library/internal/data_ark.plist" ./files/; then
osascript -e 'display dialog "Error: Failed to copy data_ark.plist" with title "Error"'
fi
if ! copy_files "/mnt2/mobile/Library/FairPlay/" ./files/; then
osascript -e 'display dialog "Error: Failed to copy FairPlay folder" with title "Error"'
fi
if ! copy_files "/mnt2/wireless/Library/Preferences/com.apple.commcenter.device_specific_nobackup.plist/" ./files/; then
osascript -e 'display dialog "Error: Failed to copy com.apple.commcenter.device_specific_nobackup.plist" with title "Error"'
fi
if ! run_ssh_command '/sbin/reboot'; then
osascript -e 'display dialog "Error: Failed to reboot" with title "Error"'
fi
osascript -e 'display dialog "Activation files saved!" with title "Success"'
kill %1 > /dev/null 2>&1