Commit 17f020bc authored by mengcuiguang's avatar mengcuiguang

创神代码优化

parent fed258b5
...@@ -11,8 +11,8 @@ android { ...@@ -11,8 +11,8 @@ android {
applicationId "com.mints.highgold" applicationId "com.mints.highgold"
minSdkVersion rootProject.ext.androidMinSdkVersion minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 14 versionCode 15
versionName "1.1.3" versionName "1.1.4"
flavorDimensions "default" flavorDimensions "default"
// dex突破65535的限制 // dex突破65535的限制
...@@ -299,7 +299,8 @@ dependencies { ...@@ -299,7 +299,8 @@ dependencies {
implementation(name: 'discovery-2.0.12', ext: 'aar') implementation(name: 'discovery-2.0.12', ext: 'aar')
implementation(name: 'shanhuAD-1.0.14', ext: 'aar') implementation(name: 'shanhuAD-1.0.14', ext: 'aar')
// 创神广告 // 创神广告
implementation(name: 'ad_support_library_v2.1.4', ext: 'aar') implementation(name: 'ad_support_library_video_v2.1.8', ext: 'aar')
implementation (name: 'ad_support_library_code_v2.1.8', ext: 'aar')
// 多盟 // 多盟
implementation(name: 'domob_rvads_1.0.0', ext: 'aar') implementation(name: 'domob_rvads_1.0.0', ext: 'aar')
implementation 'com.google.protobuf:protobuf-lite:3.0.0' implementation 'com.google.protobuf:protobuf-lite:3.0.0'
......
...@@ -435,3 +435,25 @@ ...@@ -435,3 +435,25 @@
public <methods>; public <methods>;
} }
# ======================= 多盟 END ================ # ======================= 多盟 END ================
# ===================== 创神 START ================
-keep class com.toukeads.code.AdCode{ *;}
-keep class com.toukeads.code.config.**{ *;}
-keep class com.toukeads.code.annotation.**{ *;}
-keep class com.toukeads.code.listener.**{ *;}
-keep class com.toukeads.code.utils.LogUtil{ *;}
-keep class com.toukeads.code.object.AdSave{ *;}
-keep class com.toukeads.code.object.ViewHeaderIm{ *;}
-keep class com.toukeads.code.model.**{ *;}
-keep class com.toukeads.code.server.**{ *;}
-keep class com.toukeads.code.cache.CacheListener{ *;}
-keep class com.toukeads.code.cache.HttpProxyCacheServer{ *;}
# ======================= 创神 END ================
...@@ -46,11 +46,11 @@ import com.tencent.ep.shanhuad.adpublic.ShanHuAD; ...@@ -46,11 +46,11 @@ import com.tencent.ep.shanhuad.adpublic.ShanHuAD;
import com.tendcloud.tenddata.TCAgent; import com.tendcloud.tenddata.TCAgent;
import com.tmsdk.module.coin.AbsTMSConfig; import com.tmsdk.module.coin.AbsTMSConfig;
import com.tmsdk.module.coin.TMSDKContext; import com.tmsdk.module.coin.TMSDKContext;
import com.toukeads.ads.Ad; import com.toukeads.code.AdCode;
import com.toukeads.ads.annotation.ClientOSType; import com.toukeads.code.annotation.ClientOSType;
import com.toukeads.ads.annotation.ClientType; import com.toukeads.code.annotation.ClientType;
import com.toukeads.ads.config.AdConfig; import com.toukeads.code.config.AdConfig;
import com.toukeads.ads.config.WebConfig; import com.toukeads.code.config.WebConfig;
import com.umeng.commonsdk.UMConfigure; import com.umeng.commonsdk.UMConfigure;
import com.yilan.sdk.ui.YLUIInit; import com.yilan.sdk.ui.YLUIInit;
import com.yilan.sdk.ui.configs.CommentConfig; import com.yilan.sdk.ui.configs.CommentConfig;
...@@ -448,7 +448,7 @@ public class MintsApplication extends MultiDexApplication { ...@@ -448,7 +448,7 @@ public class MintsApplication extends MultiDexApplication {
* 创神广告 * 创神广告
*/ */
private void initChuangshen() { private void initChuangshen() {
Ad.getInstance().initialize( AdCode.getInstance().initialize(
new AdConfig.Builder() new AdConfig.Builder()
.setContext(this) .setContext(this)
.setPosId("134") .setPosId("134")
......
...@@ -5,7 +5,6 @@ import android.content.Intent ...@@ -5,7 +5,6 @@ import android.content.Intent
import android.os.Bundle import android.os.Bundle
import com.mints.highgold.common.Constant import com.mints.highgold.common.Constant
import com.mints.highgold.ui.activitys.CsVedioActivity import com.mints.highgold.ui.activitys.CsVedioActivity
import com.toukeads.ads.Ad
/** /**
* 创神视频 * 创神视频
...@@ -62,6 +61,6 @@ class ChuangshenVedioAdManager private constructor(activity: Activity) { ...@@ -62,6 +61,6 @@ class ChuangshenVedioAdManager private constructor(activity: Activity) {
fun destory() { fun destory() {
//退出释放资源 //退出释放资源
Ad.getInstance().onDestroy() // Ad.getInstance().onDestroy()
} }
} }
\ No newline at end of file
...@@ -106,7 +106,7 @@ public class LiebaoManager { ...@@ -106,7 +106,7 @@ public class LiebaoManager {
// 0: 全部使用穿山甲广告 // 0: 全部使用穿山甲广告
// 100: 全部采用广点通广告 // 100: 全部采用广点通广告
// 40:则是穿山甲广告命中概率是60%,广点通是40%,如果一方没广告,则用另一方补量。 // 40:则是穿山甲广告命中概率是60%,广点通是40%,如果一方没广告,则用另一方补量。
cmGameAppInfo.setRewardAdProbability(40); // 默认值为0,全部采用穿山甲激励视频广告 cmGameAppInfo.setRewardAdProbability(20); // 默认值为0,全部采用穿山甲激励视频广告
// 功能默认开启,可使用如下方法来关闭 // 功能默认开启,可使用如下方法来关闭
// cmGameAppInfo.setShowLogin(false); // cmGameAppInfo.setShowLogin(false);
......
...@@ -352,7 +352,7 @@ public class AwardActivity extends BaseActivity implements AwardView { ...@@ -352,7 +352,7 @@ public class AwardActivity extends BaseActivity implements AwardView {
@Override @Override
public void vedioAdingListenerFail(String adType) { public void vedioAdingListenerFail(String adType) {
hideLoading(); hideLoading();
showToast("视频加载异常,请重试!"); showToast("加载失败,请稍后重试!");
} }
...@@ -804,7 +804,7 @@ public class AwardActivity extends BaseActivity implements AwardView { ...@@ -804,7 +804,7 @@ public class AwardActivity extends BaseActivity implements AwardView {
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
showToast("视频加载异常,请重试."); showToast("加载失败,请稍后重试.");
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_YLH, Constant.EVENT_TYPE_ONE, "999999", "Load Fail"); TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_YLH, Constant.EVENT_TYPE_ONE, "999999", "Load Fail");
// loadCsjAd(CARRIER_TYPE); // loadCsjAd(CARRIER_TYPE);
...@@ -863,7 +863,7 @@ public class AwardActivity extends BaseActivity implements AwardView { ...@@ -863,7 +863,7 @@ public class AwardActivity extends BaseActivity implements AwardView {
// 0 成功 1失败 2点击 3-有效展示 // 0 成功 1失败 2点击 3-有效展示
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_YLH, Constant.EVENT_TYPE_ONE, String.valueOf(adError.getErrorCode()), adError.getErrorMsg()); TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_YLH, Constant.EVENT_TYPE_ONE, String.valueOf(adError.getErrorCode()), adError.getErrorMsg());
} }
showToast("视频加载异常,请重试."); showToast("加载失败,请稍后重试.");
// loadCsjAd(CARRIER_TYPE); // loadCsjAd(CARRIER_TYPE);
} }
}); });
...@@ -948,7 +948,7 @@ public class AwardActivity extends BaseActivity implements AwardView { ...@@ -948,7 +948,7 @@ public class AwardActivity extends BaseActivity implements AwardView {
if (fullAdException) { if (fullAdException) {
loadCsjFullAd(carrierType); loadCsjFullAd(carrierType);
} else { } else {
showToast("视频加载异常,请重试."); showToast("加载失败,请稍后重试.");
} }
} }
...@@ -969,7 +969,7 @@ public class AwardActivity extends BaseActivity implements AwardView { ...@@ -969,7 +969,7 @@ public class AwardActivity extends BaseActivity implements AwardView {
if (fullAdException) { if (fullAdException) {
loadCsjFullAd(carrierType); loadCsjFullAd(carrierType);
} else { } else {
showToast("视频加载异常,请重试."); showToast("加载失败,请稍后重试.");
} }
} }
} }
...@@ -1021,7 +1021,7 @@ public class AwardActivity extends BaseActivity implements AwardView { ...@@ -1021,7 +1021,7 @@ public class AwardActivity extends BaseActivity implements AwardView {
if (fullAdException) { if (fullAdException) {
loadCsjFullAd(carrierType); loadCsjFullAd(carrierType);
} else { } else {
showToast("视频加载异常,请重试."); showToast("加载失败,请稍后重试.");
} }
} }
...@@ -1094,7 +1094,7 @@ public class AwardActivity extends BaseActivity implements AwardView { ...@@ -1094,7 +1094,7 @@ public class AwardActivity extends BaseActivity implements AwardView {
// showToast("视频加载异常,请重试!"); // showToast("视频加载异常,请重试!");
// } // }
showToast("视频加载异常,请重试."); showToast("加载失败,请稍后重试.");
} }
@Override @Override
...@@ -1168,7 +1168,7 @@ public class AwardActivity extends BaseActivity implements AwardView { ...@@ -1168,7 +1168,7 @@ public class AwardActivity extends BaseActivity implements AwardView {
// } else { // } else {
// showToast("视频加载异常,请重试!"); // showToast("视频加载异常,请重试!");
// } // }
showToast("视频加载异常,请重试."); showToast("加载失败,请稍后重试.");
} }
} }
}); });
......
...@@ -8,9 +8,8 @@ import com.mints.highgold.mvp.presenters.CsVedioPresenter ...@@ -8,9 +8,8 @@ import com.mints.highgold.mvp.presenters.CsVedioPresenter
import com.mints.highgold.mvp.views.CsVedioView import com.mints.highgold.mvp.views.CsVedioView
import com.mints.highgold.ui.activitys.base.BaseActivity import com.mints.highgold.ui.activitys.base.BaseActivity
import com.mints.highgold.utils.LogUtil import com.mints.highgold.utils.LogUtil
import com.toukeads.ads.Ad import com.toukeads.ads.video.listener.VideoCallback
import com.toukeads.ads.annotation.AdRequestType import com.toukeads.code.annotation.AdRequestType
import com.toukeads.ads.listener.out.VideoCallback
import kotlinx.android.synthetic.main.activity_cs_vedio.* import kotlinx.android.synthetic.main.activity_cs_vedio.*
import java.util.* import java.util.*
......
...@@ -713,7 +713,7 @@ public class DrinkClockActivity extends BaseActivity implements DrinkClockView, ...@@ -713,7 +713,7 @@ public class DrinkClockActivity extends BaseActivity implements DrinkClockView,
// mttRewardVideoAd.showRewardVideoAd(DrinkClockActivity.this, TTAdConstant.RitScenes.CUSTOMIZE_SCENES, "scenes_test"); // mttRewardVideoAd.showRewardVideoAd(DrinkClockActivity.this, TTAdConstant.RitScenes.CUSTOMIZE_SCENES, "scenes_test");
mttRewardVideoAd = null; mttRewardVideoAd = null;
} else { } else {
showToast("视频加载异常,请再次点击"); showToast("加载失败,请稍后重试");
} }
} }
......
...@@ -479,7 +479,7 @@ public class DrinkTeaActivity extends BaseActivity ...@@ -479,7 +479,7 @@ public class DrinkTeaActivity extends BaseActivity
// mttRewardVideoAd.showRewardVideoAd(DrinkClockActivity.this, TTAdConstant.RitScenes.CUSTOMIZE_SCENES, "scenes_test"); // mttRewardVideoAd.showRewardVideoAd(DrinkClockActivity.this, TTAdConstant.RitScenes.CUSTOMIZE_SCENES, "scenes_test");
mttRewardVideoAd = null; mttRewardVideoAd = null;
} else { } else {
showToast("视频加载异常,请再次点击"); showToast("加载失败,请稍后重试");
} }
} }
......
...@@ -441,7 +441,7 @@ public class EraseActivity extends BaseActivity ...@@ -441,7 +441,7 @@ public class EraseActivity extends BaseActivity
public void onError(int code, String message) { public void onError(int code, String message) {
hideLoading(); hideLoading();
showToast("视频加载异常,请重试"); showToast("加载失败,请稍后重试");
} }
//视频广告加载后,视频资源缓存到本地的回调,在此回调后,播放本地视频,流畅不阻塞。 //视频广告加载后,视频资源缓存到本地的回调,在此回调后,播放本地视频,流畅不阻塞。
...@@ -458,7 +458,7 @@ public class EraseActivity extends BaseActivity ...@@ -458,7 +458,7 @@ public class EraseActivity extends BaseActivity
} else { } else {
hideLoading(); hideLoading();
showToast("视频加载异常,请再次重试"); showToast("加载失败,请稍后重试");
} }
} }
......
...@@ -156,7 +156,7 @@ public class HytechVedioActivity extends BaseActivity ...@@ -156,7 +156,7 @@ public class HytechVedioActivity extends BaseActivity
} }
}); });
} else { } else {
showToast("视频加载异常,请重试."); showToast("加载失败,请稍后重试.");
finish(); finish();
return; return;
} }
......
...@@ -450,7 +450,7 @@ public class TurntableActivity extends BaseActivity ...@@ -450,7 +450,7 @@ public class TurntableActivity extends BaseActivity
public void onError(int code, String message) { public void onError(int code, String message) {
hideLoading(); hideLoading();
showToast("视频加载异常,请重试"); showToast("加载失败,请稍后重试");
} }
//视频广告加载后,视频资源缓存到本地的回调,在此回调后,播放本地视频,流畅不阻塞。 //视频广告加载后,视频资源缓存到本地的回调,在此回调后,播放本地视频,流畅不阻塞。
...@@ -468,7 +468,7 @@ public class TurntableActivity extends BaseActivity ...@@ -468,7 +468,7 @@ public class TurntableActivity extends BaseActivity
} else { } else {
hideLoading(); hideLoading();
showToast("视频加载异常,请再次重试"); showToast("加载失败,请稍后重试");
} }
} }
......
...@@ -480,8 +480,8 @@ public class MainFragment extends BaseFragment ...@@ -480,8 +480,8 @@ public class MainFragment extends BaseFragment
// data.setVedioplan_hytech_vedio_rate(0); // data.setVedioplan_hytech_vedio_rate(0);
// data.setVedioplan_mintegral_vedio_rate(0); // data.setVedioplan_mintegral_vedio_rate(0);
// data.setVedioplan_coral_vedio_rate(0); // data.setVedioplan_coral_vedio_rate(0);
// data.setVedioplan_domob_vedio_rate(10); // data.setVedioplan_domob_vedio_rate(0);
// data.setVedioplan_chuangshen_vedio_rate(0); // data.setVedioplan_chuangshen_vedio_rate(10);
// //
// data.setVedioplan_csj_vedio_surplus(0); // data.setVedioplan_csj_vedio_surplus(0);
// data.setVedioplan_lyh_vedio_surplus(0); // data.setVedioplan_lyh_vedio_surplus(0);
...@@ -489,8 +489,8 @@ public class MainFragment extends BaseFragment ...@@ -489,8 +489,8 @@ public class MainFragment extends BaseFragment
// data.setVedioplan_hytech_vedio_surplus(0); // data.setVedioplan_hytech_vedio_surplus(0);
// data.setVedioplan_mintegral_vedio_surplus(0); // data.setVedioplan_mintegral_vedio_surplus(0);
// data.setVedioplan_coral_vedio_surplus(0); // data.setVedioplan_coral_vedio_surplus(0);
// data.setVedioplan_domob_vedio_surplus(10); // data.setVedioplan_domob_vedio_surplus(0);
// data.setVedioplan_chuangshen_vedio_surplus(0); // data.setVedioplan_chuangshen_vedio_surplus(10);
// 设置随机广告权重 // 设置随机广告权重
if (vedioAdingManager != null) { if (vedioAdingManager != null) {
...@@ -1406,7 +1406,7 @@ public class MainFragment extends BaseFragment ...@@ -1406,7 +1406,7 @@ public class MainFragment extends BaseFragment
@Override @Override
public void vedioAdingListenerFail(String adType) { public void vedioAdingListenerFail(String adType) {
hideLoading(); hideLoading();
showToast("视频加载异常,请重试!"); showToast("加载失败,请稍后重试!");
LogUtil.d(TAG, "内部 vedioAdingListenerFail adType:" + adType); LogUtil.d(TAG, "内部 vedioAdingListenerFail adType:" + adType);
} }
......
...@@ -1951,7 +1951,7 @@ public class VersusFragment extends BaseFragment ...@@ -1951,7 +1951,7 @@ public class VersusFragment extends BaseFragment
tvVersusTryplay.setText("重试"); tvVersusTryplay.setText("重试");
} }
showToast("视频加载异常,请重试"); showToast("加载失败,请稍后重试");
} }
//视频广告加载后,视频资源缓存到本地的回调,在此回调后,播放本地视频,流畅不阻塞。 //视频广告加载后,视频资源缓存到本地的回调,在此回调后,播放本地视频,流畅不阻塞。
...@@ -1974,7 +1974,7 @@ public class VersusFragment extends BaseFragment ...@@ -1974,7 +1974,7 @@ public class VersusFragment extends BaseFragment
tvVersusTryplay.setText("重试"); tvVersusTryplay.setText("重试");
} }
showToast("视频加载异常,请再次重试"); showToast("加载失败,请稍后重试");
} }
} }
...@@ -2207,7 +2207,7 @@ public class VersusFragment extends BaseFragment ...@@ -2207,7 +2207,7 @@ public class VersusFragment extends BaseFragment
@Override @Override
public void vedioAdingListenerFail(String adType) { public void vedioAdingListenerFail(String adType) {
hideLoading(); hideLoading();
showToast("视频加载异常,请重试!"); showToast("加载失败,请稍后重试!");
LogUtil.d(TAG, "内部 vedioAdingListenerFail adType:" + adType); LogUtil.d(TAG, "内部 vedioAdingListenerFail adType:" + adType);
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.toukeads.ads.network.AdVideoView <com.toukeads.ads.video.network.AdVideoView
android:id="@+id/csAdVideoView" android:id="@+id/csAdVideoView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment