From 85313be7e8a62398be1b4d02f860eb374cbe0183 Mon Sep 17 00:00:00 2001 From: hd <1839732296@qq.com> Date: Mon, 22 Apr 2024 22:08:31 +0800 Subject: [PATCH] feat: add ViewGroupChatMsg --- .../main/java/me/hd/hook/ViewGroupChatMsg.kt | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 app/src/main/java/me/hd/hook/ViewGroupChatMsg.kt diff --git a/app/src/main/java/me/hd/hook/ViewGroupChatMsg.kt b/app/src/main/java/me/hd/hook/ViewGroupChatMsg.kt new file mode 100644 index 0000000000..488c4d1fb5 --- /dev/null +++ b/app/src/main/java/me/hd/hook/ViewGroupChatMsg.kt @@ -0,0 +1,49 @@ +/* + * QAuxiliary - An Xposed module for QQ/TIM + * Copyright (C) 2019-2024 QAuxiliary developers + * https://github.com/cinit/QAuxiliary + * + * This software is an opensource software: you can redistribute it + * and/or modify it under the terms of the General Public License + * as published by the Free Software Foundation; either + * version 3 of the License, or any later version as published + * by QAuxiliary contributors. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the General Public License for more details. + * + * You should have received a copy of the General Public License + * along with this software. + * If not, see + * . + */ + +package me.hd.hook + +import cc.ioctl.util.hookBeforeIfEnabled +import io.github.qauxv.base.annotation.FunctionHookEntry +import io.github.qauxv.base.annotation.UiItemAgentEntry +import io.github.qauxv.dsl.FunctionEntryRouter +import io.github.qauxv.hook.CommonSwitchFunctionHook +import io.github.qauxv.util.Initiator + +@FunctionHookEntry +@UiItemAgentEntry +object ViewGroupChatMsg : CommonSwitchFunctionHook() { + override val name = "查看群聊消息" + + override val description = "查看因涉嫌违规被停用群聊的消息" + + override val uiItemLocation: Array = FunctionEntryRouter.Locations.Auxiliary.GROUP_CATEGORY + + override fun initOnce(): Boolean { + val troopBlockClass = Initiator.loadClass("com.tencent.qqnt.aio.helper.TroopBlockHelper") + val jMethod = troopBlockClass.getDeclaredMethod("j", String::class.java, Boolean::class.java) + hookBeforeIfEnabled(jMethod) { param -> + param.args[1] = false + } + return true + } +} \ No newline at end of file