Update the YukiHookXposedProcessor

This commit is contained in:
2022-04-11 14:58:12 +08:00
parent 091b2a144f
commit 91e6903e22

View File

@@ -71,17 +71,6 @@ class YukiHookXposedProcessor : SymbolProcessorProvider {
/** 插入 Xposed 尾部的名称 */
private val xposedClassShortName = "_YukiHookXposedInit"
/**
* 获取父类名称 - 只取最后一个
* @return [String]
*/
private val KSClassDeclaration.superName
get() = try {
superTypes.last().element.toString()
} catch (_: Throwable) {
""
}
/**
* 创建一个环境方法体方便调用
* @param ignoredError 是否忽略错误 - 默认否
@@ -128,7 +117,7 @@ class YukiHookXposedProcessor : SymbolProcessorProvider {
fun fetchKSClassDeclaration(sourcePath: String, modulePackageName: String) {
asSequence().filterIsInstance<KSClassDeclaration>().forEach {
if (injectOnce)
if (it.superName == "YukiHookXposedInitProxy") {
if (it.superTypes.any { type -> type.element.toString() == "YukiHookXposedInitProxy" }) {
injectAssets(
codePath = (it.location as? FileLocation?)?.filePath ?: "",
sourcePath = sourcePath,