Disable debug only features

This commit is contained in:
topjohnwu 2024-03-22 15:45:54 -07:00
parent efa49567fa
commit 4670f762d3
3 changed files with 4 additions and 4 deletions

View File

@ -1,11 +1,10 @@
#include <base.hpp> #include <base.hpp>
#include "flags.h"
#include "policy.hpp" #include "policy.hpp"
using Str = rust::Str; using Str = rust::Str;
#if MAGISK_DEBUG #if 0
template<typename Arg> template<typename Arg>
std::string as_str(const Arg &arg) { std::string as_str(const Arg &arg) {
if constexpr (std::is_same_v<Arg, const char *> || std::is_same_v<Arg, char *>) { if constexpr (std::is_same_v<Arg, const char *> || std::is_same_v<Arg, char *>) {

View File

@ -80,6 +80,7 @@ mod ffi {
fn type_change(self: Pin<&mut sepolicy>, s: &str, t: &str, c: &str, d: &str); 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 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); fn genfscon(self: Pin<&mut sepolicy>, s: &str, t: &str, c: &str);
#[allow(dead_code)]
fn strip_dontaudit(self: Pin<&mut sepolicy>); fn strip_dontaudit(self: Pin<&mut sepolicy>);
} }

View File

@ -132,8 +132,8 @@ impl SepolicyMagisk for sepolicy {
deny(["init"], ["adb_data_file"], ["dir"], ["search"]); deny(["init"], ["adb_data_file"], ["dir"], ["search"]);
deny(["vendor_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(); self.as_mut().strip_dontaudit();
set_log_level_state(LogLevel::Warn, true); set_log_level_state(LogLevel::Warn, true);