Merge remote-tracking branch 'origin/master'

This commit is contained in:
liujiahua123123 2019-08-18 17:28:48 +08:00
commit 99a0ec85c5
2 changed files with 4 additions and 4 deletions

View File

@ -87,7 +87,7 @@ class Robot(val number: Int, private val password: String) {
}
is ServerLoginResponseSucceedPacket -> {
is ServerLoginResponseSuccessPacket -> {
this._0828_rec_decr_key = packet._0828_rec_decr_key
sendPacket(ClientLoginSucceedConfirmationPacket(this.number, this.serverIP, this.md5_32, packet.token38, packet.token88, packet.encryptionKey, this.tlv0105))
}

View File

@ -14,7 +14,7 @@ import java.io.DataInputStream
* @author Him188moe @ Mirai Project
* @author NaturalHG @ Mirai Project
*/
class ServerLoginResponseSucceedPacket(input: DataInputStream, val packetDataLength: Int) : ServerPacket(input) {
class ServerLoginResponseSuccessPacket(input: DataInputStream, val packetDataLength: Int) : ServerPacket(input) {
lateinit var _0828_rec_decr_key: ByteArray//16 bytes|
var age: Short = 0
var gender: Int = 0//from 1byte
@ -92,9 +92,9 @@ class ServerLoginResponseSucceedPacketEncrypted(input: DataInputStream) : Server
}
@ExperimentalUnsignedTypes
fun decrypt(tgtgtKey: ByteArray): ServerLoginResponseSucceedPacket {//todo test
fun decrypt(tgtgtKey: ByteArray): ServerLoginResponseSuccessPacket {//todo test
this.input.skip(14)
return ServerLoginResponseSucceedPacket(TEACryptor.decrypt(TEACryptor.decrypt(this.input.readAllBytes().let { it.copyOfRange(0, it.size - 1) }, Protocol.shareKey.hexToBytes()), tgtgtKey).dataInputStream());
return ServerLoginResponseSuccessPacket(TEACryptor.decrypt(TEACryptor.decrypt(this.input.readAllBytes().let { it.copyOfRange(0, it.size - 1) }, Protocol.shareKey.hexToBytes()), tgtgtKey).dataInputStream());
//TeaDecrypt(取文本中间(data, 43, 取文本长度(data) 45), m_0828_rec_decr_key)
}
}