diff options
author | Dan Albert <danalbert@google.com> | 2015-02-19 20:33:31 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-02-19 20:33:31 +0000 |
commit | 18daa159ec5f8455f83dd87dad1a1ed1d2501b3e (patch) | |
tree | 758bc1a42b39916d7607cd5ff707a382e8957173 | |
parent | 63feeaaa0608e63969f434456ddaa32bf85bd220 (diff) | |
parent | 13f9c406d7ae58bb3f5c3ac0b0e50f8760c5cf46 (diff) | |
download | system_core-18daa159ec5f8455f83dd87dad1a1ed1d2501b3e.zip system_core-18daa159ec5f8455f83dd87dad1a1ed1d2501b3e.tar.gz system_core-18daa159ec5f8455f83dd87dad1a1ed1d2501b3e.tar.bz2 |
Merge "Document the behavior of props affecting adb root."
-rw-r--r-- | adb/adb_main.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/adb/adb_main.c b/adb/adb_main.c index 5e06a13..02acae2 100644 --- a/adb/adb_main.c +++ b/adb/adb_main.c @@ -115,14 +115,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); |