diff options
author | Pacien TRAN-GIRARD | 2015-08-13 13:19:57 +0200 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2015-08-13 13:38:55 +0200 |
commit | 489432e1e6b1ba44ab60ebaeac3fee54722d79f9 (patch) | |
tree | 24b167f249e41a8359e1c94b4da5d62c03037c0a /root-vi7.sh | |
download | vi7-root-489432e1e6b1ba44ab60ebaeac3fee54722d79f9.tar.gz |
First (working) version
Diffstat (limited to 'root-vi7.sh')
-rw-r--r-- | root-vi7.sh | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/root-vi7.sh b/root-vi7.sh new file mode 100644 index 0000000..8bb5e61 --- /dev/null +++ b/root-vi7.sh | |||
@@ -0,0 +1,68 @@ | |||
1 | #!/system/bin/sh -x | ||
2 | |||
3 | # Chuwi Vi7 SuperSU install script <https://github.com/Pacien/vi7-root> | ||
4 | # Tailored for the stock Chuwi firmware | ||
5 | # Installation using the ADB root shell | ||
6 | # | ||
7 | # This script shall be executed if and only if the user is able to | ||
8 | # understand its purposes and possible implications. | ||
9 | # | ||
10 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
11 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
12 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
13 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
14 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
15 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
16 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
17 | |||
18 | mount -o rw,remount /system | ||
19 | |||
20 | SU_DIR=/data/local/tmp | ||
21 | ARCH=x86 | ||
22 | |||
23 | cp_chmod_chcon() { | ||
24 | cp $1 $2 | ||
25 | chmod $3 $2 | ||
26 | chcon $4 $2 | ||
27 | } | ||
28 | |||
29 | bckp() { | ||
30 | cp -p $1 $1.bckp | ||
31 | } | ||
32 | |||
33 | mkdir -p /system/app/SuperSU | ||
34 | cp_chmod_chcon $SU_DIR/common/Superuser.apk /system/app/SuperSU/SuperSU.apk 0644 u:object_r:system_file:s0 | ||
35 | |||
36 | cp_chmod_chcon $SU_DIR/common/install-recovery.sh /system/etc/install-recovery.sh 0755 u:object_r:toolbox_exec:s0 | ||
37 | |||
38 | bckp /system/bin/install-recovery.sh | ||
39 | rm /system/bin/install-recovery.sh | ||
40 | ln -s /system/etc/install-recovery.sh /system/bin/install-recovery.sh | ||
41 | |||
42 | mkdir -p /system/bin/.ext | ||
43 | cp_chmod_chcon $SU_DIR/$ARCH/su /system/xbin/su 0755 u:object_r:system_file:s0 | ||
44 | cp_chmod_chcon $SU_DIR/$ARCH/su /system/bin/.ext/.su 0755 u:object_r:system_file:s0 | ||
45 | cp_chmod_chcon $SU_DIR/$ARCH/su /system/xbin/daemonsu 0755 u:object_r:system_file:s0 | ||
46 | cp_chmod_chcon $SU_DIR/$ARCH/su /system/xbin/sugote 0755 u:object_r:zygote_exec:s0 | ||
47 | |||
48 | cp_chmod_chcon $SU_DIR/$ARCH/supolicy /system/xbin/supolicy 0755 u:object_r:system_file:s0 | ||
49 | cp_chmod_chcon $SU_DIR/$ARCH/libsupol.so /system/lib/libsupol.so 0644 u:object_r:system_file:s0 | ||
50 | |||
51 | cp_chmod_chcon /system/bin/sh /system/xbin/sugote-mksh 0755 u:object_r:system_file:s0 | ||
52 | |||
53 | cp_chmod_chcon /system/bin/app_process32 /system/bin/app_process32_original 0755 u:object_r:zygote_exec:s0 | ||
54 | cp_chmod_chcon /system/bin/app_process32 /system/bin/app_process_init 0755 u:object_r:system_file:s0 | ||
55 | |||
56 | rm /system/bin/app_process | ||
57 | ln -s /system/xbin/daemonsu /system/bin/app_process | ||
58 | |||
59 | rm /system/bin/app_process32 | ||
60 | ln -s /system/xbin/daemonsu /system/bin/app_process32 | ||
61 | |||
62 | #cp_chmod_chcon $SU_DIR/common/99SuperSUDaemon /system/etc/init.d/99SuperSUDaemon 0755 u:object_r:system_file:s0 # no init.d | ||
63 | |||
64 | touch /system/etc/.installed_su_daemon | ||
65 | |||
66 | rm -R /data/local/tmp/* | ||
67 | #mount -o ro,remount /system # done on reboot | ||
68 | /system/xbin/su --install | ||