patch

fun patch(forClass: String, fn: String, paramTypes: Array<Class<*>> = emptyArray(), hook: XC_MethodHook): Unpatch

Patch a method by class name.

Return

an Unpatch that will remove the applied hook

Parameters

forClass

full name of the class containing the method

fn

method name to patch

paramTypes

parameter types to select an overload

hook

the XC_MethodHook callback to apply


fun patch(clazz: Class<*>, fn: String, paramTypes: Array<Class<*>> = emptyArray(), hook: XC_MethodHook): Unpatch

Patch a method by Class.

Return

an Unpatch that will remove the applied hook

Parameters

clazz

the class containing the method

fn

method name to patch

paramTypes

parameter types to select an overload

hook

the XC_MethodHook callback to apply


fun patch(m: Member, hook: XC_MethodHook): Unpatch

Patch a specific method or constructor.

Return

an Unpatch that will remove the applied hook

Parameters

m

the reflective Member (method or constructor) to hook

hook

the XC_MethodHook callback to apply


Patch a specific method or constructor using a MethodHookCallback.

Return

an Unpatch that will remove the applied hook

Parameters

m

the reflective Member (method or constructor) to hook

callback

the callback wrapper to apply