紫光展锐SL8541编译user版本默认开启root的软件

    涉及修改的文件

    ../../../../../build/make/core/main.mk
    ../../../../../system/core/adb/Android.mk
      ../../../../../system/core/adb/daemon/main.cpp
      ../../../../../system/core/init/init.cpp

  ../../../../../build/make/core/main.mk

diff --git a/8541E/build/make/core/main.mk b/8541E/build/make/core/main.mk
index 2e97b68..7ac963c 100755
--- a/8541E/build/make/core/main.mk
+++ b/8541E/build/make/core/main.mk
@@ -239,13 +239,13 @@ enable_target_debugging := true
 tags_to_install :=
 ifneq (,$(user_variant))
   # Target is secure in user builds. 
-  ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1  
+  ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=0  
   #user root 0
   ADDITIONAL_DEFAULT_PROPERTIES += security.perf_harden=1
 
   ifeq ($(user_variant),user)
        #user root 0
-    ADDITIONAL_DEFAULT_PROPERTIES += ro.adb.secure=1
+    ADDITIONAL_DEFAULT_PROPERTIES += ro.adb.secure=0
   endif
 
   ifeq ($(user_variant),userdebug)

 ../../../../../system/core/adb/Android.mk

diff --git a/8541E/system/core/adb/Android.mk b/8541E/system/core/adb/Android.mk
index 5786264..855c483 100755
--- a/8541E/system/core/adb/Android.mk
+++ b/8541E/system/core/adb/Android.mk
@@ -350,12 +350,13 @@ LOCAL_CFLAGS := \
     -D_GNU_SOURCE \
     -Wno-deprecated-declarations \
 #user root 
-LOCAL_CFLAGS += -DALLOW_ADBD_NO_AUTH=$(if $(filter  userdebug eng,$(TARGET_BUILD_VARIANT)),1,0)
+##LOCAL_CFLAGS += -DALLOW_ADBD_NO_AUTH=$(if $(filter  userdebug eng,$(TARGET_BUILD_VARIANT)),1,0)
+LOCAL_CFLAGS += -DALLOW_ADBD_NO_AUTH=$(if $(filter user userdebug eng,$(TARGET_BUILD_VARIANT)),1,0)
 #user root
-ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
+##ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
 LOCAL_CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1
 LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1
-endif
+##endif
 
 LOCAL_MODULE := adbd

../../../../../system/core/adb/daemon/main.cpp 

diff --git a/8541E/system/core/adb/daemon/main.cpp b/8541E/system/core/adb/daemon/main.cpp
index aa827f4..1c7e3b8 100755
--- a/8541E/system/core/adb/daemon/main.cpp
+++ b/8541E/system/core/adb/daemon/main.cpp
@@ -59,7 +59,7 @@ static void drop_capabilities_bounding_set_if_needed(struct minijail *j) {
 }
 
 static bool should_drop_privileges() {
-       #if 1
+       #if 0
 
 #if defined(ALLOW_ADBD_ROOT)
     // The properties that affect `adb root` and `adb unroot` are ro.secure and

 ../../../../../system/core/init/init.cpp

diff --git a/8541E/system/core/init/init.cpp b/8541E/system/core/init/init.cpp
index 4fa85f4..6ef8f42 100755
--- a/8541E/system/core/init/init.cpp
+++ b/8541E/system/core/init/init.cpp
@@ -893,7 +893,8 @@ static void selinux_initialize(bool in_kernel_domain) {
         bool kernel_enforcing = (security_getenforce() == 1);
         bool is_enforcing = selinux_is_enforcing();
         if (kernel_enforcing != is_enforcing) {
-            if (security_setenforce(is_enforcing)) {
+            //if (security_setenforce(is_enforcing)) {
+                               if (security_setenforce(false)) {
                 PLOG(ERROR) << "security_setenforce(%s) failed" << (is_enforcing ? "true" : "false");
                 security_failure();
             }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值
>