Commit ad2e1e24 authored by Him188's avatar Him188

Less log

parent 5c5670c6
...@@ -126,14 +126,14 @@ fun Map<Int, ByteArray>.printTLVMap(name: String = "", keyLength: Int = 2) = ...@@ -126,14 +126,14 @@ fun Map<Int, ByteArray>.printTLVMap(name: String = "", keyLength: Int = 2) =
fun ByteReadPacket.analysisOneFullPacket(): ByteReadPacket = debugIfFail("Failed", { buildPacket { writeInt(it.size + 4); writeFully(it) } }) { fun ByteReadPacket.analysisOneFullPacket(): ByteReadPacket = debugIfFail("Failed", { buildPacket { writeInt(it.size + 4); writeFully(it) } }) {
val flag1 = readInt() val flag1 = readInt()
println("flag1=" + flag1.contentToString()) print("flag1=" + flag1.contentToString() + ", ")
val flag2 = readByte().toInt() val flag2 = readByte().toInt()
println("flag2=$flag2") print("flag2=$flag2" + ", ")
if (flag1 == 0x0B) { if (flag1 == 0x0B) {
if (flag2 == 1) { if (flag2 == 1) {
println("sequenceId = " + readInt().toUHexString()) print("sequenceId = " + readInt().toUHexString() + ", ")
} else { } else {
println("extra data=" + readBytes(readInt() - 4).toUHexString()) print("extra data=" + readBytes(readInt() - 4).toUHexString() + ", ")
} }
} else { } else {
//if (flag2 == 1) { //if (flag2 == 1) {
...@@ -145,15 +145,15 @@ fun ByteReadPacket.analysisOneFullPacket(): ByteReadPacket = debugIfFail("Failed ...@@ -145,15 +145,15 @@ fun ByteReadPacket.analysisOneFullPacket(): ByteReadPacket = debugIfFail("Failed
// } // }
} }
println("flag3=" + readByte().toUHexString()) print("flag3=" + readByte().toUHexString() + ", ")
println("uin=" + readString(readInt() - 4)) readString(readInt() - 4)
println("// 解密 body") print("// 解密 body")
val encrypted = readBytes() val encrypted = readBytes()
val decrypted = encrypted.tryDecryptOrNull() val decrypted = encrypted.tryDecryptOrNull()
if (decrypted == null) { if (decrypted == null) {
println("cannot decrypt: ${encrypted.toUHexString()}") println(", cannot decrypt: ${encrypted.toUHexString()}")
error("cannot decrypt: ${encrypted.toUHexString()}") error("cannot decrypt: ${encrypted.toUHexString()}")
} else { } else {
decrypted.toReadPacket().debugPrintThis("outer body decrypted").apply { decrypted.toReadPacket().debugPrintThis("outer body decrypted").apply {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment