add Patch
Hook the given reflective member (method or constructor) with the provided hook.
Return
an Unhook that can remove the applied hook
Parameters
member
the method or constructor to hook
hook
the XC_MethodHook to apply
fun addPatch(clazz: Class<*>, methodName: String, paramTypes: Array<Class<*>> = emptyArray(), hook: XC_MethodHook): XC_MethodHook.Unhook?
Hook the method with the given name on the specified class.
Return
an Unhook that can remove the applied hook, or null on failure
Parameters
clazz
the class containing the method
method Name
the name of the method to hook
param Types
the parameter types (defaults to none)
hook
the XC_MethodHook to apply
fun addPatch(forClass: String, methodName: String, paramTypes: Array<Class<*>> = emptyArray(), hook: XC_MethodHook): XC_MethodHook.Unhook?
Load the class by name and hook the specified method.
Return
an Unhook that can remove the applied hook, or null on failure
Parameters
for Class
the full name of the class to load (e.g. com.example.MyClass)
method Name
the name of the method to hook
param Types
the parameter types (defaults to none)
hook
the XC_MethodHook to apply