android adb 权限修改
2015-08-11 19:48
579 查看
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(List<Header> target) {
- 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).
<li>Installs APKs according to the product definition files; tags
are ignored for APK modules.
<li><code>ro.secure=1</code>
- <li><code>ro.debuggable=0</code>
+ <li><code>ro.debuggable=1</code>
<li><code>adb</code> is disabled by default.
</td>
</tr>
"<code>make user</code>"
<p>
This is the flavor intended to be the final release bits.
<ul>
<li>Installs modules tagged with <code>shell_</code>$(TARGET_SHELL) and <code>user</code>.
<li>Installs non-APK modules that have no tags specified.
<li>Installs APKs according to the product definition files; tags
are ignored for APK modules.
<li><code>ro.secure=1</code>
<li><code>ro.debuggable=1</code>
<li><code>adb</code> is disabled by default.
</td>
</tr>
<tr>
<td>
@@ -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
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(List<Header> target) {
- 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).
<li>Installs APKs according to the product definition files; tags
are ignored for APK modules.
<li><code>ro.secure=1</code>
- <li><code>ro.debuggable=0</code>
+ <li><code>ro.debuggable=1</code>
<li><code>adb</code> is disabled by default.
</td>
</tr>
"<code>make user</code>"
<p>
This is the flavor intended to be the final release bits.
<ul>
<li>Installs modules tagged with <code>shell_</code>$(TARGET_SHELL) and <code>user</code>.
<li>Installs non-APK modules that have no tags specified.
<li>Installs APKs according to the product definition files; tags
are ignored for APK modules.
<li><code>ro.secure=1</code>
<li><code>ro.debuggable=1</code>
<li><code>adb</code> is disabled by default.
</td>
</tr>
<tr>
<td>
@@ -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
相关文章推荐
- android,自定义无标题对话框(继承Dialog类,非AlertDialog)的样式
- 【Android应用开发】Android Studio - MAC 版 - 快捷键详解
- AndroidImageSlider
- Android中的动画(待续)
- Android笔记(九) Android中的布局——框架布局
- Android实例-打电话、发短信和邮件,取得手机IMEI号(XE8+小米2)
- Android开发环境搭建
- 【转】使用git 工具下载android.jar Source Code
- Android.mk解析
- Android反编译获取源码-android学习之旅(70)
- Android反编译获取源码-android学习之旅(70)
- Android反编译获取源码-android学习之旅(70)
- Android双击或多击事件
- Android异步加载学习笔记之三:用AsyncTask实现ListView中的图片数据加载
- Android反编译获取源码-android学习之旅(70)
- 《第一行代码--Android》阅读笔记之界面设计
- Android 调试之 Log和LogCat的详解
- Android.mk 分析:./frameworks/base/core/res/Android.mk
- Andriod测试类和测试内容
- Android IOS WebRTC 音视频开发总结(三八)-- tx help