Skip to content

Commit

Permalink
fix: ChatInputHint, ChatItemShowQQUin for QQ 8.9.73
Browse files Browse the repository at this point in the history
  • Loading branch information
klxiaoniu committed Aug 3, 2023
1 parent 56d72b2 commit 618c0f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/src/main/java/io/github/qauxv/util/QQVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ private QQVersion() {
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;
public static final long QQ_8_9_73 = 4416;
}
3 changes: 2 additions & 1 deletion app/src/main/java/me/ketal/hook/ChatItemShowQQUin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ 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_70)) "s55"
private val NAME_TAIL_LAYOUT = if (requireMinQQVersion(QQVersion.QQ_8_9_73)) "s8p"
else if (requireMinQQVersion(QQVersion.QQ_8_9_70)) "s55"
else if (requireMinQQVersion(QQVersion.QQ_8_9_68)) "s3o"
else "rzs"

Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/xyz/nextalone/hook/ChatInputHint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ object ChatInputHint : CommonConfigFunctionHook("na_chat_input_hint", arrayOf(NB
}
}
// 群设置hint为空后
"Lcom/tencent/mobileqq/aio/input/b/c;->l()V".method.hookAfter(this) { param ->
(if (requireMinQQVersion(QQVersion.QQ_8_9_73)) "Lcom/tencent/mobileqq/aio/input/b/c;->m()V"
else "Lcom/tencent/mobileqq/aio/input/b/c;->l()V").method.hookAfter(this) { param ->
val f = param.thisObject.javaClass.getDeclaredField("f").apply { isAccessible = true }.get(param.thisObject)
val b = f.javaClass.getDeclaredField("b").apply { isAccessible = true }.get(f) as EditText
b.hint = getValue()
Expand Down

0 comments on commit 618c0f7

Please sign in to comment.