Loading adb/daemon/main.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,8 @@ #include <scoped_minijail.h> #include "debuggerd/client.h" #include "private/android_filesystem_config.h" #include <private/android_filesystem_config.h> #include <private/android_logger.h> #include "selinux/android.h" #include "adb.h" Loading @@ -48,7 +49,7 @@ static const char* root_seclabel = nullptr; static void drop_capabilities_bounding_set_if_needed(struct minijail *j) { #if defined(ALLOW_ADBD_ROOT) if (android::base::GetBoolProperty("ro.debuggable", false)) { if (__android_log_is_debuggable()) { return; } #endif Loading @@ -68,7 +69,7 @@ static bool should_drop_privileges() { // ro.secure: // Drop privileges by default. Set to 1 on userdebug and user builds. bool ro_secure = android::base::GetBoolProperty("ro.secure", true); bool ro_debuggable = android::base::GetBoolProperty("ro.debuggable", false); bool ro_debuggable = __android_log_is_debuggable(); // Drop privileges if ro.secure is set... bool drop = ro_secure; Loading adb/services.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -38,8 +38,9 @@ #include <cutils/sockets.h> #if !ADB_HOST #include "cutils/android_reboot.h" #include <android-base/properties.h> #include <cutils/android_reboot.h> #include <private/android_logger.h> #endif #include "adb.h" Loading Loading @@ -73,7 +74,7 @@ void restart_root_service(int fd, void *cookie) { WriteFdExactly(fd, "adbd is already running as root\n"); adb_close(fd); } else { if (!android::base::GetBoolProperty("ro.debuggable", false)) { if (!__android_log_is_debuggable()) { WriteFdExactly(fd, "adbd cannot run as root in production builds\n"); adb_close(fd); return; Loading adb/set_verity_enable_state_service.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ #include "android-base/properties.h" #include "android-base/stringprintf.h" #include <private/android_logger.h> #include "adb.h" #include "adb_io.h" Loading Loading @@ -102,8 +103,7 @@ void set_verity_enabled_state_service(int fd, void* cookie) { WriteFdFmt(fd, "verity not enabled - ENG build\n"); return; } if (!android::base::GetBoolProperty("ro.debuggable", false)) { if (!__android_log_is_debuggable()) { WriteFdFmt(fd, "verity cannot be disabled/enabled - USER build\n"); return; } Loading adb/sockets.cpp +2 −6 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ #if !ADB_HOST #include <android-base/properties.h> #include <private/android_logger.h> #endif #include "adb.h" Loading Loading @@ -416,12 +417,7 @@ asocket* create_local_service_socket(const char* name, const atransport* transpo D("LS(%d): bound to '%s' via %d", s->id, name, fd); #if !ADB_HOST bool debuggable = false; if (!strncmp(name, "root:", 5)) { debuggable = android::base::GetBoolProperty("ro.debuggable", false); } if ((!strncmp(name, "root:", 5) && getuid() != 0 && debuggable) || if ((!strncmp(name, "root:", 5) && getuid() != 0 && __android_log_is_debuggable()) || (!strncmp(name, "unroot:", 7) && getuid() == 0) || !strncmp(name, "usb:", 4) || !strncmp(name, "tcpip:", 6)) { Loading Loading
adb/daemon/main.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,8 @@ #include <scoped_minijail.h> #include "debuggerd/client.h" #include "private/android_filesystem_config.h" #include <private/android_filesystem_config.h> #include <private/android_logger.h> #include "selinux/android.h" #include "adb.h" Loading @@ -48,7 +49,7 @@ static const char* root_seclabel = nullptr; static void drop_capabilities_bounding_set_if_needed(struct minijail *j) { #if defined(ALLOW_ADBD_ROOT) if (android::base::GetBoolProperty("ro.debuggable", false)) { if (__android_log_is_debuggable()) { return; } #endif Loading @@ -68,7 +69,7 @@ static bool should_drop_privileges() { // ro.secure: // Drop privileges by default. Set to 1 on userdebug and user builds. bool ro_secure = android::base::GetBoolProperty("ro.secure", true); bool ro_debuggable = android::base::GetBoolProperty("ro.debuggable", false); bool ro_debuggable = __android_log_is_debuggable(); // Drop privileges if ro.secure is set... bool drop = ro_secure; Loading
adb/services.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -38,8 +38,9 @@ #include <cutils/sockets.h> #if !ADB_HOST #include "cutils/android_reboot.h" #include <android-base/properties.h> #include <cutils/android_reboot.h> #include <private/android_logger.h> #endif #include "adb.h" Loading Loading @@ -73,7 +74,7 @@ void restart_root_service(int fd, void *cookie) { WriteFdExactly(fd, "adbd is already running as root\n"); adb_close(fd); } else { if (!android::base::GetBoolProperty("ro.debuggable", false)) { if (!__android_log_is_debuggable()) { WriteFdExactly(fd, "adbd cannot run as root in production builds\n"); adb_close(fd); return; Loading
adb/set_verity_enable_state_service.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ #include "android-base/properties.h" #include "android-base/stringprintf.h" #include <private/android_logger.h> #include "adb.h" #include "adb_io.h" Loading Loading @@ -102,8 +103,7 @@ void set_verity_enabled_state_service(int fd, void* cookie) { WriteFdFmt(fd, "verity not enabled - ENG build\n"); return; } if (!android::base::GetBoolProperty("ro.debuggable", false)) { if (!__android_log_is_debuggable()) { WriteFdFmt(fd, "verity cannot be disabled/enabled - USER build\n"); return; } Loading
adb/sockets.cpp +2 −6 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ #if !ADB_HOST #include <android-base/properties.h> #include <private/android_logger.h> #endif #include "adb.h" Loading Loading @@ -416,12 +417,7 @@ asocket* create_local_service_socket(const char* name, const atransport* transpo D("LS(%d): bound to '%s' via %d", s->id, name, fd); #if !ADB_HOST bool debuggable = false; if (!strncmp(name, "root:", 5)) { debuggable = android::base::GetBoolProperty("ro.debuggable", false); } if ((!strncmp(name, "root:", 5) && getuid() != 0 && debuggable) || if ((!strncmp(name, "root:", 5) && getuid() != 0 && __android_log_is_debuggable()) || (!strncmp(name, "unroot:", 7) && getuid() == 0) || !strncmp(name, "usb:", 4) || !strncmp(name, "tcpip:", 6)) { Loading