feat:修改正式包名

feat:重新生成加密的第三方SDK-key(感觉没区别)
This commit is contained in:
Max
2023-11-29 20:46:12 +08:00
parent efef976125
commit 5bda23c293
9 changed files with 41 additions and 42 deletions

View File

@@ -7,7 +7,7 @@ android {
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
defaultConfig {
applicationId isolationMode ? 'com.example.gogo' : 'com.example.live'
applicationId isolationMode ? 'com.example.gogo' : 'app.hiyoo.fun'
minSdkVersion MIN_SDK_VERSION.toInteger()
targetSdkVersion TARGET_SDK_VERSION.toInteger()
versionCode Integer.valueOf(version_code)
@@ -19,9 +19,9 @@ android {
buildConfigField "boolean", "ISOLATION_MODE", "$isolationMode"
if (isolationMode) {
resValue "string", "app_name", "Hi-d"
resValue "string", "app_name", "Hi-debug"
} else {
resValue "string", "app_name", "Hi"
resValue "string", "app_name", "Hiyoo"
}
}

View File

@@ -15,8 +15,8 @@ import java.util.List;
public class Constants {
public static final String ERBAN_DIR_NAME = XConstants.XCHAT_DIR_NAME;
public static final String nimAppKey = Env.isDebug() ?
XConstants.getNimKeyDebug() : XConstants.getNimKeyRelease();
public static final String nimAppSecret = "da03b83af84a";
SdkConfig.INSTANCE.getNimKeyDebug() : SdkConfig.INSTANCE.getNimKeyRelease();
// public static final String nimAppSecret = "da03b83af84a";
/**
* 百度统计
*/

View File

@@ -0,0 +1,21 @@
package com.chwl.core
import com.chwl.library.utils.codec.DESUtils
object SdkConfig {
fun getTXAppId() = decrypt("FWVTBRkBKfYufNwqvQJdTw==")
fun getAgoraKey() = decrypt("nG0ISOgixMxTjvSf2k0cAEPQkPiBOFbl0pXN90FFYNBzztbmqRnI4g==")
fun getNimKeyDebug() = decrypt("1Gb6Qra5ozRKY1/y4NCrTl0DUqrpq2zL8MVAvQAfYUtzztbmqRnI4g==")
fun getNimKeyRelease() = decrypt("dpXJwHVETO/GJEy0z5179Xd2rRRSIc1OFTZ+PzvYyelzztbmqRnI4g==")
private fun decrypt(value: String): String {
return try {
DESUtils.DESAndBase64Decrypt("2ea53d260ecf21e7b56e00223e042226", value)
} catch (e: Exception) {
""
}
}
}

View File

@@ -213,28 +213,4 @@ public class XConstants {
谷歌下载地址
*/
public static String appDownloadUrl = "https://play.google.com/store/apps/details?id=app.hiyoo.fun";
public static String getAgoraKey() {
try {
return DESUtils.DESAndBase64Decrypt("8QLrysqBwGmCodayBzvis+9wWYUwQlBPkUqdprUrlcNAwgt7a5hAGQ==");
} catch (Exception e) {
return "";
}
}
public static String getNimKeyDebug() {
try {
return DESUtils.DESAndBase64Decrypt("zkUPMmvAAUxWJTdS34whaFNEWuJaKpfllz5BgjG8r2JAwgt7a5hAGQ==");
} catch (Exception e) {
return "";
}
}
public static String getNimKeyRelease() {
try {
return DESUtils.DESAndBase64Decrypt("ivctC5n5Xoo+FOTazYk7bTOI3V+Rmi8gAjTkAaKBJolAwgt7a5hAGQ==");
} catch (Exception e) {
return "";
}
}
}

View File

@@ -11,6 +11,7 @@ import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.chwl.core.SdkConfig;
import com.orhanobut.logger.Logger;
import com.chwl.core.XConstants;
import com.chwl.core.manager.BaseEngine;
@@ -55,7 +56,7 @@ public class RtcEngineManager extends BaseEngine {
Logger.t(TAG).d("enterChannel channelId:%d", channelId);
if (mRtcEngine == null) {
try {
mRtcEngine = RtcEngine.create(BasicConfig.INSTANCE.getAppContext(), XConstants.getAgoraKey(), mEngineEventHandler);
mRtcEngine = RtcEngine.create(BasicConfig.INSTANCE.getAppContext(), SdkConfig.INSTANCE.getAgoraKey(), mEngineEventHandler);
} catch (Exception e) {
throw new RuntimeException(
"NEED TO check rtc sdk init fatal error\n" + Log.getStackTraceString(e));

View File

@@ -1,6 +1,5 @@
package com.chwl.core.manager.trtc;
import com.chwl.library.utils.codec.DESUtils;
public class SDKConfig {
/**
@@ -32,13 +31,4 @@ public class SDKConfig {
* 1表示房间号为整型房间号"111""123"
*/
public static int TX_CHANNELNAME_INT = 1;
public static String getTXAppId() {
try {
return DESUtils.DESAndBase64Decrypt("SvVKinDlp2xq9wtVeUYw1w==");
} catch (Exception e) {
return "";
}
}
}

View File

@@ -10,6 +10,7 @@ import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.chwl.core.SdkConfig;
import com.orhanobut.logger.Logger;
import com.chwl.core.initial.InitialModel;
import com.chwl.core.initial.bean.InitInfo;
@@ -51,7 +52,7 @@ public class TRtcEngineManager extends BaseEngine {
if (initInfo != null && initInfo.getTrtcAppId() != null) {
mRtcEngine = TRTCEngineAdapter.create(BasicConfig.INSTANCE.getAppContext(), initInfo.getTrtcAppId(), mEngineEventHandler);
} else {
mRtcEngine = TRTCEngineAdapter.create(BasicConfig.INSTANCE.getAppContext(), SDKConfig.getTXAppId(), mEngineEventHandler);
mRtcEngine = TRTCEngineAdapter.create(BasicConfig.INSTANCE.getAppContext(), SdkConfig.INSTANCE.getTXAppId(), mEngineEventHandler);
}
} catch (Exception e) {
throw new RuntimeException(

View File

@@ -109,6 +109,16 @@ public class DESUtils {
return textDecrypt;
}
//服务端解密
public static String DESAndBase64Decrypt(String key,String dataBase64) throws Exception {
if (StringUtils.isEmpty(dataBase64)) return null;
byte[] encryptedData = Base64.decode(dataBase64, Base64.DEFAULT);
byte[] decryptedData = decryptByteDES(encryptedData, key);
String textDecrypt = new String(decryptedData, ENCODE);
return textDecrypt;
}
/**
* 执行加密操作
*

View File

@@ -1,5 +1,5 @@
ext {
isolationMode = isReleaseBuildType() ? false : Boolean.valueOf(isolation_mode)
isolationMode = Boolean.valueOf(isolation_mode)
println("是否隔离模式:" + isolationMode)
package_name = project.hasProperty('package_name') ? package_name