首页 > 代码库 > Android 如何开启与关闭adb 的认证机制(google adb secure) (adb RSA 指纹认证)

Android 如何开启与关闭adb 的认证机制(google adb secure) (adb RSA 指纹认证)

前言
         欢迎大家我分享和推荐好用的代码段~~
声明
         欢迎转载,但请保留文章原始出处:
         CSDN
http://www.csdn.net
         雨季o莫忧离:http://blog.csdn.net/luckkof

正文

 

[Description]
如何开启与关闭adb 的认证机制(google adb secure)
[Keyword]
adb secure , ro.adb.secure , adb RSA 指纹认证
[Solution]
MTK 版本默认关闭adb 的地址认证机制,如果贵司需要开启,可以修改alps/build/core/main.mk
ifeq (true,$(strip $(enable_target_debugging)))
  # Target is more debuggable and adbd is on by default
  ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1
  ADDITIONAL_DEFAULT_PROPERTIES += ro.adb.secure=1 ==> 如果想在ENG Load新增此功能,加这行
  # 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
  ADDITIONAL_DEFAULT_PROPERTIES += ro.adb.secure=1 ==> 如果想在USER Load新增此功能,加这行
endif # !enable_target_debugging
 
而ro.adb.secure 这个system property 对于adbd 的控制点在alps/system/core/adb/adb.c 中的
property_get("ro.adb.secure", value, "0");
auth_enabled = !strcmp(value, "1");
if (auth_enabled)
    adb_auth_init();