Skip to content

Commit

Permalink
fix: HideShortcutBar on 9.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
HdShare committed Oct 30, 2024
1 parent 1987e16 commit eb572ed
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1031,9 +1031,16 @@ data object RemoveAudioTransitionMethod : DexKitTarget.UsingStr() {
override val filter = DexKitFilter.allowAll
}

data object Hd_HideShortcutBar_Method : DexKitTarget.UsingStr() {
data object Hd_HideShortcutBar_Method_TroopApp : DexKitTarget.UsingStr() {
override val findMethod = true
override val traitString = arrayOf("isShortcutBarVisibleOrGoingToBeVisible return false for AIOIceBreakViewShowing")
override val declaringClass = "Lcom/tencent/mobileqq/activity/aio/helper/TroopAppShortcutBarHelper;"
override val filter = DexKitFilter.strInClsName("com/tencent/mobileqq/activity/aio/helper/")
}

data object Hd_HideShortcutBar_Method_Troop : DexKitTarget.UsingStr() {
override val findMethod = true
override val traitString = arrayOf(",isShowingCustomShortcut:")
override val declaringClass = "Lcom/tencent/mobileqq/troop/shortcut/aio/TroopShortcutVB;"
override val filter = DexKitFilter.allowAll
}
17 changes: 13 additions & 4 deletions app/src/main/java/me/hd/hook/HideShortcutBar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,24 @@

package me.hd.hook

import cc.ioctl.util.hookAfterIfEnabled
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.QQVersion
import io.github.qauxv.util.dexkit.DexKit
import io.github.qauxv.util.dexkit.Hd_HideShortcutBar_Method
import io.github.qauxv.util.dexkit.Hd_HideShortcutBar_Method_Troop
import io.github.qauxv.util.dexkit.Hd_HideShortcutBar_Method_TroopApp
import io.github.qauxv.util.requireMinQQVersion

@FunctionHookEntry
@UiItemAgentEntry
object HideShortcutBar : CommonSwitchFunctionHook(
targets = arrayOf(Hd_HideShortcutBar_Method)
targets = arrayOf(
Hd_HideShortcutBar_Method_TroopApp,
Hd_HideShortcutBar_Method_Troop
)
) {

override val name = "隐藏聊天快捷栏"
Expand All @@ -44,9 +48,14 @@ object HideShortcutBar : CommonSwitchFunctionHook(
override val isAvailable = requireMinQQVersion(QQVersion.QQ_8_9_88)

override fun initOnce(): Boolean {
hookAfterIfEnabled(DexKit.requireMethodFromCache(Hd_HideShortcutBar_Method)) { param ->
hookBeforeIfEnabled(DexKit.requireMethodFromCache(Hd_HideShortcutBar_Method_TroopApp)) { param ->
param.result = false
}
if (requireMinQQVersion(QQVersion.QQ_9_1_10_BETA_20440)) {
hookBeforeIfEnabled(DexKit.requireMethodFromCache(Hd_HideShortcutBar_Method_Troop)) { param ->
param.result = null
}
}
return true
}
}

0 comments on commit eb572ed

Please sign in to comment.