Skip to content

Commit

Permalink
fix: FlashPicHook,GagInfoDisclosure,ShowAccurateGaggedTime on TIM_NT
Browse files Browse the repository at this point in the history
  • Loading branch information
HdShare committed Dec 12, 2024
1 parent d7b5a06 commit be9e14a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion app/src/main/java/cc/hicore/hook/ShowAccurateGaggedTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -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 -> {
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/cc/ioctl/hook/chat/GagInfoDisclosure.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions app/src/main/java/cc/ioctl/hook/msg/FlashPicHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit be9e14a

Please sign in to comment.