Commit 2468f5a6 authored by topjohnwu's avatar topjohnwu

Fix custom sepolicy patches

parent 945a52a9
...@@ -144,7 +144,7 @@ bool MagiskInit::patch_sepolicy(const char *file) { ...@@ -144,7 +144,7 @@ bool MagiskInit::patch_sepolicy(const char *file) {
sepol_allow(SEPOL_PROC_DOMAIN, ALL, ALL, ALL); sepol_allow(SEPOL_PROC_DOMAIN, ALL, ALL, ALL);
// Custom rules // Custom rules
if (auto dir = xopen_dir(persist_dir.data()); dir) { if (auto dir = open_dir(persist_dir.data()); dir) {
for (dirent *entry; (entry = xreaddir(dir.get()));) { for (dirent *entry; (entry = xreaddir(dir.get()));) {
auto rule = persist_dir + "/" + entry->d_name + "/sepolicy.rule"; auto rule = persist_dir + "/" + entry->d_name + "/sepolicy.rule";
if (access(rule.data(), R_OK) == 0) { if (access(rule.data(), R_OK) == 0) {
...@@ -238,7 +238,7 @@ void SARBase::patch_rootdir() { ...@@ -238,7 +238,7 @@ void SARBase::patch_rootdir() {
} }
setup_tmp(tmp_dir, self, config); setup_tmp(tmp_dir, self, config);
persist_dir = string(tmp_dir) + "/" MIRRDIR "/persist"; persist_dir = MIRRDIR "/persist/magisk";
chdir(tmp_dir); chdir(tmp_dir);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment