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
85d1b613
Commit
85d1b613
authored
Jan 27, 2020
by
jiahua.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push notify
parent
bfd185fc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
74 deletions
+22
-74
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/io/JceInput.kt
...ommonMain/kotlin/net/mamoe/mirai/qqandroid/io/JceInput.kt
+4
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/jce/RequestPacket.kt
...moe/mirai/qqandroid/network/protocol/jce/RequestPacket.kt
+16
-72
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/data/PushNotifyPack.kt
...droid/network/protocol/packet/chat/data/PushNotifyPack.kt
+2
-1
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/io/JceInput.kt
View file @
85d1b613
...
...
@@ -55,7 +55,10 @@ fun <J : JceStruct> ByteReadPacket.readJceRequestBufferMapVersion3ToJceStruct(fa
fun
ByteReadPacket
.
readJceRequestBufferMapVersion2
(
charset
:
Charset
=
CharsetUTF8
):
Map
<
String
,
ByteArray
>
{
this
.
use
{
discardExact
(
8
)
val
request
=
this
.
asJceInput
(
charset
).
use
{
RequestPacket
.
newInstanceFrom
(
it
)
}
val
request
=
this
.
asJceInput
(
charset
).
use
{
Jce
RequestPacket
.
serializer
()
}
val
map
=
request
.
sBuffer
.
asJceInput
(
charset
).
withUse
{
readNestedMap
<
String
,
String
,
ByteArray
>(
0
)
}
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/jce/RequestPacket.kt
View file @
85d1b613
package
net.mamoe.mirai.qqandroid.network.protocol.jce
import
net.mamoe.mirai.qqandroid.io.JceInput
import
net.mamoe.mirai.qqandroid.io.JceOutput
import
kotlinx.serialization.SerialId
import
kotlinx.serialization.Serializable
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.
utils.cryptor.contentToString
import
net.mamoe.mirai.
qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
private
val
EMPTY_MAP
=
mapOf
<
String
,
String
>()
class
RequestPacket
()
:
JceStruct
()
{
lateinit
var
sBuffer
:
ByteArray
var
cPacketType
:
Byte
=
0
var
iMessageType
:
Int
=
0
var
iRequestId
:
Int
=
0
var
iTimeout
:
Int
=
0
var
iVersion
:
Short
=
3
var
context
:
Map
<
String
,
String
>
=
EMPTY_MAP
var
sFuncName
:
String
=
""
var
sServantName
:
String
=
""
var
status
:
Map
<
String
,
String
>
=
EMPTY_MAP
constructor
(
sBuffer
:
ByteArray
,
cPacketType
:
Byte
=
0
,
iMessageType
:
Int
=
0
,
iRequestId
:
Int
=
0
,
iTimeout
:
Int
=
0
,
iVersion
:
Short
=
3
,
context
:
Map
<
String
,
String
>
=
EMPTY_MAP
,
sFuncName
:
String
=
""
,
sServantName
:
String
=
""
,
status
:
Map
<
String
,
String
>
=
EMPTY_MAP
)
:
this
()
{
this
.
sBuffer
=
sBuffer
this
.
cPacketType
=
cPacketType
this
.
iMessageType
=
iMessageType
this
.
iRequestId
=
iRequestId
this
.
iTimeout
=
iTimeout
this
.
iVersion
=
iVersion
this
.
context
=
context
this
.
sFuncName
=
sFuncName
this
.
sServantName
=
sServantName
this
.
status
=
status
}
companion
object
:
Factory
<
RequestPacket
>
{
override
fun
newInstanceFrom
(
input
:
JceInput
):
RequestPacket
{
val
iVersion
=
input
.
readShort
(
1
)
val
cPacketType
=
input
.
readByte
(
2
)
val
iMessageType
=
input
.
readInt
(
3
)
val
iRequestId
=
input
.
readInt
(
4
)
val
sServantName
=
input
.
readString
(
5
)
val
sFuncName
=
input
.
readString
(
6
)
val
sBuffer
=
input
.
readByteArray
(
7
)
val
iTimeout
=
input
.
readInt
(
8
)
val
context
=
input
.
readMap
(
""
,
""
,
9
)
val
status
=
input
.
readMap
(
""
,
""
,
10
)
return
RequestPacket
(
sBuffer
,
cPacketType
,
iMessageType
,
iRequestId
,
iTimeout
,
iVersion
,
context
,
sFuncName
,
sServantName
,
status
)
}
}
override
fun
writeTo
(
builder
:
JceOutput
)
{
builder
.
write
(
this
.
iVersion
,
1
)
builder
.
write
(
this
.
cPacketType
,
2
)
builder
.
write
(
this
.
iMessageType
,
3
)
builder
.
write
(
this
.
iRequestId
,
4
)
builder
.
write
(
this
.
sServantName
,
5
)
builder
.
write
(
this
.
sFuncName
,
6
)
builder
.
write
(
this
.
sBuffer
,
7
)
builder
.
write
(
this
.
iTimeout
,
8
)
builder
.
write
(
this
.
context
,
9
)
builder
.
write
(
this
.
status
,
10
)
}
override
fun
toString
():
String
{
return
this
.
contentToString
()
}
}
\ No newline at end of file
@Serializable
class
RequestPacket
(
@SerialId
(
1
)
val
iVersion
:
Short
=
3
,
@SerialId
(
2
)
val
cPacketType
:
Byte
=
0
,
@SerialId
(
3
)
val
iMessageType
:
Int
=
0
,
@SerialId
(
4
)
val
iRequestId
:
Int
=
0
,
@SerialId
(
5
)
val
sServantName
:
String
=
""
,
@SerialId
(
6
)
val
sFuncName
:
String
=
""
,
@SerialId
(
7
)
val
sBuffer
:
ByteArray
=
EMPTY_BYTE_ARRAY
,
@SerialId
(
8
)
val
iTimeout
:
Int
=
0
,
@SerialId
(
9
)
val
context
:
Map
<
String
,
String
>
=
EMPTY_MAP
,
@SerialId
(
10
)
val
status
:
Map
<
String
,
String
>
=
EMPTY_MAP
)
:
JceStruct
\ No newline at end of file
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/data/PushNotifyPack.kt
View file @
85d1b613
...
...
@@ -2,6 +2,7 @@ package net.mamoe.mirai.qqandroid.network.protocol.packet.chat.data
import
kotlinx.serialization.SerialId
import
kotlinx.serialization.Serializable
import
net.mamoe.mirai.data.Packet
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
...
...
@@ -21,7 +22,7 @@ internal class RequestPushNotify(
@SerialId
(
11
)
val
serverBuf
:
ByteArray
?,
@SerialId
(
12
)
val
pingFlag
:
Long
?,
@SerialId
(
13
)
val
svrip
:
Int
?
)
:
JceStruct
)
:
JceStruct
,
Packet
@Serializable
internal
class
MsgInfo
(
...
...
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