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
e6ef03f6
Commit
e6ef03f6
authored
Apr 12, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ConfigPush
parent
e23f91ba
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
142 additions
and
31 deletions
+142
-31
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt
...moe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt
+1
-1
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
+37
-3
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/login/ConfigPushSvc.kt
.../qqandroid/network/protocol/packet/login/ConfigPushSvc.kt
+19
-4
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/utils/contentToString.kt
...kotlin/net/mamoe/mirai/qqandroid/utils/contentToString.kt
+1
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/utils/io/serialization/jce/JceDecoder.kt
.../mirai/qqandroid/utils/io/serialization/jce/JceDecoder.kt
+1
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/utils/io/serialization/jce/JceInput.kt
...oe/mirai/qqandroid/utils/io/serialization/jce/JceInput.kt
+7
-6
mirai-core-qqandroid/src/commonTest/kotlin/net.mamoe.mirai.qqandroid/io/serialization/JceInputTest.kt
...et.mamoe.mirai.qqandroid/io/serialization/JceInputTest.kt
+76
-15
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt
View file @
e6ef03f6
...
@@ -433,7 +433,7 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
...
@@ -433,7 +433,7 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
"${packet.sender.nick}(${packet.sender.id}) -> ${packet.message.toString().singleLine()}"
"${packet.sender.nick}(${packet.sender.id}) -> ${packet.message.toString().singleLine()}"
}
}
is
Event
->
bot
.
logger
.
verbose
{
"Event: ${packet.toString().singleLine()}"
}
is
Event
->
bot
.
logger
.
verbose
{
"Event: ${packet.toString().singleLine()}"
}
else
->
logger
.
verbose
{
"
Even
t: ${packet.toString().singleLine()}"
}
else
->
logger
.
verbose
{
"
Packe
t: ${packet.toString().singleLine()}"
}
}
}
}
}
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/ConfigPush.kt
View file @
e6ef03f6
...
@@ -12,6 +12,7 @@ package net.mamoe.mirai.qqandroid.network.protocol.data.jce
...
@@ -12,6 +12,7 @@ package net.mamoe.mirai.qqandroid.network.protocol.data.jce
import
kotlinx.serialization.Serializable
import
kotlinx.serialization.Serializable
import
net.mamoe.mirai.qqandroid.network.Packet
import
net.mamoe.mirai.qqandroid.network.Packet
import
net.mamoe.mirai.qqandroid.utils.io.JceStruct
import
net.mamoe.mirai.qqandroid.utils.io.JceStruct
import
net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import
net.mamoe.mirai.qqandroid.utils.io.serialization.jce.JceId
import
net.mamoe.mirai.qqandroid.utils.io.serialization.jce.JceId
@Serializable
@Serializable
...
@@ -63,13 +64,46 @@ internal class DomainIpInfo(
...
@@ -63,13 +64,46 @@ internal class DomainIpInfo(
@Serializable
@Serializable
internal
class
DomainIpList
(
internal
class
DomainIpList
(
@JceId
(
0
)
val
uDomainType
:
Int
,
@JceId
(
0
)
val
uDomainType
:
Int
,
@JceId
(
1
)
val
vIplist
:
List
<
DomainIpInfo
>
@JceId
(
1
)
val
vIplist
:
List
<
DomainIpInfo
>,
@JceId
(
2
)
val
unknown
:
ByteArray
// added
)
:
JceStruct
@Serializable
internal
class
_340(
@
JceId
(
1
)
val
field1315
:
List
<
_339
>,
@JceId
(
3
)
val
field1316
:
List
<
_339
>,
@JceId
(
4
)
val
field1317
:
Int
,
@JceId
(
5
)
val
field1318
:
Byte
?
=
0
,
@JceId
(
6
)
val
field1319
:
Byte
?
=
0
,
@JceId
(
7
)
val
field1320
:
Int
?
=
1
,
@JceId
(
8
)
val
field1321
:
List
<
_339
>?
=
null
,
@JceId
(
9
)
val
field1322
:
List
<
_339
>?
=
null
,
@JceId
(
10
)
val
field1323
:
List
<
_339
>?
=
null
,
@JceId
(
11
)
val
field1324
:
List
<
_339
>?
=
null
,
@JceId
(
12
)
val
field1325
:
List
<
_339
>?
=
null
,
@JceId
(
13
)
val
field1326
:
List
<
_339
>?
=
null
,
@JceId
(
14
)
val
netType
:
Byte
?
=
0
,
@JceId
(
15
)
val
heThreshold
:
Int
?
=
0
,
@JceId
(
16
)
val
policyId
:
String
?
=
""
)
:
ProtoBuf
@Serializable
internal
class
_339(
@
JceId
(
1
)
val
field1298
:
String
=
""
,
@JceId
(
2
)
val
field1299
:
Int
=
0
,
@JceId
(
3
)
val
field1300
:
Byte
=
0
,
@JceId
(
4
)
val
field1301
:
Byte
=
0
,
@JceId
(
5
)
val
field1302
:
Byte
?
=
0
,
@JceId
(
6
)
val
field1303
:
Int
?
=
8
,
@JceId
(
7
)
val
field1304
:
Byte
?
=
0
,
@JceId
(
8
)
val
field1305
:
String
=
""
,
@JceId
(
9
)
val
field1306
:
String
=
""
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
FileStoragePushFSSvcList
(
internal
class
FileStoragePushFSSvcList
(
@JceId
(
0
)
val
vUpLoadList
:
List
<
FileStorageServerListInfo
>,
@JceId
(
0
)
val
vUpLoadList
:
List
<
FileStorageServerListInfo
>
=
listOf
()
,
@JceId
(
1
)
val
vPicDownLoadList
:
List
<
FileStorageServerListInfo
>,
@JceId
(
1
)
val
vPicDownLoadList
:
List
<
FileStorageServerListInfo
>
=
listOf
()
,
@JceId
(
2
)
val
vGPicDownLoadList
:
List
<
FileStorageServerListInfo
>?
=
null
,
@JceId
(
2
)
val
vGPicDownLoadList
:
List
<
FileStorageServerListInfo
>?
=
null
,
@JceId
(
3
)
val
vQzoneProxyServiceList
:
List
<
FileStorageServerListInfo
>?
=
null
,
@JceId
(
3
)
val
vQzoneProxyServiceList
:
List
<
FileStorageServerListInfo
>?
=
null
,
@JceId
(
4
)
val
vUrlEncodeServiceList
:
List
<
FileStorageServerListInfo
>?
=
null
,
@JceId
(
4
)
val
vUrlEncodeServiceList
:
List
<
FileStorageServerListInfo
>?
=
null
,
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/login/ConfigPushSvc.kt
View file @
e6ef03f6
This diff is collapsed.
Click to expand it.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/utils/contentToString.kt
View file @
e6ef03f6
...
@@ -29,7 +29,7 @@ private fun <T> Sequence<T>.joinToStringPrefixed(prefix: String, transform: (T)
...
@@ -29,7 +29,7 @@ private fun <T> Sequence<T>.joinToStringPrefixed(prefix: String, transform: (T)
}
}
private
val
SoutvLogger
by
lazy
{
DefaultLogger
(
"soutv"
)
}
private
val
SoutvLogger
by
lazy
{
DefaultLogger
(
"soutv"
)
}
internal
fun
Any
?.
soutv
(
name
:
String
)
{
internal
fun
Any
?.
soutv
(
name
:
String
=
"unnamed"
)
{
@Suppress
(
"DEPRECATION"
)
@Suppress
(
"DEPRECATION"
)
SoutvLogger
.
debug
{
"$name = ${this._miraiContentToString()}"
}
SoutvLogger
.
debug
{
"$name = ${this._miraiContentToString()}"
}
}
}
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/utils/io/serialization/jce/JceDecoder.kt
View file @
e6ef03f6
...
@@ -231,7 +231,7 @@ internal class JceDecoder(
...
@@ -231,7 +231,7 @@ internal class JceDecoder(
SimpleByteArrayReader
SimpleByteArrayReader
}
}
Jce
.
LIST
->
ListReader
Jce
.
LIST
->
ListReader
else
->
error
(
"type mismatch. Expected SIMPLE_LIST or LIST, got $
{it.type}
instead"
)
else
->
error
(
"type mismatch. Expected SIMPLE_LIST or LIST, got $
it
instead"
)
}
}
}
}
}
}
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/utils/io/serialization/jce/JceInput.kt
View file @
e6ef03f6
...
@@ -12,6 +12,7 @@ package net.mamoe.mirai.qqandroid.utils.io.serialization.jce
...
@@ -12,6 +12,7 @@ package net.mamoe.mirai.qqandroid.utils.io.serialization.jce
import
kotlinx.io.core.*
import
kotlinx.io.core.*
import
net.mamoe.mirai.qqandroid.utils.io.readString
import
net.mamoe.mirai.qqandroid.utils.io.readString
import
net.mamoe.mirai.qqandroid.utils.io.serialization.JceCharset
import
net.mamoe.mirai.qqandroid.utils.io.serialization.JceCharset
import
net.mamoe.mirai.qqandroid.utils.toUHexString
/**
/**
...
@@ -193,7 +194,7 @@ internal class JceInput(
...
@@ -193,7 +194,7 @@ internal class JceInput(
Jce
.
BYTE
->
input
.
readByte
().
toInt
()
Jce
.
BYTE
->
input
.
readByte
().
toInt
()
Jce
.
SHORT
->
input
.
readShort
().
toInt
()
Jce
.
SHORT
->
input
.
readShort
().
toInt
()
Jce
.
INT
->
input
.
readInt
()
Jce
.
INT
->
input
.
readInt
()
else
->
error
(
"type mismatch: $
{head.type
}"
)
else
->
error
(
"type mismatch: $
head, remaining=${input.readBytes().toUHexString()
}"
)
}
}
}
}
...
@@ -202,7 +203,7 @@ internal class JceInput(
...
@@ -202,7 +203,7 @@ internal class JceInput(
Jce
.
ZERO_TYPE
->
0
Jce
.
ZERO_TYPE
->
0
Jce
.
BYTE
->
input
.
readByte
().
toShort
()
Jce
.
BYTE
->
input
.
readByte
().
toShort
()
Jce
.
SHORT
->
input
.
readShort
()
Jce
.
SHORT
->
input
.
readShort
()
else
->
error
(
"type mismatch: $
{head.type}
"
)
else
->
error
(
"type mismatch: $
head
"
)
}
}
}
}
...
@@ -222,7 +223,7 @@ internal class JceInput(
...
@@ -222,7 +223,7 @@ internal class JceInput(
return
when
(
head
.
type
)
{
return
when
(
head
.
type
)
{
Jce
.
ZERO_TYPE
->
0
Jce
.
ZERO_TYPE
->
0
Jce
.
BYTE
->
input
.
readByte
()
Jce
.
BYTE
->
input
.
readByte
()
else
->
error
(
"type mismatch: $
{head.type}
"
)
else
->
error
(
"type mismatch: $
head
"
)
}
}
}
}
...
@@ -230,7 +231,7 @@ internal class JceInput(
...
@@ -230,7 +231,7 @@ internal class JceInput(
return
when
(
head
.
type
)
{
return
when
(
head
.
type
)
{
Jce
.
ZERO_TYPE
->
0f
Jce
.
ZERO_TYPE
->
0f
Jce
.
FLOAT
->
input
.
readFloat
()
Jce
.
FLOAT
->
input
.
readFloat
()
else
->
error
(
"type mismatch: $
{head.type}
"
)
else
->
error
(
"type mismatch: $
head
"
)
}
}
}
}
...
@@ -243,7 +244,7 @@ internal class JceInput(
...
@@ -243,7 +244,7 @@ internal class JceInput(
input
.
readUInt
().
toInt
().
also
{
require
(
it
in
1
until
104857600
)
{
"bad string length: $it"
}
},
input
.
readUInt
().
toInt
().
also
{
require
(
it
in
1
until
104857600
)
{
"bad string length: $it"
}
},
charset
=
charset
.
kotlinCharset
charset
=
charset
.
kotlinCharset
)
)
else
->
error
(
"type mismatch: $
{head.type}
, expecting 6 or 7 (for string)"
)
else
->
error
(
"type mismatch: $
head
, expecting 6 or 7 (for string)"
)
}
}
}
}
...
@@ -252,7 +253,7 @@ internal class JceInput(
...
@@ -252,7 +253,7 @@ internal class JceInput(
12
->
0.0
12
->
0.0
4
->
input
.
readFloat
().
toDouble
()
4
->
input
.
readFloat
().
toDouble
()
5
->
input
.
readDouble
()
5
->
input
.
readDouble
()
else
->
error
(
"type mismatch: $
{head.type}
"
)
else
->
error
(
"type mismatch: $
head
"
)
}
}
}
}
...
...
mirai-core-qqandroid/src/commonTest/kotlin/net.mamoe.mirai.qqandroid/io/serialization/JceInputTest.kt
View file @
e6ef03f6
This diff is collapsed.
Click to expand it.
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