Skip to content

Commit

Permalink
adb: Add ro.adb.secure.recovery handling
Browse files Browse the repository at this point in the history
Change-Id: I9c68b70381c10fbec17363f4b0392c032d22dbe8
  • Loading branch information
luk1337 authored and mikeNG committed Sep 9, 2024
1 parent f8a7480 commit c64242e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions daemon/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c64242e

Please sign in to comment.