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
ce7af37e
Commit
ce7af37e
authored
Mar 08, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate to new Jce serializer
parent
2acca0c2
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
761 additions
and
626 deletions
+761
-626
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/io/serialization/IOFormat.kt
...in/net/mamoe/mirai/qqandroid/io/serialization/IOFormat.kt
+1
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/io/serialization/JceOld.kt
...tlin/net/mamoe/mirai/qqandroid/io/serialization/JceOld.kt
+24
-23
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/io/serialization/jce/JceInput.kt
...et/mamoe/mirai/qqandroid/io/serialization/jce/JceInput.kt
+0
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/io/serialization/jce/JceNew.kt
.../net/mamoe/mirai/qqandroid/io/serialization/jce/JceNew.kt
+38
-8
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/io/serialization/jce/common.kt
.../net/mamoe/mirai/qqandroid/io/serialization/jce/common.kt
+37
-6
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/io/serialization/utils.kt
...otlin/net/mamoe/mirai/qqandroid/io/serialization/utils.kt
+15
-5
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/ConfigPush.kt
...e/mirai/qqandroid/network/protocol/data/jce/ConfigPush.kt
+68
-68
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/FriendList.kt
...e/mirai/qqandroid/network/protocol/data/jce/FriendList.kt
+129
-129
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/OnlinePushPack.kt
...rai/qqandroid/network/protocol/data/jce/OnlinePushPack.kt
+149
-149
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/PushNotifyPack.kt
...rai/qqandroid/network/protocol/data/jce/PushNotifyPack.kt
+42
-42
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/RequestPacket.kt
...irai/qqandroid/network/protocol/data/jce/RequestPacket.kt
+14
-14
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/RequestPushForceOffline.kt
...roid/network/protocol/data/jce/RequestPushForceOffline.kt
+5
-4
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/SvcReqRegister.kt
...rai/qqandroid/network/protocol/data/jce/SvcReqRegister.kt
+37
-37
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/TroopList.kt
...oe/mirai/qqandroid/network/protocol/data/jce/TroopList.kt
+131
-131
mirai-core-qqandroid/src/commonTest/kotlin/net.mamoe.mirai.qqandroid.io.serialization/JceInputTest.kt
...et.mamoe.mirai.qqandroid.io.serialization/JceInputTest.kt
+71
-8
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/io/serialization/IOFormat.kt
View file @
ce7af37e
...
@@ -8,7 +8,7 @@ import kotlinx.serialization.SerializationStrategy
...
@@ -8,7 +8,7 @@ import kotlinx.serialization.SerializationStrategy
interface
IOFormat
:
SerialFormat
{
interface
IOFormat
:
SerialFormat
{
fun
<
T
>
dump
(
serializer
:
SerializationStrategy
<
T
>,
output
:
Output
):
ByteArray
fun
<
T
>
dump
To
(
serializer
:
SerializationStrategy
<
T
>,
ojb
:
T
,
output
:
Output
)
fun
<
T
>
load
(
deserializer
:
DeserializationStrategy
<
T
>,
input
:
Input
):
T
fun
<
T
>
load
(
deserializer
:
DeserializationStrategy
<
T
>,
input
:
Input
):
T
}
}
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/io/serialization/Jce.kt
→
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/io/serialization/Jce
Old
.kt
View file @
ce7af37e
...
@@ -21,7 +21,24 @@ import kotlinx.serialization.modules.SerialModule
...
@@ -21,7 +21,24 @@ import kotlinx.serialization.modules.SerialModule
import
kotlinx.serialization.protobuf.ProtoId
import
kotlinx.serialization.protobuf.ProtoId
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.qqandroid.io.ProtoBuf
import
net.mamoe.mirai.qqandroid.io.ProtoBuf
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce.Companion.BYTE
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce.Companion.DOUBLE
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce.Companion.FLOAT
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce.Companion.INT
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce.Companion.JCE_MAX_STRING_LENGTH
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce.Companion.LIST
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce.Companion.LONG
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce.Companion.MAP
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce.Companion.SHORT
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce.Companion.SIMPLE_LIST
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce.Companion.STRING1
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce.Companion.STRING4
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce.Companion.STRUCT_BEGIN
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce.Companion.STRUCT_END
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce.Companion.ZERO_TYPE
import
net.mamoe.mirai.qqandroid.io.serialization.jce.JceHead
import
net.mamoe.mirai.qqandroid.io.serialization.jce.JceHead
import
net.mamoe.mirai.qqandroid.io.serialization.jce.JceId
import
net.mamoe.mirai.utils.io.readString
import
net.mamoe.mirai.utils.io.readString
import
net.mamoe.mirai.utils.io.toReadPacket
import
net.mamoe.mirai.utils.io.toReadPacket
...
@@ -36,14 +53,14 @@ enum class JceCharset(val kotlinCharset: Charset) {
...
@@ -36,14 +53,14 @@ enum class JceCharset(val kotlinCharset: Charset) {
UTF8
(
Charset
.
forName
(
"UTF8"
))
UTF8
(
Charset
.
forName
(
"UTF8"
))
}
}
internal
fun
getSerialId
(
desc
:
SerialDescriptor
,
index
:
Int
):
Int
?
=
desc
.
findAnnotation
<
Proto
Id
>(
index
)
?.
id
internal
fun
getSerialId
(
desc
:
SerialDescriptor
,
index
:
Int
):
Int
?
=
desc
.
findAnnotation
<
Jce
Id
>(
index
)
?.
id
/**
/**
* Jce 数据结构序列化和反序列化工具, 能将 kotlinx.serialization 通用的注解标记格式的 `class` 序列化为 [ByteArray]
* Jce 数据结构序列化和反序列化工具, 能将 kotlinx.serialization 通用的注解标记格式的 `class` 序列化为 [ByteArray]
*/
*/
@Suppress
(
"DEPRECATION_ERROR"
)
@Suppress
(
"DEPRECATION_ERROR"
)
@OptIn
(
InternalSerializationApi
::
class
)
@OptIn
(
InternalSerializationApi
::
class
)
class
Jce
private
constructor
(
private
val
charset
:
JceCharset
,
override
val
context
:
SerialModule
=
EmptyModule
)
:
class
Jce
Old
private
constructor
(
private
val
charset
:
JceCharset
,
override
val
context
:
SerialModule
=
EmptyModule
)
:
SerialFormat
,
BinaryFormat
{
SerialFormat
,
BinaryFormat
{
private
inner
class
ListWriter
(
private
inner
class
ListWriter
(
...
@@ -101,7 +118,7 @@ class Jce private constructor(private val charset: JceCharset, override val cont
...
@@ -101,7 +118,7 @@ class Jce private constructor(private val charset: JceCharset, override val cont
private
open
inner
class
JceEncoder
(
private
open
inner
class
JceEncoder
(
internal
val
output
:
BytePacketBuilder
internal
val
output
:
BytePacketBuilder
)
:
TaggedEncoder
<
Int
>()
{
)
:
TaggedEncoder
<
Int
>()
{
override
val
context
get
()
=
this
@Jce
.
context
override
val
context
get
()
=
this
@Jce
Old
.
context
override
fun
SerialDescriptor
.
getTag
(
index
:
Int
):
Int
{
override
fun
SerialDescriptor
.
getTag
(
index
:
Int
):
Int
{
return
getSerialId
(
this
,
index
)
?:
error
(
"cannot find @SerialId"
)
return
getSerialId
(
this
,
index
)
?:
error
(
"cannot find @SerialId"
)
...
@@ -753,10 +770,10 @@ class Jce private constructor(private val charset: JceCharset, override val cont
...
@@ -753,10 +770,10 @@ class Jce private constructor(private val charset: JceCharset, override val cont
@Suppress
(
"MemberVisibilityCanBePrivate"
)
@Suppress
(
"MemberVisibilityCanBePrivate"
)
companion
object
{
companion
object
{
val
UTF8
=
Jce
(
JceCharset
.
UTF8
)
val
UTF8
=
Jce
Old
(
JceCharset
.
UTF8
)
val
GBK
=
Jce
(
JceCharset
.
GBK
)
val
GBK
=
Jce
Old
(
JceCharset
.
GBK
)
fun
byCharSet
(
c
:
JceCharset
):
Jce
{
fun
byCharSet
(
c
:
JceCharset
):
Jce
Old
{
return
if
(
c
==
JceCharset
.
UTF8
)
{
return
if
(
c
==
JceCharset
.
UTF8
)
{
UTF8
UTF8
}
else
{
}
else
{
...
@@ -764,22 +781,6 @@ class Jce private constructor(private val charset: JceCharset, override val cont
...
@@ -764,22 +781,6 @@ class Jce private constructor(private val charset: JceCharset, override val cont
}
}
}
}
internal
const
val
BYTE
:
Byte
=
0
internal
const
val
DOUBLE
:
Byte
=
5
internal
const
val
FLOAT
:
Byte
=
4
internal
const
val
INT
:
Byte
=
2
internal
const
val
JCE_MAX_STRING_LENGTH
=
104857600
internal
const
val
LIST
:
Byte
=
9
internal
const
val
LONG
:
Byte
=
3
internal
const
val
MAP
:
Byte
=
8
internal
const
val
SHORT
:
Byte
=
1
internal
const
val
SIMPLE_LIST
:
Byte
=
13
internal
const
val
STRING1
:
Byte
=
6
internal
const
val
STRING4
:
Byte
=
7
internal
const
val
STRUCT_BEGIN
:
Byte
=
10
internal
const
val
STRUCT_END
:
Byte
=
11
internal
const
val
ZERO_TYPE
:
Byte
=
12
private
fun
Any
?.
getClassName
():
String
=
private
fun
Any
?.
getClassName
():
String
=
(
if
(
this
==
null
)
Unit
::
class
else this::class).qualified
Name
?.
split
(
"."
)
?.
takeLast
(
2
)
?.
joinToString
(
"."
)
(
if
(
this
==
null
)
Unit
::
class
else this::class).qualified
Name
?.
split
(
"."
)
?.
takeLast
(
2
)
?.
joinToString
(
"."
)
?:
"<unnamed class>"
?:
"<unnamed class>"
...
@@ -815,7 +816,7 @@ class Jce private constructor(private val charset: JceCharset, override val cont
...
@@ -815,7 +816,7 @@ class Jce private constructor(private val charset: JceCharset, override val cont
}
}
}
}
internal
inline
fun
<
R
>
Jce
.
JceInput
.
skipToTagOrNull
(
tag
:
Int
,
block
:
(
JceHead
)
->
R
):
R
?
{
internal
inline
fun
<
R
>
Jce
Old
.
JceInput
.
skipToTagOrNull
(
tag
:
Int
,
block
:
(
JceHead
)
->
R
):
R
?
{
// println("skipping to $tag start")
// println("skipping to $tag start")
while
(
true
)
{
while
(
true
)
{
if
(
isEndOfInput
)
{
// 读不了了
if
(
isEndOfInput
)
{
// 读不了了
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/io/serialization/jce/JceInput.kt
View file @
ce7af37e
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
package
net.mamoe.mirai.qqandroid.io.serialization.jce
package
net.mamoe.mirai.qqandroid.io.serialization.jce
import
kotlinx.io.core.*
import
kotlinx.io.core.*
import
net.mamoe.mirai.qqandroid.io.serialization.Jce
import
net.mamoe.mirai.qqandroid.io.serialization.JceCharset
import
net.mamoe.mirai.qqandroid.io.serialization.JceCharset
import
net.mamoe.mirai.utils.io.readString
import
net.mamoe.mirai.utils.io.readString
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/io/serialization/jce/JceNew.kt
View file @
ce7af37e
...
@@ -9,8 +9,8 @@
...
@@ -9,8 +9,8 @@
package
net.mamoe.mirai.qqandroid.io.serialization.jce
package
net.mamoe.mirai.qqandroid.io.serialization.jce
import
kotlinx.io.core.
Input
import
kotlinx.io.core.
*
import
kotlinx.
io.core.Outpu
t
import
kotlinx.
serialization.BinaryForma
t
import
kotlinx.serialization.DeserializationStrategy
import
kotlinx.serialization.DeserializationStrategy
import
kotlinx.serialization.SerialFormat
import
kotlinx.serialization.SerialFormat
import
kotlinx.serialization.SerializationStrategy
import
kotlinx.serialization.SerializationStrategy
...
@@ -18,26 +18,56 @@ import kotlinx.serialization.modules.EmptyModule
...
@@ -18,26 +18,56 @@ import kotlinx.serialization.modules.EmptyModule
import
kotlinx.serialization.modules.SerialModule
import
kotlinx.serialization.modules.SerialModule
import
net.mamoe.mirai.qqandroid.io.serialization.IOFormat
import
net.mamoe.mirai.qqandroid.io.serialization.IOFormat
import
net.mamoe.mirai.qqandroid.io.serialization.JceCharset
import
net.mamoe.mirai.qqandroid.io.serialization.JceCharset
import
net.mamoe.mirai.qqandroid.io.serialization.JceOld
import
net.mamoe.mirai.utils.io.toReadPacket
/**
/**
* Jce 数据结构序列化和反序列化器.
* Jce 数据结构序列化和反序列化器.
*
*
* @author Him188
* @author Him188
*/
*/
class
Jce
New
(
class
Jce
(
override
val
context
:
SerialModule
,
override
val
context
:
SerialModule
,
val
charset
:
JceCharset
val
charset
:
JceCharset
)
:
SerialFormat
,
IOFormat
{
)
:
SerialFormat
,
IOFormat
,
BinaryFormat
{
override
fun
<
T
>
dump
(
serializer
:
SerializationStrategy
<
T
>,
output
:
Output
):
ByteArray
{
override
fun
<
T
>
dump
To
(
serializer
:
SerializationStrategy
<
T
>,
ojb
:
T
,
output
:
Output
)
{
TODO
(
"Not yet implemented"
)
output
.
writePacket
(
JceOld
.
byCharSet
(
this
.
charset
).
dumpAsPacket
(
serializer
,
ojb
)
)
}
}
override
fun
<
T
>
load
(
deserializer
:
DeserializationStrategy
<
T
>,
input
:
Input
):
T
{
override
fun
<
T
>
load
(
deserializer
:
DeserializationStrategy
<
T
>,
input
:
Input
):
T
{
return
JceDecoder
(
JceInput
(
input
,
charset
),
context
).
decodeSerializableValue
(
deserializer
)
return
JceDecoder
(
JceInput
(
input
,
charset
),
context
).
decodeSerializableValue
(
deserializer
)
}
}
override
fun
<
T
>
dump
(
serializer
:
SerializationStrategy
<
T
>,
value
:
T
):
ByteArray
{
return
buildPacket
{
dumpTo
(
serializer
,
value
,
this
)
}.
readBytes
()
}
override
fun
<
T
>
load
(
deserializer
:
DeserializationStrategy
<
T
>,
bytes
:
ByteArray
):
T
{
return
load
(
deserializer
,
bytes
.
toReadPacket
())
}
companion
object
{
companion
object
{
val
UTF_8
=
JceNew
(
EmptyModule
,
JceCharset
.
UTF8
)
val
UTF_8
=
Jce
(
EmptyModule
,
JceCharset
.
UTF8
)
val
GBK
=
JceNew
(
EmptyModule
,
JceCharset
.
GBK
)
val
GBK
=
Jce
(
EmptyModule
,
JceCharset
.
GBK
)
fun
byCharSet
(
c
:
JceCharset
):
Jce
{
return
if
(
c
==
JceCharset
.
UTF8
)
UTF_8
else
GBK
}
internal
const
val
BYTE
:
Byte
=
0
internal
const
val
DOUBLE
:
Byte
=
5
internal
const
val
FLOAT
:
Byte
=
4
internal
const
val
INT
:
Byte
=
2
internal
const
val
JCE_MAX_STRING_LENGTH
=
104857600
internal
const
val
LIST
:
Byte
=
9
internal
const
val
LONG
:
Byte
=
3
internal
const
val
MAP
:
Byte
=
8
internal
const
val
SHORT
:
Byte
=
1
internal
const
val
SIMPLE_LIST
:
Byte
=
13
internal
const
val
STRING1
:
Byte
=
6
internal
const
val
STRING4
:
Byte
=
7
internal
const
val
STRUCT_BEGIN
:
Byte
=
10
internal
const
val
STRUCT_END
:
Byte
=
11
internal
const
val
ZERO_TYPE
:
Byte
=
12
}
}
}
}
\ No newline at end of file
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/io/serialization/jce/common.kt
View file @
ce7af37e
...
@@ -11,7 +11,6 @@ package net.mamoe.mirai.qqandroid.io.serialization.jce
...
@@ -11,7 +11,6 @@ package net.mamoe.mirai.qqandroid.io.serialization.jce
import
kotlinx.io.core.Output
import
kotlinx.io.core.Output
import
kotlinx.serialization.SerialInfo
import
kotlinx.serialization.SerialInfo
import
net.mamoe.mirai.qqandroid.io.serialization.Jce
/**
/**
...
@@ -27,15 +26,47 @@ annotation class JceId(val id: Int)
...
@@ -27,15 +26,47 @@ annotation class JceId(val id: Int)
* 保留这个结构, 为将来增加功能的兼容性.
* 保留这个结构, 为将来增加功能的兼容性.
*/
*/
@PublishedApi
@PublishedApi
internal
data class
JceTag
(
internal
abstract
class
JceTag
{
val
id
:
Int
,
abstract
val
id
:
Int
val
isNullable
:
Boolean
abstract
val
isNullable
:
Boolean
){
internal
var
isSimpleByteArray
:
Boolean
=
false
internal
var
isSimpleByteArray
:
Boolean
=
false
}
}
internal
sealed
class
JceTagListElement
(
override
val
isNullable
:
Boolean
)
:
JceTag
(){
override
val
id
:
Int
get
()
=
0
object
Nullable
:
JceTagListElement
(
true
)
object
NotNull
:
JceTagListElement
(
false
)
}
internal
sealed
class
JceTagMapEntryKey
(
override
val
isNullable
:
Boolean
)
:
JceTag
(){
override
val
id
:
Int
get
()
=
0
object
Nullable
:
JceTagMapEntryKey
(
true
)
object
NotNull
:
JceTagMapEntryKey
(
false
)
}
internal
sealed
class
JceTagMapEntryValue
(
override
val
isNullable
:
Boolean
)
:
JceTag
()
{
override
val
id
:
Int
get
()
=
1
object
Nullable
:
JceTagMapEntryValue
(
true
)
object
NotNull
:
JceTagMapEntryValue
(
false
)
}
internal
data class
JceTagCommon
(
override
val
id
:
Int
,
override
val
isNullable
:
Boolean
)
:
JceTag
()
fun
JceHead
.
checkType
(
type
:
Byte
)
{
fun
JceHead
.
checkType
(
type
:
Byte
)
{
check
(
this
.
type
==
type
)
{
"type mismatch. Expected $type, actual ${this.type}"
}
check
(
this
.
type
==
type
)
{
"type mismatch. Expected $type, actual ${this.type}"
}
}
}
@PublishedApi
@PublishedApi
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/io/serialization/utils.kt
View file @
ce7af37e
...
@@ -18,21 +18,29 @@ import kotlinx.serialization.SerialDescriptor
...
@@ -18,21 +18,29 @@ import kotlinx.serialization.SerialDescriptor
import
kotlinx.serialization.SerializationStrategy
import
kotlinx.serialization.SerializationStrategy
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.qqandroid.io.ProtoBuf
import
net.mamoe.mirai.qqandroid.io.ProtoBuf
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce
import
net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestDataVersion2
import
net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestDataVersion2
import
net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestDataVersion3
import
net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestDataVersion3
import
net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestPacket
import
net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestPacket
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.firstValue
import
net.mamoe.mirai.utils.firstValue
import
net.mamoe.mirai.utils.io.read
import
net.mamoe.mirai.utils.io.read
import
net.mamoe.mirai.utils.io.readPacketExact
import
net.mamoe.mirai.utils.io.toReadPacket
import
kotlin.jvm.JvmMultifileClass
import
kotlin.jvm.JvmMultifileClass
import
kotlin.jvm.JvmName
import
kotlin.jvm.JvmName
fun
<
T
:
JceStruct
>
ByteArray
.
loadAs
(
deserializer
:
DeserializationStrategy
<
T
>,
c
:
JceCharset
=
JceCharset
.
UTF8
):
T
{
fun
<
T
:
JceStruct
>
ByteArray
.
loadAs
(
deserializer
:
DeserializationStrategy
<
T
>,
c
:
JceCharset
=
JceCharset
.
UTF8
):
T
{
return
Jce
.
byCharSet
(
c
).
load
(
deserializer
,
this
)
return
Jce
.
byCharSet
(
c
).
load
(
deserializer
,
this
.
toReadPacket
()
)
}
}
fun
<
T
:
JceStruct
>
BytePacketBuilder
.
writeJceStruct
(
serializer
:
SerializationStrategy
<
T
>,
struct
:
T
,
charset
:
JceCharset
=
JceCharset
.
GBK
)
{
fun
<
T
:
JceStruct
>
BytePacketBuilder
.
writeJceStruct
(
this
.
writePacket
(
Jce
.
byCharSet
(
charset
).
dumpAsPacket
(
serializer
,
struct
))
serializer
:
SerializationStrategy
<
T
>,
struct
:
T
,
charset
:
JceCharset
=
JceCharset
.
GBK
)
{
Jce
.
byCharSet
(
charset
).
dumpTo
(
serializer
,
struct
,
this
)
}
}
fun
<
T
:
JceStruct
>
ByteReadPacket
.
readJceStruct
(
fun
<
T
:
JceStruct
>
ByteReadPacket
.
readJceStruct
(
...
@@ -40,7 +48,8 @@ fun <T : JceStruct> ByteReadPacket.readJceStruct(
...
@@ -40,7 +48,8 @@ fun <T : JceStruct> ByteReadPacket.readJceStruct(
charset
:
JceCharset
=
JceCharset
.
UTF8
,
charset
:
JceCharset
=
JceCharset
.
UTF8
,
length
:
Int
=
this
.
remaining
.
toInt
()
length
:
Int
=
this
.
remaining
.
toInt
()
):
T
{
):
T
{
return
Jce
.
byCharSet
(
charset
).
load
(
serializer
,
this
,
length
)
@OptIn
(
MiraiInternalAPI
::
class
)
return
Jce
.
byCharSet
(
charset
).
load
(
serializer
,
this
.
readPacketExact
(
length
))
}
}
/**
/**
...
@@ -82,7 +91,8 @@ fun <R> ByteReadPacket.decodeUniRequestPacketAndDeserialize(name: String? = null
...
@@ -82,7 +91,8 @@ fun <R> ByteReadPacket.decodeUniRequestPacketAndDeserialize(name: String? = null
})
})
}
}
fun
<
T
:
JceStruct
>
T
.
toByteArray
(
serializer
:
SerializationStrategy
<
T
>,
c
:
JceCharset
=
JceCharset
.
GBK
):
ByteArray
=
Jce
.
byCharSet
(
c
).
dump
(
serializer
,
this
)
fun
<
T
:
JceStruct
>
T
.
toByteArray
(
serializer
:
SerializationStrategy
<
T
>,
c
:
JceCharset
=
JceCharset
.
GBK
):
ByteArray
=
Jce
.
byCharSet
(
c
).
dump
(
serializer
,
this
)
fun
<
T
:
ProtoBuf
>
BytePacketBuilder
.
writeProtoBuf
(
serializer
:
SerializationStrategy
<
T
>,
v
:
T
)
{
fun
<
T
:
ProtoBuf
>
BytePacketBuilder
.
writeProtoBuf
(
serializer
:
SerializationStrategy
<
T
>,
v
:
T
)
{
this
.
writeFully
(
v
.
toByteArray
(
serializer
))
this
.
writeFully
(
v
.
toByteArray
(
serializer
))
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/ConfigPush.kt
View file @
ce7af37e
...
@@ -10,138 +10,138 @@
...
@@ -10,138 +10,138 @@
package
net.mamoe.mirai.qqandroid.network.protocol.data.jce
package
net.mamoe.mirai.qqandroid.network.protocol.data.jce
import
kotlinx.serialization.Serializable
import
kotlinx.serialization.Serializable
import
kotlinx.serialization.protobuf.ProtoId
import
net.mamoe.mirai.data.Packet
import
net.mamoe.mirai.data.Packet
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.qqandroid.io.serialization.jce.JceId
@Serializable
@Serializable
internal
class
BigDataChannel
(
internal
class
BigDataChannel
(
@
Proto
Id
(
0
)
val
vBigdataIplists
:
List
<
BigDataIpList
>,
@
Jce
Id
(
0
)
val
vBigdataIplists
:
List
<
BigDataIpList
>,
@
Proto
Id
(
1
)
val
sBigdataSigSession
:
ByteArray
?
=
null
,
@
Jce
Id
(
1
)
val
sBigdataSigSession
:
ByteArray
?
=
null
,
@
Proto
Id
(
2
)
val
sBigdataKeySession
:
ByteArray
?
=
null
,
@
Jce
Id
(
2
)
val
sBigdataKeySession
:
ByteArray
?
=
null
,
@
Proto
Id
(
3
)
val
uSigUin
:
Long
?
=
null
,
@
Jce
Id
(
3
)
val
uSigUin
:
Long
?
=
null
,
@
Proto
Id
(
4
)
val
iConnectFlag
:
Int
?
=
1
,
@
Jce
Id
(
4
)
val
iConnectFlag
:
Int
?
=
1
,
@
Proto
Id
(
5
)
val
vBigdataPbBuf
:
ByteArray
?
=
null
@
Jce
Id
(
5
)
val
vBigdataPbBuf
:
ByteArray
?
=
null
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
BigDataIpInfo
(
internal
class
BigDataIpInfo
(
@
Proto
Id
(
0
)
val
uType
:
Long
,
@
Jce
Id
(
0
)
val
uType
:
Long
,
@
Proto
Id
(
1
)
val
sIp
:
String
=
""
,
@
Jce
Id
(
1
)
val
sIp
:
String
=
""
,
@
Proto
Id
(
2
)
val
uPort
:
Long
@
Jce
Id
(
2
)
val
uPort
:
Long
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
BigDataIpList
(
internal
class
BigDataIpList
(
@
Proto
Id
(
0
)
val
uServiceType
:
Long
,
@
Jce
Id
(
0
)
val
uServiceType
:
Long
,
@
Proto
Id
(
1
)
val
vIplist
:
List
<
BigDataIpInfo
>,
@
Jce
Id
(
1
)
val
vIplist
:
List
<
BigDataIpInfo
>,
@
Proto
Id
(
2
)
val
netSegConfs
:
List
<
NetSegConf
>?
=
null
,
@
Jce
Id
(
2
)
val
netSegConfs
:
List
<
NetSegConf
>?
=
null
,
@
Proto
Id
(
3
)
val
ufragmentSize
:
Long
?
=
null
@
Jce
Id
(
3
)
val
ufragmentSize
:
Long
?
=
null
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
ClientLogConfig
(
internal
class
ClientLogConfig
(
@
Proto
Id
(
1
)
val
type
:
Int
,
@
Jce
Id
(
1
)
val
type
:
Int
,
@
Proto
Id
(
2
)
val
timeStart
:
TimeStamp
?
=
null
,
@
Jce
Id
(
2
)
val
timeStart
:
TimeStamp
?
=
null
,
@
Proto
Id
(
3
)
val
timeFinish
:
TimeStamp
?
=
null
,
@
Jce
Id
(
3
)
val
timeFinish
:
TimeStamp
?
=
null
,
@
Proto
Id
(
4
)
val
loglevel
:
Byte
?
=
null
,
@
Jce
Id
(
4
)
val
loglevel
:
Byte
?
=
null
,
@
Proto
Id
(
5
)
val
cookie
:
Int
?
=
null
,
@
Jce
Id
(
5
)
val
cookie
:
Int
?
=
null
,
@
Proto
Id
(
6
)
val
lseq
:
Long
?
=
null
@
Jce
Id
(
6
)
val
lseq
:
Long
?
=
null
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
DomainIpChannel
(
internal
class
DomainIpChannel
(
@
Proto
Id
(
0
)
val
vDomainIplists
:
List
<
DomainIpList
>
@
Jce
Id
(
0
)
val
vDomainIplists
:
List
<
DomainIpList
>
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
DomainIpInfo
(
internal
class
DomainIpInfo
(
@
Proto
Id
(
1
)
val
uIp
:
Int
,
@
Jce
Id
(
1
)
val
uIp
:
Int
,
@
Proto
Id
(
2
)
val
uPort
:
Int
@
Jce
Id
(
2
)
val
uPort
:
Int
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
DomainIpList
(
internal
class
DomainIpList
(
@
Proto
Id
(
0
)
val
uDomainType
:
Int
,
@
Jce
Id
(
0
)
val
uDomainType
:
Int
,
@
Proto
Id
(
1
)
val
vIplist
:
List
<
DomainIpInfo
>
@
Jce
Id
(
1
)
val
vIplist
:
List
<
DomainIpInfo
>
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
FileStoragePushFSSvcList
(
internal
class
FileStoragePushFSSvcList
(
@
Proto
Id
(
0
)
val
vUpLoadList
:
List
<
FileStorageServerListInfo
>,
@
Jce
Id
(
0
)
val
vUpLoadList
:
List
<
FileStorageServerListInfo
>,
@
Proto
Id
(
1
)
val
vPicDownLoadList
:
List
<
FileStorageServerListInfo
>,
@
Jce
Id
(
1
)
val
vPicDownLoadList
:
List
<
FileStorageServerListInfo
>,
@
Proto
Id
(
2
)
val
vGPicDownLoadList
:
List
<
FileStorageServerListInfo
>?
=
null
,
@
Jce
Id
(
2
)
val
vGPicDownLoadList
:
List
<
FileStorageServerListInfo
>?
=
null
,
@
Proto
Id
(
3
)
val
vQzoneProxyServiceList
:
List
<
FileStorageServerListInfo
>?
=
null
,
@
Jce
Id
(
3
)
val
vQzoneProxyServiceList
:
List
<
FileStorageServerListInfo
>?
=
null
,
@
Proto
Id
(
4
)
val
vUrlEncodeServiceList
:
List
<
FileStorageServerListInfo
>?
=
null
,
@
Jce
Id
(
4
)
val
vUrlEncodeServiceList
:
List
<
FileStorageServerListInfo
>?
=
null
,
@
Proto
Id
(
5
)
val
bigDataChannel
:
BigDataChannel
?
=
null
,
@
Jce
Id
(
5
)
val
bigDataChannel
:
BigDataChannel
?
=
null
,
@
Proto
Id
(
6
)
val
vVipEmotionList
:
List
<
FileStorageServerListInfo
>?
=
null
,
@
Jce
Id
(
6
)
val
vVipEmotionList
:
List
<
FileStorageServerListInfo
>?
=
null
,
@
Proto
Id
(
7
)
val
vC2CPicDownList
:
List
<
FileStorageServerListInfo
>?
=
null
,
@
Jce
Id
(
7
)
val
vC2CPicDownList
:
List
<
FileStorageServerListInfo
>?
=
null
,
@
Proto
Id
(
8
)
val
fmtIPInfo
:
FmtIPInfo
?
=
null
,
@
Jce
Id
(
8
)
val
fmtIPInfo
:
FmtIPInfo
?
=
null
,
@
Proto
Id
(
9
)
val
domainIpChannel
:
DomainIpChannel
?
=
null
,
@
Jce
Id
(
9
)
val
domainIpChannel
:
DomainIpChannel
?
=
null
,
@
Proto
Id
(
10
)
val
pttlist
:
ByteArray
?
=
null
@
Jce
Id
(
10
)
val
pttlist
:
ByteArray
?
=
null
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
FileStorageServerListInfo
(
internal
class
FileStorageServerListInfo
(
@
Proto
Id
(
1
)
val
sIP
:
String
=
""
,
@
Jce
Id
(
1
)
val
sIP
:
String
=
""
,
@
Proto
Id
(
2
)
val
iPort
:
Int
@
Jce
Id
(
2
)
val
iPort
:
Int
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
FmtIPInfo
(
internal
class
FmtIPInfo
(
@
Proto
Id
(
0
)
val
sGateIp
:
String
=
""
,
@
Jce
Id
(
0
)
val
sGateIp
:
String
=
""
,
@
Proto
Id
(
1
)
val
iGateIpOper
:
Long
@
Jce
Id
(
1
)
val
iGateIpOper
:
Long
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
NetSegConf
(
internal
class
NetSegConf
(
@
Proto
Id
(
0
)
val
uint32NetType
:
Long
?
=
null
,
@
Jce
Id
(
0
)
val
uint32NetType
:
Long
?
=
null
,
@
Proto
Id
(
1
)
val
uint32Segsize
:
Long
?
=
null
,
@
Jce
Id
(
1
)
val
uint32Segsize
:
Long
?
=
null
,
@
Proto
Id
(
2
)
val
uint32Segnum
:
Long
?
=
null
,
@
Jce
Id
(
2
)
val
uint32Segnum
:
Long
?
=
null
,
@
Proto
Id
(
3
)
val
uint32Curconnnum
:
Long
?
=
null
@
Jce
Id
(
3
)
val
uint32Curconnnum
:
Long
?
=
null
)
:
JceStruct
)
:
JceStruct
@Suppress
(
"ArrayInDataClass"
)
@Suppress
(
"ArrayInDataClass"
)
@Serializable
@Serializable
internal
data class
PushReq
(
internal
data class
PushReq
(
@
Proto
Id
(
1
)
val
type
:
Int
,
@
Jce
Id
(
1
)
val
type
:
Int
,
@
Proto
Id
(
2
)
val
jcebuf
:
ByteArray
,
@
Jce
Id
(
2
)
val
jcebuf
:
ByteArray
,
@
Proto
Id
(
3
)
val
seq
:
Long
@
Jce
Id
(
3
)
val
seq
:
Long
)
:
JceStruct
,
Packet
)
:
JceStruct
,
Packet
@Serializable
@Serializable
internal
class
PushResp
(
internal
class
PushResp
(
@
Proto
Id
(
1
)
val
type
:
Int
,
@
Jce
Id
(
1
)
val
type
:
Int
,
@
Proto
Id
(
2
)
val
seq
:
Long
,
@
Jce
Id
(
2
)
val
seq
:
Long
,
@
Proto
Id
(
3
)
val
jcebuf
:
ByteArray
?
=
null
@
Jce
Id
(
3
)
val
jcebuf
:
ByteArray
?
=
null
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
SsoServerList
(
internal
class
SsoServerList
(
@
Proto
Id
(
1
)
val
v2G3GList
:
List
<
SsoServerListInfo
>,
@
Jce
Id
(
1
)
val
v2G3GList
:
List
<
SsoServerListInfo
>,
@
Proto
Id
(
3
)
val
vWifiList
:
List
<
SsoServerListInfo
>,
@
Jce
Id
(
3
)
val
vWifiList
:
List
<
SsoServerListInfo
>,
@
Proto
Id
(
4
)
val
iReconnect
:
Int
,
@
Jce
Id
(
4
)
val
iReconnect
:
Int
,
@
Proto
Id
(
5
)
val
testSpeed
:
Byte
?
=
null
,
@
Jce
Id
(
5
)
val
testSpeed
:
Byte
?
=
null
,
@
Proto
Id
(
6
)
val
useNewList
:
Byte
?
=
null
,
@
Jce
Id
(
6
)
val
useNewList
:
Byte
?
=
null
,
@
Proto
Id
(
7
)
val
iMultiConn
:
Int
?
=
1
,
@
Jce
Id
(
7
)
val
iMultiConn
:
Int
?
=
1
,
@
Proto
Id
(
8
)
val
vHttp2g3glist
:
List
<
SsoServerListInfo
>?
=
null
,
@
Jce
Id
(
8
)
val
vHttp2g3glist
:
List
<
SsoServerListInfo
>?
=
null
,
@
Proto
Id
(
9
)
val
vHttpWifilist
:
List
<
SsoServerListInfo
>?
=
null
@
Jce
Id
(
9
)
val
vHttpWifilist
:
List
<
SsoServerListInfo
>?
=
null
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
SsoServerListInfo
(
internal
class
SsoServerListInfo
(
@
Proto
Id
(
1
)
val
sIP
:
String
=
""
,
@
Jce
Id
(
1
)
val
sIP
:
String
=
""
,
@
Proto
Id
(
2
)
val
iPort
:
Int
,
@
Jce
Id
(
2
)
val
iPort
:
Int
,
@
Proto
Id
(
3
)
val
linkType
:
Byte
,
@
Jce
Id
(
3
)
val
linkType
:
Byte
,
@
Proto
Id
(
4
)
val
proxy
:
Byte
,
@
Jce
Id
(
4
)
val
proxy
:
Byte
,
@
Proto
Id
(
5
)
val
protocolType
:
Byte
?
=
null
,
@
Jce
Id
(
5
)
val
protocolType
:
Byte
?
=
null
,
@
Proto
Id
(
6
)
val
iTimeOut
:
Int
?
=
10
@
Jce
Id
(
6
)
val
iTimeOut
:
Int
?
=
10
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
TimeStamp
(
internal
class
TimeStamp
(
@
Proto
Id
(
1
)
val
year
:
Int
,
@
Jce
Id
(
1
)
val
year
:
Int
,
@
Proto
Id
(
2
)
val
month
:
Byte
,
@
Jce
Id
(
2
)
val
month
:
Byte
,
@
Proto
Id
(
3
)
val
day
:
Byte
,
@
Jce
Id
(
3
)
val
day
:
Byte
,
@
Proto
Id
(
4
)
val
hour
:
Byte
@
Jce
Id
(
4
)
val
hour
:
Byte
)
:
JceStruct
)
:
JceStruct
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/FriendList.kt
View file @
ce7af37e
This diff is collapsed.
Click to expand it.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/OnlinePushPack.kt
View file @
ce7af37e
This diff is collapsed.
Click to expand it.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/PushNotifyPack.kt
View file @
ce7af37e
...
@@ -10,71 +10,71 @@
...
@@ -10,71 +10,71 @@
package
net.mamoe.mirai.qqandroid.network.protocol.data.jce
package
net.mamoe.mirai.qqandroid.network.protocol.data.jce
import
kotlinx.serialization.Serializable
import
kotlinx.serialization.Serializable
import
kotlinx.serialization.protobuf.ProtoId
import
net.mamoe.mirai.data.Packet
import
net.mamoe.mirai.data.Packet
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.qqandroid.io.serialization.jce.JceId
import
net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import
net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
@Suppress
(
"ArrayInDataClass"
)
@Suppress
(
"ArrayInDataClass"
)
@Serializable
@Serializable
internal
data class
RequestPushNotify
(
internal
data class
RequestPushNotify
(
@
Proto
Id
(
0
)
val
uin
:
Long
?
=
0L
,
@
Jce
Id
(
0
)
val
uin
:
Long
?
=
0L
,
@
Proto
Id
(
1
)
val
ctype
:
Byte
=
0
,
@
Jce
Id
(
1
)
val
ctype
:
Byte
=
0
,
@
Proto
Id
(
2
)
val
strService
:
String
?,
@
Jce
Id
(
2
)
val
strService
:
String
?,
@
Proto
Id
(
3
)
val
strCmd
:
String
?,
@
Jce
Id
(
3
)
val
strCmd
:
String
?,
@
Proto
Id
(
4
)
val
vNotifyCookie
:
ByteArray
?
=
EMPTY_BYTE_ARRAY
,
@
Jce
Id
(
4
)
val
vNotifyCookie
:
ByteArray
?
=
EMPTY_BYTE_ARRAY
,
@
Proto
Id
(
5
)
val
usMsgType
:
Int
?,
@
Jce
Id
(
5
)
val
usMsgType
:
Int
?,
@
Proto
Id
(
6
)
val
wUserActive
:
Int
?,
@
Jce
Id
(
6
)
val
wUserActive
:
Int
?,
@
Proto
Id
(
7
)
val
wGeneralFlag
:
Int
?,
@
Jce
Id
(
7
)
val
wGeneralFlag
:
Int
?,
@
Proto
Id
(
8
)
val
bindedUin
:
Long
?,
@
Jce
Id
(
8
)
val
bindedUin
:
Long
?,
@
Proto
Id
(
9
)
val
stMsgInfo
:
MsgInfo
?,
@
Jce
Id
(
9
)
val
stMsgInfo
:
MsgInfo
?,
@
Proto
Id
(
10
)
val
msgCtrlBuf
:
String
?,
@
Jce
Id
(
10
)
val
msgCtrlBuf
:
String
?,
@
Proto
Id
(
11
)
val
serverBuf
:
ByteArray
?,
@
Jce
Id
(
11
)
val
serverBuf
:
ByteArray
?,
@
Proto
Id
(
12
)
val
pingFlag
:
Long
?,
@
Jce
Id
(
12
)
val
pingFlag
:
Long
?,
@
Proto
Id
(
13
)
val
svrip
:
Int
?
@
Jce
Id
(
13
)
val
svrip
:
Int
?
)
:
JceStruct
,
Packet
)
:
JceStruct
,
Packet
@Serializable
@Serializable
internal
class
MsgInfo
(
internal
class
MsgInfo
(
@
Proto
Id
(
0
)
val
lFromUin
:
Long
?
=
0L
,
@
Jce
Id
(
0
)
val
lFromUin
:
Long
?
=
0L
,
@
Proto
Id
(
1
)
val
uMsgTime
:
Long
?
=
0L
,
@
Jce
Id
(
1
)
val
uMsgTime
:
Long
?
=
0L
,
@
Proto
Id
(
2
)
val
shMsgType
:
Short
,
@
Jce
Id
(
2
)
val
shMsgType
:
Short
,
@
Proto
Id
(
3
)
val
shMsgSeq
:
Short
,
@
Jce
Id
(
3
)
val
shMsgSeq
:
Short
,
@
Proto
Id
(
4
)
val
strMsg
:
String
?,
@
Jce
Id
(
4
)
val
strMsg
:
String
?,
@
Proto
Id
(
5
)
val
uRealMsgTime
:
Int
?,
@
Jce
Id
(
5
)
val
uRealMsgTime
:
Int
?,
@
Proto
Id
(
6
)
val
vMsg
:
ByteArray
?,
@
Jce
Id
(
6
)
val
vMsg
:
ByteArray
?,
@
Proto
Id
(
7
)
val
uAppShareID
:
Long
?,
@
Jce
Id
(
7
)
val
uAppShareID
:
Long
?,
@
Proto
Id
(
8
)
val
vMsgCookies
:
ByteArray
?
=
EMPTY_BYTE_ARRAY
,
@
Jce
Id
(
8
)
val
vMsgCookies
:
ByteArray
?
=
EMPTY_BYTE_ARRAY
,
@
Proto
Id
(
9
)
val
vAppShareCookie
:
ByteArray
?
=
EMPTY_BYTE_ARRAY
,
@
Jce
Id
(
9
)
val
vAppShareCookie
:
ByteArray
?
=
EMPTY_BYTE_ARRAY
,
@
Proto
Id
(
10
)
val
lMsgUid
:
Long
?,
@
Jce
Id
(
10
)
val
lMsgUid
:
Long
?,
@
Proto
Id
(
11
)
val
lLastChangeTime
:
Long
?,
@
Jce
Id
(
11
)
val
lLastChangeTime
:
Long
?,
@
Proto
Id
(
12
)
val
vCPicInfo
:
List
<
CPicInfo
>?,
@
Jce
Id
(
12
)
val
vCPicInfo
:
List
<
CPicInfo
>?,
@
Proto
Id
(
13
)
val
stShareData
:
ShareData
?,
@
Jce
Id
(
13
)
val
stShareData
:
ShareData
?,
@
Proto
Id
(
14
)
val
lFromInstId
:
Long
?,
@
Jce
Id
(
14
)
val
lFromInstId
:
Long
?,
@
Proto
Id
(
15
)
val
vRemarkOfSender
:
ByteArray
?,
@
Jce
Id
(
15
)
val
vRemarkOfSender
:
ByteArray
?,
@
Proto
Id
(
16
)
val
strFromMobile
:
String
?,
@
Jce
Id
(
16
)
val
strFromMobile
:
String
?,
@
Proto
Id
(
17
)
val
strFromName
:
String
?,
@
Jce
Id
(
17
)
val
strFromName
:
String
?,
@
Proto
Id
(
18
)
val
vNickName
:
List
<
String
>?
//,
@
Jce
Id
(
18
)
val
vNickName
:
List
<
String
>?
//,
//@SerialId(19) val stC2CTmpMsgHead: TempMsgHead?
//@SerialId(19) val stC2CTmpMsgHead: TempMsgHead?
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
ShareData
(
internal
class
ShareData
(
@
Proto
Id
(
0
)
val
pkgname
:
String
=
""
,
@
Jce
Id
(
0
)
val
pkgname
:
String
=
""
,
@
Proto
Id
(
1
)
val
msgtail
:
String
=
""
,
@
Jce
Id
(
1
)
val
msgtail
:
String
=
""
,
@
Proto
Id
(
2
)
val
picurl
:
String
=
""
,
@
Jce
Id
(
2
)
val
picurl
:
String
=
""
,
@
Proto
Id
(
3
)
val
url
:
String
=
""
@
Jce
Id
(
3
)
val
url
:
String
=
""
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
TempMsgHead
(
internal
class
TempMsgHead
(
@
Proto
Id
(
0
)
val
c2c_type
:
Int
?
=
0
,
@
Jce
Id
(
0
)
val
c2c_type
:
Int
?
=
0
,
@
Proto
Id
(
1
)
val
serviceType
:
Int
?
=
0
@
Jce
Id
(
1
)
val
serviceType
:
Int
?
=
0
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
CPicInfo
(
internal
class
CPicInfo
(
@
Proto
Id
(
0
)
val
vPath
:
ByteArray
=
EMPTY_BYTE_ARRAY
,
@
Jce
Id
(
0
)
val
vPath
:
ByteArray
=
EMPTY_BYTE_ARRAY
,
@
Proto
Id
(
1
)
val
vHost
:
ByteArray
?
=
EMPTY_BYTE_ARRAY
@
Jce
Id
(
1
)
val
vHost
:
ByteArray
?
=
EMPTY_BYTE_ARRAY
)
:
JceStruct
)
:
JceStruct
\ No newline at end of file
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/RequestPacket.kt
View file @
ce7af37e
...
@@ -10,37 +10,37 @@
...
@@ -10,37 +10,37 @@
package
net.mamoe.mirai.qqandroid.network.protocol.data.jce
package
net.mamoe.mirai.qqandroid.network.protocol.data.jce
import
kotlinx.serialization.Serializable
import
kotlinx.serialization.Serializable
import
kotlinx.serialization.protobuf.ProtoId
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.qqandroid.io.serialization.jce.JceId
import
net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import
net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
private
val
EMPTY_MAP
=
mapOf
<
String
,
String
>()
private
val
EMPTY_MAP
=
mapOf
<
String
,
String
>()
@Serializable
@Serializable
internal
class
RequestPacket
(
internal
class
RequestPacket
(
@
Proto
Id
(
1
)
val
iVersion
:
Short
?
=
3
,
@
Jce
Id
(
1
)
val
iVersion
:
Short
?
=
3
,
@
Proto
Id
(
2
)
val
cPacketType
:
Byte
=
0
,
@
Jce
Id
(
2
)
val
cPacketType
:
Byte
=
0
,
@
Proto
Id
(
3
)
val
iMessageType
:
Int
=
0
,
@
Jce
Id
(
3
)
val
iMessageType
:
Int
=
0
,
@
Proto
Id
(
4
)
val
iRequestId
:
Int
,
@
Jce
Id
(
4
)
val
iRequestId
:
Int
,
@
Proto
Id
(
5
)
val
sServantName
:
String
=
""
,
@
Jce
Id
(
5
)
val
sServantName
:
String
=
""
,
@
Proto
Id
(
6
)
val
sFuncName
:
String
=
""
,
@
Jce
Id
(
6
)
val
sFuncName
:
String
=
""
,
@
Proto
Id
(
7
)
val
sBuffer
:
ByteArray
=
EMPTY_BYTE_ARRAY
,
@
Jce
Id
(
7
)
val
sBuffer
:
ByteArray
=
EMPTY_BYTE_ARRAY
,
@
Proto
Id
(
8
)
val
iTimeout
:
Int
?
=
0
,
@
Jce
Id
(
8
)
val
iTimeout
:
Int
?
=
0
,
@
Proto
Id
(
9
)
val
context
:
Map
<
String
,
String
>?
=
EMPTY_MAP
,
@
Jce
Id
(
9
)
val
context
:
Map
<
String
,
String
>?
=
EMPTY_MAP
,
@
Proto
Id
(
10
)
val
status
:
Map
<
String
,
String
>?
=
EMPTY_MAP
@
Jce
Id
(
10
)
val
status
:
Map
<
String
,
String
>?
=
EMPTY_MAP
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
RequestDataVersion3
(
internal
class
RequestDataVersion3
(
@
Proto
Id
(
0
)
val
map
:
Map
<
String
,
ByteArray
>
// 注意: ByteArray 不能直接放序列化的 JceStruct!! 要放类似 RequestDataStructSvcReqRegister 的
@
Jce
Id
(
0
)
val
map
:
Map
<
String
,
ByteArray
>
// 注意: ByteArray 不能直接放序列化的 JceStruct!! 要放类似 RequestDataStructSvcReqRegister 的
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
RequestDataVersion2
(
internal
class
RequestDataVersion2
(
@
Proto
Id
(
0
)
val
map
:
Map
<
String
,
Map
<
String
,
ByteArray
>>
@
Jce
Id
(
0
)
val
map
:
Map
<
String
,
Map
<
String
,
ByteArray
>>
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
RequestDataStructSvcReqRegister
(
internal
class
RequestDataStructSvcReqRegister
(
@
Proto
Id
(
0
)
val
struct
:
SvcReqRegister
@
Jce
Id
(
0
)
val
struct
:
SvcReqRegister
)
:
JceStruct
)
:
JceStruct
\ No newline at end of file
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/RequestPushForceOffline.kt
View file @
ce7af37e
...
@@ -12,11 +12,12 @@ package net.mamoe.mirai.qqandroid.network.protocol.data.jce
...
@@ -12,11 +12,12 @@ package net.mamoe.mirai.qqandroid.network.protocol.data.jce
import
kotlinx.serialization.Serializable
import
kotlinx.serialization.Serializable
import
kotlinx.serialization.protobuf.ProtoId
import
kotlinx.serialization.protobuf.ProtoId
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.qqandroid.io.serialization.jce.JceId
@Serializable
@Serializable
internal
class
RequestPushForceOffline
(
internal
class
RequestPushForceOffline
(
@
Proto
Id
(
0
)
val
uin
:
Long
,
@
Jce
Id
(
0
)
val
uin
:
Long
,
@
Proto
Id
(
1
)
val
title
:
String
?
=
""
,
@
Jce
Id
(
1
)
val
title
:
String
?
=
""
,
@
Proto
Id
(
2
)
val
tips
:
String
?
=
""
,
@
Jce
Id
(
2
)
val
tips
:
String
?
=
""
,
@
Proto
Id
(
3
)
val
sameDevice
:
Byte
?
=
null
@
Jce
Id
(
3
)
val
sameDevice
:
Byte
?
=
null
)
:
JceStruct
)
:
JceStruct
\ No newline at end of file
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/SvcReqRegister.kt
View file @
ce7af37e
...
@@ -10,46 +10,46 @@
...
@@ -10,46 +10,46 @@
package
net.mamoe.mirai.qqandroid.network.protocol.data.jce
package
net.mamoe.mirai.qqandroid.network.protocol.data.jce
import
kotlinx.serialization.Serializable
import
kotlinx.serialization.Serializable
import
kotlinx.serialization.protobuf.ProtoId
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.qqandroid.io.JceStruct
import
net.mamoe.mirai.qqandroid.io.serialization.jce.JceId
@Serializable
@Serializable
internal
class
SvcReqRegister
(
internal
class
SvcReqRegister
(
@
Proto
Id
(
0
)
val
lUin
:
Long
=
0L
,
@
Jce
Id
(
0
)
val
lUin
:
Long
=
0L
,
@
Proto
Id
(
1
)
val
lBid
:
Long
=
0L
,
@
Jce
Id
(
1
)
val
lBid
:
Long
=
0L
,
@
Proto
Id
(
2
)
val
cConnType
:
Byte
=
0
,
@
Jce
Id
(
2
)
val
cConnType
:
Byte
=
0
,
@
Proto
Id
(
3
)
val
sOther
:
String
=
""
,
@
Jce
Id
(
3
)
val
sOther
:
String
=
""
,
@
Proto
Id
(
4
)
val
iStatus
:
Int
=
11
,
@
Jce
Id
(
4
)
val
iStatus
:
Int
=
11
,
@
Proto
Id
(
5
)
val
bOnlinePush
:
Byte
=
0
,
@
Jce
Id
(
5
)
val
bOnlinePush
:
Byte
=
0
,
@
Proto
Id
(
6
)
val
bIsOnline
:
Byte
=
0
,
@
Jce
Id
(
6
)
val
bIsOnline
:
Byte
=
0
,
@
Proto
Id
(
7
)
val
bIsShowOnline
:
Byte
=
0
,
@
Jce
Id
(
7
)
val
bIsShowOnline
:
Byte
=
0
,
@
Proto
Id
(
8
)
val
bKikPC
:
Byte
=
0
,
@
Jce
Id
(
8
)
val
bKikPC
:
Byte
=
0
,
@
Proto
Id
(
9
)
val
bKikWeak
:
Byte
=
0
,
@
Jce
Id
(
9
)
val
bKikWeak
:
Byte
=
0
,
@
Proto
Id
(
10
)
val
timeStamp
:
Long
=
0L
,
@
Jce
Id
(
10
)
val
timeStamp
:
Long
=
0L
,
@
Proto
Id
(
11
)
val
iOSVersion
:
Long
=
0L
,
@
Jce
Id
(
11
)
val
iOSVersion
:
Long
=
0L
,
@
Proto
Id
(
12
)
val
cNetType
:
Byte
=
0
,
@
Jce
Id
(
12
)
val
cNetType
:
Byte
=
0
,
@
Proto
Id
(
13
)
val
sBuildVer
:
String
?
=
""
,
@
Jce
Id
(
13
)
val
sBuildVer
:
String
?
=
""
,
@
Proto
Id
(
14
)
val
bRegType
:
Byte
=
0
,
@
Jce
Id
(
14
)
val
bRegType
:
Byte
=
0
,
@
Proto
Id
(
15
)
val
vecDevParam
:
ByteArray
?
=
null
,
@
Jce
Id
(
15
)
val
vecDevParam
:
ByteArray
?
=
null
,
@
Proto
Id
(
16
)
val
vecGuid
:
ByteArray
?
=
null
,
@
Jce
Id
(
16
)
val
vecGuid
:
ByteArray
?
=
null
,
@
Proto
Id
(
17
)
val
iLocaleID
:
Int
=
2052
,
@
Jce
Id
(
17
)
val
iLocaleID
:
Int
=
2052
,
@
Proto
Id
(
18
)
val
bSlientPush
:
Byte
=
0
,
@
Jce
Id
(
18
)
val
bSlientPush
:
Byte
=
0
,
@
Proto
Id
(
19
)
val
strDevName
:
String
?
=
null
,
@
Jce
Id
(
19
)
val
strDevName
:
String
?
=
null
,
@
Proto
Id
(
20
)
val
strDevType
:
String
?
=
null
,
@
Jce
Id
(
20
)
val
strDevType
:
String
?
=
null
,
@
Proto
Id
(
21
)
val
strOSVer
:
String
?
=
null
,
@
Jce
Id
(
21
)
val
strOSVer
:
String
?
=
null
,
@
Proto
Id
(
22
)
val
bOpenPush
:
Byte
=
1
,
@
Jce
Id
(
22
)
val
bOpenPush
:
Byte
=
1
,
@
Proto
Id
(
23
)
val
iLargeSeq
:
Long
=
0L
,
@
Jce
Id
(
23
)
val
iLargeSeq
:
Long
=
0L
,
@
Proto
Id
(
24
)
val
iLastWatchStartTime
:
Long
=
0L
,
@
Jce
Id
(
24
)
val
iLastWatchStartTime
:
Long
=
0L
,
@
Proto
Id
(
26
)
val
uOldSSOIp
:
Long
=
0L
,
@
Jce
Id
(
26
)
val
uOldSSOIp
:
Long
=
0L
,
@
Proto
Id
(
27
)
val
uNewSSOIp
:
Long
=
0L
,
@
Jce
Id
(
27
)
val
uNewSSOIp
:
Long
=
0L
,
@
Proto
Id
(
28
)
val
sChannelNo
:
String
?
=
null
,
@
Jce
Id
(
28
)
val
sChannelNo
:
String
?
=
null
,
@
Proto
Id
(
29
)
val
lCpId
:
Long
=
0L
,
@
Jce
Id
(
29
)
val
lCpId
:
Long
=
0L
,
@
Proto
Id
(
30
)
val
strVendorName
:
String
?
=
null
,
@
Jce
Id
(
30
)
val
strVendorName
:
String
?
=
null
,
@
Proto
Id
(
31
)
val
strVendorOSName
:
String
?
=
null
,
@
Jce
Id
(
31
)
val
strVendorOSName
:
String
?
=
null
,
@
Proto
Id
(
32
)
val
strIOSIdfa
:
String
?
=
null
,
@
Jce
Id
(
32
)
val
strIOSIdfa
:
String
?
=
null
,
@
Proto
Id
(
33
)
val
bytes_0x769_reqbody
:
ByteArray
?
=
null
,
@
Jce
Id
(
33
)
val
bytes_0x769_reqbody
:
ByteArray
?
=
null
,
@
Proto
Id
(
34
)
val
bIsSetStatus
:
Byte
=
0
,
@
Jce
Id
(
34
)
val
bIsSetStatus
:
Byte
=
0
,
@
Proto
Id
(
35
)
val
vecServerBuf
:
ByteArray
?
=
null
,
@
Jce
Id
(
35
)
val
vecServerBuf
:
ByteArray
?
=
null
,
@
Proto
Id
(
36
)
val
bSetMute
:
Byte
=
0
@
Jce
Id
(
36
)
val
bSetMute
:
Byte
=
0
// @SerialId(25) var vecBindUin: ArrayList<*>? = null // ?? 未知泛型
// @SerialId(25) var vecBindUin: ArrayList<*>? = null // ?? 未知泛型
)
:
JceStruct
)
:
JceStruct
\ No newline at end of file
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/TroopList.kt
View file @
ce7af37e
This diff is collapsed.
Click to expand it.
mirai-core-qqandroid/src/commonTest/kotlin/net.mamoe.mirai.qqandroid.io.serialization/JceInputTest.kt
View file @
ce7af37e
...
@@ -6,9 +6,9 @@ import kotlinx.io.core.buildPacket
...
@@ -6,9 +6,9 @@ import kotlinx.io.core.buildPacket
import
kotlinx.io.core.writeFully
import
kotlinx.io.core.writeFully
import
kotlinx.serialization.MissingFieldException
import
kotlinx.serialization.MissingFieldException
import
kotlinx.serialization.Serializable
import
kotlinx.serialization.Serializable
import
net.mamoe.mirai.qqandroid.io.serialization.jce.Jce
import
net.mamoe.mirai.qqandroid.io.serialization.jce.JceId
import
net.mamoe.mirai.qqandroid.io.serialization.jce.JceId
import
net.mamoe.mirai.qqandroid.io.serialization.jce.JceInput
import
net.mamoe.mirai.qqandroid.io.serialization.jce.JceInput
import
net.mamoe.mirai.qqandroid.io.serialization.jce.JceNew
import
net.mamoe.mirai.qqandroid.io.serialization.jce.writeJceHead
import
net.mamoe.mirai.qqandroid.io.serialization.jce.writeJceHead
import
kotlin.test.Test
import
kotlin.test.Test
import
kotlin.test.assertEquals
import
kotlin.test.assertEquals
...
@@ -98,7 +98,7 @@ internal class JceInputTest {
...
@@ -98,7 +98,7 @@ internal class JceInputTest {
to
TestSerializableClassC
(
123123
)
to
TestSerializableClassC
(
123123
)
)
)
),
),
Jce
New
.
UTF_8
.
load
(
TestSerializableClassA
.
serializer
(),
input
)
Jce
.
UTF_8
.
load
(
TestSerializableClassA
.
serializer
(),
input
)
)
)
}
}
...
@@ -155,7 +155,7 @@ internal class JceInputTest {
...
@@ -155,7 +155,7 @@ internal class JceInputTest {
5
,
5
,
TestSerializableClassB
(
123
,
TestSerializableClassC
(
123123
),
9
)
TestSerializableClassB
(
123
,
TestSerializableClassC
(
123123
),
9
)
),
),
Jce
New
.
UTF_8
.
load
(
TestSerializableClassA
.
serializer
(),
input
)
Jce
.
UTF_8
.
load
(
TestSerializableClassA
.
serializer
(),
input
)
)
)
}
}
...
@@ -194,7 +194,7 @@ internal class JceInputTest {
...
@@ -194,7 +194,7 @@ internal class JceInputTest {
}
}
}
}
assertEquals
(
TestSerializableClassA
(),
Jce
New
.
UTF_8
.
load
(
TestSerializableClassA
.
serializer
(),
input
))
assertEquals
(
TestSerializableClassA
(),
Jce
.
UTF_8
.
load
(
TestSerializableClassA
.
serializer
(),
input
))
}
}
@Test
@Test
...
@@ -232,7 +232,70 @@ internal class JceInputTest {
...
@@ -232,7 +232,70 @@ internal class JceInputTest {
assertEquals
(
assertEquals
(
TestSerializableClassA
(
mapOf
(
1
to
2
,
33
to
44
)),
TestSerializableClassA
(
mapOf
(
1
to
2
,
33
to
44
)),
JceNew
.
UTF_8
.
load
(
TestSerializableClassA
.
serializer
(),
input
)
Jce
.
UTF_8
.
load
(
TestSerializableClassA
.
serializer
(),
input
)
)
}
@Test
fun
testMapStringInt
()
{
@Serializable
data class
TestSerializableClassA
(
@JceId
(
0
)
val
byteArray
:
Map
<
String
,
Int
>
)
val
input
=
buildPacket
{
writeJceHead
(
MAP
,
0
)
mapOf
(
"str1"
to
2
,
"str2"
to
44
).
let
{
writeJceHead
(
BYTE
,
0
)
writeByte
(
it
.
size
.
toByte
())
it
.
forEach
{
(
key
,
value
)
->
writeJceHead
(
STRING1
,
0
)
writeByte
(
key
.
length
.
toByte
())
writeStringUtf8
(
key
)
writeJceHead
(
INT
,
1
)
writeInt
(
value
)
}
}
}
assertEquals
(
TestSerializableClassA
(
mapOf
(
"str1"
to
2
,
"str2"
to
44
)),
Jce
.
UTF_8
.
load
(
TestSerializableClassA
.
serializer
(),
input
)
)
}
@Test
fun
testMapStringByteArray
()
{
@Serializable
data class
TestSerializableClassA
(
@JceId
(
0
)
val
byteArray
:
Map
<
String
,
ByteArray
>
)
val
input
=
buildPacket
{
writeJceHead
(
MAP
,
0
)
mapOf
(
"str1"
to
byteArrayOf
(
2
,
3
,
4
),
"str2"
to
byteArrayOf
(
2
,
3
,
4
)).
let
{
writeJceHead
(
BYTE
,
0
)
writeByte
(
it
.
size
.
toByte
())
it
.
forEach
{
(
key
,
value
)
->
writeJceHead
(
STRING1
,
0
)
writeByte
(
key
.
length
.
toByte
())
writeStringUtf8
(
key
)
writeJceHead
(
SIMPLE_LIST
,
1
)
writeJceHead
(
BYTE
,
0
)
writeFully
(
value
)
}
}
}
assertEquals
(
TestSerializableClassA
(
mapOf
(
"str1"
to
byteArrayOf
(
2
,
3
,
4
),
"str2"
to
byteArrayOf
(
2
,
3
,
4
))),
Jce
.
UTF_8
.
load
(
TestSerializableClassA
.
serializer
(),
input
)
)
)
}
}
...
@@ -282,7 +345,7 @@ internal class JceInputTest {
...
@@ -282,7 +345,7 @@ internal class JceInputTest {
}
}
}
}
assertEquals
(
TestSerializableClassA
(),
Jce
New
.
UTF_8
.
load
(
TestSerializableClassA
.
serializer
(),
input
))
assertEquals
(
TestSerializableClassA
(),
Jce
.
UTF_8
.
load
(
TestSerializableClassA
.
serializer
(),
input
))
}
}
...
@@ -319,7 +382,7 @@ internal class JceInputTest {
...
@@ -319,7 +382,7 @@ internal class JceInputTest {
writeByte
(
1
)
// boolean
writeByte
(
1
)
// boolean
}
}
assertEquals
(
TestSerializableClassA
(),
Jce
New
.
UTF_8
.
load
(
TestSerializableClassA
.
serializer
(),
input
))
assertEquals
(
TestSerializableClassA
(),
Jce
.
UTF_8
.
load
(
TestSerializableClassA
.
serializer
(),
input
))
}
}
@Test
@Test
...
@@ -338,7 +401,7 @@ internal class JceInputTest {
...
@@ -338,7 +401,7 @@ internal class JceInputTest {
writeShort
(
123
)
writeShort
(
123
)
}
}
assertFailsWith
<
MissingFieldException
>
{
Jce
New
.
UTF_8
.
load
(
TestSerializableClassA
.
serializer
(),
input
)
}
assertFailsWith
<
MissingFieldException
>
{
Jce
.
UTF_8
.
load
(
TestSerializableClassA
.
serializer
(),
input
)
}
}
}
@Test
@Test
...
...
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