mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-01-12 06:53:38 +00:00
Patch monolithic sepolicy only if not treble
This commit is contained in:
parent
0f07bbb3e5
commit
3dc7d77ea9
@ -278,6 +278,12 @@ void MagiskInit::patch_rw_root() {
|
|||||||
patch_init_rc("/init.rc", "/init.p.rc", "/sbin");
|
patch_init_rc("/init.rc", "/init.p.rc", "/sbin");
|
||||||
rename("/init.p.rc", "/init.rc");
|
rename("/init.p.rc", "/init.rc");
|
||||||
|
|
||||||
|
bool treble;
|
||||||
|
{
|
||||||
|
auto init = mmap_data("/init");
|
||||||
|
treble = init.contains(SPLIT_PLAT_CIL);
|
||||||
|
}
|
||||||
|
|
||||||
xmkdir(PRE_TMPDIR, 0);
|
xmkdir(PRE_TMPDIR, 0);
|
||||||
setup_tmp(PRE_TMPDIR);
|
setup_tmp(PRE_TMPDIR);
|
||||||
chdir(PRE_TMPDIR);
|
chdir(PRE_TMPDIR);
|
||||||
@ -303,7 +309,7 @@ void MagiskInit::patch_rw_root() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (access("/sepolicy", F_OK) == 0) {
|
if (!treble && access("/sepolicy", F_OK) == 0) {
|
||||||
patch_sepolicy("/sepolicy");
|
patch_sepolicy("/sepolicy");
|
||||||
} else {
|
} else {
|
||||||
hijack_sepolicy();
|
hijack_sepolicy();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user