From a48c4f9e055d86450a692c70ae14eb59e93fe1fe Mon Sep 17 00:00:00 2001 From: osm0sis Date: Thu, 27 Jun 2019 18:01:00 -0300 Subject: [PATCH] magiskboot: don't clobber /overlay with cpio restore anymore - Magisk "dirty" flashes would remove the /overlay directory which might have been put there by a custom kernel or other mod - this is a leftover from when Magisk itself used /overlay for placing init.magisk.rc, so just remove this file specifically and leave the rest intact --- native/jni/magiskboot/ramdisk.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/native/jni/magiskboot/ramdisk.cpp b/native/jni/magiskboot/ramdisk.cpp index 07a6ac3e7..a4565b5e1 100644 --- a/native/jni/magiskboot/ramdisk.cpp +++ b/native/jni/magiskboot/ramdisk.cpp @@ -130,8 +130,8 @@ void magisk_cpio::restore() { } else { mv(cur, &cur->first[8]); } - } else if (str_starts(cur->first, "overlay") || - str_starts(cur->first, "magisk") || + } else if (str_starts(cur->first, "magisk") || + cur->first == "overlay/init.magisk.rc" || cur->first == "sbin/magic_mask.sh" || cur->first == "init.magisk.rc") { // Some known stuff we can remove