INNER CODE UNIT · Kotlin
Replacer
NexAlloy/NexAlloy · app/src/main/java/io/github/nexalloy/KotlinXposedHelper.kt:33
typealias Replacer = (MethodHookParam) -> Any?
fun MethodHookParam.invokeOriginalMethod(): Any? = invokeOriginalMethod(method, thisObject, args)
fun MethodHookParam.invokeOriginalMethod(args: Array<*>?): Any? =
invokeOriginalMethod(method, thisObject, args)
inline fun <T, R> T.runCatchingOrNull(func: T.() -> R?) = try {
func()
} catch (e: Throwable) {
null
}
fun Any.getObjectField(field: String?): Any? = getObjectField(this, field)
fun Any.getObjectFieldOrNull(field: String?): Any? = runCatchingOrNull {
getObjectField(this, field)
}