diff --git a/mirai-core-api/src/commonMain/kotlin/utils/DeviceInfo.kt b/mirai-core-api/src/commonMain/kotlin/utils/DeviceInfo.kt index 91a7bf39b..99d09c9c4 100644 --- a/mirai-core-api/src/commonMain/kotlin/utils/DeviceInfo.kt +++ b/mirai-core-api/src/commonMain/kotlin/utils/DeviceInfo.kt @@ -49,8 +49,8 @@ public class DeviceInfo( public val simInfo: ByteArray, public val osType: ByteArray, public val macAddress: ByteArray, - public val wifiBSSID: ByteArray?, - public val wifiSSID: ByteArray?, + public val wifiBSSID: ByteArray, + public val wifiSSID: ByteArray, public val imsiMd5: ByteArray, public val imei: String, public val apn: ByteArray diff --git a/mirai-core/src/commonMain/kotlin/network/QQAndroidClient.kt b/mirai-core/src/commonMain/kotlin/network/QQAndroidClient.kt index 14f6ace1d..3b92dba98 100644 --- a/mirai-core/src/commonMain/kotlin/network/QQAndroidClient.kt +++ b/mirai-core/src/commonMain/kotlin/network/QQAndroidClient.kt @@ -116,13 +116,13 @@ internal open class QQAndroidClient( val bot: QQAndroidBot by bot.unsafeWeakRef() - var tgtgtKey: ByteArray = generateTgtgtKey(device.guid) - val randomKey: ByteArray = getRandomByteArray(16) + internal var tgtgtKey: ByteArray = generateTgtgtKey(device.guid) + internal val randomKey: ByteArray = getRandomByteArray(16) - val miscBitMap: Int get() = protocol.miscBitMap // 184024956 // 也可能是 150470524 ? - private val mainSigMap: Int = protocol.mainSigMap - var subSigMap: Int = protocol.subSigMap // 0x10400 //=66,560 + internal val miscBitMap: Int = protocol.miscBitMap // 184024956 // 也可能是 150470524 ? + internal val mainSigMap: Int = protocol.mainSigMap + internal var subSigMap: Int = protocol.subSigMap // 0x10400 //=66,560 private val _ssoSequenceId: AtomicInt = atomic(85600) diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/packet/Tlv.kt b/mirai-core/src/commonMain/kotlin/network/protocol/packet/Tlv.kt index 20d86e608..3e896c706 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/packet/Tlv.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/packet/Tlv.kt @@ -163,6 +163,7 @@ internal fun BytePacketBuilder.t100( subAppId: Long, appClientVersion: Int, ssoVersion: Int, + mainSigMap: Int ) { writeShort(0x100) writeShortLVPacket { @@ -171,7 +172,7 @@ internal fun BytePacketBuilder.t100( writeInt(appId.toInt()) writeInt(subAppId.toInt()) writeInt(appClientVersion) - writeInt(34869472) // sigMap, 34869472? + writeInt(mainSigMap) // sigMap, 34869472? } shouldEqualsTo 22 } diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/packet/login/WtLogin.kt b/mirai-core/src/commonMain/kotlin/network/protocol/packet/login/WtLogin.kt index fcfada40c..ac6fa0853 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/packet/login/WtLogin.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/packet/login/WtLogin.kt @@ -160,7 +160,7 @@ internal class WtLogin { if (ConfigManager.get_loginWithPicSt()) appIdList = longArrayOf(1600000226L) */ t116(client.miscBitMap, client.subSigMap) - t100(appId, client.subAppId, client.appClientVersion, client.ssoVersion) + t100(appId, client.subAppId, client.appClientVersion, client.ssoVersion, client.mainSigMap) t107(0) t108(client.device.imei.toByteArray()) @@ -230,21 +230,13 @@ internal class WtLogin { t187(client.device.macAddress) t188(client.device.androidId) - - val imsi = client.device.imsiMd5 - if (imsi.isNotEmpty()) { - t194(imsi) - } + t194(client.device.imsiMd5) t191() /* t201(N = byteArrayOf())*/ - val bssid = client.device.wifiBSSID - val ssid = client.device.wifiSSID - if (bssid != null && ssid != null) { - t202(bssid, ssid) - } + t202(client.device.wifiBSSID, client.device.wifiSSID) t177( buildTime = client.buildTime,