Unverified Commit 89c2c217 authored by 残页's avatar 残页 Committed by GitHub

Fix init.rc path detection

Fix #4319
Some devices store init.rc into the new path but still have the legacy /init.rc file
parent 2954eb4b
......@@ -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
......
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