before

inline fun <T> PatcherAPI.before(vararg paramTypes: Class<*>, crossinline callback: HookCallback<T>): Runnable

Adds a PreHook to a constructor of a class.

Return

The Runnable object of the patch

Parameters

paramTypes

parameters of the constructor. Useful for patching individual overloads

callback

callback for the patch

See also

XC_MethodHook.beforeHookedMethod

inline fun <T> PatcherAPI.before(methodName: String, vararg paramTypes: Class<*>, crossinline callback: HookCallback<T>): Runnable

Adds a PreHook to a method of a class.

Return

The Runnable object of the patch

Parameters

methodName

name of the method to patch

paramTypes

parameters of the method. Useful for patching individual overloads

callback

callback for the patch

See also

XC_MethodHook.beforeHookedMethod