Temporarily suppress warnings when applying Magisk rules

This commit is contained in:
topjohnwu 2018-11-29 06:31:05 -05:00
parent 2977dbcded
commit 51e9ff59de

View File

@ -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;
}