android adb 許可權改動

來源:互聯網
上載者:User

標籤:bool   off   UI   man   val   dbr   this   post   ret   

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





android adb 許可權改動

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.