mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-17 16:38:28 +00:00
More Q cleanup
This commit is contained in:
parent
bb67a837d3
commit
aac9e85e04
@ -41,11 +41,6 @@ constexpr const char wrapper[] =
|
|||||||
|
|
||||||
void RootFSInit::setup_rootfs() {
|
void RootFSInit::setup_rootfs() {
|
||||||
if (patch_sepolicy()) {
|
if (patch_sepolicy()) {
|
||||||
constexpr char SYSTEM_INIT[] = "/system/bin/init";
|
|
||||||
// If init is symlink, copy it to rootfs so we can patch
|
|
||||||
if (is_lnk("/init"))
|
|
||||||
cp_afc(SYSTEM_INIT, "/init");
|
|
||||||
|
|
||||||
char *addr;
|
char *addr;
|
||||||
size_t size;
|
size_t size;
|
||||||
mmap_rw("/init", addr, size);
|
mmap_rw("/init", addr, size);
|
||||||
@ -54,12 +49,7 @@ void RootFSInit::setup_rootfs() {
|
|||||||
// Force init to load /sepolicy
|
// Force init to load /sepolicy
|
||||||
LOGD("Remove from init: " SPLIT_PLAT_CIL "\n");
|
LOGD("Remove from init: " SPLIT_PLAT_CIL "\n");
|
||||||
memset(p, 'x', sizeof(SPLIT_PLAT_CIL) - 1);
|
memset(p, 'x', sizeof(SPLIT_PLAT_CIL) - 1);
|
||||||
p += sizeof(SPLIT_PLAT_CIL) - 1;
|
break;
|
||||||
} else if (memcmp(p, SYSTEM_INIT, sizeof(SYSTEM_INIT)) == 0) {
|
|
||||||
// Force execute /init instead of /system/bin/init
|
|
||||||
LOGD("Patch init: [/system/bin/init] -> [/init]\n");
|
|
||||||
strcpy(p, "/init");
|
|
||||||
p += sizeof(SYSTEM_INIT) - 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
munmap(addr, size);
|
munmap(addr, size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user