mirror of
https://github.com/topjohnwu/Magisk.git
synced 2026-01-11 04:34:40 -08:00
Refactor sepolicy.rules resolve native
Co-authored-by: LoveSy <shana@zju.edu.cn>
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user