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
5d81ff26
Commit
5d81ff26
authored
Jan 12, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup
parent
a8ec96b1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
11 deletions
+4
-11
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/Tlv.kt
.../net/mamoe/mirai/qqandroid/network/protocol/packet/Tlv.kt
+1
-8
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/src/commonMain/kotlin/net.mamoe.mirai/BotAccount.kt
...-core/src/commonMain/kotlin/net.mamoe.mirai/BotAccount.kt
+2
-2
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/Tlv.kt
View file @
5d81ff26
...
...
@@ -16,7 +16,6 @@ import kotlin.random.Random
*/
inline
class
Tlv
(
val
value
:
ByteArray
)
@Suppress
(
"MemberVisibilityCanBePrivate"
)
fun
BytePacketBuilder
.
t1
(
uin
:
Long
,
ip
:
String
)
{
writeShort
(
0
x1
)
writeShortLVPacket
{
...
...
@@ -618,10 +617,4 @@ private fun Boolean.toByte(): Byte = if (this) 1 else 0
private
fun
Boolean
.
toInt
():
Int
=
if
(
this
)
1
else
0
private
infix
fun
Int
.
shouldEqualsTo
(
int
:
Int
)
=
check
(
this
==
int
)
{
"Required $int, but found $this"
}
private
infix
fun
ByteArray
.
requireSize
(
exactSize
:
Int
)
=
check
(
this
.
size
==
exactSize
)
{
"Required size $exactSize, but found ${this.size}"
}
fun
randomAndroidId
():
String
=
buildString
(
15
)
{
repeat
(
15
)
{
append
(
Random
.
nextInt
(
10
))
}
}
// AndroidDevInfo: oicq.wlogin_sdk.tools.util#get_android_dev_info
private
infix
fun
ByteArray
.
requireSize
(
exactSize
:
Int
)
=
check
(
this
.
size
==
exactSize
)
{
"Required size $exactSize, but found ${this.size}"
}
\ No newline at end of file
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/login/LoginPacket.kt
View file @
5d81ff26
...
...
@@ -41,7 +41,7 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse, Log
):
OutgoingPacket
=
buildLoginOutgoingPacket
(
client
,
subAppId
)
{
sequenceId
->
writeOicqRequestPacket
(
client
,
EncryptMethodECDH7
(
client
.
ecdh
),
id
)
{
writeShort
(
9
)
// subCommand
writeShort
(
0
x17
)
writeShort
(
17
)
// count of TLVs, probably ignored by server?
//writeShort(LoginType.PASSWORD.value.toShort())
t18
(
appId
,
client
.
appClientVersion
,
client
.
uin
)
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/BotAccount.kt
View file @
5d81ff26
...
...
@@ -10,7 +10,7 @@ import kotlin.annotation.AnnotationTarget.*
data class
BotAccount
(
/**
* **注意**: 在 Android 协议, 总是使用 `QQAndroidClient.uin`, 而不要使用 [BotAccount.id]. 将来 [BotAccount.id] 可能会变为 [String]
* **注意**: 在 Android 协议, 总是使用 `QQAndroidClient.uin`
或 [Bot.uin]
, 而不要使用 [BotAccount.id]. 将来 [BotAccount.id] 可能会变为 [String]
*/
@MiraiExperimentalAPI
val
id
:
Long
,
...
...
@@ -20,7 +20,7 @@ data class BotAccount(
}
/**
* 标记直接访问 [BotAccount.id], 而不是访问 [Bot.uin]
* 标记直接访问 [BotAccount.id], 而不是访问 [Bot.uin]
. 这将可能会不兼容未来的 API 修改.
*/
@Retention
(
AnnotationRetention
.
SOURCE
)
@Target
(
CLASS
,
TYPEALIAS
,
FUNCTION
,
PROPERTY
,
FIELD
,
CONSTRUCTOR
)
...
...
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