Android开启adb root 和 Console Root

adb root 开启

    feat: Allow adb Root.
            Notice: need build bootimage then download boot.img

diff --git a/system/core/adb/daemon/main.cpp b/system/core/adb/daemon/main.cpp
index 4721e2fbb4..ef3d7817f0 100644
--- a/system/core/adb/daemon/main.cpp
+++ b/system/core/adb/daemon/main.cpp
@@ -64,6 +64,7 @@ static void drop_capabilities_bounding_set_if_needed() {
 }
 
 static bool should_drop_privileges() {
+    return false;
 #if defined(ALLOW_ADBD_ROOT)
     char value[PROPERTY_VALUE_MAX];

生成的adbd 在 out 目录下 root/sbin/adbd 所以需要编译boot

Console root 开启

--- a/system/core/rootdir/init.rc
+++ b/system/core/rootdir/init.rc
@@ -666,9 +666,12 @@ service console /system/bin/sh
     class core
     console
     disabled
-    user shell
-    group shell log readproc
-    seclabel u:r:shell:s0
+#    user shell
+#    group shell log readproc
+#    seclabel u:r:shell:s0
+    user root
+    group root
+    seclabel u:r:su:s0
 
 on property:ro.debuggable=1
     # Give writes to anyone for the trace folder on debug builds.

init.rc会被拷贝到out 目录下 root/ 下, 所有需要编译 boot

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值