mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-23 18:15:30 +00:00
SAR can also have monolithic sepolicy
This commit is contained in:
parent
f008420891
commit
32cd694ad5
@ -61,9 +61,6 @@ protected:
|
||||
// When this boolean is set, this means we are currently
|
||||
// running magiskinit on legacy SAR AVD emulator
|
||||
bool avd_hack = false;
|
||||
#else
|
||||
// Make it constexpr so compiler can optimize hacks out of the code
|
||||
static constexpr bool avd_hack = false;
|
||||
#endif
|
||||
|
||||
void patch_sepolicy(const char *file);
|
||||
|
@ -181,6 +181,7 @@ void SARBase::patch_ro_root() {
|
||||
|
||||
xmkdir(ROOTOVL, 0);
|
||||
|
||||
#if ENABLE_AVD_HACK
|
||||
// Handle avd hack
|
||||
if (avd_hack) {
|
||||
int src = xopen("/init", O_RDONLY | O_CLOEXEC);
|
||||
@ -193,6 +194,7 @@ void SARBase::patch_ro_root() {
|
||||
close(src);
|
||||
close(dest);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Handle overlay.d
|
||||
restore_folder(ROOTOVL, overlays);
|
||||
@ -233,14 +235,18 @@ void SARBase::patch_ro_root() {
|
||||
}
|
||||
}
|
||||
|
||||
if (access("/sepolicy", F_OK) == 0) {
|
||||
patch_sepolicy(ROOTOVL "/sepolicy");
|
||||
} else {
|
||||
hijack_sepolicy();
|
||||
}
|
||||
|
||||
// Mount rootdir
|
||||
magic_mount(ROOTOVL);
|
||||
int dest = xopen(ROOTMNT, O_WRONLY | O_CREAT, 0);
|
||||
write(dest, magic_mount_list.data(), magic_mount_list.length());
|
||||
close(dest);
|
||||
|
||||
hijack_sepolicy();
|
||||
|
||||
chdir("/");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user