From c07775f5e385866dd914f2d5a674501488dbc581 Mon Sep 17 00:00:00 2001 From: Fox2Code <42963271+Fox2Code@users.noreply.github.com> Date: Thu, 12 Mar 2020 07:28:43 +0000 Subject: [PATCH] Add missing ro.vendor(.boot).warranty_bit props Co-authored-by: John Wu --- native/jni/magiskhide/hide_policy.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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) {