summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2015-02-19 11:03:26 -0800
committerDan Albert <danalbert@google.com>2015-02-19 12:29:01 -0800
commit13f9c406d7ae58bb3f5c3ac0b0e50f8760c5cf46 (patch)
tree0515137d18aa4e4e902bd76e0082a118ba593a3f /adb
parent9a525d7f2e050a81fd800557293fc3ce6d4933ff (diff)
downloadsystem_core-13f9c406d7ae58bb3f5c3ac0b0e50f8760c5cf46.zip
system_core-13f9c406d7ae58bb3f5c3ac0b0e50f8760c5cf46.tar.gz
system_core-13f9c406d7ae58bb3f5c3ac0b0e50f8760c5cf46.tar.bz2
Document the behavior of props affecting adb root.
Change-Id: Icfdc3ba696556d6db64835e61dde6f40b491d1a7
Diffstat (limited to 'adb')
-rw-r--r--adb/adb_main.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/adb/adb_main.c b/adb/adb_main.c
index 72168ec..d53a61f 100644
--- a/adb/adb_main.c
+++ b/adb/adb_main.c
@@ -107,14 +107,25 @@ static bool should_drop_privileges() {
return false;
}
+ // The properties that affect `adb root` and `adb unroot` are ro.secure and
+ // ro.debuggable. In this context the names don't make the expected behavior
+ // particularly obvious.
+ //
+ // ro.debuggable:
+ // Allowed to become root, but not necessarily the default. Set to 1 on
+ // eng and userdebug builds.
+ //
+ // ro.secure:
+ // Drop privileges by default. Set to 1 on userdebug and user builds.
property_get("ro.secure", value, "1");
bool ro_secure = (strcmp(value, "1") == 0);
+ property_get("ro.debuggable", value, "");
+ bool ro_debuggable = (strcmp(value, "1") == 0);
+
// Drop privileges if ro.secure is set...
bool drop = ro_secure;
- property_get("ro.debuggable", value, "");
- bool ro_debuggable = (strcmp(value, "1") == 0);
property_get("service.adb.root", value, "");
bool adb_root = (strcmp(value, "1") == 0);
bool adb_unroot = (strcmp(value, "0") == 0);