From 59d39463247b8a2dc91d117b9f50e8b12fd804ea Mon Sep 17 00:00:00 2001 From: Hicores Date: Thu, 22 Jun 2023 13:21:43 +0800 Subject: [PATCH] fix: FlashPicHook on QQNT Signed-off-by: Hicores --- app/src/main/java/cc/ioctl/hook/msg/FlashPicHook.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 0e0cbc7cc0..16c8dfe5fb 100644 --- a/app/src/main/java/cc/ioctl/hook/msg/FlashPicHook.java +++ b/app/src/main/java/cc/ioctl/hook/msg/FlashPicHook.java @@ -28,8 +28,10 @@ import android.text.TextUtils; import android.view.View; import androidx.annotation.NonNull; +import cc.hicore.QApp.QAppUtils; import cc.ioctl.util.HookUtils; import cc.ioctl.util.Reflex; +import com.tencent.qqnt.kernel.nativeinterface.MsgRecord; import de.robv.android.xposed.XposedHelpers; import io.github.qauxv.base.annotation.FunctionHookEntry; import io.github.qauxv.base.annotation.UiItemAgentEntry; @@ -83,6 +85,14 @@ public boolean isFlashPic(Object msgRecord) { @Override public boolean initOnce() throws Exception { + if (QAppUtils.isQQnt()){ + HookUtils.hookAfterIfEnabled(this, MsgRecord.class.getDeclaredMethod("getSubMsgType"),param -> { + int result = (int) param.getResult(); + if (result == 8194)param.setResult(2); + else if (result == 12288)param.setResult(4096); + }); + return true; + } Class clz = DexKit.loadClassFromCache(CFlashPicHelper.INSTANCE); Objects.requireNonNull(clz, "CFLASH_PIC_HELPER.INSTANCE"); Method isFlashPic = null;