|
@@ -49,40 +49,38 @@ internal fun TlvMap.smartToString(leadingLineBreak: Boolean = true, sorted: Bool
|
|
|
@JvmInline
|
|
@JvmInline
|
|
|
internal value class Tlv(val value: ByteArray)
|
|
internal value class Tlv(val value: ByteArray)
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t1(uin: Long, ip: ByteArray) {
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t1(uin: Long, ip: ByteArray) {
|
|
|
require(ip.size == 4) { "ip.size must == 4" }
|
|
require(ip.size == 4) { "ip.size must == 4" }
|
|
|
- writeShort(0x1)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ tlv(0x01) {
|
|
|
writeShort(1) // _ip_ver
|
|
writeShort(1) // _ip_ver
|
|
|
writeInt(Random.nextInt())
|
|
writeInt(Random.nextInt())
|
|
|
writeInt(uin.toInt())
|
|
writeInt(uin.toInt())
|
|
|
writeInt(currentTimeSeconds().toInt())
|
|
writeInt(currentTimeSeconds().toInt())
|
|
|
writeFully(ip)
|
|
writeFully(ip)
|
|
|
writeShort(0)
|
|
writeShort(0)
|
|
|
- } shouldEqualsTo 20
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t2(captchaCode: String, captchaToken: ByteArray, sigVer: Short = 0) {
|
|
|
|
|
- writeShort(0x2)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t2(captchaCode: String, captchaToken: ByteArray, sigVer: Short = 0) {
|
|
|
|
|
+ tlv(0x02) {
|
|
|
writeShort(sigVer)
|
|
writeShort(sigVer)
|
|
|
writeShortLVString(captchaCode)
|
|
writeShortLVString(captchaCode)
|
|
|
writeShortLVByteArray(captchaToken)
|
|
writeShortLVByteArray(captchaToken)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t8(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t8(
|
|
|
localId: Int = 2052
|
|
localId: Int = 2052
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x8)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x08) {
|
|
|
writeShort(0)
|
|
writeShort(0)
|
|
|
writeInt(localId) // localId
|
|
writeInt(localId) // localId
|
|
|
writeShort(0)
|
|
writeShort(0)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t16(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t16(
|
|
|
ssoVersion: Int,
|
|
ssoVersion: Int,
|
|
|
subAppId: Long,
|
|
subAppId: Long,
|
|
|
guid: ByteArray,
|
|
guid: ByteArray,
|
|
@@ -90,8 +88,7 @@ internal fun BytePacketBuilder.t16(
|
|
|
apkVersionName: ByteArray,
|
|
apkVersionName: ByteArray,
|
|
|
apkSignatureMd5: ByteArray
|
|
apkSignatureMd5: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x16)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x16) {
|
|
|
writeInt(ssoVersion)
|
|
writeInt(ssoVersion)
|
|
|
writeInt(16)
|
|
writeInt(16)
|
|
|
writeInt(subAppId.toInt())
|
|
writeInt(subAppId.toInt())
|
|
@@ -102,14 +99,13 @@ internal fun BytePacketBuilder.t16(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t18(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t18(
|
|
|
appId: Long,
|
|
appId: Long,
|
|
|
appClientVersion: Int = 0,
|
|
appClientVersion: Int = 0,
|
|
|
uin: Long,
|
|
uin: Long,
|
|
|
constant1_always_0: Int = 0
|
|
constant1_always_0: Int = 0
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x18)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x18) {
|
|
|
writeShort(1) //_ping_version
|
|
writeShort(1) //_ping_version
|
|
|
writeInt(0x00_00_06_00) //_sso_version=1536
|
|
writeInt(0x00_00_06_00) //_sso_version=1536
|
|
|
writeInt(appId.toInt())
|
|
writeInt(appId.toInt())
|
|
@@ -117,10 +113,10 @@ internal fun BytePacketBuilder.t18(
|
|
|
writeInt(uin.toInt())
|
|
writeInt(uin.toInt())
|
|
|
writeShort(constant1_always_0.toShort())
|
|
writeShort(constant1_always_0.toShort())
|
|
|
writeShort(0)
|
|
writeShort(0)
|
|
|
- } shouldEqualsTo 22
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t1b(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t1b(
|
|
|
micro: Int = 0,
|
|
micro: Int = 0,
|
|
|
version: Int = 0,
|
|
version: Int = 0,
|
|
|
size: Int = 3,
|
|
size: Int = 3,
|
|
@@ -129,8 +125,7 @@ internal fun BytePacketBuilder.t1b(
|
|
|
ecLevel: Int = 2,
|
|
ecLevel: Int = 2,
|
|
|
hint: Int = 2
|
|
hint: Int = 2
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x1b)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x1b) {
|
|
|
writeInt(micro)
|
|
writeInt(micro)
|
|
|
writeInt(version)
|
|
writeInt(version)
|
|
|
writeInt(size)
|
|
writeInt(size)
|
|
@@ -142,11 +137,10 @@ internal fun BytePacketBuilder.t1b(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t1d(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t1d(
|
|
|
miscBitmap: Int,
|
|
miscBitmap: Int,
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x1d)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x1d) {
|
|
|
writeByte(1)
|
|
writeByte(1)
|
|
|
writeInt(miscBitmap)
|
|
writeInt(miscBitmap)
|
|
|
writeInt(0)
|
|
writeInt(0)
|
|
@@ -155,7 +149,7 @@ internal fun BytePacketBuilder.t1d(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t1f(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t1f(
|
|
|
isRoot: Boolean = false,
|
|
isRoot: Boolean = false,
|
|
|
osName: ByteArray,
|
|
osName: ByteArray,
|
|
|
osVersion: ByteArray,
|
|
osVersion: ByteArray,
|
|
@@ -163,8 +157,7 @@ internal fun BytePacketBuilder.t1f(
|
|
|
apn: ByteArray,
|
|
apn: ByteArray,
|
|
|
networkType: Short = 2,
|
|
networkType: Short = 2,
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x1f)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x1f) {
|
|
|
writeByte(if (isRoot) 1 else 0)
|
|
writeByte(if (isRoot) 1 else 0)
|
|
|
writeShortLVByteArray(osName)
|
|
writeShortLVByteArray(osName)
|
|
|
writeShortLVByteArray(osVersion)
|
|
writeShortLVByteArray(osVersion)
|
|
@@ -175,23 +168,21 @@ internal fun BytePacketBuilder.t1f(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t33(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t33(
|
|
|
guid: ByteArray,
|
|
guid: ByteArray,
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x33)
|
|
|
|
|
- writeShortLVByteArray(guid)
|
|
|
|
|
|
|
+ tlv(0x33, guid)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t35(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t35(
|
|
|
productType: Int
|
|
productType: Int
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x35)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x35) {
|
|
|
writeInt(productType)
|
|
writeInt(productType)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t106(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t106(
|
|
|
client: QQAndroidClient,
|
|
client: QQAndroidClient,
|
|
|
appId: Long = 16L,
|
|
appId: Long = 16L,
|
|
|
passwordMd5: ByteArray,
|
|
passwordMd5: ByteArray,
|
|
@@ -213,11 +204,10 @@ internal fun BytePacketBuilder.t106(
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t106(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t106(
|
|
|
encryptA1: ByteArray
|
|
encryptA1: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x106)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x106) {
|
|
|
writeFully(encryptA1)
|
|
writeFully(encryptA1)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -225,7 +215,7 @@ internal fun BytePacketBuilder.t106(
|
|
|
/**
|
|
/**
|
|
|
* A1
|
|
* A1
|
|
|
*/
|
|
*/
|
|
|
-internal fun BytePacketBuilder.t106(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t106(
|
|
|
appId: Long = 16L,
|
|
appId: Long = 16L,
|
|
|
subAppId: Long,
|
|
subAppId: Long,
|
|
|
appClientVersion: Int = 0,
|
|
appClientVersion: Int = 0,
|
|
@@ -240,12 +230,11 @@ internal fun BytePacketBuilder.t106(
|
|
|
loginType: LoginType,
|
|
loginType: LoginType,
|
|
|
ssoVersion: Int,
|
|
ssoVersion: Int,
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x106)
|
|
|
|
|
passwordMd5.requireSize(16)
|
|
passwordMd5.requireSize(16)
|
|
|
tgtgtKey.requireSize(16)
|
|
tgtgtKey.requireSize(16)
|
|
|
guid?.requireSize(16)
|
|
guid?.requireSize(16)
|
|
|
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x106) {
|
|
|
encryptAndWrite(
|
|
encryptAndWrite(
|
|
|
(passwordMd5 + ByteArray(4) + (salt.takeIf { it != 0L } ?: uin).toInt()
|
|
(passwordMd5 + ByteArray(4) + (salt.takeIf { it != 0L } ?: uin).toInt()
|
|
|
.toByteArray()).md5()
|
|
.toByteArray()).md5()
|
|
@@ -287,13 +276,12 @@ internal fun BytePacketBuilder.t106(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t116(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t116(
|
|
|
miscBitmap: Int,
|
|
miscBitmap: Int,
|
|
|
subSigMap: Int,
|
|
subSigMap: Int,
|
|
|
appIdList: LongArray = longArrayOf(1600000226L)
|
|
appIdList: LongArray = longArrayOf(1600000226L)
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x116)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x116) {
|
|
|
writeByte(0) // _ver
|
|
writeByte(0) // _ver
|
|
|
writeInt(miscBitmap) // 184024956
|
|
writeInt(miscBitmap) // 184024956
|
|
|
writeInt(subSigMap) // 66560
|
|
writeInt(subSigMap) // 66560
|
|
@@ -305,131 +293,122 @@ internal fun BytePacketBuilder.t116(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t100(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t100(
|
|
|
appId: Long = 16,
|
|
appId: Long = 16,
|
|
|
subAppId: Long,
|
|
subAppId: Long,
|
|
|
appClientVersion: Int,
|
|
appClientVersion: Int,
|
|
|
ssoVersion: Int,
|
|
ssoVersion: Int,
|
|
|
mainSigMap: Int
|
|
mainSigMap: Int
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x100)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x100) {
|
|
|
writeShort(1)//db_buf_ver
|
|
writeShort(1)//db_buf_ver
|
|
|
writeInt(ssoVersion)//sso_ver
|
|
writeInt(ssoVersion)//sso_ver
|
|
|
writeInt(appId.toInt())
|
|
writeInt(appId.toInt())
|
|
|
writeInt(subAppId.toInt())
|
|
writeInt(subAppId.toInt())
|
|
|
writeInt(appClientVersion)
|
|
writeInt(appClientVersion)
|
|
|
writeInt(mainSigMap) // sigMap, 34869472?
|
|
writeInt(mainSigMap) // sigMap, 34869472?
|
|
|
- } shouldEqualsTo 22
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t10a(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t10a(
|
|
|
tgt: ByteArray,
|
|
tgt: ByteArray,
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x10a)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x10a) {
|
|
|
writeFully(tgt)
|
|
writeFully(tgt)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t107(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t107(
|
|
|
picType: Int,
|
|
picType: Int,
|
|
|
capType: Int = 0,
|
|
capType: Int = 0,
|
|
|
picSize: Int = 0,
|
|
picSize: Int = 0,
|
|
|
retType: Int = 1
|
|
retType: Int = 1
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x107)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x107) {
|
|
|
writeShort(picType.toShort())
|
|
writeShort(picType.toShort())
|
|
|
writeByte(capType.toByte())
|
|
writeByte(capType.toByte())
|
|
|
writeShort(picSize.toShort())
|
|
writeShort(picSize.toShort())
|
|
|
writeByte(retType.toByte())
|
|
writeByte(retType.toByte())
|
|
|
- } shouldEqualsTo 6
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t108(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t108(
|
|
|
ksid: ByteArray
|
|
ksid: ByteArray
|
|
|
) {
|
|
) {
|
|
|
// require(ksid.size == 16) { "ksid should length 16" }
|
|
// require(ksid.size == 16) { "ksid should length 16" }
|
|
|
- writeShort(0x108)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x108) {
|
|
|
writeFully(ksid)
|
|
writeFully(ksid)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t104(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t104(
|
|
|
t104Data: ByteArray
|
|
t104Data: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x104)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x104) {
|
|
|
writeFully(t104Data)
|
|
writeFully(t104Data)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t547(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t547(
|
|
|
t547Data: ByteArray
|
|
t547Data: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x547)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x547) {
|
|
|
writeFully(t547Data)
|
|
writeFully(t547Data)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t174(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t174(
|
|
|
t174Data: ByteArray
|
|
t174Data: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x174)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x174) {
|
|
|
writeFully(t174Data)
|
|
writeFully(t174Data)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t17a(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t17a(
|
|
|
value: Int = 0
|
|
value: Int = 0
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x17a)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x17a) {
|
|
|
writeInt(value)
|
|
writeInt(value)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t197() {
|
|
|
|
|
- writeShort(0x197)
|
|
|
|
|
- writeFully(byteArrayOf(0, 1, 0))
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t197() {
|
|
|
|
|
+ tlv(0x197) {
|
|
|
|
|
+ writeByte(0)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t198() {
|
|
|
|
|
- writeShort(0x198)
|
|
|
|
|
- writeFully(byteArrayOf(0, 1, 0))
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t198() {
|
|
|
|
|
+ tlv(0x198) {
|
|
|
|
|
+ writeByte(0)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t19e(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t19e(
|
|
|
value: Int = 0
|
|
value: Int = 0
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x19e)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x19e) {
|
|
|
writeShort(1)
|
|
writeShort(1)
|
|
|
writeByte(value.toByte())
|
|
writeByte(value.toByte())
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t17c(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t17c(
|
|
|
t17cData: ByteArray
|
|
t17cData: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x17c)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x17c) {
|
|
|
writeShort(t17cData.size.toShort())
|
|
writeShort(t17cData.size.toShort())
|
|
|
writeFully(t17cData)
|
|
writeFully(t17cData)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t401(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t401(
|
|
|
t401Data: ByteArray
|
|
t401Data: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x401)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x401) {
|
|
|
writeFully(t401Data)
|
|
writeFully(t401Data)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -437,35 +416,32 @@ internal fun BytePacketBuilder.t401(
|
|
|
/**
|
|
/**
|
|
|
* @param apkId application.getPackageName().getBytes()
|
|
* @param apkId application.getPackageName().getBytes()
|
|
|
*/
|
|
*/
|
|
|
-internal fun BytePacketBuilder.t142(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t142(
|
|
|
apkId: ByteArray
|
|
apkId: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x142)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x142) {
|
|
|
writeShort(0) //_version
|
|
writeShort(0) //_version
|
|
|
writeShortLVByteArrayLimitedLength(apkId, 32)
|
|
writeShortLVByteArrayLimitedLength(apkId, 32)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t143(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t143(
|
|
|
d2: ByteArray
|
|
d2: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x143)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x143) {
|
|
|
writeFully(d2)
|
|
writeFully(d2)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t112(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t112(
|
|
|
nonNumberUin: ByteArray
|
|
nonNumberUin: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x112)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x112) {
|
|
|
writeFully(nonNumberUin)
|
|
writeFully(nonNumberUin)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t144(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t144(
|
|
|
client: QQAndroidClient
|
|
client: QQAndroidClient
|
|
|
) {
|
|
) {
|
|
|
return t144(
|
|
return t144(
|
|
@@ -488,7 +464,7 @@ internal fun BytePacketBuilder.t144(
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t144(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t144(
|
|
|
// t109
|
|
// t109
|
|
|
androidId: ByteArray,
|
|
androidId: ByteArray,
|
|
|
|
|
|
|
@@ -515,34 +491,32 @@ internal fun BytePacketBuilder.t144(
|
|
|
// encrypt
|
|
// encrypt
|
|
|
tgtgtKey: ByteArray
|
|
tgtgtKey: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x144)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x144) {
|
|
|
encryptAndWrite(tgtgtKey) {
|
|
encryptAndWrite(tgtgtKey) {
|
|
|
- writeShort(5) // tlv count
|
|
|
|
|
- t109(androidId)
|
|
|
|
|
- t52d(androidDevInfo)
|
|
|
|
|
- t124(osType, osVersion, networkType, simInfo, unknown, apn)
|
|
|
|
|
- t128(isGuidFromFileNull, isGuidAvailable, isGuidChanged, guidFlag, buildModel, guid, buildBrand)
|
|
|
|
|
- t16e(buildModel)
|
|
|
|
|
|
|
+ _writeTlvMap {
|
|
|
|
|
+ t109(androidId)
|
|
|
|
|
+ t52d(androidDevInfo)
|
|
|
|
|
+ t124(osType, osVersion, networkType, simInfo, unknown, apn)
|
|
|
|
|
+ t128(isGuidFromFileNull, isGuidAvailable, isGuidChanged, guidFlag, buildModel, guid, buildBrand)
|
|
|
|
|
+ t16e(buildModel)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t109(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t109(
|
|
|
androidId: ByteArray
|
|
androidId: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x109)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x109) {
|
|
|
writeFully(androidId.md5())
|
|
writeFully(androidId.md5())
|
|
|
- } shouldEqualsTo 16
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t52d(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t52d(
|
|
|
androidDevInfo: ByteArray // oicq.wlogin_sdk.tools.util#get_android_dev_info
|
|
androidDevInfo: ByteArray // oicq.wlogin_sdk.tools.util#get_android_dev_info
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x52d)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x52d) {
|
|
|
writeFully(androidDevInfo)
|
|
writeFully(androidDevInfo)
|
|
|
|
|
|
|
|
// 0A 07 75 6E 6B 6E 6F 77 6E 12 7E 4C 69 6E 75 78 20 76 65 72 73 69 6F 6E 20 34 2E 39 2E 33 31 20 28 62 75 69 6C 64 40 42 75 69 6C 64 32 29 20 28 67 63 63 20 76 65 72 73 69 6F 6E 20 34 2E 39 20 32 30 31 35 30 31 32 33 20 28 70 72 65 72 65 6C 65 61 73 65 29 20 28 47 43 43 29 20 29 20 23 31 20 53 4D 50 20 50 52 45 45 4D 50 54 20 54 68 75 20 44 65 63 20 31 32 20 31 35 3A 33 30 3A 35 35 20 49 53 54 20 32 30 31 39 1A 03 52 45 4C 22 03 33 32 37 2A 41 4F 6E 65 50 6C 75 73 2F 4F 6E 65 50 6C 75 73 35 2F 4F 6E 65 50 6C 75 73 35 3A 37 2E 31 2E 31 2F 4E 4D 46 32 36 58 2F 31 30 31 37 31 36 31 37 3A 75 73 65 72 2F 72 65 6C 65 61 73 65 2D 6B 65 79 73 32 24 36 63 39 39 37 36 33 66 2D 66 62 34 32 2D 34 38 38 31 2D 62 37 32 65 2D 63 37 61 61 38 61 36 63 31 63 61 34 3A 10 65 38 63 37 30 35 34 64 30 32 66 33 36 33 64 30 42 0A 6E 6F 20 6D 65 73 73 61 67 65 4A 03 33 32 37
|
|
// 0A 07 75 6E 6B 6E 6F 77 6E 12 7E 4C 69 6E 75 78 20 76 65 72 73 69 6F 6E 20 34 2E 39 2E 33 31 20 28 62 75 69 6C 64 40 42 75 69 6C 64 32 29 20 28 67 63 63 20 76 65 72 73 69 6F 6E 20 34 2E 39 20 32 30 31 35 30 31 32 33 20 28 70 72 65 72 65 6C 65 61 73 65 29 20 28 47 43 43 29 20 29 20 23 31 20 53 4D 50 20 50 52 45 45 4D 50 54 20 54 68 75 20 44 65 63 20 31 32 20 31 35 3A 33 30 3A 35 35 20 49 53 54 20 32 30 31 39 1A 03 52 45 4C 22 03 33 32 37 2A 41 4F 6E 65 50 6C 75 73 2F 4F 6E 65 50 6C 75 73 35 2F 4F 6E 65 50 6C 75 73 35 3A 37 2E 31 2E 31 2F 4E 4D 46 32 36 58 2F 31 30 31 37 31 36 31 37 3A 75 73 65 72 2F 72 65 6C 65 61 73 65 2D 6B 65 79 73 32 24 36 63 39 39 37 36 33 66 2D 66 62 34 32 2D 34 38 38 31 2D 62 37 32 65 2D 63 37 61 61 38 61 36 63 31 63 61 34 3A 10 65 38 63 37 30 35 34 64 30 32 66 33 36 33 64 30 42 0A 6E 6F 20 6D 65 73 73 61 67 65 4A 03 33 32 37
|
|
@@ -550,7 +524,7 @@ internal fun BytePacketBuilder.t52d(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t124(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t124(
|
|
|
osType: ByteArray = "android".toByteArray(),
|
|
osType: ByteArray = "android".toByteArray(),
|
|
|
osVersion: ByteArray, // Build.VERSION.RELEASE.toByteArray()
|
|
osVersion: ByteArray, // Build.VERSION.RELEASE.toByteArray()
|
|
|
networkType: NetworkType, //oicq.wlogin_sdk.tools.util#get_network_type
|
|
networkType: NetworkType, //oicq.wlogin_sdk.tools.util#get_network_type
|
|
@@ -558,8 +532,7 @@ internal fun BytePacketBuilder.t124(
|
|
|
address: ByteArray, // always new byte[0]
|
|
address: ByteArray, // always new byte[0]
|
|
|
apn: ByteArray = "wifi".toByteArray() // oicq.wlogin_sdk.tools.util#get_apn_string
|
|
apn: ByteArray = "wifi".toByteArray() // oicq.wlogin_sdk.tools.util#get_apn_string
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x124)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x124) {
|
|
|
writeShortLVByteArrayLimitedLength(osType, 16)
|
|
writeShortLVByteArrayLimitedLength(osType, 16)
|
|
|
writeShortLVByteArrayLimitedLength(osVersion, 16)
|
|
writeShortLVByteArrayLimitedLength(osVersion, 16)
|
|
|
writeShort(networkType.value.toShort())
|
|
writeShort(networkType.value.toShort())
|
|
@@ -569,7 +542,7 @@ internal fun BytePacketBuilder.t124(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t128(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t128(
|
|
|
isGuidFromFileNull: Boolean = false, // 保存到文件的 GUID 是否为 null
|
|
isGuidFromFileNull: Boolean = false, // 保存到文件的 GUID 是否为 null
|
|
|
isGuidAvailable: Boolean = true, // GUID 是否可用(计算/读取成功)
|
|
isGuidAvailable: Boolean = true, // GUID 是否可用(计算/读取成功)
|
|
|
isGuidChanged: Boolean = false, // GUID 是否有变动
|
|
isGuidChanged: Boolean = false, // GUID 是否有变动
|
|
@@ -610,8 +583,7 @@ internal fun BytePacketBuilder.t128(
|
|
|
guid: ByteArray,
|
|
guid: ByteArray,
|
|
|
buildBrand: ByteArray // android.os.Build.BRAND
|
|
buildBrand: ByteArray // android.os.Build.BRAND
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x128)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x128) {
|
|
|
writeShort(0)
|
|
writeShort(0)
|
|
|
writeByte(isGuidFromFileNull.toByte())
|
|
writeByte(isGuidFromFileNull.toByte())
|
|
|
writeByte(isGuidAvailable.toByte())
|
|
writeByte(isGuidAvailable.toByte())
|
|
@@ -623,71 +595,64 @@ internal fun BytePacketBuilder.t128(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t16e(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t16e(
|
|
|
buildModel: ByteArray
|
|
buildModel: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x16e)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x16e) {
|
|
|
writeFully(buildModel)
|
|
writeFully(buildModel)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t145(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t145(
|
|
|
guid: ByteArray
|
|
guid: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x145)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x145) {
|
|
|
writeFully(guid)
|
|
writeFully(guid)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t147(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t147(
|
|
|
appId: Long,
|
|
appId: Long,
|
|
|
apkVersionName: ByteArray,
|
|
apkVersionName: ByteArray,
|
|
|
apkSignatureMd5: ByteArray
|
|
apkSignatureMd5: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x147)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x147) {
|
|
|
writeInt(appId.toInt())
|
|
writeInt(appId.toInt())
|
|
|
writeShortLVByteArrayLimitedLength(apkVersionName, 32)
|
|
writeShortLVByteArrayLimitedLength(apkVersionName, 32)
|
|
|
writeShortLVByteArrayLimitedLength(apkSignatureMd5, 32)
|
|
writeShortLVByteArrayLimitedLength(apkSignatureMd5, 32)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t166(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t166(
|
|
|
imageType: Int
|
|
imageType: Int
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x166)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x166) {
|
|
|
writeByte(imageType.toByte())
|
|
writeByte(imageType.toByte())
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t16a(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t16a(
|
|
|
noPicSig: ByteArray // unknown source
|
|
noPicSig: ByteArray // unknown source
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x16a)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x16a) {
|
|
|
writeFully(noPicSig)
|
|
writeFully(noPicSig)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t154(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t154(
|
|
|
ssoSequenceId: Int // starts from 0
|
|
ssoSequenceId: Int // starts from 0
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x154)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x154) {
|
|
|
writeInt(ssoSequenceId)
|
|
writeInt(ssoSequenceId)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t141(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t141(
|
|
|
simInfo: ByteArray,
|
|
simInfo: ByteArray,
|
|
|
networkType: NetworkType,
|
|
networkType: NetworkType,
|
|
|
apn: ByteArray
|
|
apn: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x141)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x141) {
|
|
|
writeShort(1) // version
|
|
writeShort(1) // version
|
|
|
writeShortLVByteArray(simInfo)
|
|
writeShortLVByteArray(simInfo)
|
|
|
writeShort(networkType.value.toShort())
|
|
writeShort(networkType.value.toShort())
|
|
@@ -695,7 +660,7 @@ internal fun BytePacketBuilder.t141(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t511(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t511(
|
|
|
domains: List<String> = listOf(
|
|
domains: List<String> = listOf(
|
|
|
"tenpay.com",
|
|
"tenpay.com",
|
|
|
"openmobile.qq.com",
|
|
"openmobile.qq.com",
|
|
@@ -713,8 +678,7 @@ internal fun BytePacketBuilder.t511(
|
|
|
"mma.qq.com",
|
|
"mma.qq.com",
|
|
|
)
|
|
)
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x511)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x511) {
|
|
|
val list = domains.filter { it.isNotEmpty() }
|
|
val list = domains.filter { it.isNotEmpty() }
|
|
|
writeShort(list.size.toShort())
|
|
writeShort(list.size.toShort())
|
|
|
list.forEach { element ->
|
|
list.forEach { element ->
|
|
@@ -737,24 +701,22 @@ internal fun BytePacketBuilder.t511(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t172(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t172(
|
|
|
rollbackSig: ByteArray // 由服务器发来的 tlv_t172 获得
|
|
rollbackSig: ByteArray // 由服务器发来的 tlv_t172 获得
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x172)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x172) {
|
|
|
writeFully(rollbackSig)
|
|
writeFully(rollbackSig)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t185() {
|
|
|
|
|
- writeShort(0x185)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t185() {
|
|
|
|
|
+ tlv(0x185) {
|
|
|
writeByte(1)
|
|
writeByte(1)
|
|
|
writeByte(1)
|
|
writeByte(1)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t400(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t400(
|
|
|
/**
|
|
/**
|
|
|
* if (var1[2] != null && var1[2].length > 0) {
|
|
* if (var1[2] != null && var1[2].length > 0) {
|
|
|
this._G = (byte[])var1[2].clone();
|
|
this._G = (byte[])var1[2].clone();
|
|
@@ -768,8 +730,7 @@ internal fun BytePacketBuilder.t400(
|
|
|
subAppId: Long,
|
|
subAppId: Long,
|
|
|
randomSeed: ByteArray
|
|
randomSeed: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x400)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x400) {
|
|
|
encryptAndWrite(g) {
|
|
encryptAndWrite(g) {
|
|
|
writeByte(1) // version
|
|
writeByte(1) // version
|
|
|
writeLong(uin)
|
|
writeLong(uin)
|
|
@@ -784,62 +745,56 @@ internal fun BytePacketBuilder.t400(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t187(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t187(
|
|
|
macAddress: ByteArray
|
|
macAddress: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x187)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x187) {
|
|
|
writeFully(macAddress.md5()) // may be md5
|
|
writeFully(macAddress.md5()) // may be md5
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t188(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t188(
|
|
|
androidId: ByteArray
|
|
androidId: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x188)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x188) {
|
|
|
writeFully(androidId.md5())
|
|
writeFully(androidId.md5())
|
|
|
- } shouldEqualsTo 16
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t193(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t193(
|
|
|
ticket: String
|
|
ticket: String
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x193)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x193) {
|
|
|
writeFully(ticket.toByteArray())
|
|
writeFully(ticket.toByteArray())
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t194(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t194(
|
|
|
imsiMd5: ByteArray
|
|
imsiMd5: ByteArray
|
|
|
) {
|
|
) {
|
|
|
imsiMd5 requireSize 16
|
|
imsiMd5 requireSize 16
|
|
|
|
|
|
|
|
- writeShort(0x194)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x194) {
|
|
|
writeFully(imsiMd5)
|
|
writeFully(imsiMd5)
|
|
|
- } shouldEqualsTo 16
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t191(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t191(
|
|
|
K: Int = 0x82
|
|
K: Int = 0x82
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x191)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x191) {
|
|
|
writeByte(K.toByte())
|
|
writeByte(K.toByte())
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t201(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t201(
|
|
|
L: ByteArray = byteArrayOf(), // unknown
|
|
L: ByteArray = byteArrayOf(), // unknown
|
|
|
channelId: ByteArray = byteArrayOf(),
|
|
channelId: ByteArray = byteArrayOf(),
|
|
|
clientType: ByteArray = "qq".toByteArray(),
|
|
clientType: ByteArray = "qq".toByteArray(),
|
|
|
N: ByteArray
|
|
N: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x201)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x201) {
|
|
|
writeShortLVByteArray(L)
|
|
writeShortLVByteArray(L)
|
|
|
writeShortLVByteArray(channelId)
|
|
writeShortLVByteArray(channelId)
|
|
|
writeShortLVByteArray(clientType)
|
|
writeShortLVByteArray(clientType)
|
|
@@ -847,73 +802,66 @@ internal fun BytePacketBuilder.t201(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t202(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t202(
|
|
|
wifiBSSID: ByteArray,
|
|
wifiBSSID: ByteArray,
|
|
|
wifiSSID: ByteArray
|
|
wifiSSID: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x202)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x202) {
|
|
|
writeShortLVByteArrayLimitedLength(wifiBSSID, 16)
|
|
writeShortLVByteArrayLimitedLength(wifiBSSID, 16)
|
|
|
writeShortLVByteArrayLimitedLength(wifiSSID, 32)
|
|
writeShortLVByteArrayLimitedLength(wifiSSID, 32)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t177(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t177(
|
|
|
buildTime: Long = 1571193922L, // wtLogin BuildTime
|
|
buildTime: Long = 1571193922L, // wtLogin BuildTime
|
|
|
buildVersion: String = "6.0.0.2413" // wtLogin SDK Version
|
|
buildVersion: String = "6.0.0.2413" // wtLogin SDK Version
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x177)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x177) {
|
|
|
writeByte(1)
|
|
writeByte(1)
|
|
|
writeInt(buildTime.toInt())
|
|
writeInt(buildTime.toInt())
|
|
|
writeShortLVString(buildVersion)
|
|
writeShortLVString(buildVersion)
|
|
|
} // shouldEqualsTo 0x11
|
|
} // shouldEqualsTo 0x11
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t516( // 1302
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t516( // 1302
|
|
|
sourceType: Int = 0 // always 0
|
|
sourceType: Int = 0 // always 0
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x516)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x516) {
|
|
|
writeInt(sourceType)
|
|
writeInt(sourceType)
|
|
|
- } shouldEqualsTo 4
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t521( // 1313
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t521( // 1313
|
|
|
productType: Int = 0, // coz setProductType is never used
|
|
productType: Int = 0, // coz setProductType is never used
|
|
|
unknown: Short = 0 // const
|
|
unknown: Short = 0 // const
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x521)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x521) {
|
|
|
writeInt(productType)
|
|
writeInt(productType)
|
|
|
writeShort(unknown)
|
|
writeShort(unknown)
|
|
|
- } shouldEqualsTo 6
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t52c(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t52c(
|
|
|
// ?
|
|
// ?
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x52c)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x52c) {
|
|
|
writeByte(1)
|
|
writeByte(1)
|
|
|
writeLong(-1)
|
|
writeLong(-1)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t536( // 1334
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t536( // 1334
|
|
|
loginExtraData: ByteArray
|
|
loginExtraData: ByteArray
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x536)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x536) {
|
|
|
writeFully(loginExtraData)
|
|
writeFully(loginExtraData)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t536( // 1334
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t536( // 1334
|
|
|
loginExtraData: Collection<LoginExtraData>
|
|
loginExtraData: Collection<LoginExtraData>
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x536)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x536) {
|
|
|
//com.tencent.loginsecsdk.ProtocolDet#packExtraData
|
|
//com.tencent.loginsecsdk.ProtocolDet#packExtraData
|
|
|
writeByte(1) // const
|
|
writeByte(1) // const
|
|
|
writeByte(loginExtraData.size.toByte()) // data count
|
|
writeByte(loginExtraData.size.toByte()) // data count
|
|
@@ -923,45 +871,44 @@ internal fun BytePacketBuilder.t536( // 1334
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t525(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t525(
|
|
|
loginExtraData: Collection<LoginExtraData>,
|
|
loginExtraData: Collection<LoginExtraData>,
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x525)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
- writeShort(1)
|
|
|
|
|
- t536(loginExtraData)
|
|
|
|
|
|
|
+ tlv(0x525) {
|
|
|
|
|
+ _writeTlvMap {
|
|
|
|
|
+ t536(loginExtraData)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t525(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t525(
|
|
|
t536: ByteReadPacket = buildPacket {
|
|
t536: ByteReadPacket = buildPacket {
|
|
|
- t536(buildPacket {
|
|
|
|
|
- //com.tencent.loginsecsdk.ProtocolDet#packExtraData
|
|
|
|
|
- writeByte(1) // const
|
|
|
|
|
- writeByte(0) // data count
|
|
|
|
|
- }.readBytes())
|
|
|
|
|
|
|
+ _writeTlvMap(includeCount = false) {
|
|
|
|
|
+ t536(buildPacket {
|
|
|
|
|
+ //com.tencent.loginsecsdk.ProtocolDet#packExtraData
|
|
|
|
|
+ writeByte(1) // const
|
|
|
|
|
+ writeByte(0) // data count
|
|
|
|
|
+ }.readBytes())
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x525)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x525) {
|
|
|
writeShort(1)
|
|
writeShort(1)
|
|
|
writePacket(t536)
|
|
writePacket(t536)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t544( // 1334
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t544( // 1334
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x544)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x544) {
|
|
|
writeFully(byteArrayOf(0, 0, 0, 11)) // means native throws exception
|
|
writeFully(byteArrayOf(0, 0, 0, 11)) // means native throws exception
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-internal fun BytePacketBuilder.t318(
|
|
|
|
|
|
|
+internal fun TlvMapWriter.t318(
|
|
|
tgtQR: ByteArray // unknown
|
|
tgtQR: ByteArray // unknown
|
|
|
) {
|
|
) {
|
|
|
- writeShort(0x318)
|
|
|
|
|
- writeShortLVPacket {
|
|
|
|
|
|
|
+ tlv(0x318) {
|
|
|
writeFully(tgtQR)
|
|
writeFully(tgtQR)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|