Unverified Commit 79620c97 authored by 残页's avatar 残页 Committed by GitHub

Invalidate Samsung's persist.sys.zygote.early

Samsung FDE devices with the "persist.sys.zygote.early=true" property will cause Zygote to start before post-fs-data. According to Magisk's document, the post-fs-data phase should always happen before Zygote is started. Features assuming this behavior (like Zygisk and modules that need to control zygote) will not work. To avoid breaking existing modules, we simply invalidate this property to prevent this non-standard behavior from happening

Fix #5299, fix #5328, fix #5308
Co-authored-by: 's avatarLoveSy <shana@zju.edu.cn>
parent ffec9a4d
...@@ -31,6 +31,12 @@ static void patch_init_rc(const char *src, const char *dest, const char *tmp_dir ...@@ -31,6 +31,12 @@ static void patch_init_rc(const char *src, const char *dest, const char *tmp_dir
fprintf(rc, "service flash_recovery /system/bin/xxxxx\n"); fprintf(rc, "service flash_recovery /system/bin/xxxxx\n");
return true; return true;
} }
// Samsung's persist.sys.zygote.early will start zygotes before actual post-fs-data phase
if (str_starts(line, "on property:persist.sys.zygote.early=")) {
LOGD("Invalidate persist.sys.zygote.early\n");
fprintf(rc, "on property:persist.sys.zygote.early.xxxxx=true\n");
return true;
}
// Else just write the line // Else just write the line
fprintf(rc, "%s", line.data()); fprintf(rc, "%s", line.data());
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment