From 489432e1e6b1ba44ab60ebaeac3fee54722d79f9 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Thu, 13 Aug 2015 13:19:57 +0200 Subject: First (working) version --- readme.md | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ root-vi7.sh | 68 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 170 insertions(+) create mode 100644 readme.md create mode 100644 root-vi7.sh diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..ed20e24 --- /dev/null +++ b/readme.md @@ -0,0 +1,102 @@ +Vi7 root install script +======================= + +This repository contains a tailored version of the SuperSU install script. +It is intended to work exclusively on the Chuwi Vi7 tablet running the almost stock Android 5.1 firmware. + +This 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. + + +Disclaimer +---------- + +This procedure shall be followed if and only if the reader is fully able to understand its purposes and possible implications. + +As 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. + + +Prerequisites +------------- + +- [ADB platform-tools](https://developer.android.com/tools/sdk/tools-notes.html) +- [SuperSU Update zip archive (v2.46)](https://download.chainfire.eu/696/SuperSU) + + + +Rooting procedure +----------------- + +### Disabling `verity` + +Disabling verity is required to be able to boot an altered `/system` partition. + +```bash +adb root +adb disable-verity +adb reboot +``` + +### Copying required files + +The SuperSU Update archive has to be unzipped and both its content and the custom install script have to be sent to the device. + +```bash +adb root +adb push UPDATE-SuperSU-v2.46 /data/local/tmp/ +adb push root-vi7.sh /data/local/tmp/ +``` + +### Running the install script + +Running the custom installation script will: + +- try to remount the `/system` partition in read and write mode, +- copy the necessary binaries, +- applies the right permissions to those, +- complete the `su` binary installation, +- remove the temporary files sent to the device in `/data/local/tmp/`. + + +```bash +adb shell /system/bin/sh -x /data/local/tmp/root-vi7.sh +``` + +### Installing the GUI + +The SuperSU APK is provided in the SuperSU Update archive and should be installed using ADB. A confirmation dialog may appear on the device. + +```bash +adb install UPDATE-SuperSU-v2.46/common/Superuser.apk +``` + +Optionnally, 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/) + +```bash +adb install com.joeykrim.rootcheck-5.5.3-94-minAPI11.apk +``` + +### Reboot + +A reboot of the device is required to complete the procedure. + +```bash +adb reboot +``` + + +Following updates +----------------- + +Vendor's OTA updates or SuperSU APK and binary updates may break the aquired root. It is advised to avoid any of these updates. + + +Disaster recovery +----------------- + +It 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. + + +Enhancements +------------ + +Pull 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 @@ +#!/system/bin/sh -x + +# Chuwi Vi7 SuperSU install script +# Tailored for the stock Chuwi firmware +# Installation using the ADB root shell +# +# This script shall be executed if and only if the user is able to +# understand its purposes and possible implications. +# +# 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. + +mount -o rw,remount /system + +SU_DIR=/data/local/tmp +ARCH=x86 + +cp_chmod_chcon() { + cp $1 $2 + chmod $3 $2 + chcon $4 $2 +} + +bckp() { + cp -p $1 $1.bckp +} + +mkdir -p /system/app/SuperSU +cp_chmod_chcon $SU_DIR/common/Superuser.apk /system/app/SuperSU/SuperSU.apk 0644 u:object_r:system_file:s0 + +cp_chmod_chcon $SU_DIR/common/install-recovery.sh /system/etc/install-recovery.sh 0755 u:object_r:toolbox_exec:s0 + +bckp /system/bin/install-recovery.sh +rm /system/bin/install-recovery.sh +ln -s /system/etc/install-recovery.sh /system/bin/install-recovery.sh + +mkdir -p /system/bin/.ext +cp_chmod_chcon $SU_DIR/$ARCH/su /system/xbin/su 0755 u:object_r:system_file:s0 +cp_chmod_chcon $SU_DIR/$ARCH/su /system/bin/.ext/.su 0755 u:object_r:system_file:s0 +cp_chmod_chcon $SU_DIR/$ARCH/su /system/xbin/daemonsu 0755 u:object_r:system_file:s0 +cp_chmod_chcon $SU_DIR/$ARCH/su /system/xbin/sugote 0755 u:object_r:zygote_exec:s0 + +cp_chmod_chcon $SU_DIR/$ARCH/supolicy /system/xbin/supolicy 0755 u:object_r:system_file:s0 +cp_chmod_chcon $SU_DIR/$ARCH/libsupol.so /system/lib/libsupol.so 0644 u:object_r:system_file:s0 + +cp_chmod_chcon /system/bin/sh /system/xbin/sugote-mksh 0755 u:object_r:system_file:s0 + +cp_chmod_chcon /system/bin/app_process32 /system/bin/app_process32_original 0755 u:object_r:zygote_exec:s0 +cp_chmod_chcon /system/bin/app_process32 /system/bin/app_process_init 0755 u:object_r:system_file:s0 + +rm /system/bin/app_process +ln -s /system/xbin/daemonsu /system/bin/app_process + +rm /system/bin/app_process32 +ln -s /system/xbin/daemonsu /system/bin/app_process32 + +#cp_chmod_chcon $SU_DIR/common/99SuperSUDaemon /system/etc/init.d/99SuperSUDaemon 0755 u:object_r:system_file:s0 # no init.d + +touch /system/etc/.installed_su_daemon + +rm -R /data/local/tmp/* +#mount -o ro,remount /system # done on reboot +/system/xbin/su --install -- cgit v1.2.3