mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-24 18:45:28 +00:00
clean code
This commit is contained in:
parent
9a00b7b942
commit
2282365cf8
@ -15,17 +15,10 @@ void MagiskInit::patch_sepolicy(const char *in, const char *out) {
|
|||||||
sepol->magisk_rules();
|
sepol->magisk_rules();
|
||||||
|
|
||||||
// Custom rules
|
// Custom rules
|
||||||
if (auto dir = xopen_dir("/data/" PREINITMIRR)) {
|
auto rule = "/data/" PREINITMIRR "/sepolicy.rule";
|
||||||
for (dirent *entry; (entry = xreaddir(dir.get()));) {
|
if (xaccess(rule, R_OK) == 0) {
|
||||||
auto name = "/data/" PREINITMIRR "/"s + entry->d_name;
|
LOGD("Loading custom sepolicy patch: [%s]\n", rule);
|
||||||
auto rule = name + "/sepolicy.rule";
|
sepol->load_rule_file(rule);
|
||||||
if (xaccess(rule.data(), R_OK) == 0 &&
|
|
||||||
access((name + "/disable").data(), F_OK) != 0 &&
|
|
||||||
access((name + "/remove").data(), F_OK) != 0) {
|
|
||||||
LOGD("Loading custom sepolicy patch: [%s]\n", rule.data());
|
|
||||||
sepol->load_rule_file(rule.data());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGD("Dumping sepolicy to: [%s]\n", out);
|
LOGD("Dumping sepolicy to: [%s]\n", out);
|
||||||
|
@ -583,7 +583,7 @@ copy_preinit_files() {
|
|||||||
[ -f $MODDIR/update ] && continue
|
[ -f $MODDIR/update ] && continue
|
||||||
cat $r
|
cat $r
|
||||||
echo
|
echo
|
||||||
done > $PREINITDIR/0/sepolicy.rule
|
done > $PREINITDIR/sepolicy.rule
|
||||||
}
|
}
|
||||||
|
|
||||||
#################
|
#################
|
||||||
|
Loading…
Reference in New Issue
Block a user