mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-12 01:01:49 +00:00
Support SELinux disabled on debug builds
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <base.hpp>
|
||||
#include <socket.hpp>
|
||||
#include <daemon.hpp>
|
||||
#include <selinux.hpp>
|
||||
|
||||
#include "zygisk.hpp"
|
||||
|
||||
@@ -17,7 +18,14 @@ int app_process_main(int argc, char *argv[]) {
|
||||
char buf[PATH_MAX];
|
||||
|
||||
bool zygote = false;
|
||||
if (auto fp = open_file("/proc/self/attr/current", "r")) {
|
||||
if (!selinux_enabled()) {
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
if (argv[i] == "--zygote"sv) {
|
||||
zygote = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (auto fp = open_file("/proc/self/attr/current", "r")) {
|
||||
fscanf(fp.get(), "%s", buf);
|
||||
zygote = (buf == "u:r:zygote:s0"sv);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user