Skip to content

Commit

Permalink
chore: Tencent QQ server has filtered sender uin from multi forward msg
Browse files Browse the repository at this point in the history
  • Loading branch information
cinit committed Sep 6, 2023
1 parent de44e8d commit d154251
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions app/src/main/java/cc/ioctl/hook/msg/MultiForwardAvatarHook.kt
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ object MultiForwardAvatarHook : CommonSwitchFunctionHook(arrayOf(CAIOUtils, Mult
// 2023.7.20 NT版收到的合并转发中群号变为0
// 2023.8.1 收到的合并转发中群号变为284840486
val isTroopUinAvailable = troopUin != null && troopUin != 0L && troopUin != 284840486L
// 2023-09-06 起合并转发中 senderUin 变为 1094950020
val isSenderUinAvailable = senderUin != 0L && senderUin != 1094950020L
val ctx = CommonContextWrapper.createAppCompatContext(hostContext)
val dialog = CustomDialog.createFailsafe(ctx).setTitle(Reflex.getShortClassName(msg))
.setPositiveButton("确认", null).setCancelable(true)
Expand All @@ -293,17 +295,25 @@ object MultiForwardAvatarHook : CommonSwitchFunctionHook(arrayOf(CAIOUtils, Mult
} else {
HostStyledViewBuilder.newDialogClickableItem(ctx, "群号", "已被服务器端屏蔽", null, null, ll, true)
}
HostStyledViewBuilder.newDialogClickableItemClickToCopy(ctx, "成员", senderUin.toString(), ll, true) {
if (senderUin > 10000) {
OpenProfileCard.openUserProfileCard(ctx, senderUin)
if (isSenderUinAvailable) {
HostStyledViewBuilder.newDialogClickableItemClickToCopy(ctx, "成员", senderUin.toString(), ll, true) {
if (senderUin > 10000) {
OpenProfileCard.openUserProfileCard(ctx, senderUin)
}
}
} else {
HostStyledViewBuilder.newDialogClickableItem(ctx, "成员", "已被服务器端屏蔽", null, null, ll, true)
}
} else {
// private chat
HostStyledViewBuilder.newDialogClickableItemClickToCopy(ctx, "发送者", senderUin.toString(), ll, true) {
if (senderUin > 10000) {
OpenProfileCard.openUserProfileCard(ctx, senderUin)
if (isSenderUinAvailable) {
HostStyledViewBuilder.newDialogClickableItemClickToCopy(ctx, "发送者", senderUin.toString(), ll, true) {
if (senderUin > 10000) {
OpenProfileCard.openUserProfileCard(ctx, senderUin)
}
}
} else {
HostStyledViewBuilder.newDialogClickableItem(ctx, "发送者", "已被服务器端屏蔽", null, null, ll, true)
}
}
val disclaimerTextView = AppCompatTextView(ctx).apply {
Expand All @@ -317,6 +327,7 @@ object MultiForwardAvatarHook : CommonSwitchFunctionHook(arrayOf(CAIOUtils, Mult
因此,合并转发消息的内容存在被篡改和伪造的可能。
在非恶意情形下,PC 端 QQ 在合并转发提供的群号可能是错误的,而 Android 端 QQ 合并转发提供的群号通常是正确的。
以上信息仅供参考,本模块不对以上信息的正确性负责,以上信息不得作为任何依据。
问: “已被服务器端屏蔽”是什么意思? 答:QQ 服务器端屏蔽了该信息,因此无法获取。
""".trimIndent()
disclaimerTextView.text = disclaimer
}
Expand Down

0 comments on commit d154251

Please sign in to comment.