fix: ChatItemShowQQUin, RemoveQRLoginAuth, ShowMsgAt for QQ 8.9.70
This commit is contained in:
@@ -60,6 +60,7 @@ import io.github.qauxv.util.QQVersion.QQ_8_9_28
|
||||
import io.github.qauxv.util.QQVersion.QQ_8_9_3
|
||||
import io.github.qauxv.util.QQVersion.QQ_8_9_63
|
||||
import io.github.qauxv.util.QQVersion.QQ_8_9_68
|
||||
import io.github.qauxv.util.QQVersion.QQ_8_9_70
|
||||
import io.github.qauxv.util.QQVersion.QQ_8_9_8
|
||||
import me.ketal.hook.SortAtPanel
|
||||
import xyz.nextalone.hook.ChatWordsCount
|
||||
@@ -100,6 +101,7 @@ class QQConfigTable : ConfigTableInterface {
|
||||
// NT begin
|
||||
QQ_8_9_63 to "nxj",
|
||||
QQ_8_9_68 to "nyb",
|
||||
QQ_8_9_70 to "nyn"
|
||||
),
|
||||
|
||||
//中间部分(QQ会员 我的钱包等)
|
||||
|
||||
@@ -97,4 +97,5 @@ public class QQVersion {
|
||||
// The first NT version
|
||||
public static final long QQ_8_9_63 = 4194;
|
||||
public static final long QQ_8_9_68 = 4264;
|
||||
public static final long QQ_8_9_70 = 4330;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,9 @@ object ChatItemShowQQUin : CommonConfigFunctionHook(), OnBubbleBuilder {
|
||||
// For NT
|
||||
private const val ID_ADD_LAYOUT = 0x114515
|
||||
private const val ID_ADD_TEXTVIEW = 0x114516
|
||||
private val NAME_TAIL_LAYOUT = if (requireMinQQVersion(QQVersion.QQ_8_9_68)) "s3o" else "rzs"
|
||||
private val NAME_TAIL_LAYOUT = if (requireMinQQVersion(QQVersion.QQ_8_9_70)) "s55"
|
||||
else if (requireMinQQVersion(QQVersion.QQ_8_9_68)) "s3o"
|
||||
else "rzs"
|
||||
|
||||
override val valueState: MutableStateFlow<String?> by lazy {
|
||||
MutableStateFlow(if (isEnabled) "已开启" else "禁用")
|
||||
@@ -336,9 +338,9 @@ object ChatItemShowQQUin : CommonConfigFunctionHook(), OnBubbleBuilder {
|
||||
if (!isEnabled && !isFlashPicTagNeedShow) return
|
||||
|
||||
val tailLayout = try {
|
||||
rootView.findHostView(NAME_TAIL_LAYOUT) ?: throw Exception("TailLayout not found")
|
||||
rootView.findHostView(NAME_TAIL_LAYOUT) ?: return
|
||||
} catch (_: Exception) {
|
||||
val stub = rootView.findHostView<ViewStub>(NAME_TAIL_LAYOUT) ?: return
|
||||
val stub = rootView.findHostView<ViewStub>(NAME_TAIL_LAYOUT)!!
|
||||
stub.inflate() as FrameLayout
|
||||
}
|
||||
if (!tailLayout.children.map { it.id }.contains(ID_ADD_LAYOUT)) {
|
||||
|
||||
@@ -30,6 +30,7 @@ import io.github.qauxv.hook.CommonSwitchFunctionHook
|
||||
import io.github.qauxv.util.Initiator
|
||||
import io.github.qauxv.util.QQVersion
|
||||
import io.github.qauxv.util.QQVersion.QQ_8_9_0
|
||||
import io.github.qauxv.util.QQVersion.QQ_8_9_70
|
||||
import io.github.qauxv.util.requireMinQQVersion
|
||||
import xyz.nextalone.util.hookBefore
|
||||
import xyz.nextalone.util.throwOrTrue
|
||||
@@ -43,7 +44,13 @@ object RemoveQRLoginAuth : CommonSwitchFunctionHook() {
|
||||
override val isAvailable: Boolean get() = requireMinQQVersion(QQVersion.QQ_8_5_0)
|
||||
|
||||
override fun initOnce() = throwOrTrue {
|
||||
val clazz = if (requireMinQQVersion(QQ_8_9_0)) "com/tencent/open/agent/QrAgentLoginManager\$a" else "com/tencent/open/agent/QrAgentLoginManager\$2"
|
||||
val clazz = if (requireMinQQVersion(QQ_8_9_70)) {
|
||||
"com/tencent/open/agent/QrAgentLoginManager"
|
||||
} else if (requireMinQQVersion(QQ_8_9_0)) {
|
||||
"com/tencent/open/agent/QrAgentLoginManager\$a"
|
||||
} else {
|
||||
"com/tencent/open/agent/QrAgentLoginManager\$2"
|
||||
}
|
||||
Initiator.loadClass(clazz).declaredMethods
|
||||
.findMethod {
|
||||
returnType == Void.TYPE && parameterTypes.isNotEmpty() && parameterTypes[0] == Boolean::class.java
|
||||
|
||||
@@ -66,7 +66,9 @@ object ShowMsgAt : CommonSwitchFunctionHook(), OnBubbleBuilder {
|
||||
override val uiItemLocation = FunctionEntryRouter.Locations.Auxiliary.MESSAGE_CATEGORY
|
||||
override val extraSearchKeywords: Array<String> = arrayOf("@", "艾特")
|
||||
|
||||
private val NAME_TEXTVIEW = if (requireMinQQVersion(QQVersion.QQ_8_9_68)) "ewl" else "ewk"
|
||||
private val NAME_TEXTVIEW = if (requireMinQQVersion(QQVersion.QQ_8_9_70)) "ex1"
|
||||
else if (requireMinQQVersion(QQVersion.QQ_8_9_68)) "ewl"
|
||||
else "ewk"
|
||||
|
||||
override fun initOnce(): Boolean {
|
||||
return !isTim() && BaseBubbleBuilderHook.initialize()
|
||||
|
||||
Reference in New Issue
Block a user