Skip to content

Commit

Permalink
fastboot: Revert to Android 11 method of checking lock status
Browse files Browse the repository at this point in the history
Now that we're setting system-wide properties for SafetyNet, which
includes ro.boot.verifiedbootstate=green, fastbootd always detects the
bootloader as being locked. Revert to the Android 11 method of reading
directly from the kernel cmdline to work arround the issue.

Change-Id: I57f6d48acddb29748778053edf354d7bd8994bd7
Signed-off-by: Joey Huab <[email protected]>

Former-commit-id: 2ebedf57b332ab4406cfa9a0781014876a999bca
Former-commit-id: f81ac0f1fd300b274ad03ba76d040f454c294387
Former-commit-id: 3f6620ae4fd69eaa41e1bb475dbb1bf84df37099
  • Loading branch information
kdrag0n authored and Maitreya25 committed Dec 15, 2023
1 parent 44933b1 commit afa92d1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fastboot/device/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,12 @@ std::vector<std::string> ListPartitions(FastbootDevice* device) {
}

bool GetDeviceLockStatus() {
return android::base::GetProperty("ro.boot.verifiedbootstate", "") != "orange";
std::string cmdline;
// Return lock status true if unable to read kernel command line.
if (!android::base::ReadFileToString("/proc/cmdline", &cmdline)) {
return true;
}
return cmdline.find("androidboot.verifiedbootstate=orange") == std::string::npos;
}

bool UpdateAllPartitionMetadata(FastbootDevice* device, const std::string& super_name,
Expand Down

0 comments on commit afa92d1

Please sign in to comment.