diff --git a/daemon/main.cpp b/daemon/main.cpp index 77e535af..6f0fcbce 100644 --- a/daemon/main.cpp +++ b/daemon/main.cpp @@ -213,15 +213,10 @@ int adbd_main(int server_port) { #if defined(__ANDROID__) bool device_unlocked = android::base::GetProperty("ro.boot.verifiedbootstate", "") == "orange"; if (device_unlocked || __android_log_is_debuggable()) { -#if defined(__ANDROID_RECOVERY__) - auth_required = false; // Bypass authorization when the device transitions to - // fastbootd (from recovery). A corrupt userdata image can potentially - // result in the device falling into rescue, and a subsequent fastboot - // state should not require authorization - otherwise, it will force the - // need for manual intervention(b/188703874). -#else // If we're on userdebug/eng or the device is unlocked, 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); #endif } #endif