-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathroot.sh
executable file
·54 lines (46 loc) · 1.23 KB
/
root.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
#!/bin/bash
echo "Connect your phone with computer and prepare to root"
echo "USB debugging mode must be enabled"
echo "Do not disconnect USB cable while rooting"
echo "Whole process can take up to 10 minutes, please be patient"
cd $(dirname "${0}")
adb wait-for-device
adb reboot bootloader
sleep 20
echo
echo "Unlocking fastboot"
echo "--- log ---"
fastboot flash fastboot files/root/fastboot.img
fastboot reboot-bootloader
echo "--- end log ---"
sleep 20
echo
echo "Unlocking bootloader"
echo "--- log ---"
fastboot flash dnx files/vanilla/dnx_fwr_ctp_a500cg.bin
fastboot flash ifwi files/root/ifwi_ctp_a500cg.bin
fastboot reboot-bootloader
echo "--- end log ---"
sleep 180
echo
echo "Rooting phone"
echo "--- log ---"
fastboot flash recovery files/root/recovery.img
sleep 5
fastboot flash update files/root/dummy.zip
adb wait-for-device
adb reboot bootloader
echo "--- end log ---"
sleep 20
echo
echo "Restoring vanilla files"
echo "--- log ---"
fastboot flash fastboot files/vanilla/fastboot.img
fastboot flash recovery files/vanilla/recovery.img
sleep 5
fastboot flash dnx files/vanilla/dnx_fwr_ctp_a500cg.bin
fastboot flash ifwi files/vanilla/ifwi_ctp_a500cg.bin
fastboot reboot
echo "--- end log ---"
echo
echo "All done, enjoy your rooted phone"