mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-21 15:05:28 +00:00
Fix sepolicy rule path
This commit is contained in:
parent
0dc596e206
commit
f488e9df8f
@ -100,18 +100,10 @@ bool MagiskInit::hijack_sepolicy() {
|
||||
|
||||
// Read all custom rules into memory
|
||||
string rules;
|
||||
if (auto dir = xopen_dir("/data/" PREINITMIRR)) {
|
||||
for (dirent *entry; (entry = xreaddir(dir.get()));) {
|
||||
auto name = "/data/" PREINITMIRR "/"s + entry->d_name;
|
||||
auto rule_file = name + "/sepolicy.rule";
|
||||
if (xaccess(rule_file.data(), R_OK) == 0 &&
|
||||
access((name + "/disable").data(), F_OK) != 0 &&
|
||||
access((name + "/remove").data(), F_OK) != 0) {
|
||||
LOGD("Load custom sepolicy patch: [%s]\n", rule_file.data());
|
||||
full_read(rule_file.data(), rules);
|
||||
rules += '\n';
|
||||
}
|
||||
}
|
||||
auto rule = "/data/" PREINITMIRR "/sepolicy.rule";
|
||||
if (xaccess(rule, R_OK) == 0) {
|
||||
LOGD("Loading custom sepolicy patch: [%s]\n", rule);
|
||||
rules = full_read(rule);
|
||||
}
|
||||
// Create a new process waiting for init operations
|
||||
if (xfork()) {
|
||||
|
Loading…
Reference in New Issue
Block a user