76 [[nodiscard, maybe_unused, gnu::visibility(
"default")]]
bool Init(
JNIEnv *env,
127 [[nodiscard, maybe_unused, gnu::visibility(
"default")]]
bool UnHook(
JNIEnv *env,
struct _jobject * jobject
jobject Hook(JNIEnv *env, jobject target_method, jobject hooker_object, jobject callback_method)
Hook a Java method by providing the target_method together with the context object hooker_object and ...
bool UnHook(JNIEnv *env, jobject target_method)
Unhook a Java function that is previously hooked.
bool IsHooked(JNIEnv *env, jobject method)
Check if a Java function is hooked by LSPlant or not.
bool MakeDexFileTrusted(JNIEnv *env, jobject cookie)
Make a DexFile trustable so that it can access hidden APIs. This is useful because we likely need to ...
bool Init(JNIEnv *env, const InitInfo &info)
Initialize LSPlant for the proceeding hook. It mainly prefetch needed symbols and hook some functions...
bool Deoptimize(JNIEnv *env, jobject method)
Deoptimize a method to avoid hooked callee not being called because of inline.
void * GetNativeFunction(JNIEnv *env, jobject method)
Get the registered native function pointer of a native function. It helps user to hook native methods...
bool MakeClassInheritable(JNIEnv *env, jclass target)
Make a class inheritable. It will make the class non-final and make all its private constructors prot...
Information and configuration that are needed to call Init()
InlineHookFunType inline_hooker
The inline hooker function. Must not be null.
std::string_view generated_class_name
The generated class name. Must not be empty. It contains a field and a method and they could be set b...
std::string_view generated_method_name
The generated class name. Must not be emtpy. If {target} is set, it will follows the name of the targ...
std::string_view generated_field_name
The generated field name. Must not be empty.
ArtSymbolResolver art_symbol_resolver
The symbol resolver to libart.so. Must not be null.
InlineUnhookFunType inline_unhooker
The inline unhooker function. Must not be null.
std::string_view generated_source_name
The generated source name. Could be empty.
ArtSymbolPrefixResolver art_symbol_prefix_resolver
The symbol prefix resolver to libart.so. May be null.