This commit is contained in:
Him188 2020-01-12 00:15:25 +08:00
parent a8ec96b113
commit 5d81ff2680
3 changed files with 4 additions and 11 deletions

View File

@ -16,7 +16,6 @@ import kotlin.random.Random
*/
inline class Tlv(val value: ByteArray)
@Suppress("MemberVisibilityCanBePrivate")
fun BytePacketBuilder.t1(uin: Long, ip: String) {
writeShort(0x1)
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}" }

View File

@ -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(0x17)
writeShort(17) // count of TLVs, probably ignored by server?
//writeShort(LoginType.PASSWORD.value.toShort())
t18(appId, client.appClientVersion, client.uin)

View File

@ -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)