Refine zygisk api
This commit is contained in:
parent
cf0e552715
commit
5eaec4596a
|
|
@ -273,17 +273,13 @@ void zygisk_companion_entry(int client) { func(client); }
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
void entry_impl(api_table *table, JNIEnv *env) {
|
void entry_impl(api_table *table, JNIEnv *env) {
|
||||||
static T module{};
|
static Api api;
|
||||||
|
api.impl = table;
|
||||||
|
static T module;
|
||||||
ModuleBase *m = &module;
|
ModuleBase *m = &module;
|
||||||
static module_abi abi(m);
|
static module_abi abi(m);
|
||||||
static bool loaded = table->registerModule(table, &abi);
|
if (!table->registerModule(table, &abi)) return;
|
||||||
if (!loaded) return;
|
m->onLoad(&api, env);
|
||||||
[[maybe_unused]] static Api api = [&] {
|
|
||||||
Api api;
|
|
||||||
api.impl = table;
|
|
||||||
m->onLoad(&api, env);
|
|
||||||
return api;
|
|
||||||
}();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue