mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-24 02:25:28 +00:00
Fix init.rc path detection
Fix #4319 Some devices store init.rc into the new path but still have the legacy /init.rc file
This commit is contained in:
parent
2954eb4bdc
commit
89c2c21774
@ -285,12 +285,12 @@ void SARBase::patch_rootdir() {
|
||||
}
|
||||
|
||||
// Patch init.rc
|
||||
if (access("/init.rc", F_OK) == 0) {
|
||||
patch_init_rc("/init.rc", ROOTOVL "/init.rc", tmp_dir.data());
|
||||
} else {
|
||||
if (access(NEW_INITRC, F_OK) == 0) {
|
||||
// Android 11's new init.rc
|
||||
xmkdirs(dirname(ROOTOVL NEW_INITRC), 0755);
|
||||
patch_init_rc(NEW_INITRC, ROOTOVL NEW_INITRC, tmp_dir.data());
|
||||
} else {
|
||||
patch_init_rc("/init.rc", ROOTOVL "/init.rc", tmp_dir.data());
|
||||
}
|
||||
|
||||
// Extract magisk
|
||||
|
Loading…
Reference in New Issue
Block a user