From d1be34c34acafa4db1ae29fa062ce61bde478c5e Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 2 Feb 2018 04:17:13 +0800 Subject: [PATCH] Support sepolicy_debug --- native/jni/core/magiskinit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/native/jni/core/magiskinit.c b/native/jni/core/magiskinit.c index 80240e003..7b8e36bad 100644 --- a/native/jni/core/magiskinit.c +++ b/native/jni/core/magiskinit.c @@ -318,6 +318,12 @@ static int patch_sepolicy() { sepol_magisk_rules(); dump_policydb("/sepolicy"); + // Remove the stupid debug sepolicy and use our own + if (access("/sepolicy_debug", F_OK) == 0) { + unlink("/sepolicy_debug"); + link("/sepolicy", "/sepolicy_debug"); + } + return 0; }