From 51e9ff59de560d04700270423b96f052af34793d Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Thu, 29 Nov 2018 06:31:05 -0500 Subject: [PATCH] Temporarily suppress warnings when applying Magisk rules --- native/jni/magiskpolicy/rules.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/native/jni/magiskpolicy/rules.cpp b/native/jni/magiskpolicy/rules.cpp index 88e00a53e..0c5df399f 100644 --- a/native/jni/magiskpolicy/rules.cpp +++ b/native/jni/magiskpolicy/rules.cpp @@ -28,6 +28,10 @@ static void allowSuClient(const char *target) { } void sepol_magisk_rules() { + // Temp suppress warnings + auto bak = log_cb.w; + log_cb.w = nop_log; + // First prevent anything to change sepolicy except ourselves sepol_deny(ALL, "kernel", "security", "load_policy"); @@ -171,4 +175,6 @@ void sepol_magisk_rules() { if (p->key.specified == AVTAB_AUDITDENY || p->key.specified == AVTAB_XPERMS_DONTAUDIT) avtab_remove_node(&policydb->te_avtab, p); }); + + log_cb.w = bak; }