From e1987c42c407c972547e8dd37db02f4f51453d69 Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Sat, 9 Apr 2022 17:13:30 +0800 Subject: [PATCH] Cleanup SELinux mock files --- native/jni/core/daemon.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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";