INNER CODE UNIT · Kotlin

IHookCallback

NexAlloy/NexAlloy · app/src/main/java/io/github/nexalloy/Helper.kt:22

typealias IHookCallback = (MethodHookParam) -> Unit

fun <T> Array<T>.atLast(index: Int) = this[this.size - index]

private val proxyRef = WeakHashMap<Any, Any>()

/*
 * Bind a proxy to the implement's lifecycle via WeakHashMap.
 *
 *
 * Do not hold a strong reference to `impl` inside the proxy!
 * It will create a strong-reference loop and cause memory leaks.
 *
 * See Implementation note https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/WeakHashMap.html
 * */
internal fun <TImpl> TImpl.bindProxy(proxy: Any) {
    synchronized(proxyRef) {
        proxyRef[this] = proxy

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…