forked from ei9h7/64-bit-SSH-Ramdisk
-
Notifications
You must be signed in to change notification settings - Fork 1
/
load.sh
96 lines (78 loc) · 2.34 KB
/
load.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
#!/bin/bash
set -e
echo "64-bit Ramdisk Loader v0.17.1 by meowcat454"
echo "-----------------------------------------"
usage() {
echo "Usage: load.sh [devicetype]"
echo " devicetype: specify device model"
echo "Examples: "
echo "'bash load.sh iPhone9,2'"
}
if [ -z "$1" ]; then
usage
exit
fi
device=$1
if [ "$2" == "-b" ]; then
boot=1
dirprefix=bootchain
else
boot=0
dirprefix=SSH-Ramdisk
fi
if ! [ -d "$dirprefix-$device" ]; then
echo "Ramdisk folder not found, run create.sh to create one."
exit 1
fi
cd $dirprefix-$device
if ! [ -e iBoot.img4 ]; then
if ! [ -f iBSS.img4 ]; then echo "ERROR: iBSS not found!"; exit 1; fi
if ! [ -f iBEC.img4 ]; then echo "ERROR: iBEC not found!"; exit 1; fi
fi
if ! [ -f bootlogo.img4 ]; then echo "ERROR: Boot logo not found!"; exit 1; fi
if ! [ -f devicetree.img4 ]; then echo "ERROR: Device tree not found!"; exit 1; fi
if [ "$2" != "-b" ] && ! [ -f ramdisk ]; then echo "ERROR: Ramdisk not found!"; exit 1; fi
if ! [ -f kernelcache.img4 ]; then echo "ERROR: Kernelcache not found!"; exit 1; fi
#read -p "Enter pwned DFU mode, then press Enter to continue." -n1 -s
if [ -e iBoot.img4 ]; then # A10/A11 device
echo "Sending iBoot..."
../resources/bin/irecovery -f iBoot.img4
sleep 2
../resources/bin/irecovery -f iBoot.img4
else
echo "Sending iBSS..."
../resources/bin/irecovery -f iBSS.img4
sleep 2
../resources/bin/irecovery -f iBSS.img4
sleep 2
echo "Sending iBEC..."
../resources/bin/irecovery -f iBEC.img4
fi
sleep 3
../resources/bin/irecovery -c "bgcolor 11 45 113"
echo "Sending logo..."
../resources/bin/irecovery -f bootlogo.img4
../resources/bin/irecovery -c "setpicture 5"
sleep 1
echo "Sending device tree..."
../resources/bin/irecovery -f devicetree.img4
../resources/bin/irecovery -c devicetree
sleep 2
if [ "$2" != "-b" ]; then
echo "Sending ramdisk..."
../resources/bin/irecovery -f ramdisk
../resources/bin/irecovery -c ramdisk
fi
# iOS 11 and later need trustcache files
if [ -e trustcache ]; then
echo "Sending trustcache..."
../resources/bin/irecovery -f trustcache
../resources/bin/irecovery -c firmware
fi
sleep 1
echo "Sending kernelcache..."
../resources/bin/irecovery -f kernelcache.img4
echo "Booting device now..."
../resources/bin/irecovery -c bootx
echo "Finished! If all the progress bars are 100%, you should see a verbose boot then the apple logo."
cd ..