mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-23 18:15:30 +00:00
parent
f9e82c9e8a
commit
44cfe94e4d
@ -3,11 +3,14 @@
|
||||
#include <unistd.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
int security_load_policy(void *data, size_t len) {
|
||||
__attribute__((constructor))
|
||||
static void preload_init() {
|
||||
// Make sure our next exec won't get bugged
|
||||
unsetenv("LD_PRELOAD");
|
||||
unlink("/dev/preload.so");
|
||||
}
|
||||
|
||||
int security_load_policy(void *data, size_t len) {
|
||||
int (*load_policy)(void *, size_t) = dlsym(RTLD_NEXT, "security_load_policy");
|
||||
// Skip checking errors, because if we cannot find the symbol, there
|
||||
// isn't much we can do other than crashing anyways.
|
||||
|
Loading…
Reference in New Issue
Block a user