涉及修改的文件
../../../../../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();
}