Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: hide group assistant banner #1318

Merged
merged 3 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-keep class cc.** { *; }
-keep class io.** { *; }
-keep class org.** { *; }
-keep class com.enlysure.** { *; }
-keep class com.microsoft.** { *; }
-keep class com.rymmmmm.** { *; }
-keep class com.codepwn.** { *; }
Expand Down
51 changes: 51 additions & 0 deletions app/src/main/java/com/enlysure/hook/HideGroupAssistantBanner.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* QAuxiliary - An Xposed module for QQ/TIM
* Copyright (C) 2019-2025 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
* <https://github.com/cinit/QAuxiliary/blob/master/LICENSE.md>.
*/

package com.enlysure.hook

import android.view.View
import cc.ioctl.util.hookAfterIfEnabled
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 HideGroupAssistantBanner : CommonSwitchFunctionHook() {

override val name = "隐藏群助手顶部Banner提示"

override val description = "隐藏群助手顶部 '以下为\"收进群助手且不提醒\"的群消息:' 的提示"

override val uiItemLocation = FunctionEntryRouter.Locations.Simplify.CHAT_GROUP_OTHER

override fun initOnce(): Boolean {
val createTopBannerMethod = Initiator.loadClass("com/tencent/mobileqq/activity/home/chats/troophelper/TroopHelperFragment")
.getDeclaredMethod("createTopBanner")
hookAfterIfEnabled(createTopBannerMethod) { param ->
(param.result as View).visibility = View.GONE
}
return true
}
}
6 changes: 4 additions & 2 deletions app/src/main/java/xyz/nextalone/hook/SimplifyContactTabs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ import io.github.qauxv.base.annotation.FunctionHookEntry
import io.github.qauxv.base.annotation.UiItemAgentEntry
import io.github.qauxv.dsl.FunctionEntryRouter
import io.github.qauxv.util.QQVersion
import io.github.qauxv.util.TIMVersion
import io.github.qauxv.util.requireMinQQVersion
import io.github.qauxv.util.requireMinTimVersion
import xyz.nextalone.base.MultiItemDelayableHook
import xyz.nextalone.util.*

Expand All @@ -37,10 +39,10 @@ object SimplifyContactTabs : MultiItemDelayableHook("na_simplify_contact_tabs_mu
override val allItems = setOf("好友", "分组", "群聊", "设备", "通讯录", "订阅号", "推荐", "频道", "机器人")
override val defaultItems = setOf<String>()
override val uiItemLocation = FunctionEntryRouter.Locations.Simplify.MAIN_UI_CONTACT
override val isAvailable = requireMinQQVersion(QQVersion.QQ_8_5_5)
override val isAvailable = requireMinQQVersion(QQVersion.QQ_8_5_5) || requireMinTimVersion(TIMVersion.TIM_4_0_95_BETA)

override fun initOnce() = throwOrTrue {
val nameContactsTabs = if (requireMinQQVersion(QQVersion.QQ_8_9_2)) "b" else "ContactsTabs"
val nameContactsTabs = if (requireMinQQVersion(QQVersion.QQ_8_9_2) || requireMinTimVersion(TIMVersion.TIM_4_0_95_BETA)) "b" else "ContactsTabs"
"Lcom.tencent.mobileqq.activity.contacts.base.tabs.$nameContactsTabs;->a()V".method.hookAfter(this) {

val listTabId: ArrayList<Int> = arrayListOf()
Expand Down
Loading