-
Notifications
You must be signed in to change notification settings - Fork 2
/
armv7-a40i.sh
executable file
·37 lines (29 loc) · 1.35 KB
/
armv7-a40i.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
# For [A40i](https://www.allwinnertech.com/index.php?c=product&a=index&id=69)
#
# Ref to https://github.com/spff/install-supersu-via-adb/blob/master/suscript.sh
# and https://android.stackexchange.com/questions/224119/how-to-gain-root-on-bluestacks-android-emulator/224120#224120
result=`adb shell "if [ -f /system/xbin/su_original ]; then echo 0; else echo 1; fi"`
if test $result -eq 0
then
echo Already run $0, maybe you need run corresponding revert.sh?
exit
fi
adb remount
adb shell "mv /system/xbin/su /system/xbin/su_original"
adb push armv7/su system/xbin/su
# adb shell "chmod 4750 /system/xbin/su"
adb shell "chmod 755 /system/xbin/su"
adb shell "chown root:shell /system/xbin/su"
adb shell "chcon u:object_r:system_file:s0 /system/xbin/su"
adb push armv7/su system/xbin/daemonsu
adb shell "chmod 755 /system/xbin/daemonsu"
adb shell "chcon u:object_r:system_file:s0 /system/xbin/daemonsu"
adb shell "mv /system/bin/app_process32 /system/bin/app_process32_original"
adb shell "rm -rf /system/bin/app_process32"
adb shell "ln -s /system/xbin/daemonsu /system/bin/app_process32"
# adb shell "chown root:root /system/bin/app_process32"
adb shell "system/xbin/su --install"
adb install common/Superuser.apk
# Seems need below and click on Android screen to run `SuperSU` APP
# just after run this `.sh` to complete the root.
adb shell "system/xbin/su --daemon"