diff --git a/native/jni/magiskhide/hide_policy.cpp b/native/jni/magiskhide/hide_policy.cpp index ee12f0d9f..856ad9a65 100644 --- a/native/jni/magiskhide/hide_policy.cpp +++ b/native/jni/magiskhide/hide_policy.cpp @@ -12,12 +12,14 @@ using namespace std; static const char *prop_key[] = { "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.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[] = { "locked", "green", "1", "enforcing", "0", "0", "0", - "1", "user", "release-keys", "0", nullptr }; + "1", "user", "release-keys", "0", + "0", "0", nullptr }; void hide_sensitive_props() { LOGI("hide_policy: Hiding sensitive props\n"); @@ -29,6 +31,15 @@ void hide_sensitive_props() { 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 auto hwc = getprop("ro.boot.hwc"); if (!hwc.empty() && hwc.find("CN") != string::npos) {