[6.2.9] extends the crtfile

This commit is contained in:
EmArrow
2024-01-23 18:22:07 +08:00
parent 79c208e87e
commit b5431c3685
6 changed files with 36 additions and 8 deletions

View File

@@ -280,9 +280,9 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
linkChainLog = CHAIN_TYPE_STATUS,
linkCode = CHAIN_SOURCE_CLOUD,
nodeAliasCode = CHAIN_CODE_CLOUD_PASSPORT_AUTH_OK,
paramIndexes = [0]
paramIndexes = [0,1]
)
override fun onSuccess(securityKey: String) {
override fun onSuccess(securityKey: String, rootKey: String) {
CallerLogger.d(
"$M_MAIN$TAG",
"onSuccess securityKey:$securityKey , thread:${Thread.currentThread().name}"
@@ -295,6 +295,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
)
SharedPrefsMgr.getInstance()
.putBoolean("securityKey-${DebugConfig.getNetMode()}", true)
CallerCloudListenerManager.invokeCloudCrtFile(securityKey, rootKey)
}
@ChainLog(

View File

@@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.startup.stageone.secret;
public interface IPassportSecret {
void onSuccess(String secretKey);
void onSuccess(String secretKey, String rootKey);
void onFailed(int errorCode, String errorMsg);
}

View File

@@ -5,6 +5,7 @@ import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import java.io.UnsupportedEncodingException;
import java.util.List;
import constant.ErrorCode;
import domain.Passport;
@@ -42,14 +43,15 @@ public class PassPortSecret {
secretCB.onFailed(r.getCode(), r.getMsg());
}
Passport passport = (Passport) r.getData();
domain.R<String> res = passportService.deviceActive(passport);
domain.R<List<String>> res = passportService.deviceActive(passport);
if (res.getCode() != ErrorCode.OK.getCode()) {
secretCB.onFailed(res.getCode(), res.getMsg());
} else {
String secretKey = res.getData();
List<String> secretKey = res.getData();
try {
String result = new String(Base64.encode(secretKey.getBytes("utf-8"), Base64.NO_WRAP), "utf-8");
secretCB.onSuccess(result);
String result = new String(Base64.encode(secretKey.get(0).getBytes("utf-8"), Base64.NO_WRAP), "utf-8");
String root = new String(Base64.encode(secretKey.get(1).getBytes("utf-8"), Base64.NO_WRAP), "utf-8");
secretCB.onSuccess(result, root);
} catch (UnsupportedEncodingException e) {
secretCB.onFailed(5000, "url encode error :" + secretKey);
}