Disable adb auth if ro.adb.secure is false
- Safetynet hack in init rewrites
ro.boot.verifiedbootstate=orange to green
ro.debuggable=1 to 0
- adbd expects either ro.boot.verifiedbootstate=orange or ro.debuggable=1 to skip adb auth
Change-Id: If0e000131572ca841711d887144afc40dec3e030
Signed-off-by: SagarMakhar <sagarmakhar@gmail.com>
Signed-off-by: Jackeagle <jackeagle102@gmail.com>
diff --git a/daemon/main.cpp b/daemon/main.cpp
index 3280ac7..bad44dc 100644
--- a/daemon/main.cpp
+++ b/daemon/main.cpp
@@ -208,14 +208,11 @@
adbd_cloexec_auth_socket();
#if defined(__ANDROID__)
- bool device_unlocked = android::base::GetProperty("ro.boot.verifiedbootstate", "") == "orange";
- if (device_unlocked || __android_log_is_debuggable()) {
- // If we're on userdebug/eng or the device is unlocked, permit no-authentication.
- auth_required = android::base::GetBoolProperty("ro.adb.secure", false);
+ // If ro.adb.secure is false, permit no-authentication.
+ auth_required = android::base::GetBoolProperty("ro.adb.secure", false);
#if defined(__ANDROID_RECOVERY__)
- auth_required &= android::base::GetBoolProperty("ro.adb.secure.recovery", true);
+ auth_required |= android::base::GetBoolProperty("ro.adb.secure.recovery", true);
#endif
- }
#endif
// Our external storage path may be different than apps, since