Skip to content

Commit

Permalink
fix: MultiActionHook on 9.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
klxiaoniu committed Oct 10, 2024
1 parent c6ffe95 commit d2fca54
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
31 changes: 19 additions & 12 deletions app/src/main/java/io/github/qauxv/util/dexkit/DexKitTarget.kt
Original file line number Diff line number Diff line change
Expand Up @@ -796,24 +796,31 @@ data object AIOTextElementCtor : DexKitTarget.UsingStr() {
}

data object AIOPicElementType : DexKitTarget.UsingStr() {
override val findMethod: Boolean = false;
override val declaringClass = "com.tencent.mobileqq.aio.msg.AIOMsgElementType.PicElement";
override val traitString = arrayOf("PicElement(origPath=");
override val filter = DexKitFilter.strInClsName("com/tencent/qqnt/aio/");
override val findMethod: Boolean = false
override val declaringClass = "com.tencent.mobileqq.aio.msg.AIOMsgElementType.PicElement"
override val traitString = arrayOf("PicElement(origPath=")
override val filter = DexKitFilter.strInClsName("com/tencent/qqnt/aio/")
}

data object MultiSelectToBottomIntent : DexKitTarget.UsingStr() {
override val findMethod: Boolean = false;
override val declaringClass = "com.tencent.mobileqq.aio.input.multiselect.c.toBottomIntent";
override val traitString = arrayOf("SelectToBottom(dividingLineTop=");
override val filter = DexKitFilter.strInClsName("com/tencent/mobileqq/aio/input/multiselect");
override val findMethod: Boolean = false
override val declaringClass = "com.tencent.mobileqq.aio.input.multiselect.c.toBottomIntent"
override val traitString = arrayOf("SelectToBottom(dividingLineTop=")
override val filter = DexKitFilter.strInClsName("com/tencent/mobileqq/aio/input/multiselect")
}

data object MultiSelectBarVM : DexKitTarget.UsingStr() {
override val findMethod: Boolean = false
override val declaringClass = ""
override val traitString = arrayOf("MultiSelectBarVM")
override val filter = DexKitFilter.allowAll
}

data object AIOSendMsg : DexKitTarget.UsingStr() {
override val findMethod: Boolean = true;
override val declaringClass = "com.tencent.mobileqq.aio.input.sendmsg.AIOSendMsgVMDelegate.sendMsg";
override val traitString = arrayOf("[sendMsg] elements is empty");
override val filter = DexKitFilter.strInClsName("com/tencent/mobileqq/aio/input/sendmsg/AIOSendMsgVMDelegate");
override val findMethod: Boolean = true
override val declaringClass = "com.tencent.mobileqq.aio.input.sendmsg.AIOSendMsgVMDelegate.sendMsg"
override val traitString = arrayOf("[sendMsg] elements is empty")
override val filter = DexKitFilter.strInClsName("com/tencent/mobileqq/aio/input/sendmsg/AIOSendMsgVMDelegate")
}

data object AIODelegate_ISwipeListener : DexKitTarget.UsingStringVector() {
Expand Down
9 changes: 7 additions & 2 deletions app/src/main/java/me/ketal/hook/MultiActionHook.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,16 @@ import io.github.qauxv.ui.ResUtils
import io.github.qauxv.util.Initiator
import io.github.qauxv.util.Initiator._BaseChatPie
import io.github.qauxv.util.Log
import io.github.qauxv.util.QQVersion
import io.github.qauxv.util.SyncUtils
import io.github.qauxv.util.dexkit.CMessageCache
import io.github.qauxv.util.dexkit.CMessageRecordFactory
import io.github.qauxv.util.dexkit.CMultiMsgManager
import io.github.qauxv.util.dexkit.DexKit
import io.github.qauxv.util.dexkit.MultiSelectBarVM
import io.github.qauxv.util.dexkit.MultiSelectToBottomIntent
import io.github.qauxv.util.dexkit.NBaseChatPie_createMulti
import io.github.qauxv.util.requireMinQQVersion
import mqq.app.AppActivity
import xyz.nextalone.util.hookAfter
import xyz.nextalone.util.hookBefore
Expand All @@ -74,7 +77,8 @@ object MultiActionHook : CommonSwitchFunctionHook(
CMessageRecordFactory,
NBaseChatPie_createMulti,
CMultiMsgManager,
MultiSelectToBottomIntent
MultiSelectToBottomIntent,
MultiSelectBarVM,
)
), SessionHooker.IAIOParamUpdate {

Expand Down Expand Up @@ -141,7 +145,8 @@ object MultiActionHook : CommonSwitchFunctionHook(
}
val intentClass = DexKit.requireClassFromCache(MultiSelectToBottomIntent)
val multiSelectUtilClazz = Initiator.loadClass("com.tencent.mobileqq.aio.msglist.holder.component.multifoward.b")
Initiator.loadClass("com.tencent.mobileqq.aio.input.multiselect.MultiSelectBarVM")
(if (requireMinQQVersion(QQVersion.QQ_9_1_5_BETA_20015)) DexKit.requireClassFromCache(MultiSelectBarVM)
else Initiator.loadClass("com.tencent.mobileqq.aio.input.multiselect.MultiSelectBarVM"))
.method("handleIntent")!!
.hookBefore(this) {
// 劫持一个 intent 自己传参
Expand Down

0 comments on commit d2fca54

Please sign in to comment.