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
ad2e1e24
Commit
ad2e1e24
authored
Feb 08, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Less log
parent
5c5670c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
mirai-core-qqandroid/src/jvmTest/kotlin/androidPacketTests/clientToServer.kt
...d/src/jvmTest/kotlin/androidPacketTests/clientToServer.kt
+8
-8
No files found.
mirai-core-qqandroid/src/jvmTest/kotlin/androidPacketTests/clientToServer.kt
View file @
ad2e1e24
...
...
@@ -126,14 +126,14 @@ fun Map<Int, ByteArray>.printTLVMap(name: String = "", keyLength: Int = 2) =
fun
ByteReadPacket
.
analysisOneFullPacket
():
ByteReadPacket
=
debugIfFail
(
"Failed"
,
{
buildPacket
{
writeInt
(
it
.
size
+
4
);
writeFully
(
it
)
}
})
{
val
flag1
=
readInt
()
print
ln
(
"flag1="
+
flag1
.
contentToString
()
)
print
(
"flag1="
+
flag1
.
contentToString
()
+
", "
)
val
flag2
=
readByte
().
toInt
()
print
ln
(
"flag2=$flag2
"
)
print
(
"flag2=$flag2"
+
",
"
)
if
(
flag1
==
0
x0B
)
{
if
(
flag2
==
1
)
{
print
ln
(
"sequenceId = "
+
readInt
().
toUHexString
()
)
print
(
"sequenceId = "
+
readInt
().
toUHexString
()
+
", "
)
}
else
{
print
ln
(
"extra data="
+
readBytes
(
readInt
()
-
4
).
toUHexString
()
)
print
(
"extra data="
+
readBytes
(
readInt
()
-
4
).
toUHexString
()
+
", "
)
}
}
else
{
//if (flag2 == 1) {
...
...
@@ -145,15 +145,15 @@ fun ByteReadPacket.analysisOneFullPacket(): ByteReadPacket = debugIfFail("Failed
// }
}
print
ln
(
"flag3="
+
readByte
().
toUHexString
()
)
println
(
"uin="
+
readString
(
readInt
()
-
4
)
)
print
(
"flag3="
+
readByte
().
toUHexString
()
+
", "
)
readString
(
readInt
()
-
4
)
print
ln
(
"// 解密 body"
)
print
(
"// 解密 body"
)
val
encrypted
=
readBytes
()
val
decrypted
=
encrypted
.
tryDecryptOrNull
()
if
(
decrypted
==
null
)
{
println
(
"cannot decrypt: ${encrypted.toUHexString()}"
)
println
(
"
,
cannot decrypt: ${encrypted.toUHexString()}"
)
error
(
"cannot decrypt: ${encrypted.toUHexString()}"
)
}
else
{
decrypted
.
toReadPacket
().
debugPrintThis
(
"outer body decrypted"
).
apply
{
...
...
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