[core] Add qimei36 key for EncryptServiceContext

This commit is contained in:
sandtechnology 2023-06-18 19:50:49 +08:00 committed by Karlatemp
parent 390726ff4d
commit 644eddd4d9
No known key found for this signature in database
GPG Key ID: BA173CA2B9956C59
4 changed files with 6 additions and 1 deletions

View File

@ -123,6 +123,7 @@ internal class EcdhInitialPublicKeyUpdaterImpl(
set(EncryptServiceContext.KEY_CHANNEL_PROXY, createChannelProxy(bot))
set(EncryptServiceContext.KEY_DEVICE_INFO, bot.client.device)
set(EncryptServiceContext.KEY_BOT_PROTOCOL, bot.configuration.protocol)
set(EncryptServiceContext.KEY_QIMEI36, bot.client.qimei36 ?: "")
}))
}

View File

@ -213,7 +213,6 @@ internal open class SsoProcessorImpl(
components[CacheValidator].validate()
components[BdhSessionSyncer].loadServerListFromCache()
components[EcdhInitialPublicKeyUpdater].initializeSsoSecureEcdh()
try {
ssoContext.bot.requestQimei(qimeiLogger)
@ -221,6 +220,9 @@ internal open class SsoProcessorImpl(
qimeiLogger.warning("Cannot get qimei from server.", exception)
}
// trpc ecdh service needs qimei to init
components[EcdhInitialPublicKeyUpdater].initializeSsoSecureEcdh()
// try fast login
if (client.wLoginSigInfoInitialized) {
ssoContext.bot.components[EcdhInitialPublicKeyUpdater].refreshInitialPublicKeyAndApplyEcdh()

View File

@ -325,6 +325,7 @@ internal inline fun BytePacketBuilder.writeSsoPacket(
EncryptServiceContext(client.uin, buildTypeSafeMap {
set(EncryptServiceContext.KEY_APP_QUA, "V1_AND_SQ_8.9.58_4106_YYB_D") // 8.9.58
set(EncryptServiceContext.KEY_CHANNEL_PROXY, createChannelProxy(client.bot))
set(EncryptServiceContext.KEY_QIMEI36, client.qimei36 ?: "")
}),
sequenceId,
commandName,

View File

@ -32,6 +32,7 @@ public class EncryptServiceContext @MiraiInternalApi constructor(
public val KEY_APP_QUA: TypeKey<String> = TypeKey("KEY_APP_QUA")
public val KEY_CHANNEL_PROXY: TypeKey<EncryptService.ChannelProxy> = TypeKey("KEY_CHANNEL_PROXY")
public val KEY_DEVICE_INFO: TypeKey<DeviceInfo> = TypeKey("KEY_DEVICE_INFO")
public val KEY_QIMEI36: TypeKey<String> = TypeKey("KEY_QIMEI36")
}
}