From be9e14ae3e09e1de509896d8da9cadc30766f54f Mon Sep 17 00:00:00 2001 From: hd Date: Thu, 12 Dec 2024 08:19:44 +0800 Subject: [PATCH] fix: FlashPicHook,GagInfoDisclosure,ShowAccurateGaggedTime on TIM_NT --- .../main/java/cc/hicore/hook/ShowAccurateGaggedTime.java | 4 +++- app/src/main/java/cc/ioctl/hook/chat/GagInfoDisclosure.kt | 4 +++- app/src/main/java/cc/ioctl/hook/msg/FlashPicHook.java | 8 +++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/cc/hicore/hook/ShowAccurateGaggedTime.java b/app/src/main/java/cc/hicore/hook/ShowAccurateGaggedTime.java index bc153ed829..8fa34519ab 100644 --- a/app/src/main/java/cc/hicore/hook/ShowAccurateGaggedTime.java +++ b/app/src/main/java/cc/hicore/hook/ShowAccurateGaggedTime.java @@ -21,6 +21,7 @@ package cc.hicore.hook; +import static io.github.qauxv.util.HostInfo.requireMinTimVersion; import static io.github.qauxv.util.HostInfo.requireMinQQVersion; import android.content.Context; @@ -34,6 +35,7 @@ import io.github.qauxv.hook.CommonSwitchFunctionHook; import io.github.qauxv.util.Initiator; import io.github.qauxv.util.QQVersion; +import io.github.qauxv.util.TIMVersion; @FunctionHookEntry @UiItemAgentEntry @@ -58,7 +60,7 @@ public String[] getUiItemLocation() { @Override protected boolean initOnce() throws Exception { - if (requireMinQQVersion(QQVersion.QQ_9_0_75)) { + if (requireMinQQVersion(QQVersion.QQ_9_0_75) || requireMinTimVersion(TIMVersion.TIM_4_0_95)) { HookUtils.hookBeforeIfEnabled(this, Reflex.findMethod(Initiator.loadClass("com.tencent.qqnt.troop.impl.TroopGagUtils"), String.class, "remainingTimeToStringCountDown", long.class), param -> { diff --git a/app/src/main/java/cc/ioctl/hook/chat/GagInfoDisclosure.kt b/app/src/main/java/cc/ioctl/hook/chat/GagInfoDisclosure.kt index 13b2c4babf..f71bbb73dd 100644 --- a/app/src/main/java/cc/ioctl/hook/chat/GagInfoDisclosure.kt +++ b/app/src/main/java/cc/ioctl/hook/chat/GagInfoDisclosure.kt @@ -39,12 +39,14 @@ import io.github.qauxv.util.Initiator import io.github.qauxv.util.Log import io.github.qauxv.util.QQVersion import io.github.qauxv.util.SyncUtils +import io.github.qauxv.util.TIMVersion import io.github.qauxv.util.dexkit.CMessageRecordFactory import io.github.qauxv.util.dexkit.DexKit import io.github.qauxv.util.dexkit.Hd_GagInfoDisclosure_Method import io.github.qauxv.util.dexkit.NContactUtils_getBuddyName import io.github.qauxv.util.dexkit.NContactUtils_getDiscussionMemberShowName import io.github.qauxv.util.requireMinQQVersion +import io.github.qauxv.util.requireMinTimVersion import xyz.nextalone.util.get @FunctionHookEntry @@ -124,7 +126,7 @@ object GagInfoDisclosure : CommonSwitchFunctionHook( } override fun initOnce(): Boolean { - if (requireMinQQVersion(QQVersion.QQ_9_0_73)) { + if (requireMinQQVersion(QQVersion.QQ_9_0_73) || requireMinTimVersion(TIMVersion.TIM_4_0_95)) { hookAfterIfEnabled(DexKit.requireMethodFromCache(Hd_GagInfoDisclosure_Method)) { param -> val msgInfo = param.args[1] val vMsg = msgInfo.get("vMsg") as ByteArray? ?: return@hookAfterIfEnabled diff --git a/app/src/main/java/cc/ioctl/hook/msg/FlashPicHook.java b/app/src/main/java/cc/ioctl/hook/msg/FlashPicHook.java index e86e4cebad..592e5a2375 100644 --- a/app/src/main/java/cc/ioctl/hook/msg/FlashPicHook.java +++ b/app/src/main/java/cc/ioctl/hook/msg/FlashPicHook.java @@ -22,6 +22,7 @@ package cc.ioctl.hook.msg; import static io.github.qauxv.util.HostInfo.requireMinQQVersion; +import static io.github.qauxv.util.HostInfo.requireMinTimVersion; import static io.github.qauxv.util.Initiator._MessageRecord; import static io.github.qauxv.util.Initiator._PicItemBuilder; import static io.github.qauxv.util.Initiator.load; @@ -34,17 +35,18 @@ import cc.ioctl.util.HookUtils; import cc.ioctl.util.Reflex; import com.tencent.qqnt.kernel.nativeinterface.MsgRecord; -import io.github.qauxv.util.xpcompat.XposedHelpers; import io.github.qauxv.base.annotation.FunctionHookEntry; import io.github.qauxv.base.annotation.UiItemAgentEntry; import io.github.qauxv.dsl.FunctionEntryRouter.Locations.Auxiliary; import io.github.qauxv.hook.CommonSwitchFunctionHook; import io.github.qauxv.util.QQVersion; +import io.github.qauxv.util.TIMVersion; import io.github.qauxv.util.dexkit.CBasePicDlProcessor; import io.github.qauxv.util.dexkit.CFlashPicHelper; import io.github.qauxv.util.dexkit.CItemBuilderFactory; import io.github.qauxv.util.dexkit.DexKit; import io.github.qauxv.util.dexkit.DexKitTarget; +import io.github.qauxv.util.xpcompat.XposedHelpers; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.Objects; @@ -90,8 +92,8 @@ public boolean isFlashPic(Object msgRecord) { @Override public boolean initOnce() throws Exception { // 闪照SubMsgType(8194 -> 2, 12288 -> 4096) - if (QAppUtils.isQQnt()) { - if (requireMinQQVersion(QQVersion.QQ_9_0_15)) { + if (QAppUtils.isQQnt() || requireMinTimVersion(TIMVersion.TIM_4_0_95)) { + if (requireMinQQVersion(QQVersion.QQ_9_0_15) || requireMinTimVersion(TIMVersion.TIM_4_0_95)) { Class AIOMsgItem = loadClass("com.tencent.mobileqq.aio.msg.AIOMsgItem"); HookUtils.hookAfterIfEnabled(this, AIOMsgItem.getDeclaredMethod("getMsgRecord"), param -> { MsgRecord msgRecord = (MsgRecord) param.getResult();