初始化代码
This commit is contained in:
96
app/src/main/java/com/qxcm/qxlive/AppContext.java
Normal file
96
app/src/main/java/com/qxcm/qxlive/AppContext.java
Normal file
@@ -0,0 +1,96 @@
|
||||
package com.qxcm.qxlive;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.hjq.toast.IToastInterceptor;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.qxcm.moduleutil.utils.config.EnvironmentEnum;
|
||||
import com.qxcm.moduleutil.utils.config.EnvironmentPrefs;
|
||||
import com.qxcm.moduleutil.widget.CommonAppConfig;
|
||||
import com.qxcm.moduleutil.widget.CommonAppContext;
|
||||
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/3.
|
||||
*/
|
||||
|
||||
public class AppContext extends CommonAppContext {
|
||||
|
||||
private boolean mBeautyInited;
|
||||
private EnvironmentEnum currentEnvironment;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
ToastUtils.init(this);
|
||||
// ToastUtils.setInterceptor(new IToastInterceptor() {
|
||||
// @Override
|
||||
// public boolean intercept(CharSequence charSequence) {
|
||||
// return !CommonAppContext.getInstance().isFront();
|
||||
// }
|
||||
// });
|
||||
// L.setDeBug(BuildConfig.DEBUG);
|
||||
EnvironmentPrefs prefs = new EnvironmentPrefs(this);
|
||||
currentEnvironment = prefs.getSelectedEnvironment();
|
||||
}
|
||||
public EnvironmentEnum getCurrentEnvironment() {
|
||||
return currentEnvironment;
|
||||
}
|
||||
public static void initSdk() {
|
||||
CommonAppContext context = CommonAppContext.getInstance();
|
||||
// if (BuildConfig.DEBUG) {
|
||||
// L.e("应用签名:" + context.getAppSignature());
|
||||
// //L.e("facebook散列秘钥------>" + context.getFacebookHashKey());
|
||||
// }
|
||||
// //腾讯云直播鉴权url
|
||||
// String liveLicenceUrl = "https://license.vod2.myqcloud.com/license/v2/1346816652_1/v_cube.license";
|
||||
// //腾讯云直播鉴权key
|
||||
// String liveKey = "c30f209835056ba00f738a014ca4448a";
|
||||
// //腾讯云视频鉴权url
|
||||
// String ugcLicenceUrl = "https://license.vod2.myqcloud.com/license/v2/1346816652_1/v_cube.license";
|
||||
// //腾讯云视频鉴权key
|
||||
// String ugcKey = "c30f209835056ba00f738a014ca4448a";
|
||||
// TXLiveBase.getInstance().setDebug(BuildConfig.DEBUG);
|
||||
// TXLiveBase.getInstance().setLicence(context, liveLicenceUrl, liveKey, ugcLicenceUrl, ugcKey);
|
||||
// //初始化腾讯bugly
|
||||
// CrashReport.initCrashReport(context);
|
||||
// CrashReport.setAppVersion(context, CommonAppConfig.getInstance().getVersion());
|
||||
// //初始化ShareSdk
|
||||
// MobSDK.init(context);
|
||||
// MobSDK.submitPolicyGrantResult(true);
|
||||
// //初始化IM
|
||||
// ImMessageUtil.getInstance().init();
|
||||
// //初始化腾讯TPNS 移动推送
|
||||
// TpnsUtil.register(BuildConfig.DEBUG);
|
||||
// //初始化友盟统计
|
||||
// UmengUtil.init(context, BuildConfig.DEBUG);
|
||||
// //OpenInstall
|
||||
// OpenInstall.init(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化美狐
|
||||
*/
|
||||
public void initBeautySdk(String beautyAppId, String beautyKey) {
|
||||
// if (!TextUtils.isEmpty(beautyAppId) && !TextUtils.isEmpty(beautyKey)) {
|
||||
// if (!mBeautyInited) {
|
||||
// mBeautyInited = true;
|
||||
// if (CommonAppConfig.isYunBaoApp()) {
|
||||
// beautyAppId = DecryptUtil.decrypt(beautyAppId);
|
||||
// beautyKey = DecryptUtil.decrypt(beautyKey);
|
||||
// }
|
||||
// MHSDK.init(this, beautyAppId, beautyKey);
|
||||
// CommonAppConfig.getInstance().setMhBeautyEnable(true);
|
||||
// L.e("美狐初始化----AppId--->" + beautyAppId + "---AppKey--->" + beautyKey);
|
||||
// }
|
||||
// } else {
|
||||
// CommonAppConfig.getInstance().setMhBeautyEnable(false);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startInitSdk() {
|
||||
initSdk();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user