mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-07 18:34:43 +08:00
SMS login part
This commit is contained in:
parent
822c3049c2
commit
d4a8573772
@ -18,9 +18,16 @@ internal data class BotAccount(
|
|||||||
internal val id: Long,
|
internal val id: Long,
|
||||||
@JvmSynthetic
|
@JvmSynthetic
|
||||||
@MiraiExperimentalApi
|
@MiraiExperimentalApi
|
||||||
val passwordMd5: ByteArray // md5
|
val passwordMd5: ByteArray, // md5
|
||||||
|
|
||||||
|
val phoneNumber: String = ""
|
||||||
) {
|
) {
|
||||||
constructor(id: Long, passwordPlainText: String) : this(id, passwordPlainText.md5())
|
constructor(id: Long, passwordPlainText: String, phoneNumber: String = "") : this(
|
||||||
|
id,
|
||||||
|
passwordPlainText.md5(),
|
||||||
|
phoneNumber
|
||||||
|
)
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other == null || this::class != other::class) return false
|
if (other == null || this::class != other::class) return false
|
||||||
|
@ -116,6 +116,40 @@ internal class WtLogin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check SMS Login
|
||||||
|
*/
|
||||||
|
object SubCommand17 {
|
||||||
|
operator fun invoke(
|
||||||
|
client: QQAndroidClient
|
||||||
|
): OutgoingPacket = buildLoginOutgoingPacket(client, bodyType = 2) { sequenceId ->
|
||||||
|
writeSsoPacket(
|
||||||
|
client,
|
||||||
|
client.subAppId,
|
||||||
|
commandName,
|
||||||
|
sequenceId = sequenceId,
|
||||||
|
unknownHex = "01 00 00 00 00 00 00 00 00 00 01 00"
|
||||||
|
) {
|
||||||
|
writeOicqRequestPacket(client, EncryptMethodECDH(client.ecdh), 0x0810) {
|
||||||
|
writeShort(17) // subCommand
|
||||||
|
writeShort(12)
|
||||||
|
t100(16, client.subAppId, client.appClientVersion, client.ssoVersion, client.mainSigMap)
|
||||||
|
t108(client.device.imei.toByteArray())
|
||||||
|
t109(client.device.androidId)
|
||||||
|
t8(2052)
|
||||||
|
t142(client.apkId)
|
||||||
|
t145(client.device.guid)
|
||||||
|
t154(0)
|
||||||
|
t112(client.account.phoneNumber.encodeToByteArray())
|
||||||
|
t116(client.miscBitMap, client.subSigMap)
|
||||||
|
t521()
|
||||||
|
t52c()
|
||||||
|
t52d(client.device.generateDeviceInfoData())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 密码登录
|
* 密码登录
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user