One stage zygisk loading

This commit is contained in:
LoveSy
2024-01-07 22:13:43 +08:00
committed by John Wu
parent df66458db6
commit 79334b7702
3 changed files with 7 additions and 22 deletions

View File

@@ -16,25 +16,11 @@ using namespace std;
void *self_handle = nullptr;
string native_bridge = "0";
extern "C" [[maybe_unused]] void zygisk_inject_entry(void *handle) {
self_handle = handle;
zygisk_logging();
hook_functions();
ZLOGD("load success\n");
}
static bool is_compatible_with(uint32_t) {
auto name = get_prop(NBPROP);
android_dlextinfo info = {
.flags = ANDROID_DLEXT_FORCE_LOAD
};
void *handle = android_dlopen_ext(name.data(), RTLD_LAZY, &info);
if (handle) {
auto entry = reinterpret_cast<void (*)(void *)>(dlsym(handle, "zygisk_inject_entry"));
if (entry) {
entry(handle);
}
}
android_logging();
hook_functions();
ZLOGD("load success\n");
return false;
}