Add missing ro.vendor(.boot).warranty_bit props

Co-authored-by: John Wu <topjohnwu@gmail.com>
This commit is contained in:
Fox2Code 2020-03-12 07:28:43 +00:00 committed by GitHub
parent e261579e72
commit c07775f5e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,12 +12,14 @@ using namespace std;
static const char *prop_key[] = static const char *prop_key[] =
{ "ro.boot.vbmeta.device_state", "ro.boot.verifiedbootstate", "ro.boot.flash.locked", { "ro.boot.vbmeta.device_state", "ro.boot.verifiedbootstate", "ro.boot.flash.locked",
"ro.boot.veritymode", "ro.boot.warranty_bit", "ro.warranty_bit", "ro.debuggable", "ro.boot.veritymode", "ro.boot.warranty_bit", "ro.warranty_bit", "ro.debuggable",
"ro.secure", "ro.build.type", "ro.build.tags", "ro.build.selinux", nullptr }; "ro.secure", "ro.build.type", "ro.build.tags", "ro.build.selinux",
"ro.vendor.boot.warranty_bit", "ro.vendor.warranty_bit", nullptr };
static const char *prop_value[] = static const char *prop_value[] =
{ "locked", "green", "1", { "locked", "green", "1",
"enforcing", "0", "0", "0", "enforcing", "0", "0", "0",
"1", "user", "release-keys", "0", nullptr }; "1", "user", "release-keys", "0",
"0", "0", nullptr };
void hide_sensitive_props() { void hide_sensitive_props() {
LOGI("hide_policy: Hiding sensitive props\n"); LOGI("hide_policy: Hiding sensitive props\n");
@ -29,6 +31,15 @@ void hide_sensitive_props() {
setprop(prop_key[i], prop_value[i], false); setprop(prop_key[i], prop_value[i], false);
} }
// Hide that we booted from recovery when magisk is in recovery mode
auto bootmode = getprop("ro.bootmode");
if (!bootmode.empty() && bootmode.find("recovery") != string::npos) {
setprop("ro.bootmode", "unknown", false);
}
bootmode = getprop("ro.boot.mode");
if (!bootmode.empty() && bootmode.find("recovery") != string::npos) {
setprop("ro.boot.mode", "unknown", false);
// Xiaomi cross region flash // Xiaomi cross region flash
auto hwc = getprop("ro.boot.hwc"); auto hwc = getprop("ro.boot.hwc");
if (!hwc.empty() && hwc.find("CN") != string::npos) { if (!hwc.empty() && hwc.find("CN") != string::npos) {