Skip to content

Commit

Permalink
fix: DisableThirdContainer QQ9.0.75+ crash
Browse files Browse the repository at this point in the history
Closes #1165
  • Loading branch information
HdShare committed Sep 4, 2024
1 parent 06460d9 commit f9b683c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions app/src/main/java/me/hd/hook/DisableThirdContainer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,18 @@ object DisableThirdContainer : CommonSwitchFunctionHook() {
else
"com.tencent.qqnt.chats.core.ui.d.e"
)
val method = thirdContainerClass.declaredMethods.single { method ->
hookBeforeIfEnabled(thirdContainerClass.declaredMethods.single { method ->
val params = method.parameterTypes
params.size == 1 && params[0] == List::class.java
}
hookBeforeIfEnabled(method) { param ->
param.args[0] = emptyList<Any>()
}) { it.args[0] = emptyList<Any>() }

if (requireMinQQVersion(QQVersion.QQ_9_0_75)) {
val newAdManager = Initiator.loadClass("cooperation.vip.ad.TianshuNewAdManager")
val conversationThirdView = Initiator.loadClass("com.tencent.mobileqq.activity.home.chats.biz.tianshu.TianShuConversationThirdView")
hookBeforeIfEnabled(newAdManager.declaredMethods.single { method ->
val params = method.parameterTypes
params.size == 1 && params[0] == conversationThirdView
}) { it.result = null }
}
return true
}
Expand Down

0 comments on commit f9b683c

Please sign in to comment.