Skip to content

Commit

Permalink
fix: fix multi recall for 8.9.76 and 8.9.75
Browse files Browse the repository at this point in the history
没测过 8.9.73 还能不能用(应该能
  • Loading branch information
std-microblock committed Aug 22, 2023
1 parent 29da086 commit 4213f8d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions app/src/main/java/io/github/qauxv/util/dexkit/DexKitTarget.kt
Original file line number Diff line number Diff line change
Expand Up @@ -783,3 +783,10 @@ data object AIOPicElementType: DexKitTarget.UsingStr() {
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");
}
9 changes: 6 additions & 3 deletions app/src/main/java/me/ketal/hook/MultiActionHook.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ object MultiActionHook : CommonSwitchFunctionHook(
CMessageCache,
CMessageRecordFactory,
NBaseChatPie_createMulti,
CMultiMsgManager
CMultiMsgManager,
MultiSelectToBottomIntent
)
), SessionHooker.IAIOParamUpdate {

Expand Down Expand Up @@ -115,13 +116,14 @@ object MultiActionHook : CommonSwitchFunctionHook(
)
setMargin(rootView)
}
val intentClass = Initiator.loadClass("com.tencent.mobileqq.aio.input.multiselect.c\$h")
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")
.method("handleIntent")!!
.hookBefore(this) {
// 劫持一个 intent 自己传参
val intent = it.args[0]

if (intent.javaClass.isAssignableFrom(intentClass)) {
val flags = Reflex.getFirstByType(intent, Int::class.java)
if (flags != -114514) return@hookBefore
Expand All @@ -138,6 +140,7 @@ object MultiActionHook : CommonSwitchFunctionHook(
it.result = null
}
}

}

private fun recall(ctx: Context) {
Expand Down Expand Up @@ -176,7 +179,7 @@ object MultiActionHook : CommonSwitchFunctionHook(
private fun recallNt(ctx: Context, vb: Any) {
runCatching {
val baseVB = Initiator.loadClass("com.tencent.mvi.mvvm.BaseVB")
val intentClass = Initiator.loadClass("com.tencent.mobileqq.aio.input.multiselect.c\$h")
val intentClass = DexKit.requireClassFromCache(MultiSelectToBottomIntent)
val flags: Int = -114514
val intent = intentClass.newInstance(args(flags), argTypes(Int::class.java))!!
baseVB.method("sendIntent")!!.invoke(vb, intent)
Expand Down

0 comments on commit 4213f8d

Please sign in to comment.