From 4670f762d3d6590f80099ede85c7c3adf2a25c26 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 22 Mar 2024 15:45:54 -0700 Subject: [PATCH] Disable debug only features --- native/src/sepolicy/api.cpp | 3 +-- native/src/sepolicy/lib.rs | 1 + native/src/sepolicy/rules.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/native/src/sepolicy/api.cpp b/native/src/sepolicy/api.cpp index a69de7163..b23c0c460 100644 --- a/native/src/sepolicy/api.cpp +++ b/native/src/sepolicy/api.cpp @@ -1,11 +1,10 @@ #include -#include "flags.h" #include "policy.hpp" using Str = rust::Str; -#if MAGISK_DEBUG +#if 0 template std::string as_str(const Arg &arg) { if constexpr (std::is_same_v || std::is_same_v) { diff --git a/native/src/sepolicy/lib.rs b/native/src/sepolicy/lib.rs index a5e08e888..317ee6405 100644 --- a/native/src/sepolicy/lib.rs +++ b/native/src/sepolicy/lib.rs @@ -80,6 +80,7 @@ mod ffi { fn type_change(self: Pin<&mut sepolicy>, s: &str, t: &str, c: &str, d: &str); fn type_member(self: Pin<&mut sepolicy>, s: &str, t: &str, c: &str, d: &str); fn genfscon(self: Pin<&mut sepolicy>, s: &str, t: &str, c: &str); + #[allow(dead_code)] fn strip_dontaudit(self: Pin<&mut sepolicy>); } diff --git a/native/src/sepolicy/rules.rs b/native/src/sepolicy/rules.rs index 97a30925c..fe0ddda8b 100644 --- a/native/src/sepolicy/rules.rs +++ b/native/src/sepolicy/rules.rs @@ -132,8 +132,8 @@ impl SepolicyMagisk for sepolicy { deny(["init"], ["adb_data_file"], ["dir"], ["search"]); deny(["vendor_init"], ["adb_data_file"], ["dir"], ["search"]); } - // Remove all dontaudit in debug mode - #[cfg(debug_assertions)] + + #[cfg(any())] self.as_mut().strip_dontaudit(); set_log_level_state(LogLevel::Warn, true);