refactor: make some change for dexkit

This commit is contained in:
2024-06-17 01:22:15 +08:00
parent c5711338e3
commit 80e89d087f
2 changed files with 5 additions and 5 deletions

View File

@@ -171,7 +171,7 @@ object QQTIMHooker : YukiBaseHooker() {
paramCount = 0
returnType = UnitType.name
}
}.firstOrNull()?.getMethodInstance(classLoader)
}.singleOrNull()?.getMethodInstance(classLoader)
DexKitData.BaseChatPie_CancelRemainScreenOnMethod =
findMethod {
matcher {
@@ -180,7 +180,7 @@ object QQTIMHooker : YukiBaseHooker() {
paramCount = 0
returnType = UnitType.name
}
}.firstOrNull()?.getMethodInstance(classLoader)
}.singleOrNull()?.getMethodInstance(classLoader)
}
val kotlinFunction0 = "kotlin.jvm.functions.Function0"
findClass {
@@ -198,7 +198,7 @@ object QQTIMHooker : YukiBaseHooker() {
}
fields { count(6..Int.MAX_VALUE) }
}
}.firstOrNull()?.name?.also { className ->
}.singleOrNull()?.name?.also { className ->
DexKitData.SimpleItemProcessorClass = className.toClass()
DexKitData.SimpleItemProcessorClass_OnClickMethod =
findMethod {
@@ -208,7 +208,7 @@ object QQTIMHooker : YukiBaseHooker() {
returnType = UnitType.name
usingNumbers(2)
}
}.firstOrNull()?.getMethodInstance(classLoader)
}.singleOrNull()?.getMethodInstance(classLoader)
}
}
}

View File

@@ -51,6 +51,6 @@ object DexKitHelper {
*/
fun create(param: PackageParam, initiate: DexKitBridge.() -> Unit) {
load()
runCatching { DexKitBridge.create(param.appInfo.sourceDir)?.use { initiate(it) } }
runCatching { DexKitBridge.create(param.appInfo.sourceDir).use { initiate(it) } }
}
}