当前位置:   article > 正文

几乎万能的安卓root方法,需adb能获取root权限(小白教小白)_瑞芯微rk312x 安卓root

瑞芯微rk312x 安卓root

此文章部分摘自 bingoCoder2013的博客
最近闲着没事,平常也喜欢搞搞机,搞机过程中遇到需要root权限是很麻烦的,各大root软件没有适配就无法root,现在有了一点收获,也是整理网上各大论坛出来的,用adb安装SuperSU。
我的环境: 瑞芯微RK3368 / Android 7.1.2 / SuperSU-v2.82-201705271822

1.必要前提

  • adb驱动,adb工具包(推荐到adbshell.com下载)
  • adb可以临时获取root权限(也可利用RageAgainstTheCage漏洞,本人没有太多了解,在这不予介绍)
  • SELinux可关闭(没有具体试过不关闭的后果,具体方法请看 坛内博客 bingoCoder2013
  • SuperSU Recovery刷机包

2.步骤

  • a.安装adb
    • Step 1 下载adb驱动,并安装
    • Step 2 下载adb工具包,是一个压缩格式。解压到任意目录即可
  • b.准备安装
    • Step 3 解压SuperSU文件到任意目录
    • Step 4 在SuperSU根目录(含有common等目录)下新建文本文档,并重命名为root.bat(只要是批处理文件即可,点号前的文件名随意)
    • Step 5 右键root.bat,选择编辑,并将脚本复制进去,需注意复制后会有多出来的文字,请自行删除
  • c.准备手机硬件
    • Step 6 打开手机USB调试(在设置开发者选项里,打开USB调试。没有开发者选项需在关于手机里多次点击版本号,回到主界面就有了。这里的操作不一定一样,每种手机会有一定差异)
    • Step 7 用数据线连接电脑(尽量采用USB2.0和主机背板插口)
  • d.电脑开始安装
    • 运行root.bat脚本即可

3.脚本

由于我也还是小白,没什么说的,直接上脚本
注意: 脚本变量需安照自己机型来修改,如

set CPU_TYPE=arm64
set LIB_FORDER=lib64
  • 1
  • 2

这两行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 
  • 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

如需深入了解SuperSU的原理,可在网上自行查找,或去SuperSU的官网找说明

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/人工智能uu/article/detail/949455
推荐阅读
相关标签
  

闽ICP备14008679号