赞
踩
此文章部分摘自 bingoCoder2013的博客
最近闲着没事,平常也喜欢搞搞机,搞机过程中遇到需要root权限是很麻烦的,各大root软件没有适配就无法root,现在有了一点收获,也是整理网上各大论坛出来的,用adb安装SuperSU。
我的环境: 瑞芯微RK3368 / Android 7.1.2 / SuperSU-v2.82-201705271822
由于我也还是小白,没什么说的,直接上脚本
注意: 脚本变量需安照自己机型来修改,如
set CPU_TYPE=arm64
set LIB_FORDER=lib64
这两行CPU_TYPE变量和LIB_FORDER变量需要自行修改
例如我是arm64的CPU架构,系统lib文件夹是lib64,则我CPU_TYPE=arm64,LIB_FORDER=lib64
不了解自己架构的可以在百度上找搜索自己的机型
set CPU_TYPE=arm64 set LIB_FORDER=lib64 adb wait-for-device adb root adb remount adb shell setenforce 0 adb push common/Superuser.apk /system/app/SuperSU/SuperSU.apk adb shell chmod 0644 /system/app/SuperSU/SuperSU.apk adb shell chcon u:object_r:system_file:s0 /system/app/SuperSU/SuperSU.apk adb shell "echo >> /system/bin/install-recovery.sh" adb shell "echo '# Disable SELINUX & Run SuperSU deamon' >> /system/bin/install-recovery.sh" adb shell "echo '/system/xbin/daemonsu --auto-daemon &' >> /system/bin/install-recovery.sh" adb shell chmod 0755 /system/bin/install-recovery.sh adb push %CPU_TYPE%/su /system/xbin/su adb shell chmod 0755 /system/xbin/su adb shell chcon u:object_r:system_file:s0 /system/xbin/su adb push %CPU_TYPE%/su /system/bin/.ext/.su adb shell chmod 0755 /system/bin/.ext/.su adb shell chcon u:object_r:system_file:s0 /system/bin/.ext/.su adb push %CPU_TYPE%/su /system/xbin/daemonsu adb shell chmod 0755 /system/xbin/daemonsu adb shell chcon u:object_r:system_file:s0 /system/xbin/daemonsu adb push %CPU_TYPE%/supolicy /system/xbin/supolicy adb shell chmod 0755 /system/xbin/supolicy adb shell chcon u:object_r:system_file:s0 /system/xbin/supolicy adb push %CPU_TYPE%/libsupol.so /system/%LIB_FORDER%/libsupol.so adb shell chmod 0755 /system/%LIB_FORDER%/libsupol.so adb shell chcon u:object_r:system_file:s0 /system/%LIB_FORDER%/libsupol.so
如需深入了解SuperSU的原理,可在网上自行查找,或去SuperSU的官网找说明
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。