当前位置:   article > 正文

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

sl8541

    涉及修改的文件

    ../../../../../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

  1. diff --git a/8541E/build/make/core/main.mk b/8541E/build/make/core/main.mk
  2. index 2e97b68..7ac963c 100755
  3. --- a/8541E/build/make/core/main.mk
  4. +++ b/8541E/build/make/core/main.mk
  5. @@ -239,13 +239,13 @@ enable_target_debugging := true
  6. tags_to_install :=
  7. ifneq (,$(user_variant))
  8. # Target is secure in user builds.
  9. - ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1
  10. + ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=0
  11. #user root 0
  12. ADDITIONAL_DEFAULT_PROPERTIES += security.perf_harden=1
  13. ifeq ($(user_variant),user)
  14. #user root 0
  15. - ADDITIONAL_DEFAULT_PROPERTIES += ro.adb.secure=1
  16. + ADDITIONAL_DEFAULT_PROPERTIES += ro.adb.secure=0
  17. endif
  18. ifeq ($(user_variant),userdebug)

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

  1. diff --git a/8541E/system/core/adb/Android.mk b/8541E/system/core/adb/Android.mk
  2. index 5786264..855c483 100755
  3. --- a/8541E/system/core/adb/Android.mk
  4. +++ b/8541E/system/core/adb/Android.mk
  5. @@ -350,12 +350,13 @@ LOCAL_CFLAGS := \
  6. -D_GNU_SOURCE \
  7. -Wno-deprecated-declarations \
  8. #user root
  9. -LOCAL_CFLAGS += -DALLOW_ADBD_NO_AUTH=$(if $(filter userdebug eng,$(TARGET_BUILD_VARIANT)),1,0)
  10. +##LOCAL_CFLAGS += -DALLOW_ADBD_NO_AUTH=$(if $(filter userdebug eng,$(TARGET_BUILD_VARIANT)),1,0)
  11. +LOCAL_CFLAGS += -DALLOW_ADBD_NO_AUTH=$(if $(filter user userdebug eng,$(TARGET_BUILD_VARIANT)),1,0)
  12. #user root
  13. -ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
  14. +##ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
  15. LOCAL_CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1
  16. LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1
  17. -endif
  18. +##endif
  19. LOCAL_MODULE := adbd

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

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

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

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

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号