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
bfd185fc
Commit
bfd185fc
authored
Jan 27, 2020
by
jiahua.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Push Notify Update
parent
81b34796
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
160 deletions
+60
-160
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/io/JceStruct.kt
...mmonMain/kotlin/net/mamoe/mirai/qqandroid/io/JceStruct.kt
+1
-6
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
+59
-154
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/io/JceStruct.kt
View file @
bfd185fc
package
net.mamoe.mirai.qqandroid.io
package
net.mamoe.mirai.qqandroid.io
abstract
class
JceStruct
{
interface
JceStruct
{
abstract
fun
writeTo
(
builder
:
JceOutput
)
interface
Factory
<
out
T
:
JceStruct
>
{
fun
newInstanceFrom
(
input
:
JceInput
):
T
}
}
}
\ 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 @
bfd185fc
package
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.data
package
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.data
import
net.mamoe.mirai.data.Packet
import
kotlinx.serialization.SerialId
import
net.mamoe.mirai.qqandroid.io.JceInput
import
kotlinx.serialization.Serializable
import
net.mamoe.mirai.qqandroid.io.JceOutput
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import
net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
class
RequestPushNotify
(
@Serializable
val
uin
:
Long
,
internal
class
RequestPushNotify
(
val
ctype
:
Byte
,
@SerialId
(
0
)
val
uin
:
Long
=
0L
,
val
strService
:
String
,
@SerialId
(
1
)
val
ctype
:
Byte
=
0
,
val
strCmd
:
String
,
@SerialId
(
2
)
val
strService
:
String
?,
val
vNotifyCookie
:
ByteArray
,
@SerialId
(
3
)
val
strCmd
:
String
?,
val
usMsgType
:
Int
,
@SerialId
(
4
)
val
vNotifyCookie
:
ByteArray
=
EMPTY_BYTE_ARRAY
,
val
wUserActive
:
Int
,
@SerialId
(
5
)
val
usMsgType
:
Int
?,
val
wGeneralFlag
:
Int
,
@SerialId
(
6
)
val
wUserActive
:
Int
?,
val
bindedUin
:
Long
,
@SerialId
(
7
)
val
wGeneralFlag
:
Int
?,
val
stMsgInfo
:
MsgInfo
,
@SerialId
(
8
)
val
bindedUin
:
Long
?,
val
msgCtrlBuf
:
String
,
@SerialId
(
9
)
val
stMsgInfo
:
MsgInfo
?,
val
serverBuf
:
ByteArray
,
@SerialId
(
10
)
val
msgCtrlBuf
:
String
?,
val
pingFlag
:
Long
,
@SerialId
(
11
)
val
serverBuf
:
ByteArray
?,
val
svrip
:
Int
@SerialId
(
12
)
val
pingFlag
:
Long
?,
)
:
Packet
,
JceStruct
()
{
@SerialId
(
13
)
val
svrip
:
Int
?
override
fun
writeTo
(
builder
:
JceOutput
)
{
)
:
JceStruct
//not needed
}
@Serializable
internal
class
MsgInfo
(
companion
object
:
Factory
<
RequestPushNotify
>
{
@SerialId
(
0
)
val
lFromUin
:
Long
=
0L
,
override
fun
newInstanceFrom
(
input
:
JceInput
):
RequestPushNotify
{
@SerialId
(
1
)
val
uMsgTime
:
Long
=
0L
,
return
RequestPushNotify
(
@SerialId
(
2
)
val
shMsgType
:
Short
?,
input
.
read
(
0L
,
0
),
@SerialId
(
3
)
val
shMsgSeq
:
Short
?,
input
.
read
(
0
.
toByte
(),
1
),
@SerialId
(
4
)
val
strMsg
:
String
?,
input
.
readString
(
2
),
@SerialId
(
5
)
val
uRealMsgTime
:
Int
?,
input
.
readString
(
3
),
@SerialId
(
6
)
val
vMsg
:
ByteArray
?,
input
.
read
(
EMPTY_BYTE_ARRAY
,
4
),
@SerialId
(
7
)
val
uAppShareID
:
Long
?,
input
.
read
(
0
,
5
),
@SerialId
(
8
)
val
vMsgCookies
:
ByteArray
=
EMPTY_BYTE_ARRAY
,
input
.
read
(
0
,
6
),
@SerialId
(
9
)
val
vAppShareCookie
:
ByteArray
=
EMPTY_BYTE_ARRAY
,
input
.
read
(
0
,
7
),
@SerialId
(
10
)
val
lMsgUid
:
Long
?,
input
.
read
(
0L
,
8
),
@SerialId
(
11
)
val
lLastChangeTime
:
Long
?,
input
.
readJceStruct
(
MsgInfo
,
9
),
@SerialId
(
12
)
val
vCPicInfo
:
List
<
CPicInfo
>?,
input
.
readString
(
10
),
@SerialId
(
13
)
val
stShareData
:
ShareData
?,
input
.
readByteArray
(
11
),
@SerialId
(
14
)
val
lFromInstId
:
Long
?,
input
.
readLong
(
12
),
@SerialId
(
15
)
val
vRemarkOfSender
:
ByteArray
?,
input
.
readInt
(
13
)
@SerialId
(
16
)
val
strFromMobile
:
String
?,
)
@SerialId
(
17
)
val
strFromName
:
String
?,
}
@SerialId
(
18
)
val
vNickName
:
List
<
String
>?,
}
@SerialId
(
19
)
val
stC2CTmpMsgHead
:
TempMsgHead
?
)
:
JceStruct
}
class
MsgInfo
(
@Serializable
val
lFromUin
:
Long
,
val
uMsgTime
:
Long
,
val
shMsgType
:
Short
,
val
shMsgSeq
:
Short
,
val
strMsg
:
String
,
val
uRealMsgTime
:
Int
,
val
vMsg
:
ByteArray
,
val
uAppShareID
:
Long
,
val
vMsgCookies
:
ByteArray
,
val
vAppShareCookie
:
ByteArray
,
val
lMsgUid
:
Long
,
val
lLastChangeTime
:
Long
,
val
vCPicInfo
:
List
<
CPicInfo
>,
val
stShareData
:
ShareData
,
val
lFromInstId
:
Long
,
val
vRemarkOfSender
:
ByteArray
,
val
strFromMobile
:
String
,
val
strFromName
:
String
,
val
vNickName
:
List
<
String
>,
val
stC2CTmpMsgHead
:
TempMsgHead
?
)
:
JceStruct
()
{
companion
object
:
Factory
<
MsgInfo
>
{
override
fun
newInstanceFrom
(
input
:
JceInput
):
MsgInfo
=
with
(
input
)
{
return
MsgInfo
(
readLong
(
0
),
readLong
(
1
),
readShort
(
2
),
readShort
(
3
),
readString
(
4
),
readInt
(
5
),
readByteArray
(
6
),
readLong
(
7
),
readByteArray
(
8
),
readByteArray
(
9
),
readLong
(
10
),
readLong
(
11
),
readJceStructList
(
CPicInfo
,
12
),
readJceStruct
(
ShareData
,
13
),
readLong
(
14
),
readByteArray
(
15
),
readString
(
16
),
readString
(
17
),
readList
(
18
),
readJceStructOrNull
(
TempMsgHead
,
19
)
)
}
}
override
fun
writeTo
(
builder
:
JceOutput
)
{
// not needed
}
}
class
ShareData
(
class
ShareData
(
val
pkgname
:
String
=
""
,
@SerialId
(
0
)
val
pkgname
:
String
=
""
,
val
msgtail
:
String
=
""
,
@SerialId
(
1
)
val
msgtail
:
String
=
""
,
val
picurl
:
String
=
""
,
@SerialId
(
2
)
val
picurl
:
String
=
""
,
val
url
:
String
=
""
@SerialId
(
3
)
val
url
:
String
=
""
)
:
JceStruct
()
{
)
:
JceStruct
companion
object
:
Factory
<
ShareData
>
{
override
fun
newInstanceFrom
(
input
:
JceInput
):
ShareData
{
return
ShareData
(
input
.
readString
(
0
),
input
.
readString
(
1
),
input
.
readString
(
2
),
input
.
readString
(
3
)
)
}
}
override
fun
writeTo
(
builder
:
JceOutput
)
{
// not needed
}
}
@Serializable
class
TempMsgHead
(
class
TempMsgHead
(
val
c2c_type
:
Int
,
@SerialId
(
0
)
val
c2c_type
:
Int
=
0
,
val
serviceType
:
Int
@SerialId
(
1
)
val
serviceType
:
Int
=
0
)
:
JceStruct
()
{
)
:
JceStruct
override
fun
writeTo
(
builder
:
JceOutput
)
{
}
companion
object
:
Factory
<
TempMsgHead
>
{
override
fun
newInstanceFrom
(
input
:
JceInput
):
TempMsgHead
{
return
TempMsgHead
(
input
.
readInt
(
0
),
input
.
readInt
(
1
)
)
}
}
}
@Serializable
class
CPicInfo
(
class
CPicInfo
(
val
vPath
:
ByteArray
,
@SerialId
(
0
)
val
vPath
:
ByteArray
=
EMPTY_BYTE_ARRAY
,
val
vHost
:
ByteArray
?
@SerialId
(
1
)
val
vHost
:
ByteArray
=
EMPTY_BYTE_ARRAY
)
:
JceStruct
()
{
)
:
JceStruct
override
fun
writeTo
(
builder
:
JceOutput
)
{
\ No newline at end of file
}
companion
object
:
Factory
<
CPicInfo
>
{
override
fun
newInstanceFrom
(
input
:
JceInput
):
CPicInfo
{
return
CPicInfo
(
input
.
readByteArray
(
0
),
input
.
readByteArray
(
1
)
)
}
}
}
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