[3.4.0] fix bug of security key and socket ststus

This commit is contained in:
zhongchao
2023-08-01 11:51:10 +08:00
parent 52194e22ad
commit a9834dbaf5
2 changed files with 16 additions and 16 deletions

View File

@@ -253,11 +253,11 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
if (FunctionBuildConfig.isSecure) {
context?.let {
val authStatus =
SharedPrefsMgr.getInstance(it).getBoolean("passportAuth-${DebugConfig.getNetMode()}", false)
SharedPrefsMgr.getInstance(it).getBoolean("securityKey-${DebugConfig.getNetMode()}", false)
if (authStatus) {
// clientConfig设置auth值并带入header
clientConfig.authPubKey = SharedPrefsMgr.getInstance(it)
.getString("passportAuthKey-${DebugConfig.getNetMode()}", "")
.getString("securityKey-${DebugConfig.getNetMode()}", "")
return@let
}
// 安全校验
@@ -271,15 +271,15 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
nodeAliasCode = CHAIN_CODE_CLOUD_PASSPORT_AUTH_OK,
paramIndexes = [0]
)
override fun onSuccess(secretKey: String) {
override fun onSuccess(securityKey: String) {
CallerLogger.d(
"$M_MAIN$TAG",
"onSuccess secretKey:$secretKey , thread:${Thread.currentThread().name}"
"onSuccess securityKey:$securityKey , thread:${Thread.currentThread().name}"
)
clientConfig.authPubKey = secretKey
clientConfig.securityKey = securityKey
SharedPrefsMgr.getInstance(it)
.putString("passportAuthKey-${DebugConfig.getNetMode()}", secretKey)
SharedPrefsMgr.getInstance(it).putBoolean("passportAuth-${DebugConfig.getNetMode()}", true)
.putString("securityKey-${DebugConfig.getNetMode()}", securityKey)
SharedPrefsMgr.getInstance(it).putBoolean("securityKey-${DebugConfig.getNetMode()}", true)
}
@ChainLog(