mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-24 15:00:38 +08:00
Little updates
This commit is contained in:
parent
39d8406018
commit
d50c2746d6
@ -2,7 +2,10 @@ package net.mamoe.mirai.network.protocol.tim.handler
|
||||
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import net.mamoe.mirai.network.LoginSession
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.*
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.ClientAccountInfoRequestPacket
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.ServerAccountInfoResponsePacket
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.ServerEventPacket
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.ServerPacket
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.action.AddFriendResult
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.action.ClientAddFriendPacket
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.action.ClientCanAddFriendPacket
|
||||
@ -10,6 +13,9 @@ import net.mamoe.mirai.network.protocol.tim.packet.action.ServerCanAddFriendResp
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.image.ServerTryGetImageIDFailedPacket
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.image.ServerTryGetImageIDResponsePacket
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.image.ServerTryGetImageIDSuccessPacket
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.login.ClientSKeyRefreshmentRequestPacket
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.login.ClientSKeyRequestPacket
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.login.ServerSKeyResponsePacket
|
||||
import net.mamoe.mirai.task.MiraiThreadPool
|
||||
import net.mamoe.mirai.utils.getGTK
|
||||
import java.awt.image.BufferedImage
|
||||
|
@ -192,9 +192,9 @@ fun UInt.toByteArray(): ByteArray = byteArrayOf(
|
||||
|
||||
fun Int.toUHexString(separator: String = " "): String = this.toByteArray().toUHexString(separator)
|
||||
|
||||
internal fun md5(str: String): ByteArray = MessageDigest.getInstance("MD5").digest(str.toByteArray())
|
||||
fun md5(str: String): ByteArray = MessageDigest.getInstance("MD5").digest(str.toByteArray())
|
||||
|
||||
internal fun md5(byteArray: ByteArray): ByteArray = MessageDigest.getInstance("MD5").digest(byteArray)
|
||||
fun md5(byteArray: ByteArray): ByteArray = MessageDigest.getInstance("MD5").digest(byteArray)
|
||||
|
||||
|
||||
@Throws(IOException::class)
|
||||
|
@ -3,9 +3,7 @@ package net.mamoe.mirai.network.protocol.tim.packet
|
||||
/**
|
||||
* @author Him188moe
|
||||
*/
|
||||
interface Packet {
|
||||
|
||||
}
|
||||
interface Packet
|
||||
|
||||
|
||||
object PacketNameFormatter {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package net.mamoe.mirai.network.protocol.tim.packet
|
||||
package net.mamoe.mirai.network.protocol.tim.packet.login
|
||||
|
||||
import net.mamoe.mirai.network.protocol.tim.TIMProtocol
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.*
|
||||
import net.mamoe.mirai.utils.TEA
|
||||
import java.io.DataInputStream
|
||||
|
@ -1,6 +1,7 @@
|
||||
package net.mamoe.mirai.network.protocol.tim.packet
|
||||
package net.mamoe.mirai.network.protocol.tim.packet.login
|
||||
|
||||
import net.mamoe.mirai.network.protocol.tim.TIMProtocol
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.*
|
||||
import net.mamoe.mirai.utils.TEA
|
||||
import net.mamoe.mirai.utils.lazyEncode
|
||||
import java.io.DataInputStream
|
@ -1,7 +1,7 @@
|
||||
package net.mamoe.mirai.network.protocol.tim.packet
|
||||
package net.mamoe.mirai.network.protocol.tim.packet.login
|
||||
|
||||
import net.mamoe.mirai.network.protocol.tim.TIMProtocol
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.login.ClientPasswordSubmissionPacket
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.*
|
||||
import net.mamoe.mirai.utils.ByteArrayDataOutputStream
|
||||
import net.mamoe.mirai.utils.TEA
|
||||
import net.mamoe.mirai.utils.hexToBytes
|
@ -1,6 +1,7 @@
|
||||
package net.mamoe.mirai.network.protocol.tim.packet
|
||||
package net.mamoe.mirai.network.protocol.tim.packet.login
|
||||
|
||||
import net.mamoe.mirai.network.protocol.tim.TIMProtocol
|
||||
import net.mamoe.mirai.network.protocol.tim.packet.*
|
||||
import net.mamoe.mirai.utils.TEA
|
||||
import net.mamoe.mirai.utils.Tested
|
||||
import net.mamoe.mirai.utils.hexToBytes
|
||||
@ -51,11 +52,11 @@ class ClientVerificationCodeSubmitPacket(
|
||||
private val packetIdLast: Int,
|
||||
private val qq: Long,
|
||||
private val token0825: ByteArray,
|
||||
private val verificationCode: String,
|
||||
private val captcha: String,
|
||||
private val verificationToken: ByteArray
|
||||
) : ClientPacket() {
|
||||
init {
|
||||
require(verificationCode.length == 4) { "verificationCode.length must == 4" }
|
||||
require(captcha.length == 4) { "captcha.length must == 4" }
|
||||
}
|
||||
|
||||
override fun encode() {
|
||||
@ -75,7 +76,7 @@ class ClientVerificationCodeSubmitPacket(
|
||||
it.writeHex(TIMProtocol.publicKey)//25
|
||||
|
||||
it.writeHex("14 00 05 00 00 00 00 00 04")
|
||||
it.write(verificationCode.toUpperCase().toByteArray())
|
||||
it.write(captcha.toUpperCase().toByteArray())
|
||||
it.writeHex("00 38")
|
||||
it.write(verificationToken)
|
||||
|
Loading…
Reference in New Issue
Block a user