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
aefe39ea
Commit
aefe39ea
authored
Jan 29, 2020
by
jiahua.liu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/mamoe/mirai
parents
c094aba0
fb1b3752
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
13 deletions
+19
-13
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/OutgoingPacketAndroid.kt
...qandroid/network/protocol/packet/OutgoingPacketAndroid.kt
+2
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/login/LoginPacket.kt
...ai/qqandroid/network/protocol/packet/login/LoginPacket.kt
+1
-1
mirai-core-qqandroid/src/jvmTest/kotlin/androidPacketTests/serverToClient.kt
...d/src/jvmTest/kotlin/androidPacketTests/serverToClient.kt
+16
-11
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/OutgoingPacketAndroid.kt
View file @
aefe39ea
...
@@ -222,6 +222,7 @@ internal inline fun BytePacketBuilder.writeSsoPacket(
...
@@ -222,6 +222,7 @@ internal inline fun BytePacketBuilder.writeSsoPacket(
subAppId
:
Long
,
subAppId
:
Long
,
commandName
:
String
,
commandName
:
String
,
extraData
:
ByteReadPacket
=
BRP_STUB
,
extraData
:
ByteReadPacket
=
BRP_STUB
,
unknownHex
:
String
=
"01 00 00 00 00 00 00 00 00 00 01 00"
,
sequenceId
:
Int
,
sequenceId
:
Int
,
body
:
BytePacketBuilder
.()
->
Unit
body
:
BytePacketBuilder
.()
->
Unit
)
{
)
{
...
@@ -229,7 +230,7 @@ internal inline fun BytePacketBuilder.writeSsoPacket(
...
@@ -229,7 +230,7 @@ internal inline fun BytePacketBuilder.writeSsoPacket(
writeInt
(
sequenceId
)
writeInt
(
sequenceId
)
writeInt
(
subAppId
.
toInt
())
writeInt
(
subAppId
.
toInt
())
writeInt
(
subAppId
.
toInt
())
writeInt
(
subAppId
.
toInt
())
writeHex
(
"01 00 00 00 00 00 00 00 00 00 01 00"
)
writeHex
(
unknownHex
)
if
(
extraData
===
BRP_STUB
)
{
if
(
extraData
===
BRP_STUB
)
{
writeInt
(
0
x04
)
writeInt
(
0
x04
)
}
else
{
}
else
{
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/login/LoginPacket.kt
View file @
aefe39ea
...
@@ -279,7 +279,7 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse>("wt
...
@@ -279,7 +279,7 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse>("wt
1
,
15
->
onErrorMessage
(
tlvMap
)
1
,
15
->
onErrorMessage
(
tlvMap
)
2
->
onSolveLoginCaptcha
(
tlvMap
,
bot
)
2
->
onSolveLoginCaptcha
(
tlvMap
,
bot
)
-
96
->
onUnsafeDeviceLogin
(
tlvMap
)
-
96
->
onUnsafeDeviceLogin
(
tlvMap
)
-
52
->
onSMSVerifyNeeded
(
tlvMap
,
bot
)
-
52
/*0xCC=204*/
->
onSMSVerifyNeeded
(
tlvMap
,
bot
)
else
->
error
(
"unknown login result type: $type"
)
else
->
error
(
"unknown login result type: $type"
)
}
}
}
}
...
...
mirai-core-qqandroid/src/jvmTest/kotlin/androidPacketTests/serverToClient.kt
View file @
aefe39ea
...
@@ -95,19 +95,24 @@ private fun processFullPacketWithoutLength(packet: ByteReadPacket) {
...
@@ -95,19 +95,24 @@ private fun processFullPacketWithoutLength(packet: ByteReadPacket) {
val
bytes
=
it
.
data
.
readBytes
()
val
bytes
=
it
.
data
.
readBytes
()
if
(
flag2
==
2
&&
it
.
packetFactory
!=
null
)
{
if
(
flag2
==
2
&&
it
.
packetFactory
!=
null
)
{
PacketLogger
.
debug
(
"Oicq Reuqest= "
+
bytes
.
toUHexString
())
PacketLogger
.
debug
(
"Oicq Reuqest= "
+
bytes
.
toUHexString
())
try
{
try
{
bytes
.
toReadPacket
().
parseOicqResponse
{
bytes
.
toReadPacket
().
parseOicqResponse
{
if
(
it
.
packetFactory
.
commandName
==
"wtlogin.login"
)
{
debugIfFail
{
DebugLogger
.
info
(
"服务器发来了 wtlogin.login. 正在解析 key"
)
if
(
it
.
packetFactory
.
commandName
==
"wtlogin.login"
)
{
try
{
DebugLogger
.
info
(
"服务器发来了 wtlogin.login. 正在解析 key"
)
val
subCommand
=
readUShort
().
toInt
()
try
{
println
(
"subCommand=$subCommand"
)
val
subCommand
=
readUShort
().
toInt
(
)
val
type
=
readUByte
().
toInt
(
)
println
(
"subCommand=$subCommand"
)
println
(
"type=$type"
)
val
type
=
readUByte
().
toInt
(
)
if
(
type
==
0
)
{
println
(
"type=$type"
)
discardExact
(
2
)
discardExact
(
2
)
val
tlvMap
:
Map
<
Int
,
ByteArray
>
=
this
.
readTLVMap
()
val
tlvMap
:
Map
<
Int
,
ByteArray
>
=
this
.
readTLVMap
()
println
(
"tlvMap: "
)
tlvMap
.
forEach
{
println
(
it
.
key
.
toShort
().
toUHexString
()
+
" = "
+
it
.
value
.
toUHexString
())
}
tlvMap
[
0
x119
]
?.
let
{
t119Data
->
tlvMap
[
0
x119
]
?.
let
{
t119Data
->
t119Data
.
decryptBy
(
tgtgtKey
).
toReadPacket
().
debugPrint
(
"0x119data"
).
apply
{
t119Data
.
decryptBy
(
tgtgtKey
).
toReadPacket
().
debugPrint
(
"0x119data"
).
apply
{
discardExact
(
2
)
// always discarded. 00 1C
discardExact
(
2
)
// always discarded. 00 1C
...
@@ -123,9 +128,9 @@ private fun processFullPacketWithoutLength(packet: ByteReadPacket) {
...
@@ -123,9 +128,9 @@ private fun processFullPacketWithoutLength(packet: ByteReadPacket) {
DebugLogger
.
info
(
"D2Key=${D2Key.toUHexString()}"
)
DebugLogger
.
info
(
"D2Key=${D2Key.toUHexString()}"
)
}
}
}
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
}
}
}
}
}
...
...
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