diff --git a/native/jni/core/daemon.cpp b/native/jni/core/daemon.cpp index bcc661e14..72831ef94 100644 --- a/native/jni/core/daemon.cpp +++ b/native/jni/core/daemon.cpp @@ -360,8 +360,15 @@ static void daemon_entry() { return true; }); } - unlink("/dev/.se"); - unlink(mount_list.data()); + rm_rf((MAGISKTMP + "/" ROOTOVL).data()); + + // SELinux mock cleanups + string selinux_mock = MAGISKTMP + "/" SELINUXMOCK; + string fs = selinux_mock + "/fs"; + if (access(fs.data(), F_OK) == 0) { + umount2(fs.data(), MNT_DETACH); + } + rm_rf(selinux_mock.data()); // Load config status auto config = MAGISKTMP + "/" INTLROOT "/config";