Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
7d06b498
Commit
7d06b498
authored
Jan 29, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add C2cMessageSyncData
parent
5ae4296b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidClient.kt
...tlin/net/mamoe/mirai/qqandroid/network/QQAndroidClient.kt
+10
-0
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/data/MsgSvc.kt
...rai/qqandroid/network/protocol/packet/chat/data/MsgSvc.kt
+1
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.PushNotify.kt
...ork/protocol/packet/chat/receive/MessageSvc.PushNotify.kt
+12
-2
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidClient.kt
View file @
7d06b498
...
@@ -8,6 +8,7 @@ import net.mamoe.mirai.BotAccount
...
@@ -8,6 +8,7 @@ import net.mamoe.mirai.BotAccount
import
net.mamoe.mirai.RawAccountIdUse
import
net.mamoe.mirai.RawAccountIdUse
import
net.mamoe.mirai.data.OnlineStatus
import
net.mamoe.mirai.data.OnlineStatus
import
net.mamoe.mirai.qqandroid.QQAndroidBot
import
net.mamoe.mirai.qqandroid.QQAndroidBot
import
net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import
net.mamoe.mirai.qqandroid.network.protocol.packet.PacketLogger
import
net.mamoe.mirai.qqandroid.network.protocol.packet.PacketLogger
import
net.mamoe.mirai.qqandroid.network.protocol.packet.Tlv
import
net.mamoe.mirai.qqandroid.network.protocol.packet.Tlv
import
net.mamoe.mirai.qqandroid.utils.*
import
net.mamoe.mirai.qqandroid.utils.*
...
@@ -107,6 +108,15 @@ internal open class QQAndroidClient(
...
@@ -107,6 +108,15 @@ internal open class QQAndroidClient(
*/
*/
val
protocolVersion
:
Short
=
8001
val
protocolVersion
:
Short
=
8001
class
C2cMessageSyncData
{
var
syncCookie
=
EMPTY_BYTE_ARRAY
var
pubAccountCookie
=
EMPTY_BYTE_ARRAY
var
syncFlag
:
Int
=
2
var
msgCtrlBuf
:
ByteArray
=
EMPTY_BYTE_ARRAY
}
val
c2cMessageSync
=
C2cMessageSyncData
()
/*
/*
* 以下登录使用
* 以下登录使用
*/
*/
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/data/MsgSvc.kt
View file @
7d06b498
...
@@ -21,7 +21,7 @@ class MsgSvc : ProtoBuf {
...
@@ -21,7 +21,7 @@ class MsgSvc : ProtoBuf {
@SerialId
(
5
)
val
uinPairMsgs
:
List
<
MsgComm
.
UinPairMsg
>?
=
null
,
@SerialId
(
5
)
val
uinPairMsgs
:
List
<
MsgComm
.
UinPairMsg
>?
=
null
,
@SerialId
(
6
)
val
bindUin
:
Long
=
0L
,
@SerialId
(
6
)
val
bindUin
:
Long
=
0L
,
@SerialId
(
7
)
val
msgRspType
:
Int
=
0
,
@SerialId
(
7
)
val
msgRspType
:
Int
=
0
,
@SerialId
(
8
)
val
pub
a
ccountCookie
:
ByteArray
=
EMPTY_BYTE_ARRAY
,
@SerialId
(
8
)
val
pub
A
ccountCookie
:
ByteArray
=
EMPTY_BYTE_ARRAY
,
@SerialId
(
9
)
val
isPartialSync
:
Boolean
=
false
,
@SerialId
(
9
)
val
isPartialSync
:
Boolean
=
false
,
@SerialId
(
10
)
val
msgCtrlBuf
:
ByteArray
=
EMPTY_BYTE_ARRAY
@SerialId
(
10
)
val
msgCtrlBuf
:
ByteArray
=
EMPTY_BYTE_ARRAY
)
:
ProtoBuf
)
:
ProtoBuf
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.PushNotify.kt
View file @
7d06b498
...
@@ -19,6 +19,7 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.data.RequestPushNo
...
@@ -19,6 +19,7 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.data.RequestPushNo
import
net.mamoe.mirai.qqandroid.network.protocol.packet.login.data.RequestDataVersion2
import
net.mamoe.mirai.qqandroid.network.protocol.packet.login.data.RequestDataVersion2
import
net.mamoe.mirai.qqandroid.network.protocol.packet.login.data.RequestPacket
import
net.mamoe.mirai.qqandroid.network.protocol.packet.login.data.RequestPacket
import
net.mamoe.mirai.qqandroid.utils.toMessageChain
import
net.mamoe.mirai.qqandroid.utils.toMessageChain
import
net.mamoe.mirai.utils.cryptor.contentToString
import
net.mamoe.mirai.utils.firstValue
import
net.mamoe.mirai.utils.firstValue
import
net.mamoe.mirai.utils.io.hexToBytes
import
net.mamoe.mirai.utils.io.hexToBytes
import
net.mamoe.mirai.utils.io.toReadPacket
import
net.mamoe.mirai.utils.io.toReadPacket
...
@@ -58,7 +59,11 @@ class MessageSvc {
...
@@ -58,7 +59,11 @@ class MessageSvc {
latestRambleNumber
=
20
,
latestRambleNumber
=
20
,
otherRambleNumber
=
3
,
otherRambleNumber
=
3
,
onlineSyncFlag
=
1
,
onlineSyncFlag
=
1
,
serverBuf
=
from
.
serverBuf
?:
EMPTY_BYTE_ARRAY
serverBuf
=
from
.
serverBuf
?:
EMPTY_BYTE_ARRAY
,
syncCookie
=
client
.
c2cMessageSync
.
syncCookie
,
syncFlag
=
client
.
c2cMessageSync
.
syncFlag
,
msgCtrlBuf
=
client
.
c2cMessageSync
.
msgCtrlBuf
,
pubaccountCookie
=
client
.
c2cMessageSync
.
pubAccountCookie
)
)
)
)
}
}
...
@@ -67,7 +72,12 @@ class MessageSvc {
...
@@ -67,7 +72,12 @@ class MessageSvc {
// 00 00 01 0F 08 00 12 00 1A 34 08 FF C1 C4 F1 05 10 FF C1 C4 F1 05 18 E6 ED B9 C3 02 20 89 FE BE A4 06 28 8A CA 91 D1 0C 48 9B A5 BD 9B 0A 58 DE 9D 99 F8 08 60 1D 68 FF C1 C4 F1 05 70 00 20 02 2A 9D 01 08 F3 C1 C4 F1 05 10 A2 FF 8C F0 03 18 01 22 8A 01 0A 2A 08 A2 FF 8C F0 03 10 DD F1 92 B7 07 18 A6 01 20 0B 28 AE F9 01 30 F4 C1 C4 F1 05 38 A7 E3 D8 D4 84 80 80 80 01 B8 01 CD B5 01 12 08 08 01 10 00 18 00 20 00 1A 52 0A 50 0A 27 08 00 10 F4 C1 C4 F1 05 18 A7 E3 D8 D4 04 20 00 28 0C 30 00 38 86 01 40 22 4A 0C E5 BE AE E8 BD AF E9 9B 85 E9 BB 91 12 08 0A 06 0A 04 4E 4D 53 4C 12 15 AA 02 12 9A 01 0F 80 01 01 C8 01 00 F0 01 00 F8 01 00 90 02 00 12 04 4A 02 08 00 30 01 2A 15 08 97 A2 C1 F1 05 10 95 A6 F5 E5 0C 18 01 30 01 40 01 48 81 01 2A 10 08 D3 F7 B5 F1 05 10 DD F1 92 B7 07 18 01 30 01 38 00 42 00 48 00
// 00 00 01 0F 08 00 12 00 1A 34 08 FF C1 C4 F1 05 10 FF C1 C4 F1 05 18 E6 ED B9 C3 02 20 89 FE BE A4 06 28 8A CA 91 D1 0C 48 9B A5 BD 9B 0A 58 DE 9D 99 F8 08 60 1D 68 FF C1 C4 F1 05 70 00 20 02 2A 9D 01 08 F3 C1 C4 F1 05 10 A2 FF 8C F0 03 18 01 22 8A 01 0A 2A 08 A2 FF 8C F0 03 10 DD F1 92 B7 07 18 A6 01 20 0B 28 AE F9 01 30 F4 C1 C4 F1 05 38 A7 E3 D8 D4 84 80 80 80 01 B8 01 CD B5 01 12 08 08 01 10 00 18 00 20 00 1A 52 0A 50 0A 27 08 00 10 F4 C1 C4 F1 05 18 A7 E3 D8 D4 04 20 00 28 0C 30 00 38 86 01 40 22 4A 0C E5 BE AE E8 BD AF E9 9B 85 E9 BB 91 12 08 0A 06 0A 04 4E 4D 53 4C 12 15 AA 02 12 9A 01 0F 80 01 01 C8 01 00 F0 01 00 F8 01 00 90 02 00 12 04 4A 02 08 00 30 01 2A 15 08 97 A2 C1 F1 05 10 95 A6 F5 E5 0C 18 01 30 01 40 01 48 81 01 2A 10 08 D3 F7 B5 F1 05 10 DD F1 92 B7 07 18 01 30 01 38 00 42 00 48 00
discardExact
(
4
)
discardExact
(
4
)
val
resp
=
readRemainingAsProtoBuf
(
MsgSvc
.
PbGetMsgResp
.
serializer
())
val
resp
=
readRemainingAsProtoBuf
(
MsgSvc
.
PbGetMsgResp
.
serializer
())
//println(resp.contentToString())
bot
.
client
.
c2cMessageSync
.
syncCookie
=
resp
.
syncCookie
bot
.
client
.
c2cMessageSync
.
pubAccountCookie
=
resp
.
pubAccountCookie
bot
.
client
.
c2cMessageSync
.
syncFlag
=
resp
.
syncFlag
bot
.
client
.
c2cMessageSync
.
msgCtrlBuf
=
resp
.
msgCtrlBuf
println
(
resp
.
contentToString
())
if
(
resp
.
uinPairMsgs
==
null
)
{
if
(
resp
.
uinPairMsgs
==
null
)
{
return
MultiPacket
(
emptyList
())
return
MultiPacket
(
emptyList
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment