android adb 存储权限,android adb 权限修改

1. 修改 ADB ROOT权限:

system/core$ git diff adb/adb.c

diff --git a/adb/adb.c b/adb/adb.c

index 99bea0f..d8fc090 100644

--- a/adb/adb.c

+++ b/adb/adb.c

@@ -1217,6 +1217,11 @@ static void drop_capabilities_bounding_set_if_needed() {

static int should_drop_privileges() {

#ifndef ALLOW_ADBD_ROOT

+       char value[PROPERTY_VALUE_MAX];

+       property_get("hw.hasusbadbroot", value, "");

+       if(strcmp(value, "1") == 0)

+       return 0;

+ else

return 1;

#else /* ALLOW_ADBD_ROOT */

int secure = 0;

同时在system.prop中添加hw.hasusbadbroot=1

2.去掉adb 密钥校验:

ro.adb.secure=0

3.修改开发者选项隐藏

packages/apps/Settings/src/com/android/settings/Settings.java

private void updateHeaderList(Listtarget) {

-        final boolean showDev = mDevelopmentPreferences.getBoolean(

-                DevelopmentSettings.PREF_SHOW,

-                android.os.Build.TYPE.equals("eng"));

-        int i = 0;

+//        final boolean showDev = mDevelopmentPreferences.getBoolean(

+//                DevelopmentSettings.PREF_SHOW,

+//                android.os.Build.TYPE.equals("eng")); //samjiang modify

+               final boolean showDev = true;

+               int i = 0;

final UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);

mHeaderIndexMap.clear();

4.USB调试默认打开:

@@ -272,7 +272,7 @@ for these).

Installs APKs according to the product definition files; tags

are ignored for APK modules.

ro.secure=1

-

ro.debuggable=0

+

ro.debuggable=1

adb is disabled by default.

"make user"

This is the flavor intended to be the final release bits.Installs modules tagged with shell_$(TARGET_SHELL) and user.

Installs non-APK modules that have no tags specified.

Installs APKs according to the product definition files; tags

are ignored for APK modules.

ro.secure=1

ro.debuggable=1

adb is disabled by default.

@@ -350,7 +350,7 @@ ifeq (true,$(strip $(enable_target_debugging)))

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.debuggable=1

endif # !enable_target_debugging

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved.

京ICP备09083238号

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值