aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2015-08-13 13:19:57 +0200
committerPacien TRAN-GIRARD2015-08-13 13:38:55 +0200
commit489432e1e6b1ba44ab60ebaeac3fee54722d79f9 (patch)
tree24b167f249e41a8359e1c94b4da5d62c03037c0a
downloadvi7-root-489432e1e6b1ba44ab60ebaeac3fee54722d79f9.tar.gz
First (working) version
-rw-r--r--readme.md102
-rw-r--r--root-vi7.sh68
2 files changed, 170 insertions, 0 deletions
diff --git a/readme.md b/readme.md
new file mode 100644
index 0000000..ed20e24
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,102 @@
1Vi7 root install script
2=======================
3
4This repository contains a tailored version of the SuperSU install script.
5It is intended to work exclusively on the Chuwi Vi7 tablet running the almost stock Android 5.1 firmware.
6
7This script, which is meant to be run in an ADB root shell, simply copies the root binaries to the `/system` partition and applies the right permissions to those.
8
9
10Disclaimer
11----------
12
13This procedure shall be followed if and only if the reader is fully able to understand its purposes and possible implications.
14
15As always, THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
17
18Prerequisites
19-------------
20
21- [ADB platform-tools](https://developer.android.com/tools/sdk/tools-notes.html)
22- [SuperSU Update zip archive (v2.46)](https://download.chainfire.eu/696/SuperSU)
23
24
25
26Rooting procedure
27-----------------
28
29### Disabling `verity`
30
31Disabling verity is required to be able to boot an altered `/system` partition.
32
33```bash
34adb root
35adb disable-verity
36adb reboot
37```
38
39### Copying required files
40
41The SuperSU Update archive has to be unzipped and both its content and the custom install script have to be sent to the device.
42
43```bash
44adb root
45adb push UPDATE-SuperSU-v2.46 /data/local/tmp/
46adb push root-vi7.sh /data/local/tmp/
47```
48
49### Running the install script
50
51Running the custom installation script will:
52
53- try to remount the `/system` partition in read and write mode,
54- copy the necessary binaries,
55- applies the right permissions to those,
56- complete the `su` binary installation,
57- remove the temporary files sent to the device in `/data/local/tmp/`.
58
59
60```bash
61adb shell /system/bin/sh -x /data/local/tmp/root-vi7.sh
62```
63
64### Installing the GUI
65
66The SuperSU APK is provided in the SuperSU Update archive and should be installed using ADB. A confirmation dialog may appear on the device.
67
68```bash
69adb install UPDATE-SuperSU-v2.46/common/Superuser.apk
70```
71
72Optionnally, the reader may want to install a root checking app like [Root Checker](https://www.apkmirror.com/apk/joeykrim/root-checker-basic/root-checker-basic-5-5-3-android-apk-download/)
73
74```bash
75adb install com.joeykrim.rootcheck-5.5.3-94-minAPI11.apk
76```
77
78### Reboot
79
80A reboot of the device is required to complete the procedure.
81
82```bash
83adb reboot
84```
85
86
87Following updates
88-----------------
89
90Vendor's OTA updates or SuperSU APK and binary updates may break the aquired root. It is advised to avoid any of these updates.
91
92
93Disaster recovery
94-----------------
95
96It is reminded to the reader that flashing the factory image should still be possible in the case of a bootloop. This kind of image may be obtained on dedicated forums.
97
98
99Enhancements
100------------
101
102Pull requests aimed to correct or enhance this procedure are welcome.
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
18mount -o rw,remount /system
19
20SU_DIR=/data/local/tmp
21ARCH=x86
22
23cp_chmod_chcon() {
24 cp $1 $2
25 chmod $3 $2
26 chcon $4 $2
27}
28
29bckp() {
30 cp -p $1 $1.bckp
31}
32
33mkdir -p /system/app/SuperSU
34cp_chmod_chcon $SU_DIR/common/Superuser.apk /system/app/SuperSU/SuperSU.apk 0644 u:object_r:system_file:s0
35
36cp_chmod_chcon $SU_DIR/common/install-recovery.sh /system/etc/install-recovery.sh 0755 u:object_r:toolbox_exec:s0
37
38bckp /system/bin/install-recovery.sh
39rm /system/bin/install-recovery.sh
40ln -s /system/etc/install-recovery.sh /system/bin/install-recovery.sh
41
42mkdir -p /system/bin/.ext
43cp_chmod_chcon $SU_DIR/$ARCH/su /system/xbin/su 0755 u:object_r:system_file:s0
44cp_chmod_chcon $SU_DIR/$ARCH/su /system/bin/.ext/.su 0755 u:object_r:system_file:s0
45cp_chmod_chcon $SU_DIR/$ARCH/su /system/xbin/daemonsu 0755 u:object_r:system_file:s0
46cp_chmod_chcon $SU_DIR/$ARCH/su /system/xbin/sugote 0755 u:object_r:zygote_exec:s0
47
48cp_chmod_chcon $SU_DIR/$ARCH/supolicy /system/xbin/supolicy 0755 u:object_r:system_file:s0
49cp_chmod_chcon $SU_DIR/$ARCH/libsupol.so /system/lib/libsupol.so 0644 u:object_r:system_file:s0
50
51cp_chmod_chcon /system/bin/sh /system/xbin/sugote-mksh 0755 u:object_r:system_file:s0
52
53cp_chmod_chcon /system/bin/app_process32 /system/bin/app_process32_original 0755 u:object_r:zygote_exec:s0
54cp_chmod_chcon /system/bin/app_process32 /system/bin/app_process_init 0755 u:object_r:system_file:s0
55
56rm /system/bin/app_process
57ln -s /system/xbin/daemonsu /system/bin/app_process
58
59rm /system/bin/app_process32
60ln -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
64touch /system/etc/.installed_su_daemon
65
66rm -R /data/local/tmp/*
67#mount -o ro,remount /system # done on reboot
68/system/xbin/su --install