[3.4.0] security passport add online env

This commit is contained in:
zhongchao
2023-07-24 17:15:55 +08:00
parent 95c1947657
commit 5e92f3727f
4 changed files with 25 additions and 20 deletions

View File

@@ -124,7 +124,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
// 使用中台长链接
clientConfig.isUseOriginSocket = true
// 设置是否输出网络日志
clientConfig.isShowNetDebugLog = true //todo test
clientConfig.isShowNetDebugLog = false //todo test
clientConfig.passportUrl = FunctionBuildConfig.urlJson.passportUrl
clientConfig.socketBaseUrl = FunctionBuildConfig.urlJson.socketBaseUrl

View File

@@ -3,11 +3,7 @@ package com.mogo.eagle.core.function.startup.stageone.secret;
import android.util.Base64;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.app.UrlConfig;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.utilcode.util.GsonUtils;
import com.mogo.eagle.core.utilcode.util.Utils;
import com.zhidao.utils.digest.Base64Utils;
import java.io.UnsupportedEncodingException;
@@ -49,13 +45,13 @@ public class PassPortSecret {
domain.R<String> res = passportService.deviceActive(passport);
if (res.getCode() != ErrorCode.OK.getCode()) {
secretCB.onFailed(res.getCode(), res.getMsg());
}else{
} else {
String secretKey = res.getData();
try {
String result = new String(Base64.encode(secretKey.getBytes("utf-8"), Base64.NO_WRAP),"utf-8");
String result = new String(Base64.encode(secretKey.getBytes("utf-8"), Base64.NO_WRAP), "utf-8");
secretCB.onSuccess(result);
} catch (UnsupportedEncodingException e) {
secretCB.onFailed(5000,"url encode error :" + secretKey);
secretCB.onFailed(5000, "url encode error :" + secretKey);
}
}
@@ -66,9 +62,25 @@ public class PassPortSecret {
.deviceActive(FunctionBuildConfig.urlJson.getSecureActive())
.deviceRefresh(FunctionBuildConfig.urlJson.getSecureRefresh())
.deviceAuth(FunctionBuildConfig.urlJson.getSecureAuth())
.productId("10019")
.productSecret("5cbcdc2240fa4104a70f28cdbe5ca69b")
.productId(getProductId())
.productSecret(getProductSecret())
.sn(deviceId)
.certPath(path).build());
}
private static String getProductId() {
if (DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE
|| DebugConfig.getNetMode() == DebugConfig.NET_MODE_DEMO) {
return "10028";
}
return "10019";
}
private static String getProductSecret() {
if (DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE
|| DebugConfig.getNetMode() == DebugConfig.NET_MODE_DEMO) {
return "6b4c4db8286547b78b1def2d76f70fb3";
}
return "5cbcdc2240fa4104a70f28cdbe5ca69b";
}
}