From 79e2211ef1bd427789cc6bcc2d6e1791fb05dcfd Mon Sep 17 00:00:00 2001 From: hd Date: Sun, 22 Dec 2024 11:32:37 +0800 Subject: [PATCH] fix: SendPangu on TIM_NT --- app/src/main/java/cc/microblock/hook/Pangu.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/cc/microblock/hook/Pangu.kt b/app/src/main/java/cc/microblock/hook/Pangu.kt index 011d1fd7be..d91b3ebb8a 100644 --- a/app/src/main/java/cc/microblock/hook/Pangu.kt +++ b/app/src/main/java/cc/microblock/hook/Pangu.kt @@ -27,9 +27,11 @@ import io.github.qauxv.base.annotation.UiItemAgentEntry import io.github.qauxv.dsl.FunctionEntryRouter import io.github.qauxv.hook.CommonSwitchFunctionHook import io.github.qauxv.util.QQVersion +import io.github.qauxv.util.TIMVersion import io.github.qauxv.util.dexkit.AIOTextElementCtor import io.github.qauxv.util.dexkit.DexKit import io.github.qauxv.util.requireMinQQVersion +import io.github.qauxv.util.requireMinTimVersion import xyz.nextalone.util.get import xyz.nextalone.util.hookBefore import xyz.nextalone.util.set @@ -177,7 +179,11 @@ object SendPangu : CommonSwitchFunctionHook("sendMsgPangu", arrayOf(AIOTextEleme override fun initOnce(): Boolean { DexKit.requireMethodFromCache(AIOTextElementCtor) .hookBefore(this) { - val inputStrFieldName = if (requireMinQQVersion(QQVersion.QQ_9_0_56)) "e" else "a" + val inputStrFieldName = when { + requireMinTimVersion(TIMVersion.TIM_4_0_95) -> "d" + requireMinQQVersion(QQVersion.QQ_9_0_56) -> "e" + else -> "a" + } val content = it.args[0].get(inputStrFieldName) as String if (!content.startsWith(",,") && !content.startsWith(",,")) it.args[0].set(inputStrFieldName, processPangu(content))