是否打开ADB root权限:
/build/make/core/main.mk
有两个值会影响是否打开adb root权限:
ro.secure 为0 时,直接开启root 权限;为1时再根据ro.debuggable 等选项来确认是否可以开启root 权限
ro.debuggable=1 //开启adb调试
ro.debuggable=0 //关闭adb调试
//通过配置enable_target_debugging的值,最终配置ro.debuggable的值
ifeq (true,$(strip $(enable_target_debugging)))
# Target is more debuggable and adbd is on by default
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1
# Enable Dalvik lock contention logging.
ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.lockprof.threshold=500
# Include the debugging/testing OTA keys in this build.
INCLUDE_TEST_OTA_KEYS := true
else # !enable_target_debugging
# Target is less debuggable and adbd is off by default
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=0
endif # !enable_target_debugging
/system/core/adb/Android.mk
// 下一行加上user或注释掉ifneq判断,也可以给user版本开启user权限
ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
LOCAL_CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1
LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1
endif
是否显示adb授权提示:
关闭授权框提示:这个ro.adb.secure=0(0为不弹显示信任此电脑提示框,1为弹框)
去掉adb 密钥校验:ro.adb.secure=0 不显示对话框