From 7df828b6d6e41341552e3400d8c9b0b1e06db4b6 Mon Sep 17 00:00:00 2001 From: hd Date: Tue, 21 Jan 2025 16:57:54 +0800 Subject: [PATCH] fix: SimplifyRecentDialog on TIM_NT Closes #1303 --- .../java/xyz/nextalone/hook/SimplifyRecentDialog.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/xyz/nextalone/hook/SimplifyRecentDialog.kt b/app/src/main/java/xyz/nextalone/hook/SimplifyRecentDialog.kt index ce73b3f8d9..9ed6492542 100644 --- a/app/src/main/java/xyz/nextalone/hook/SimplifyRecentDialog.kt +++ b/app/src/main/java/xyz/nextalone/hook/SimplifyRecentDialog.kt @@ -25,7 +25,9 @@ import io.github.qauxv.base.annotation.FunctionHookEntry import io.github.qauxv.base.annotation.UiItemAgentEntry import io.github.qauxv.dsl.FunctionEntryRouter import io.github.qauxv.util.QQVersion +import io.github.qauxv.util.TIMVersion import io.github.qauxv.util.requireMinQQVersion +import io.github.qauxv.util.requireMinTimVersion import xyz.nextalone.base.MultiItemDelayableHook import xyz.nextalone.util.clazz import xyz.nextalone.util.get @@ -47,16 +49,18 @@ object SimplifyRecentDialog : MultiItemDelayableHook("na_simplify_recent_dialog_ override fun initOnce() = throwOrTrue { val methodName: String val titleName: String - if (requireMinQQVersion(QQVersion.QQ_8_6_0)) { + if (requireMinQQVersion(QQVersion.QQ_8_6_0) || requireMinTimVersion(TIMVersion.TIM_4_0_95_BETA)) { methodName = "conversationPlusBuild" titleName = "title" } else { methodName = "b" titleName = "a" } - "com/tencent/widget/PopupMenuDialog".clazz?.method(methodName, + "com/tencent/widget/PopupMenuDialog".clazz?.method( + methodName, 4, - "com.tencent.widget.PopupMenuDialog".clazz)?.hookBefore(this) { + "com.tencent.widget.PopupMenuDialog".clazz + )?.hookBefore(this) { val list = (it.args[1] as List<*>).toMutableList() val iterator = list.iterator() while (iterator.hasNext()) { @@ -69,5 +73,5 @@ object SimplifyRecentDialog : MultiItemDelayableHook("na_simplify_recent_dialog_ } } - override val isAvailable: Boolean get() = requireMinQQVersion(QQVersion.QQ_8_3_9) + override val isAvailable: Boolean get() = requireMinQQVersion(QQVersion.QQ_8_3_9) || requireMinTimVersion(TIMVersion.TIM_4_0_95_BETA) }