mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-30 13:35:27 +00:00
Move late props to boot complete
This commit is contained in:
parent
18a09703de
commit
dbdb0a2560
@ -271,8 +271,8 @@ void post_fs_data(int client) {
|
|||||||
} else {
|
} else {
|
||||||
LOGI("* Running post-fs-data.d scripts\n");
|
LOGI("* Running post-fs-data.d scripts\n");
|
||||||
exec_common_script("post-fs-data");
|
exec_common_script("post-fs-data");
|
||||||
handle_modules();
|
|
||||||
auto_start_magiskhide();
|
auto_start_magiskhide();
|
||||||
|
handle_modules();
|
||||||
}
|
}
|
||||||
|
|
||||||
// We still want to do magic mount because root itself might need it
|
// We still want to do magic mount because root itself might need it
|
||||||
@ -300,8 +300,6 @@ void late_start(int client) {
|
|||||||
if (!pfs_done || safe_mode)
|
if (!pfs_done || safe_mode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto_start_magiskhide();
|
|
||||||
|
|
||||||
LOGI("* Running service.d scripts\n");
|
LOGI("* Running service.d scripts\n");
|
||||||
exec_common_script("service");
|
exec_common_script("service");
|
||||||
|
|
||||||
|
@ -12,20 +12,20 @@ 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.secure", "ro.build.type", "ro.build.tags", "vendor.boot.vbmeta.device_state",
|
||||||
"ro.vendor.boot.warranty_bit", "ro.vendor.warranty_bit", nullptr };
|
"ro.vendor.boot.warranty_bit", "ro.vendor.warranty_bit", nullptr };
|
||||||
|
|
||||||
static const char *prop_val[] =
|
static const char *prop_val[] =
|
||||||
{ "locked", "green", "1",
|
{ "locked", "green", "1",
|
||||||
"enforcing", "0", "0", "0",
|
"enforcing", "0", "0", "0",
|
||||||
"1", "user", "release-keys",
|
"1", "user", "release-keys", "locked",
|
||||||
"0", "0", nullptr };
|
"0", "0", nullptr };
|
||||||
|
|
||||||
static const char *late_prop_key[] =
|
static const char *late_prop_key[] =
|
||||||
{ "vendor.boot.vbmeta.device_state", "vendor.boot.verifiedbootstate", nullptr };
|
{ "vendor.boot.verifiedbootstate", nullptr };
|
||||||
|
|
||||||
static const char *late_prop_val[] =
|
static const char *late_prop_val[] =
|
||||||
{ "locked", "green", nullptr };
|
{ "green", nullptr };
|
||||||
|
|
||||||
void hide_sensitive_props() {
|
void hide_sensitive_props() {
|
||||||
LOGI("hide_policy: Hiding sensitive props\n");
|
LOGI("hide_policy: Hiding sensitive props\n");
|
||||||
@ -43,6 +43,9 @@ void hide_sensitive_props() {
|
|||||||
bootmode = getprop("ro.boot.mode");
|
bootmode = getprop("ro.boot.mode");
|
||||||
if (!bootmode.empty() && str_contains(bootmode, "recovery"))
|
if (!bootmode.empty() && str_contains(bootmode, "recovery"))
|
||||||
setprop("ro.boot.mode", "unknown", false);
|
setprop("ro.boot.mode", "unknown", false);
|
||||||
|
bootmode = getprop("vendor.boot.mode");
|
||||||
|
if (!bootmode.empty() && str_contains(bootmode, "recovery"))
|
||||||
|
setprop("vendor.boot.mode", "unknown", false);
|
||||||
|
|
||||||
// Xiaomi cross region flash
|
// Xiaomi cross region flash
|
||||||
auto hwc = getprop("ro.boot.hwc");
|
auto hwc = getprop("ro.boot.hwc");
|
||||||
@ -65,10 +68,6 @@ void hide_late_sensitive_props() {
|
|||||||
if (!value.empty() && value != late_prop_val[i])
|
if (!value.empty() && value != late_prop_val[i])
|
||||||
setprop(prop_key[i], late_prop_val[i], false);
|
setprop(prop_key[i], late_prop_val[i], false);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto bootmode = getprop("vendor.boot.mode");
|
|
||||||
if (!bootmode.empty() && str_contains(bootmode, "recovery"))
|
|
||||||
setprop("vendor.boot.mode", "unknown", false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lazy_unmount(const char* mountpoint) {
|
static void lazy_unmount(const char* mountpoint) {
|
||||||
|
Loading…
Reference in New Issue
Block a user