fix: check origin return value is an issue with type Any (#111)

* fix: check origin return value is an issue with type Any

* refactor: replace to modern usage

---------

Co-authored-by: fankesyooni <qzmmcn@163.com>
This commit is contained in:
Hd
2025-08-19 19:46:46 +08:00
committed by GitHub
parent e1544a8ae3
commit bab5068484

View File

@@ -26,6 +26,7 @@
package com.highcapable.yukihookapi.hook.core
import com.highcapable.kavaref.extension.classOf
import com.highcapable.kavaref.extension.isNotSubclassOf
import com.highcapable.yukihookapi.YukiHookAPI
import com.highcapable.yukihookapi.hook.bean.HookClass
@@ -545,6 +546,7 @@ class YukiMemberHookCreator internal constructor(private val packageParam: Packa
*/
private fun checkingReturnType(origin: Class<*>?, target: Class<*>?) {
if (origin == null || target == null) return
if (origin == classOf<Any>()) return
origin.toJavaPrimitiveType().also { o ->
target.toJavaPrimitiveType().also { t ->
if (o isNotSubclassOf t && t isNotSubclassOf o)