Skip to content

Commit

Permalink
support: disable reply at
Browse files Browse the repository at this point in the history
  • Loading branch information
callng committed Aug 3, 2024
1 parent 14ed5b9 commit 2ed582d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/src/main/java/moe/qwq/miko/ActionManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import moe.qwq.miko.hooks.AllowGroupFlashPic
import moe.qwq.miko.hooks.DefaultPacketHijacker
import moe.qwq.miko.hooks.DisableFlashPictures
import moe.qwq.miko.hooks.DisableQRLoginCheck
import moe.qwq.miko.hooks.DisableReplyAt
import moe.qwq.miko.hooks.ForceTabletMode
import moe.qwq.miko.hooks.HotUpdateSoPatch
import moe.qwq.miko.hooks.MessageEncrypt
Expand Down Expand Up @@ -44,7 +45,8 @@ object ActionManager {
AllowGroupFlashPic::class.java,
QQCrashHook::class.java,
OptimizeAtSort::class.java,
DisableQRLoginCheck::class.java
DisableQRLoginCheck::class.java,
DisableReplyAt::class.java
)

private val instanceMap = hashMapOf<Class<*>, IAction>()
Expand Down
26 changes: 26 additions & 0 deletions app/src/main/java/moe/qwq/miko/hooks/DisableReplyAt.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package moe.qwq.miko.hooks

import android.content.Context
import com.tencent.mobileqq.aio.msg.AIOMsgItem
import de.robv.android.xposed.XposedBridge
import moe.fuqiuluo.xposed.loader.LuoClassloader
import moe.qwq.miko.actions.IAction
import moe.qwq.miko.ext.beforeHook
import moe.qwq.miko.internals.setting.QwQSetting

class DisableReplyAt: IAction {
override fun onRun(ctx: Context) {
val replyAt = LuoClassloader.load("com.tencent.mobileqq.aio.input.reply.c") // 混淆的类名
?: throw RuntimeException("ReplyAt not found")
replyAt.declaredMethods.firstOrNull {
it.returnType == Void.TYPE && it.parameterTypes.size == 1 && it.parameterTypes[0] == AIOMsgItem::class.java
}?.let {
val hook = beforeHook { param ->
param.result = Unit
}
XposedBridge.hookMethod(it, hook)
}
}

override val name: String = QwQSetting.DISABLE_REPLY_AT
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import mqq.app.MobileQQ
import kotlin.reflect.KProperty

object QwQSetting {
const val DISABLE_REPLY_AT: String = "disable_reply_at"
const val DISABLE_QRLOGIN_CHECK: String = "disable_qrlogin_check"
const val DISABLE_QQ_CRASH_REPORT: String = "disable_qq_crash_report"
const val MESSAGE_ENCRYPT: String = "message_encrypt"
Expand Down Expand Up @@ -55,7 +56,8 @@ object QwQSetting {
MESSAGE_TAIL to Setting(MESSAGE_TAIL, SettingType.STRING, ""),
MESSAGE_ENCRYPT to Setting(MESSAGE_ENCRYPT, SettingType.STRING, ""), // 消息加密密钥
DISABLE_QQ_CRASH_REPORT to Setting(DISABLE_QQ_CRASH_REPORT, SettingType.BOOLEAN, true),
DISABLE_QRLOGIN_CHECK to Setting(DISABLE_QRLOGIN_CHECK, SettingType.BOOLEAN, true)
DISABLE_QRLOGIN_CHECK to Setting(DISABLE_QRLOGIN_CHECK, SettingType.BOOLEAN, true),
DISABLE_REPLY_AT to Setting<Boolean>(DISABLE_REPLY_AT, SettingType.BOOLEAN)
)

val settingUrl: String
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.tencent.mobileqq.aio.msg;

public class AIOMsgItem {
}

0 comments on commit 2ed582d

Please sign in to comment.