mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 02:20:14 +08:00
Try fix group list
This commit is contained in:
parent
07fab04a90
commit
c044c64b82
@ -111,6 +111,8 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
|
|||||||
2
|
2
|
||||||
).sendAndExpect<FriendList.GetFriendGroupList.Response>()
|
).sendAndExpect<FriendList.GetFriendGroupList.Response>()
|
||||||
*/
|
*/
|
||||||
|
delay(2000)
|
||||||
|
|
||||||
val data = FriendList.GetTroopList(
|
val data = FriendList.GetTroopList(
|
||||||
bot.client
|
bot.client
|
||||||
).sendAndExpect<FriendList.GetTroopList.Response>()
|
).sendAndExpect<FriendList.GetTroopList.Response>()
|
||||||
|
@ -54,12 +54,13 @@ internal class FriendList {
|
|||||||
GetTroopListReqV2Simplify.serializer(),
|
GetTroopListReqV2Simplify.serializer(),
|
||||||
GetTroopListReqV2Simplify(
|
GetTroopListReqV2Simplify(
|
||||||
uin = client.uin,
|
uin = client.uin,
|
||||||
getMSFMsgFlag = 0,
|
getMSFMsgFlag = 0, // const
|
||||||
groupFlagExt = 1,
|
groupFlagExt = 1,// const
|
||||||
shVersion = 7,
|
shVersion = 7, // const
|
||||||
dwCompanyId = 0,
|
dwCompanyId = 0,
|
||||||
versionNum = 1,
|
versionNum = 1, // const
|
||||||
getLongGroupName = 1
|
vecGroupInfo = listOf(),
|
||||||
|
getLongGroupName = 1// const
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -294,13 +294,15 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse>("wt
|
|||||||
|
|
||||||
data class UnsafeLogin(val url: String) : LoginPacketResponse()
|
data class UnsafeLogin(val url: String) : LoginPacketResponse()
|
||||||
|
|
||||||
class SMSVerifyCodeNeeded(val t402: ByteArray, val t403: ByteArray) : LoginPacketResponse(){
|
class SMSVerifyCodeNeeded(val t402: ByteArray, val t403: ByteArray) : LoginPacketResponse() {
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "LoginPacketResponse.SMSVerifyCodeNeeded"
|
return "LoginPacketResponse.SMSVerifyCodeNeeded"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class DeviceLockLogin(val t402: ByteArray, val t403: ByteArray) : LoginPacketResponse()
|
class DeviceLockLogin(val t402: ByteArray, val t403: ByteArray) : LoginPacketResponse() {
|
||||||
|
override fun toString(): String = "LoginPacket.LoginPacketResponse.DeviceLockLogin"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@InternalAPI
|
@InternalAPI
|
||||||
|
@ -12,6 +12,7 @@ import net.mamoe.mirai.utils.cryptor.ECDH
|
|||||||
import net.mamoe.mirai.utils.cryptor.adjustToPublicKey
|
import net.mamoe.mirai.utils.cryptor.adjustToPublicKey
|
||||||
import net.mamoe.mirai.utils.cryptor.decryptBy
|
import net.mamoe.mirai.utils.cryptor.decryptBy
|
||||||
import net.mamoe.mirai.utils.io.*
|
import net.mamoe.mirai.utils.io.*
|
||||||
|
import net.mamoe.mirai.utils.unzip
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
@ -67,7 +68,6 @@ private fun processFullPacketWithoutLength(packet: ByteReadPacket) {
|
|||||||
PacketLogger.verbose("包类型(flag2) = $flag2. (可能是 ${if (flag2 == 2) "sso" else "uni"})")
|
PacketLogger.verbose("包类型(flag2) = $flag2. (可能是 ${if (flag2 == 2) "sso" else "uni"})")
|
||||||
|
|
||||||
val flag3 = readByte().toInt()
|
val flag3 = readByte().toInt()
|
||||||
check(flag3 == 0) { "Illegal flag3. Expected 0, got $flag3" }
|
|
||||||
|
|
||||||
val uinAccount = readString(readInt() - 4)//uin
|
val uinAccount = readString(readInt() - 4)//uin
|
||||||
|
|
||||||
@ -88,9 +88,9 @@ private fun processFullPacketWithoutLength(packet: ByteReadPacket) {
|
|||||||
this.readBytes().tryDecryptOrNull()?.toReadPacket()
|
this.readBytes().tryDecryptOrNull()?.toReadPacket()
|
||||||
}?.debugPrint("sso/uni body=")?.let {
|
}?.debugPrint("sso/uni body=")?.let {
|
||||||
if (flag1 == 0x0A) {
|
if (flag1 == 0x0A) {
|
||||||
parseSsoFrame(it)
|
parseSsoFrame(flag3, it)
|
||||||
} else {
|
} else {
|
||||||
parseSsoFrame(it)
|
parseSsoFrame(flag3, it)
|
||||||
}
|
}
|
||||||
}?.let {
|
}?.let {
|
||||||
val bytes = it.data.readBytes()
|
val bytes = it.data.readBytes()
|
||||||
@ -205,7 +205,7 @@ private fun ByteReadPacket.parseOicqResponse(body: ByteReadPacket.() -> Unit) {
|
|||||||
* 解析 SSO 层包装
|
* 解析 SSO 层包装
|
||||||
*/
|
*/
|
||||||
@UseExperimental(ExperimentalUnsignedTypes::class)
|
@UseExperimental(ExperimentalUnsignedTypes::class)
|
||||||
private fun parseSsoFrame(input: ByteReadPacket): KnownPacketFactories.IncomingPacket {
|
private fun parseSsoFrame(flag3: Int, input: ByteReadPacket): KnownPacketFactories.IncomingPacket {
|
||||||
val commandName: String
|
val commandName: String
|
||||||
val ssoSequenceId: Int
|
val ssoSequenceId: Int
|
||||||
|
|
||||||
@ -232,7 +232,14 @@ private fun parseSsoFrame(input: ByteReadPacket): KnownPacketFactories.IncomingP
|
|||||||
println("找不到包 PacketFactory")
|
println("找不到包 PacketFactory")
|
||||||
PacketLogger.verbose("传递给 PacketFactory 的数据 = ${input.readBytes().toUHexString()}")
|
PacketLogger.verbose("传递给 PacketFactory 的数据 = ${input.readBytes().toUHexString()}")
|
||||||
}
|
}
|
||||||
return KnownPacketFactories.IncomingPacket(packetFactory, ssoSequenceId, input)
|
|
||||||
|
var data = input.readBytes()
|
||||||
|
if (flag3 == 1) {
|
||||||
|
data = data.unzip(offset = 4)
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
return KnownPacketFactories.IncomingPacket(packetFactory, ssoSequenceId, data.toReadPacket())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user