Merge remote-tracking branch 'mirai/dev' into dev

This commit is contained in:
Him188 2021-04-07 21:50:42 +08:00
commit c67d1d111c
7 changed files with 17 additions and 15 deletions

View File

@ -129,6 +129,9 @@ internal class NormalMemberImpl constructor(
check(this.id != bot.id) {
"A bot can't mute itself."
}
require(durationSeconds > 0) {
"durationSeconds must greater than zero"
}
checkBotPermissionHigherThanThis("mute")
bot.network.run {
TroopManagement.Mute(
@ -141,6 +144,7 @@ internal class NormalMemberImpl constructor(
@Suppress("RemoveRedundantQualifierName") // or unresolved reference
net.mamoe.mirai.event.events.MemberMuteEvent(this@NormalMemberImpl, durationSeconds, null).broadcastWithBot(bot)
this._muteTimestamp = currentTimeSeconds().toInt() + durationSeconds
}
override suspend fun unmute() {
@ -156,6 +160,7 @@ internal class NormalMemberImpl constructor(
@Suppress("RemoveRedundantQualifierName") // or unresolved reference
net.mamoe.mirai.event.events.MemberUnmuteEvent(this@NormalMemberImpl, null).broadcastWithBot(bot)
this._muteTimestamp = 0
}
override suspend fun kick(message: String) {

View File

@ -251,7 +251,7 @@ internal open class QQAndroidClient(
/**
* t108 时更新
*/
var ksid: ByteArray = "|454001228437590|A8.2.7.27f6ea96".toByteArray()
var ksid: ByteArray = EMPTY_BYTE_ARRAY
/**
* t186

View File

@ -69,11 +69,11 @@ internal class LoginExtraData(
internal class WLoginSigInfo(
val uin: Long,
val encryptA1: ByteArray?, // sigInfo[0]
var encryptA1: ByteArray?, // sigInfo[0]
/**
* WARNING, please check [QQAndroidClient.tlv16a]
*/
val noPicSig: ByteArray?, // sigInfo[1]
var noPicSig: ByteArray?, // sigInfo[1]
val simpleInfo: WLoginSimpleInfo,

View File

@ -415,6 +415,8 @@ internal class WtLogin {
encryptedDownloadSession = tlvMap119[0x11d]?.let {
client.analysisTlv11d(it)
} ?: encryptedDownloadSession
encryptA1 = tlvMap119.getOrDefault(0x106, encryptA1)
noPicSig = tlvMap119.getOrDefault(0x16a, noPicSig)
}
} else {
var a1: ByteArray? = tlvMap119.getOrFail(0x106)

View File

@ -74,13 +74,7 @@ internal object WtLogin10 : WtLoginExt {
t187(client.device.macAddress)
t188(client.device.androidId)
t194(client.device.imsiMd5)
t511(
listOf(
"tenpay.com", "openmobile.qq.com", "docs.qq.com", "connect.qq.com",
"qzone.qq.com", "vip.qq.com", "qun.qq.com", "game.qq.com", "qqweb.qq.com",
"office.qq.com", "ti.qq.com", "mail.qq.com", "qzone.com", "mma.qq.com"
)
)
t511()
//t544()
}

View File

@ -87,7 +87,8 @@ internal object WtLogin15 : WtLoginExt {
t100(appId, 2, client.appClientVersion, client.ssoVersion, client.mainSigMap)
t107(0)
// t108(client.ksid) // 第一次 exchange 没有 108
//t108(client.ksid) // 第一次 exchange 没有 108
t144(client)
t142(client.apkId)
t145(client.device.guid)

View File

@ -36,12 +36,12 @@ internal class MiraiProtocolInternal(
"com.tencent.mobileqq",
537066978,
"8.5.5",
"6.0.0.2454",
184024956,
"6.0.0.2463",
150470524,
0x10400,
34869472,
16724722,
"A6 B7 45 BF 24 A2 C2 77 52 77 16 F6 F3 6E B6 8D",
1604580615L,
1609322643L,
)
protocols[MiraiProtocol.ANDROID_PAD] = MiraiProtocolInternal(
"com.tencent.mobileqq",