feat:修改正式包名
feat:重新生成加密的第三方SDK-key(感觉没区别)
This commit is contained in:
@@ -7,7 +7,7 @@ android {
|
|||||||
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
|
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId isolationMode ? 'com.example.gogo' : 'com.example.live'
|
applicationId isolationMode ? 'com.example.gogo' : 'app.hiyoo.fun'
|
||||||
minSdkVersion MIN_SDK_VERSION.toInteger()
|
minSdkVersion MIN_SDK_VERSION.toInteger()
|
||||||
targetSdkVersion TARGET_SDK_VERSION.toInteger()
|
targetSdkVersion TARGET_SDK_VERSION.toInteger()
|
||||||
versionCode Integer.valueOf(version_code)
|
versionCode Integer.valueOf(version_code)
|
||||||
@@ -19,9 +19,9 @@ android {
|
|||||||
buildConfigField "boolean", "ISOLATION_MODE", "$isolationMode"
|
buildConfigField "boolean", "ISOLATION_MODE", "$isolationMode"
|
||||||
|
|
||||||
if (isolationMode) {
|
if (isolationMode) {
|
||||||
resValue "string", "app_name", "Hi-d"
|
resValue "string", "app_name", "Hi-debug"
|
||||||
} else {
|
} else {
|
||||||
resValue "string", "app_name", "Hi"
|
resValue "string", "app_name", "Hiyoo"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,8 +15,8 @@ import java.util.List;
|
|||||||
public class Constants {
|
public class Constants {
|
||||||
public static final String ERBAN_DIR_NAME = XConstants.XCHAT_DIR_NAME;
|
public static final String ERBAN_DIR_NAME = XConstants.XCHAT_DIR_NAME;
|
||||||
public static final String nimAppKey = Env.isDebug() ?
|
public static final String nimAppKey = Env.isDebug() ?
|
||||||
XConstants.getNimKeyDebug() : XConstants.getNimKeyRelease();
|
SdkConfig.INSTANCE.getNimKeyDebug() : SdkConfig.INSTANCE.getNimKeyRelease();
|
||||||
public static final String nimAppSecret = "da03b83af84a";
|
// public static final String nimAppSecret = "da03b83af84a";
|
||||||
/**
|
/**
|
||||||
* 百度统计
|
* 百度统计
|
||||||
*/
|
*/
|
||||||
|
21
core/src/main/java/com/chwl/core/SdkConfig.kt
Normal file
21
core/src/main/java/com/chwl/core/SdkConfig.kt
Normal 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) {
|
||||||
|
""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -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 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 "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -11,6 +11,7 @@ import android.util.Log;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.chwl.core.SdkConfig;
|
||||||
import com.orhanobut.logger.Logger;
|
import com.orhanobut.logger.Logger;
|
||||||
import com.chwl.core.XConstants;
|
import com.chwl.core.XConstants;
|
||||||
import com.chwl.core.manager.BaseEngine;
|
import com.chwl.core.manager.BaseEngine;
|
||||||
@@ -55,7 +56,7 @@ public class RtcEngineManager extends BaseEngine {
|
|||||||
Logger.t(TAG).d("enterChannel channelId:%d", channelId);
|
Logger.t(TAG).d("enterChannel channelId:%d", channelId);
|
||||||
if (mRtcEngine == null) {
|
if (mRtcEngine == null) {
|
||||||
try {
|
try {
|
||||||
mRtcEngine = RtcEngine.create(BasicConfig.INSTANCE.getAppContext(), XConstants.getAgoraKey(), mEngineEventHandler);
|
mRtcEngine = RtcEngine.create(BasicConfig.INSTANCE.getAppContext(), SdkConfig.INSTANCE.getAgoraKey(), mEngineEventHandler);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"NEED TO check rtc sdk init fatal error\n" + Log.getStackTraceString(e));
|
"NEED TO check rtc sdk init fatal error\n" + Log.getStackTraceString(e));
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package com.chwl.core.manager.trtc;
|
package com.chwl.core.manager.trtc;
|
||||||
|
|
||||||
import com.chwl.library.utils.codec.DESUtils;
|
|
||||||
|
|
||||||
public class SDKConfig {
|
public class SDKConfig {
|
||||||
/**
|
/**
|
||||||
@@ -32,13 +31,4 @@ public class SDKConfig {
|
|||||||
* 1:表示房间号为整型房间号,如:"111","123"
|
* 1:表示房间号为整型房间号,如:"111","123"
|
||||||
*/
|
*/
|
||||||
public static int TX_CHANNELNAME_INT = 1;
|
public static int TX_CHANNELNAME_INT = 1;
|
||||||
|
|
||||||
|
|
||||||
public static String getTXAppId() {
|
|
||||||
try {
|
|
||||||
return DESUtils.DESAndBase64Decrypt("SvVKinDlp2xq9wtVeUYw1w==");
|
|
||||||
} catch (Exception e) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -10,6 +10,7 @@ import android.util.Log;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.chwl.core.SdkConfig;
|
||||||
import com.orhanobut.logger.Logger;
|
import com.orhanobut.logger.Logger;
|
||||||
import com.chwl.core.initial.InitialModel;
|
import com.chwl.core.initial.InitialModel;
|
||||||
import com.chwl.core.initial.bean.InitInfo;
|
import com.chwl.core.initial.bean.InitInfo;
|
||||||
@@ -51,7 +52,7 @@ public class TRtcEngineManager extends BaseEngine {
|
|||||||
if (initInfo != null && initInfo.getTrtcAppId() != null) {
|
if (initInfo != null && initInfo.getTrtcAppId() != null) {
|
||||||
mRtcEngine = TRTCEngineAdapter.create(BasicConfig.INSTANCE.getAppContext(), initInfo.getTrtcAppId(), mEngineEventHandler);
|
mRtcEngine = TRTCEngineAdapter.create(BasicConfig.INSTANCE.getAppContext(), initInfo.getTrtcAppId(), mEngineEventHandler);
|
||||||
} else {
|
} else {
|
||||||
mRtcEngine = TRTCEngineAdapter.create(BasicConfig.INSTANCE.getAppContext(), SDKConfig.getTXAppId(), mEngineEventHandler);
|
mRtcEngine = TRTCEngineAdapter.create(BasicConfig.INSTANCE.getAppContext(), SdkConfig.INSTANCE.getTXAppId(), mEngineEventHandler);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
|
@@ -109,6 +109,16 @@ public class DESUtils {
|
|||||||
return textDecrypt;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行加密操作
|
* 执行加密操作
|
||||||
*
|
*
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
ext {
|
ext {
|
||||||
isolationMode = isReleaseBuildType() ? false : Boolean.valueOf(isolation_mode)
|
isolationMode = Boolean.valueOf(isolation_mode)
|
||||||
println("是否隔离模式:" + isolationMode)
|
println("是否隔离模式:" + isolationMode)
|
||||||
|
|
||||||
package_name = project.hasProperty('package_name') ? package_name
|
package_name = project.hasProperty('package_name') ? package_name
|
||||||
|
Reference in New Issue
Block a user