diff --git a/core/function-impl/mogo-core-function-datacenter/build.gradle b/core/function-impl/mogo-core-function-datacenter/build.gradle index 5ac23c33a5..1e1721f3b6 100644 --- a/core/function-impl/mogo-core-function-datacenter/build.gradle +++ b/core/function-impl/mogo-core-function-datacenter/build.gradle @@ -65,8 +65,6 @@ dependencies { compileOnly project(':core:function-impl:mogo-core-function-map') implementation project(':core:mogo-core-function-call') implementation project(":foudations:mogo-commons") - - implementation rootProject.ext.dependencies.passport_secret } //apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/DataCenterProvider.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/DataCenterProvider.kt index 34ca6ec19f..c6d9ffe435 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/DataCenterProvider.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/DataCenterProvider.kt @@ -8,7 +8,6 @@ import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.datacenter.location.MoGoLocationDispatcher import com.mogo.eagle.core.function.datacenter.v2x.SpeedLimitDispatcher import com.mogo.eagle.core.function.datacenter.v2x.TrafficLightDispatcher -import com.mogo.eagle.core.function.secure.CertFileManager @Route(path = MogoServicePaths.PATH_DATA_CENTER_MODULE) class DataCenterProvider: IDataCenterProvider { @@ -22,17 +21,12 @@ class DataCenterProvider: IDataCenterProvider { MoGoLocationDispatcher.initListener() mContext = context mContext?.let { - CertFileManager.INSTANCE.init(it) CallerMsgBoxManager.queryAllMessages(it) TrafficLightDispatcher.INSTANCE.initServer(it) SpeedLimitDispatcher.INSTANCE.initLimit(it) } } - override fun certificateDownLoad(callback: (String, String) -> Unit) { - CertFileManager.INSTANCE.downloadCert() - } - override fun onDestroy() { TrafficLightDispatcher.INSTANCE.destroy() SpeedLimitDispatcher.INSTANCE.destroy() diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/secure/CertFileManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/secure/CertFileManager.kt deleted file mode 100644 index cae80f8573..0000000000 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/secure/CertFileManager.kt +++ /dev/null @@ -1,86 +0,0 @@ -package com.mogo.eagle.core.function.secure - -import android.content.Context -import com.mogo.commons.debug.DebugConfig -import com.mogo.commons.storage.SharedPrefsMgr -import com.mogo.eagle.core.data.config.FunctionBuildConfig -import com.mogo.eagle.core.data.deva.chain.ChainConstant -import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger -import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant -import com.zhjt.service.chain.ChainLog - -class CertFileManager { - - private var context: Context? = null - - companion object{ - val INSTANCE by lazy(LazyThreadSafetyMode.SYNCHRONIZED){ - CertFileManager() - } - } - - fun init(context: Context?) { - this.context = context - } - - fun downloadCert() { - if (FunctionBuildConfig.isSecure) { - context?.let { - val authStatus = - SharedPrefsMgr.getInstance() - .getBoolean("securityKeyStatus-${DebugConfig.getNetMode()}", false) - if (authStatus) { - // clientConfig设置auth值,并带入header //todo 作为使用方,invoke出去设置 - clientConfig.authPubKey = SharedPrefsMgr.getInstance() - .getString("securityKey-${DebugConfig.getNetMode()}", "") - return@let - } - // 安全校验 - try { - PassPortSecret.getInstance().init(sn, it.filesDir.path, object : - IPassportSecret { - - @ChainLog( - linkChainLog = ChainConstant.CHAIN_TYPE_STATUS, - linkCode = ChainConstant.CHAIN_SOURCE_CLOUD, - nodeAliasCode = ChainConstant.CHAIN_CODE_CLOUD_PASSPORT_AUTH_OK, - paramIndexes = [0,1] - ) - override fun onSuccess(securityKey: String, rootKey: String) { - CallerLogger.d( - "${SceneConstant.M_MAIN}$TAG", - "onSuccess securityKey:$securityKey , thread:${Thread.currentThread().name}" - ) - clientConfig.securityKey = securityKey - SharedPrefsMgr.getInstance() - .putString( - "securityKey-${DebugConfig.getNetMode()}", - securityKey - ) - SharedPrefsMgr.getInstance() - .putBoolean("securityKeyStatus-${DebugConfig.getNetMode()}", true) - CallerCloudListenerManager.invokeCloudCrtFile(securityKey, rootKey) - } - - @ChainLog( - linkChainLog = ChainConstant.CHAIN_TYPE_STATUS, - linkCode = ChainConstant.CHAIN_SOURCE_CLOUD, - nodeAliasCode = ChainConstant.CHAIN_CODE_CLOUD_PASSPORT_AUTH_FAILED, - paramIndexes = [0, 1] - ) - override fun onFailed(errorCode: Int, errorMsg: String) { -// logError( -// getPrReason( -// "PassPortSecret-onFailed , errorCode:$errorCode,errorMsg:$errorMsg" -// ) -// ) - } - }) - } catch (e: Exception) { - e.printStackTrace() - } - } - } - } -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-startup/build.gradle b/core/function-impl/mogo-core-function-startup/build.gradle index 55049b2c91..e70626291f 100644 --- a/core/function-impl/mogo-core-function-startup/build.gradle +++ b/core/function-impl/mogo-core-function-startup/build.gradle @@ -52,7 +52,7 @@ dependencies { implementation project(":test:crashreport") implementation project(':foudations:mogo-commons') -// implementation rootProject.ext.dependencies.passport_secret + implementation rootProject.ext.dependencies.passport_secret } apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() diff --git a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt index c2bd6f5d02..5132cd337a 100644 --- a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt +++ b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt @@ -21,8 +21,6 @@ import com.mogo.commons.storage.SharedPrefsMgr import com.mogo.commons.utils.MogoAnalyticUtils import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_CLOUD_INIT -import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_CLOUD_PASSPORT_AUTH_FAILED -import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_CLOUD_PASSPORT_AUTH_OK import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_CLOUD_PASSPORT_TOKEN import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_CLOUD_RECONNECT import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_HTTP_DNS_ERROR_REASON @@ -30,12 +28,12 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_SOURCE_ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_STATUS import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener +import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager +import com.mogo.eagle.core.function.call.cloud.CallerCloudCertManager import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager -import com.mogo.eagle.core.function.startup.stageone.secret.IPassportSecret -import com.mogo.eagle.core.function.startup.stageone.secret.PassPortSecret import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAIN import com.mogo.eagle.core.utilcode.util.AppUtils @@ -47,7 +45,7 @@ import com.rousetime.android_startup.AndroidStartup import com.zhjt.service.chain.ChainLog import kotlin.properties.Delegates -class HttpDnsStartUp : AndroidStartup() { +class HttpDnsStartUp : AndroidStartup(), IMoGoCloudListener { companion object { private const val TAG = "HttpDnsStartUp" @@ -108,6 +106,8 @@ class HttpDnsStartUp : AndroidStartup() { } private fun preparePassportEnvironment() { + //监听cert文件下载 + CallerCloudListenerManager.addListener(TAG,this) // 设置网络环境:HTTP_DNS_ENV_QA、HTTP_DNS_ENV_RELEASE、HTTP_DNS_ENV_DEV when (DebugConfig.getNetMode()) { DebugConfig.NET_MODE_DEV -> clientConfig.netMode = @@ -229,8 +229,8 @@ class HttpDnsStartUp : AndroidStartup() { if (!gotToken) { CallerLogger.d("$M_MAIN$TAG", "onTokenGot token : $token , sn :$sn") CallerCloudListenerManager.invokeCloudTokenGot(token, sn) - // 异步初始化NetConfig - asyncInit(sn) + // 开启cert download && 异步初始化NetConfig + asyncInit() startSocketService(sn) // 开启每5s/次定位上报 uploadLocPerFiveSecond() @@ -248,7 +248,11 @@ class HttpDnsStartUp : AndroidStartup() { /** * 异步初始化 */ - private fun asyncInit(sn: String) { + private fun asyncInit() { + // cert file下载 + CallerCloudCertManager.certFileDownLoad{ + logError(getPrReason("PassPortSecret-onFailed , $it")) + } ThreadPoolService.execute { // 初始化网络配置 NetConfigUtils.init() @@ -259,65 +263,13 @@ class HttpDnsStartUp : AndroidStartup() { mStartParams["app_flavor"] = DebugConfig.getProductFlavor() mStartParams["app_identity_mode"] = FunctionBuildConfig.appIdentityMode MogoAnalyticUtils.track("app_start_time", mStartParams) + } + } - if (FunctionBuildConfig.isSecure) { - context?.let { - val authStatus = - SharedPrefsMgr.getInstance() - .getBoolean("securityKeyStatus-${DebugConfig.getNetMode()}", false) - if (authStatus) { - // clientConfig设置auth值,并带入header - clientConfig.authPubKey = SharedPrefsMgr.getInstance() - .getString("securityKey-${DebugConfig.getNetMode()}", "") - return@let - } - // 安全校验 - try { - PassPortSecret.getInstance().init(sn, it.filesDir.path, object : - IPassportSecret { - - @ChainLog( - linkChainLog = CHAIN_TYPE_STATUS, - linkCode = CHAIN_SOURCE_CLOUD, - nodeAliasCode = CHAIN_CODE_CLOUD_PASSPORT_AUTH_OK, - paramIndexes = [0,1] - ) - override fun onSuccess(securityKey: String, rootKey: String) { - CallerLogger.d( - "$M_MAIN$TAG", - "onSuccess securityKey:$securityKey , thread:${Thread.currentThread().name}" - ) - clientConfig.securityKey = securityKey - SharedPrefsMgr.getInstance() - .putString( - "securityKey-${DebugConfig.getNetMode()}", - securityKey - ) - SharedPrefsMgr.getInstance() - .putBoolean("securityKeyStatus-${DebugConfig.getNetMode()}", true) - CallerCloudListenerManager.invokeCloudCrtFile(securityKey, rootKey) - } - - @ChainLog( - linkChainLog = CHAIN_TYPE_STATUS, - linkCode = CHAIN_SOURCE_CLOUD, - nodeAliasCode = CHAIN_CODE_CLOUD_PASSPORT_AUTH_FAILED, - paramIndexes = [0, 1] - ) - override fun onFailed(errorCode: Int, errorMsg: String) { - logError( - getPrReason( - "PassPortSecret-onFailed , errorCode:$errorCode,errorMsg:$errorMsg" - ) - ) - } - }) - } catch (e: Exception) { - e.printStackTrace() - } - } - } - + override fun authCrtFile(device: String, root: String) { + super.authCrtFile(device, root) + handler.post { + clientConfig.securityKey = device } } diff --git a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/secret/CertFileManager.kt b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/secret/CertFileManager.kt new file mode 100644 index 0000000000..37ea05c4a3 --- /dev/null +++ b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/secret/CertFileManager.kt @@ -0,0 +1,114 @@ +package com.mogo.eagle.core.function.startup.stageone.secret + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.mogo.commons.debug.DebugConfig +import com.mogo.commons.storage.SharedPrefsMgr +import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.data.constants.MogoServicePaths +import com.mogo.eagle.core.data.deva.chain.ChainConstant +import com.mogo.eagle.core.function.api.cloud.IMoGoCertProvider +import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant +import com.mogo.eagle.core.utilcode.util.ThreadPoolService +import com.zhjt.service.chain.ChainLog +import java.util.concurrent.atomic.AtomicBoolean + +@Route(path = MogoServicePaths.PATH_CERT_DOWN_LOAD_PROVIDER) +class CertFileManager : IMoGoCertProvider { + + private var context: Context? = null + private val securityKeyTAG = "securityKey-${DebugConfig.getNetMode()}" + private val securityRootTAG = "securityRoot-${DebugConfig.getNetMode()}" + private val securityKeyStatus = "securityKeyStatus-${DebugConfig.getNetMode()}" + private val certStatus = AtomicBoolean(false) + + @Volatile + private var deviceCrtFile: String? = null + + @Volatile + private var rootCrtFile: String? = null + + companion object { + private const val TAG = "CertFileManager" + } + + override fun init(context: Context?) { + this.context = context + } + + override fun certificateDownLoad(onError: ((String) -> Unit)?) { + if (FunctionBuildConfig.isSecure) { + context?.let { + val authStatus = SharedPrefsMgr.getInstance().getBoolean(securityKeyStatus, false) + if (authStatus) { + deviceCrtFile = SharedPrefsMgr.getInstance().getString(securityKeyTAG, "") + rootCrtFile = SharedPrefsMgr.getInstance().getString(securityRootTAG, "") + CallerCloudListenerManager.invokeCloudCrtFile(deviceCrtFile!!, rootCrtFile!!) + return@let + } + if (certStatus.get()) { + onError?.invoke("正在下载证书,请稍后再试") + return@let + } + // 安全校验 + try { + ThreadPoolService.execute { + PassPortSecret.getInstance() + .init(SharedPrefsMgr.getInstance().sn, it.filesDir.path, object : + IPassportSecret { + + @ChainLog( + linkChainLog = ChainConstant.CHAIN_TYPE_STATUS, + linkCode = ChainConstant.CHAIN_SOURCE_CLOUD, + nodeAliasCode = ChainConstant.CHAIN_CODE_CLOUD_PASSPORT_AUTH_OK, + paramIndexes = [0, 1] + ) + override fun onSuccess(securityKey: String, rootKey: String) { + CallerLogger.d( + "${SceneConstant.M_D_C}$TAG", + "onSuccess securityKey:$securityKey , thread:${Thread.currentThread().name}" + ) + certStatus.set(true) + deviceCrtFile = securityKey + rootCrtFile = rootKey + SharedPrefsMgr.getInstance().putString(securityKeyTAG, securityKey) + SharedPrefsMgr.getInstance().putString(securityRootTAG, rootKey) + SharedPrefsMgr.getInstance().putBoolean(securityKeyStatus, true) + CallerCloudListenerManager.invokeCloudCrtFile( + securityKey, + rootKey + ) + } + + @ChainLog( + linkChainLog = ChainConstant.CHAIN_TYPE_STATUS, + linkCode = ChainConstant.CHAIN_SOURCE_CLOUD, + nodeAliasCode = ChainConstant.CHAIN_CODE_CLOUD_PASSPORT_AUTH_FAILED, + paramIndexes = [0, 1] + ) + override fun onFailed(errorCode: Int, errorMsg: String) { + CallerLogger.d("${SceneConstant.M_D_C}$TAG", "onFailed code:$errorCode, msg:$errorMsg") + certStatus.set(true) + onError?.invoke("证书下载失败, code:$errorCode, msg:$errorMsg") + } + }) + } + } catch (e: Exception) { + e.printStackTrace() + } + } + } else { + onError?.invoke("当前环境id:${FunctionBuildConfig.urlJson.secureProductId} 不支持密钥下载") + } + } + + override fun getDeviceCrtF(): String? { + return deviceCrtFile?:SharedPrefsMgr.getInstance().getString(securityKeyTAG, "") + } + + override fun getRootCrtF(): String? { + return rootCrtFile?:SharedPrefsMgr.getInstance().getString(securityRootTAG, "") + } +} \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java index 00f24f1610..b1460e7ea7 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java @@ -97,6 +97,8 @@ public class MogoServicePaths { @Keep public static final String PATH_DATA_CENTER_MODULE = "/data_center/api"; + @Keep + public static final String PATH_CERT_DOWN_LOAD_PROVIDER = "/cert_file/api"; @Keep public static final String PATH_VISUAL_ANGLE = "/map/angle_change"; diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCertProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCertProvider.kt new file mode 100644 index 0000000000..fbd266d3df --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCertProvider.kt @@ -0,0 +1,11 @@ +package com.mogo.eagle.core.function.api.cloud + +import com.alibaba.android.arouter.facade.template.IProvider + +interface IMoGoCertProvider:IProvider { + fun certificateDownLoad(onError: ((String) -> Unit)? = null) + + fun getDeviceCrtF():String? + + fun getRootCrtF(): String? +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCloudListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCloudListener.kt index c57446b7a2..d82f858588 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCloudListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCloudListener.kt @@ -3,7 +3,7 @@ package com.mogo.eagle.core.function.api.cloud import com.mogo.eagle.core.data.v2x.V2XEvent interface IMoGoCloudListener{ - + //单独线程 fun authCrtFile(device:String, root:String){} fun tokenGot(token: String, sn: String){} diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/IDataCenterProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/IDataCenterProvider.kt index 9306c2c184..2440a49a65 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/IDataCenterProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/IDataCenterProvider.kt @@ -3,5 +3,5 @@ package com.mogo.eagle.core.function.api.datacenter import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider interface IDataCenterProvider: IMoGoFunctionServerProvider { - fun certificateDownLoad(callback: (String,String) -> Unit) + } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerDataCenter.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerDataCenter.kt deleted file mode 100644 index 4f1ed23bcb..0000000000 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerDataCenter.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.mogo.eagle.core.function.call.autopilot - -import com.mogo.eagle.core.function.api.datacenter.IDataCenterProvider -import com.mogo.eagle.core.function.call.base.CallerBase - -object CallerDataCenter : CallerBase() { - - fun certificate(callback: (String, String) -> Unit) { - M_LISTENERS.forEach { - val listener = it.value - listener.certificateDownLoad { s1, s2 -> - callback.invoke(s1, s2) - } - } - } - -} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudCertManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudCertManager.kt new file mode 100644 index 0000000000..10b0c25e07 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudCertManager.kt @@ -0,0 +1,26 @@ +package com.mogo.eagle.core.function.call.cloud + +import com.mogo.eagle.core.data.constants.MogoServicePaths +import com.mogo.eagle.core.function.api.cloud.IMoGoCertProvider +import com.mogo.eagle.core.function.call.base.CallerBase + +object CallerCloudCertManager { + + private val certProviderApi: IMoGoCertProvider + get() = CallerBase.getApiInstance( + IMoGoCertProvider::class.java, + MogoServicePaths.PATH_CERT_DOWN_LOAD_PROVIDER + ) + + fun certFileDownLoad(onError: ((String) -> Unit)? = null) { + certProviderApi.certificateDownLoad(onError) + } + + fun getDeviceCrtF(): String? { + return certProviderApi.getDeviceCrtF() + } + + fun getRootCrtF(): String? { + return certProviderApi.getRootCrtF() + } +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudListenerManager.kt index 8dfd069548..2a38dfc1ce 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudListenerManager.kt @@ -12,12 +12,6 @@ object CallerCloudListenerManager : CallerBase() { @Volatile private var sn: String? = null - @Volatile - private var deviceCrtFile: String? = null - - @Volatile - private var rootCrtFile: String? = null - override fun doSomeAfterAddListener(tag: String, listener: IMoGoCloudListener) { super.doSomeAfterAddListener(tag, listener) if (!token.isNullOrEmpty() && !sn.isNullOrEmpty()) { @@ -25,17 +19,7 @@ object CallerCloudListenerManager : CallerBase() { } } - fun getRootCrtF(): String? { - return rootCrtFile - } - - fun getDeviceCrtF(): String? { - return deviceCrtFile - } - fun invokeCloudCrtFile(deviceCrtFile: String, rootCrtFile: String) { - this.deviceCrtFile = deviceCrtFile - this.rootCrtFile = rootCrtFile M_LISTENERS.forEach { val listener = it.value listener.authCrtFile(deviceCrtFile, rootCrtFile)