mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-05 18:25:28 +08:00
Update the YukiHookXposedProcessor
This commit is contained in:
@@ -71,17 +71,6 @@ class YukiHookXposedProcessor : SymbolProcessorProvider {
|
|||||||
/** 插入 Xposed 尾部的名称 */
|
/** 插入 Xposed 尾部的名称 */
|
||||||
private val xposedClassShortName = "_YukiHookXposedInit"
|
private val xposedClassShortName = "_YukiHookXposedInit"
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取父类名称 - 只取最后一个
|
|
||||||
* @return [String]
|
|
||||||
*/
|
|
||||||
private val KSClassDeclaration.superName
|
|
||||||
get() = try {
|
|
||||||
superTypes.last().element.toString()
|
|
||||||
} catch (_: Throwable) {
|
|
||||||
""
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建一个环境方法体方便调用
|
* 创建一个环境方法体方便调用
|
||||||
* @param ignoredError 是否忽略错误 - 默认否
|
* @param ignoredError 是否忽略错误 - 默认否
|
||||||
@@ -128,7 +117,7 @@ class YukiHookXposedProcessor : SymbolProcessorProvider {
|
|||||||
fun fetchKSClassDeclaration(sourcePath: String, modulePackageName: String) {
|
fun fetchKSClassDeclaration(sourcePath: String, modulePackageName: String) {
|
||||||
asSequence().filterIsInstance<KSClassDeclaration>().forEach {
|
asSequence().filterIsInstance<KSClassDeclaration>().forEach {
|
||||||
if (injectOnce)
|
if (injectOnce)
|
||||||
if (it.superName == "YukiHookXposedInitProxy") {
|
if (it.superTypes.any { type -> type.element.toString() == "YukiHookXposedInitProxy" }) {
|
||||||
injectAssets(
|
injectAssets(
|
||||||
codePath = (it.location as? FileLocation?)?.filePath ?: "",
|
codePath = (it.location as? FileLocation?)?.filePath ?: "",
|
||||||
sourcePath = sourcePath,
|
sourcePath = sourcePath,
|
||||||
|
Reference in New Issue
Block a user