Refactor sepolicy.rules resolve native

Co-authored-by: LoveSy <shana@zju.edu.cn>
This commit is contained in:
vvb2060
2023-03-08 14:42:54 +08:00
committed by John Wu
parent 4de93cfd4b
commit 362eea741f
12 changed files with 163 additions and 122 deletions

View File

@@ -1,4 +1,5 @@
#include <sys/mount.h>
#include <sys/sysmacros.h>
#include <libgen.h>
#include <base.hpp>
@@ -133,6 +134,10 @@ int magisk_main(int argc, char *argv[]) {
return 0;
} else if (argc >= 3 && argv[1] == "--install-module"sv) {
install_module(argv[2]);
} else if (argv[1] == "--rules-device"sv) {
auto dev = find_rules_device(parse_mount_info("self"));
if (dev) printf("%u:%u\n", major(dev), minor(dev));
return dev ? 0 : 1;
}
#if 0
/* Entry point for testing stuffs */