SMS login part

This commit is contained in:
Him188 2020-12-26 22:16:36 +08:00
parent 822c3049c2
commit d4a8573772
2 changed files with 43 additions and 2 deletions

View File

@ -18,9 +18,16 @@ internal data class BotAccount(
internal val id: Long,
@JvmSynthetic
@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 {
if (this === other) return true
if (other == null || this::class != other::class) return false

View File

@ -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())
}
}
}
}
/**
* 密码登录
*/