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
9516c308
Commit
9516c308
authored
Jan 29, 2020
by
jiahua.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
loginpacket correction
parent
625d48f3
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
5 additions
and
451 deletions
+5
-451
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/packet/chat/receive/MessageSvc.GetMessage.kt
...ork/protocol/packet/chat/receive/MessageSvc.GetMessage.kt
+0
-82
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/friend/FriendListPacket.kt
...ndroid/network/protocol/packet/friend/FriendListPacket.kt
+0
-19
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/friend/data/GetFriendListRequest.kt
...twork/protocol/packet/friend/data/GetFriendListRequest.kt
+0
-30
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/friend/data/Vec0xd50Req.kt
...ndroid/network/protocol/packet/friend/data/Vec0xd50Req.kt
+0
-2
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/friend/data/Vec0xd6bReq.kt
...ndroid/network/protocol/packet/friend/data/Vec0xd6bReq.kt
+0
-8
mirai-core-qqandroid/src/jvmTest/kotlin/androidPacketTests/serverToClient.kt
...d/src/jvmTest/kotlin/androidPacketTests/serverToClient.kt
+0
-304
mirai-core-qqandroid/src/jvmTest/kotlin/test/QLogReader.kt
mirai-core-qqandroid/src/jvmTest/kotlin/test/QLogReader.kt
+1
-1
mirai-core-qqandroid/src/jvmTest/kotlin/test/SmsTest.kt
mirai-core-qqandroid/src/jvmTest/kotlin/test/SmsTest.kt
+2
-3
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/cryptor/ECDH.kt
...c/commonMain/kotlin/net.mamoe.mirai/utils/cryptor/ECDH.kt
+1
-1
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt
View file @
9516c308
...
...
@@ -73,7 +73,7 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
is
SMSVerifyCodeNeeded
->
{
val
result
=
bot
.
configuration
.
loginSolver
.
onGetPhoneNumber
()
response
=
LoginPacket
.
SubCommand
8
(
response
=
LoginPacket
.
SubCommand
7
(
bot
.
client
,
response
.
t174
,
response
.
t402
,
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.GetMessage.kt
deleted
100644 → 0
View file @
625d48f3
package
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive
import
kotlinx.io.core.ByteReadPacket
import
kotlinx.serialization.protobuf.ProtoBuf
import
net.mamoe.mirai.qqandroid.QQAndroidBot
import
net.mamoe.mirai.qqandroid.network.QQAndroidClient
import
net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import
net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket
import
net.mamoe.mirai.qqandroid.network.protocol.packet.PacketFactory
import
net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgingPacket
import
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.data.Cmd0x352Packet
import
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.data.MsgSvc
import
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.data.RequestPushNotify
internal
object
GetMsgRequest
:
PacketFactory
<
MsgSvc
.
PbGetMsgResp
>(
"MessageSvc.PbGetMsg"
)
{
override
suspend
fun
ByteReadPacket
.
decode
(
bot
:
QQAndroidBot
):
MsgSvc
.
PbGetMsgResp
{
println
(
"received MsgSvc.PbGetMsgResp"
)
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
}
/**
@Serializable
class PbGetMsgReq(
@SerialId(1) val syncFlag: Int /* enum */
=
0
,
@SerialId
(
2
)
val
syncCookie
:
ByteArray
=
EMPTY_BYTE_ARRAY
,
@SerialId
(
3
)
val
rambleFlag
:
Int
=
1
,
@SerialId
(
4
)
val
latestRambleNumber
:
Int
=
20
,
@SerialId
(
5
)
val
otherRambleNumber
:
Int
=
3
,
@SerialId
(
6
)
val
onlineSyncFlag
:
Int
=
1
,
@SerialId
(
7
)
val
contextFlag
:
Int
=
0
,
@SerialId
(
8
)
val
whisperSessionId
:
Int
=
0
,
@SerialId
(
9
)
val
msgReqType
:
Int
=
0
,
@SerialId
(
10
)
val
pubaccountCookie
:
ByteArray
=
EMPTY_BYTE_ARRAY
,
@SerialId
(
11
)
val
msgCtrlBuf
:
ByteArray
=
EMPTY_BYTE_ARRAY
,
@SerialId
(
12
)
val
serverBuf
:
ByteArray
=
EMPTY_BYTE_ARRAY
)
:
ProtoBuf
@Serializable
internal
class
RequestPushNotify
(
@SerialId
(
0
)
val
uin
:
Long
=
0L
,
@SerialId
(
1
)
val
ctype
:
Byte
=
0
,
@SerialId
(
2
)
val
strService
:
String
?,
@SerialId
(
3
)
val
strCmd
:
String
?,
@SerialId
(
4
)
val
vNotifyCookie
:
ByteArray
?
=
EMPTY_BYTE_ARRAY
,
@SerialId
(
5
)
val
usMsgType
:
Int
?,
@SerialId
(
6
)
val
wUserActive
:
Int
?,
@SerialId
(
7
)
val
wGeneralFlag
:
Int
?,
@SerialId
(
8
)
val
bindedUin
:
Long
?,
@SerialId
(
9
)
val
stMsgInfo
:
MsgInfo
?,
@SerialId
(
10
)
val
msgCtrlBuf
:
String
?,
@SerialId
(
11
)
val
serverBuf
:
ByteArray
?,
@SerialId
(
12
)
val
pingFlag
:
Long
?,
@SerialId
(
13
)
val
svrip
:
Int
?
)
:
JceStruct
,
Packet
*/
operator
fun
invoke
(
client
:
QQAndroidClient
,
notify
:
RequestPushNotify
):
OutgoingPacket
=
buildOutgingPacket
(
client
,
key
=
client
.
wLoginSigInfo
.
d2Key
)
{
val
req
=
MsgSvc
.
PbGetMsgReq
(
serverBuf
=
notify
.
serverBuf
?:
EMPTY_BYTE_ARRAY
,
msgReqType
=
notify
.
usMsgType
?:
0
,
syncFlag
=
0
,
rambleFlag
=
0
,
contextFlag
=
1
,
latestRambleNumber
=
20
,
otherRambleNumber
=
3
,
onlineSyncFlag
=
1
)
val
data
=
ProtoBuf
.
dump
(
MsgSvc
.
PbGetMsgReq
.
serializer
(),
req
)
writeInt
(
data
.
size
)
writeFully
(
data
,
0
,
data
.
size
)
}
}
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/friend/FriendListPacket.kt
deleted
100644 → 0
View file @
625d48f3
package
net.mamoe.mirai.qqandroid.network.protocol.packet.friend
import
kotlinx.io.core.ByteReadPacket
import
net.mamoe.mirai.data.Packet
import
net.mamoe.mirai.qqandroid.QQAndroidBot
import
net.mamoe.mirai.qqandroid.network.protocol.packet.PacketFactory
internal
object
FriendListPacket
:
PacketFactory
<
FriendListPacket
.
GetFriendListResponse
>(
"friendlist.GetFriendListReq"
)
{
class
GetFriendListResponse
()
:
Packet
override
suspend
fun
ByteReadPacket
.
decode
(
bot
:
QQAndroidBot
):
GetFriendListResponse
{
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
}
}
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/friend/data/GetFriendListRequest.kt
deleted
100644 → 0
View file @
625d48f3
package
net.mamoe.mirai.qqandroid.network.protocol.packet.friend.data
import
kotlinx.serialization.SerialId
import
kotlinx.serialization.Serializable
import
net.mamoe.mirai.qqandroid.io.JceStruct
@Serializable
internal
class
GetFriendListReq
(
@SerialId
(
0
)
val
reqtype
:
Int
?
=
null
,
@SerialId
(
1
)
val
ifReflush
:
Byte
?
=
null
,
@SerialId
(
2
)
val
uin
:
Long
?
=
null
,
@SerialId
(
3
)
val
startIndex
:
Short
?
=
null
,
@SerialId
(
4
)
val
getfriendCount
:
Short
?
=
null
,
@SerialId
(
5
)
val
groupid
:
Byte
?
=
null
,
@SerialId
(
6
)
val
ifGetGroupInfo
:
Byte
?
=
null
,
@SerialId
(
7
)
val
groupstartIndex
:
Byte
?
=
null
,
@SerialId
(
8
)
val
getgroupCount
:
Byte
?
=
null
,
@SerialId
(
9
)
val
ifGetMSFGroup
:
Byte
?
=
null
,
@SerialId
(
10
)
val
ifShowTermType
:
Byte
?
=
null
,
@SerialId
(
11
)
val
version
:
Long
?
=
null
,
@SerialId
(
12
)
val
uinList
:
List
<
Long
>?
=
null
,
@SerialId
(
13
)
val
eAppType
:
Int
=
0
,
@SerialId
(
14
)
val
ifGetDOVId
:
Byte
?
=
null
,
@SerialId
(
15
)
val
ifGetBothFlag
:
Byte
?
=
null
,
@SerialId
(
16
)
val
vec0xd50Req
:
ByteArray
?
=
null
,
@SerialId
(
17
)
val
vec0xd6bReq
:
ByteArray
?
=
null
,
@SerialId
(
18
)
val
vecSnsTypelist
:
List
<
Long
>?
=
null
)
:
JceStruct
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/friend/data/Vec0xd50Req.kt
deleted
100644 → 0
View file @
625d48f3
package
net.mamoe.mirai.qqandroid.network.protocol.packet.friend.data
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/friend/data/Vec0xd6bReq.kt
deleted
100644 → 0
View file @
625d48f3
package
net.mamoe.mirai.qqandroid.network.protocol.packet.friend.data
import
kotlinx.serialization.Serializable
@Serializable
class
Vec0xd6bReq
{
}
\ No newline at end of file
mirai-core-qqandroid/src/jvmTest/kotlin/androidPacketTests/serverToClient.kt
deleted
100644 → 0
View file @
625d48f3
This diff is collapsed.
Click to expand it.
mirai-core-qqandroid/src/jvmTest/kotlin/test/QLogReader.kt
View file @
9516c308
...
...
@@ -9,7 +9,7 @@ object QLogReader {
@JvmStatic
fun
main
(
args
:
Array
<
String
>)
{
println
(
readQLog
(
File
(
"
C:\\Users\\Him18\\Desktop\\log\\wtlogin_20200101
.log"
)))
println
(
readQLog
(
File
(
"
/Users/jiahua.liu/Downloads/wtlogin_20200129
.log"
)))
}
fun
readQLog
(
file
:
File
):
String
{
...
...
mirai-core-qqandroid/src/jvmTest/kotlin/test/SmsTest.kt
View file @
9516c308
...
...
@@ -11,8 +11,7 @@ fun main(){
//server to client
val
s2c
=
"01 46 00 33 00 00 00 A3 00 0F E9 AA 8C E7 9F AD E4 BF A1 E5 A4 B1 E8 B4 A5 00 18 E9 AA 8C E8 AF 81 E7 A0 81 E8 BE 93 E5 85 A5 E9 94 99 E8 AF AF E3 80 82 00 00 00 00 05 08 00 22 01 00 00 0B B8 00 1B 02 00 00 00 10 20 02 ED BD 08 10 00 00 00 A3 00 00 00 00 3E 03 3F A2 00 00 00 A3"
.
hexToBytes
().
toIoBuffer
().
readTLVMap
()
//client to server
val
c2s
=
"00 08 00 08 00 00 00 00 08 04 00 00 01 04 00 24 41 69
78 39 46 68 4E 44 6C 41 42 30 54 79 46 30 4B 36 67 78 37 45 6E 2B 30 7A 39 35 65 35 30 6E 66 41
3D 3D 01 16 00 0E 00 08 F7 FF 7C 00 01 04 00 01 5F 5E 10 E2 01 74 00 61 45 66 43 39 46 4B 63 70 47 30 5F 5A 55 41 4F 6A 4E 4C 6F 72 56 30 77 66 4B 67 49 4D 33 33 6E 58 44 37 5F 4B 61 75 56 6D 4F 6F 54 68 6A 64 38 62 72 44 64 69 5F 62 48 51 5A 66 37 6E 4F 6B 78 43 35 6E 47 4E 38 6B 6A 35 39 6D 37 32 71 47 66 78 4E 76 50 51 53 39 33 66 37 6B 72 71 66 71 78 63 5F 01 7A 00 04 00 00 00 09 01 97 00 01 00"
.
hexToBytes
().
toIoBuffer
().
readTLVMap
()
val
c2s
=
"00 08 00 08 00 00 00 00 08 04 00 00 01 04 00 24 41 69
4E 54 75 7A 50 2F 48 6D 5A 30 74 37 64 54 71 57 7A 67 79 35 54 4C 77 39 55 69 53 59 69 45 71 67
3D 3D 01 16 00 0E 00 08 F7 FF 7C 00 01 04 00 01 5F 5E 10 E2 01 74 00 61 45 66 43 39 46 4B 63 70 47 30 5F 5A 55 41 4F 6A 4E 4C 6F 72 56 30 77 66 4B 67 49 4D 33 33 6E 58 44 37 5F 4B 61 75 56 6D 4F 6F 54 68 6A 64 38 62 72 44 64 69 5F 62 48 51 5A 66 37 6E 4F 6B 78 43 35 6E 47 4E 38 6B 6A 35 39 6D 37 32 71 47 66 78 4E 76 50 51 53 39 33 66 37 6B 72 71 66 71 78 63 5F 01 7A 00 04 00 00 00 09 01 97 00 01 00"
.
hexToBytes
().
toIoBuffer
().
readTLVMap
()
println
(
s2c
.
contentToString
())
println
(
c2s
.
contentToString
())
}
\ No newline at end of file
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/cryptor/ECDH.kt
View file @
9516c308
...
...
@@ -70,7 +70,7 @@ fun ByteArray.adjustToPublicKey(): ECDHPublicKey {
commonHeadFor02
+
this
}
else
if
(!
this
.
toUHexString
(
""
).
startsWith
(
constantHead
))
{
commonHeadForNot02
+
if
(
this
[
0
].
toInt
()
==
0
x04
)
this
if
(
this
[
0
].
toInt
()
==
0
x04
||
this
[
0
].
toInt
()
==
0
x03
)
this
else
(
byteArray_04
+
this
)
}
else
this
...
...
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