Commit d22b8123 authored by mengcuiguang's avatar mengcuiguang

按渠道更新代码位

parent 6d02663d
......@@ -106,7 +106,7 @@ android {
productFlavors {
goodmoneypkg {}
// toutiao {}
// share_goodmoney {}
// sougou_123 {}
}
productFlavors.all {
......
......@@ -99,6 +99,11 @@ public class MintsApplication extends MultiDexApplication {
// 移动安全联盟 oaid
initMiitHelper();
// 按包渠道更新代码位
TtCsjAdManager.updataIdByChannel();
YlhAdManager.INSTANCE.updataIdByChannel();
// 子线程初始化三方SDK
String processName = SystemUtils.INSTANCE.getProcessName(this, android.os.Process.myPid());
if (processName != null) {
......
package com.mints.goodmoney.ad.video;
import android.app.Activity;
import android.text.TextUtils;
import com.bytedance.sdk.openadsdk.AdSlot;
import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTRewardVideoAd;
import com.mints.goodmoney.BuildConfig;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.manager.TTNativeExpressManager;
import com.mints.goodmoney.manager.TrackManager;
......@@ -14,6 +16,7 @@ import com.mints.goodmoney.manager.TtCsjAdManager;
import com.mints.goodmoney.manager.UserManager;
import com.mints.goodmoney.utils.LogUtil;
import com.mints.goodmoney.utils.MD5;
import com.mints.library.utils.CommonUtils;
import com.mints.library.utils.json.JsonUtil;
import net.grandcentrix.tray.AppPreferences;
......
......@@ -3,12 +3,14 @@ package com.mints.goodmoney.ad.video;
import android.app.Activity;
import android.os.SystemClock;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.manager.TrackManager;
import com.mints.goodmoney.manager.YlhAdManager;
import com.mints.goodmoney.mvp.presenters.YlhVedioAdPresenter;
import com.mints.goodmoney.mvp.views.VedioAdManagerView;
import com.mints.goodmoney.utils.LogUtil;
import com.mints.goodmoney.utils.ToastUtil;
import com.qq.e.ads.rewardvideo.RewardVideoAD;
import com.qq.e.ads.rewardvideo.RewardVideoADListener;
import com.qq.e.comm.util.AdError;
......@@ -70,30 +72,53 @@ public class YlhVedioAdManager extends BaseVideoAd implements VedioAdManagerView
isClickScreen = true;
String ylhPostId;
// switch (carrierType) {
// case Constant.CARRIER_VERSUS_VIDEO:// 每日任务视频
// ylhPostId = YlhAdManager.YLH_AD_VEDIO_MAIN_POSTID;
// break;
// case Constant.CARRIER_OFFLINE_DOUBLE:// 离线收益翻倍
// case Constant.CARRIER_SIGNIN_HOMEPAGE_CARD:// 签到翻倍
// case Constant.CARRIER_WALK_BUBBLE:// 汽泡
// ylhPostId = YlhAdManager.YLH_AD_VEDIO_MOREDIALOG_POSTID;
// break;
// case Constant.CARRIER_HOMEWATER:// 喝水
// ylhPostId = YlhAdManager.YLH_AD_VEDIO_DRINK_POSTID;
// break;
// case Constant.CARRIER_CHALLENGE_TURN:// 大转盘
// case Constant.CARRIER_DRAWCASH:// 提现
// ylhPostId = YlhAdManager.YLH_AD_VEDIO_TURNABLE_POSTID;
// break;
// case Constant.CARRIER_CHALLENGE_CARD:// 刮刮乐
// ylhPostId = YlhAdManager.YLH_AD_VEDIO_ERASE_POSTID;
// break;
// default:// 在线收益翻倍
// ylhPostId = YlhAdManager.YLH_AD_VEDIO_MOREDIALOG_POSTID;
// break;
// }
switch (carrierType) {
case Constant.CARRIER_VERSUS_VIDEO:// 每日任务视频
ylhPostId = YlhAdManager.YLH_AD_VEDIO_MAIN_POSTID;
ylhPostId = YlhAdManager.INSTANCE.getYLH_AD_VEDIO_MAIN_POSTID();
break;
case Constant.CARRIER_OFFLINE_DOUBLE:// 离线收益翻倍
case Constant.CARRIER_SIGNIN_HOMEPAGE_CARD:// 签到翻倍
case Constant.CARRIER_WALK_BUBBLE:// 汽泡
ylhPostId = YlhAdManager.YLH_AD_VEDIO_MOREDIALOG_POSTID;
ylhPostId = YlhAdManager.INSTANCE.getYLH_AD_VEDIO_MOREDIALOG_POSTID();
break;
case Constant.CARRIER_HOMEWATER:// 喝水
ylhPostId = YlhAdManager.YLH_AD_VEDIO_DRINK_POSTID;
ylhPostId = YlhAdManager.INSTANCE.getYLH_AD_VEDIO_DRINK_POSTID();
break;
case Constant.CARRIER_CHALLENGE_TURN:// 大转盘
case Constant.CARRIER_DRAWCASH:// 提现
ylhPostId = YlhAdManager.YLH_AD_VEDIO_TURNABLE_POSTID;
ylhPostId = YlhAdManager.INSTANCE.getYLH_AD_VEDIO_TURNABLE_POSTID();
break;
case Constant.CARRIER_CHALLENGE_CARD:// 刮刮乐
ylhPostId = YlhAdManager.YLH_AD_VEDIO_ERASE_POSTID;
ylhPostId = YlhAdManager.INSTANCE.getYLH_AD_VEDIO_ERASE_POSTID();
break;
default:// 在线收益翻倍
ylhPostId = YlhAdManager.YLH_AD_VEDIO_MOREDIALOG_POSTID;
ylhPostId = YlhAdManager.INSTANCE.getYLH_AD_VEDIO_MOREDIALOG_POSTID();
break;
}
ToastUtil.showLong(MintsApplication.getContext(), "ylh vedio:" + ylhPostId);
if (rewardVideoAD != null) {
rewardVideoAD = null;
}
......
package com.mints.goodmoney.manager
/**
* 渠道管理, 根据渠道名称 调用不同的代码位
*/
object ChannelManager {
const val CHANNEL_XIAOJUJI = "xiaojuji"
const val CHANNEL_ZITOU = "zitou"
const val CHANNEL_QIAOSHUI = "qiaoshui"
const val CHANNEL_SOUGOU = "sougou"
const val CHANNEL_QUTOUTIAO = "qutoutiao"
}
\ No newline at end of file
......@@ -95,10 +95,10 @@ public class LiebaoManager {
CmGameAppInfo.GDTAdInfo gdtAdInfo = new CmGameAppInfo.GDTAdInfo();
gdtAdInfo.setAppId(YlhAdManager.YLH_AD_APPID); // 广点通的APPID
// 游戏内广告场景;
gdtAdInfo.setRewardVideoId(YlhAdManager.YLH_AD_VEDIO_GAME_POSTID); // 激励视频
gdtAdInfo.setGameLoadInterId(YlhAdManager.YLH_AD_INTERSTITIALAD_LIEBAO);//游戏加载中的插屏
gdtAdInfo.setRewardVideoId(YlhAdManager.INSTANCE.getYLH_AD_VEDIO_GAME_POSTID()); // 激励视频
gdtAdInfo.setGameLoadInterId(YlhAdManager.INSTANCE.getYLH_AD_INTERSTITIALAD_LIEBAO());//游戏加载中的插屏
// gdtAdInfo.setBannerId(YlhAdManager.YLH_AD_BANNER_LIEBAO); // banner广告
gdtAdInfo.setPlayGameInterId(YlhAdManager.YLH_AD_INTERSTITIALAD_LIEBAO);//游戏进行中关卡插屏
gdtAdInfo.setPlayGameInterId(YlhAdManager.INSTANCE.getYLH_AD_INTERSTITIALAD_LIEBAO());//游戏进行中关卡插屏
cmGameAppInfo.setGdtAdInfo(gdtAdInfo);
//
......
......@@ -11,6 +11,7 @@ import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTAppDownloadListener;
import com.bytedance.sdk.openadsdk.TTNativeExpressAd;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.utils.ToastUtil;
import java.util.List;
......@@ -67,6 +68,8 @@ public class TTNativeExpressManager {
* @param viewHeight
*/
private void getTtNativeExpress(String codeId, FrameLayout view, float viewWidth, float viewHeight) {
ToastUtil.showLong(MintsApplication.getContext(), "通用信息流:" + codeId);
// Context context= MintsApplication.getContext();
//step4:创建广告请求参数AdSlot,具体参数含义参考文档
AdSlot adSlot = new AdSlot.Builder()
......
......@@ -5,10 +5,12 @@ import android.os.Handler;
import android.os.HandlerThread;
import android.os.Message;
import android.widget.FrameLayout;
import android.widget.Toast;
import androidx.annotation.NonNull;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.utils.ToastUtil;
public class TTPreLoadCarrierExpressManager {
......@@ -101,6 +103,8 @@ public class TTPreLoadCarrierExpressManager {
public void loadTtFrameLayout(String codeId) {
init();
ToastUtil.showLong(MintsApplication.getContext(), "信息流:" + codeId);
if (mWorkHandler != null) {
Message msg = Message.obtain();
msg.what = mTTPreLoadWhat;
......
......@@ -6,7 +6,9 @@ import com.bytedance.sdk.openadsdk.TTAdConfig;
import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.bytedance.sdk.openadsdk.TTAdSdk;
import com.mints.goodmoney.BuildConfig;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.Constant;
import com.mints.library.utils.CommonUtils;
/**
* 穿山甲广告
......@@ -16,34 +18,33 @@ public class TtCsjAdManager {
public static final String TT_AD_APPID = "5113521";
public static final String TT_AD_NAME = Constant.MINTS_APP_NAME;
// 按渠道划分代码位
//============================== 版本升级、分享 START ==============================
/*banner*/
public static final String TT_AD_BANNER_MY = "945661050";// 个人中心
public static final String TT_AD_BANNER_JULEYUN = "945675532";// 聚乐云
public static String TT_AD_BANNER_MY = "945661050";// 个人中心
public static String TT_AD_BANNER_JULEYUN = "945675532";// 聚乐云
/*激励视频*/
public static final String TT_AD_VEDIO_MAIN_DEV = "945561938";// 开发使用
public static final String TT_AD_VEDIO_DRINK = "945562032";//喝水打卡
public static final String TT_AD_VEDIO_MAIN = "945562036";// 我的界面视频
public static final String TT_AD_VEDIO_ERASE = "945562037";// 刮刮乐
public static final String TT_AD_VEDIO_TURNABLE = "945562039";// 大转盘
public static final String TT_AD_VEDIO_MOREDIALOG = "945562040";// 签到、气泡、离线弹框
public static final String TT_AD_VEDIO_GAME = "945562067";// 猎豹
public static final String TT_AD_VEDIO_JULEYUN = "945675529";// 聚乐云
public static String TT_AD_VEDIO_MAIN_DEV = "945561938";// 开发使用
public static String TT_AD_VEDIO_DRINK = "945562032";//喝水打卡
public static String TT_AD_VEDIO_MAIN = "945562036";// 我的界面视频
public static String TT_AD_VEDIO_ERASE = "945562037";// 刮刮乐
public static String TT_AD_VEDIO_TURNABLE = "945562039";// 大转盘
public static String TT_AD_VEDIO_MOREDIALOG = "945562040";// 签到、气泡、离线弹框
public static String TT_AD_VEDIO_GAME = "945562067";// 猎豹
public static String TT_AD_VEDIO_JULEYUN = "945675529";// 聚乐云
/*信息流*/
public static final String TT_AD_NATIVEEXPRESS_AWARD = "945562047";//信息流弹窗
public static final String TT_AD_NATIVEEXPRESS_WALK = "945562480";//走路
public static final String TT_AD_NATIVEEXPRESS_WATER = "945562698";//喝水
public static final String TT_AD_NATIVEEXPRESS_MORNINGCLOCK = "945627921";//早上打卡
public static final String TT_AD_NATIVEEXPRESS_EAT = "945627922";//餐补
public static final String TT_AD_NATIVEEXPRESS_ID_LIEBAO_LISTEXIT = "945562050";//猎豹列表和退出
public static String TT_AD_NATIVEEXPRESS_AWARD = "945562047";//信息流弹窗
public static String TT_AD_NATIVEEXPRESS_WALK = "945562480";//走路
public static String TT_AD_NATIVEEXPRESS_WATER = "945562698";//喝水
public static String TT_AD_NATIVEEXPRESS_MORNINGCLOCK = "945627921";//早上打卡
public static String TT_AD_NATIVEEXPRESS_EAT = "945627922";//餐补
public static String TT_AD_NATIVEEXPRESS_ID_LIEBAO_LISTEXIT = "945562050";//猎豹列表和退出
/*全屏广告*/
public static final String TT_AD_ALLVEDIO_ID_LIEBAO = "945562481";//猎豹全屏带跳过按钮
public static String TT_AD_ALLVEDIO_ID_LIEBAO = "945562481";//猎豹全屏带跳过按钮
/*插屏广告*/
public static final String TT_AD_INSERT_LOADING_ID_LIEBAO = "945608874";//猎豹游戏加载时
public static final String TT_AD_INSERT_LOADING_ID_JULEYUN = "945675533";//聚乐云
public static String TT_AD_INSERT_LOADING_ID_LIEBAO = "945608874";//猎豹游戏加载时
public static String TT_AD_INSERT_LOADING_ID_JULEYUN = "945675533";//聚乐云
//============================== 版本升级、分享 END ==============================
private static boolean sInit;
......@@ -91,4 +92,65 @@ public class TtCsjAdManager {
//.httpStack(new MyOkStack3())//自定义网络库,demo中给出了okhttp3版本的样例,其余请自行开发或者咨询工作人员。
.build();
}
/**
* 按包渠道更新代码位
*/
public static void updataIdByChannel() {
String channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME");
if (channel.contains(ChannelManager.CHANNEL_ZITOU)
|| channel.contains(ChannelManager.CHANNEL_XIAOJUJI)
|| channel.contains(ChannelManager.CHANNEL_QIAOSHUI)) {
// 信息流
TT_AD_NATIVEEXPRESS_AWARD = "945666217";
TT_AD_NATIVEEXPRESS_WALK = "945666097";
TT_AD_NATIVEEXPRESS_WATER = "945666097";
TT_AD_NATIVEEXPRESS_MORNINGCLOCK = "945666097";
TT_AD_NATIVEEXPRESS_EAT = "945666097";
// 激励视频
TT_AD_VEDIO_DRINK = "945666029";
TT_AD_VEDIO_MAIN = "945666029";
TT_AD_VEDIO_ERASE = "945666029";
TT_AD_VEDIO_TURNABLE = "945666029";
TT_AD_VEDIO_MOREDIALOG = "945666029";
// banner
TT_AD_BANNER_MY="945666042";
} else if (channel.contains(ChannelManager.CHANNEL_SOUGOU)) {
// 信息流
TT_AD_NATIVEEXPRESS_AWARD = "945666318";
TT_AD_NATIVEEXPRESS_WALK = "945666243";
TT_AD_NATIVEEXPRESS_WATER = "945666243";
TT_AD_NATIVEEXPRESS_MORNINGCLOCK = "945666243";
TT_AD_NATIVEEXPRESS_EAT = "945666243";
// 激励视频
TT_AD_VEDIO_DRINK = "945666260";
TT_AD_VEDIO_MAIN = "945666260";
TT_AD_VEDIO_ERASE = "945666260";
TT_AD_VEDIO_TURNABLE = "945666260";
TT_AD_VEDIO_MOREDIALOG = "945666260";
// banner
TT_AD_BANNER_MY="945666251";
} else if (channel.contains(ChannelManager.CHANNEL_QUTOUTIAO)) {
// 信息流
TT_AD_NATIVEEXPRESS_AWARD = "945681112";
TT_AD_NATIVEEXPRESS_WALK = "945681145";
TT_AD_NATIVEEXPRESS_WATER = "945681145";
TT_AD_NATIVEEXPRESS_MORNINGCLOCK = "945681145";
TT_AD_NATIVEEXPRESS_EAT = "945681145";
// 激励视频
TT_AD_VEDIO_DRINK = "945681060";
TT_AD_VEDIO_MAIN = "945681060";
TT_AD_VEDIO_ERASE = "945681060";
TT_AD_VEDIO_TURNABLE = "945681060";
TT_AD_VEDIO_MOREDIALOG = "945681060";
// banner
TT_AD_BANNER_MY="945681032";
}
}
}
package com.mints.goodmoney.manager
import android.content.Context
import com.mints.goodmoney.MintsApplication
import com.mints.library.utils.CommonUtils
import com.qq.e.comm.managers.GDTADManager
/**
......@@ -13,28 +15,27 @@ object YlhAdManager {
const val YLH_AD_APPID = "1111046903"
// 按渠道划分代码位
//============================== 版本升级、分享 START ==============================
/* splash-postid */
const val YLH_AD_SPLASH_POSTID = "7021944730189381"
var YLH_AD_SPLASH_POSTID = "7021944730189381"
/* vedio-postid */
const val YLH_AD_VEDIO_DRINK_POSTID = "2031043750380462" //喝水打卡
const val YLH_AD_VEDIO_MAIN_POSTID = "8081940760988417" //我的界面视频
const val YLH_AD_VEDIO_ERASE_POSTID = "9061142700180449" //挑战刮刮乐
const val YLH_AD_VEDIO_TURNABLE_POSTID = "5051746700185561" //大转盘
const val YLH_AD_VEDIO_MOREDIALOG_POSTID = "9001346780383626" //签到、气泡、离线弹框
const val YLH_AD_VEDIO_GAME_POSTID = "9051646750686770" //猎豹游戏
const val YLH_AD_VEDIO_JULEYUN_POSTID = "1011746770898338" //聚乐云
var YLH_AD_VEDIO_DRINK_POSTID = "2031043750380462" //喝水打卡
var YLH_AD_VEDIO_MAIN_POSTID = "8081940760988417" //我的界面视频
var YLH_AD_VEDIO_ERASE_POSTID = "9061142700180449" //挑战刮刮乐
var YLH_AD_VEDIO_TURNABLE_POSTID = "5051746700185561" //大转盘
var YLH_AD_VEDIO_MOREDIALOG_POSTID = "9001346780383626" //签到、气泡、离线弹框
var YLH_AD_VEDIO_GAME_POSTID = "9051646750686770" //猎豹游戏
var YLH_AD_VEDIO_JULEYUN_POSTID = "1011746770898338" //聚乐云
/*信息流*/
const val YLH_AD_NATIVEEXPRESS_JULEYUN = "8041941770890627" //聚乐云
var YLH_AD_NATIVEEXPRESS_JULEYUN = "8041941770890627" //聚乐云
/* 插屏 */
const val YLH_AD_INTERSTITIALAD_LIEBAO = "1021648750986824" //猎豹
const val YLH_AD_INTERSTITIALAD_JULEYUN = "4051047730890430" //聚乐云
var YLH_AD_INTERSTITIALAD_LIEBAO = "1021648750986824" //猎豹
var YLH_AD_INTERSTITIALAD_JULEYUN = "4051047730890430" //聚乐云
//============================== 版本升级、分享 END ==============================
/**
* 广告初始化
......@@ -43,4 +44,43 @@ object YlhAdManager {
GDTADManager.getInstance().initWith(context, YLH_AD_APPID)
}
/**
* 按包渠道更新代码位
*/
fun updataIdByChannel() {
val channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
if (channel.contains(ChannelManager.CHANNEL_ZITOU)
|| channel.contains(ChannelManager.CHANNEL_XIAOJUJI)
|| channel.contains(ChannelManager.CHANNEL_QIAOSHUI)) {
// 开屏
YLH_AD_SPLASH_POSTID = "4031840694338658"
// 激励视频
YLH_AD_VEDIO_DRINK_POSTID = "7091944614237712"
YLH_AD_VEDIO_MAIN_POSTID = "7091944614237712"
YLH_AD_VEDIO_ERASE_POSTID = "7091944614237712"
YLH_AD_VEDIO_TURNABLE_POSTID = "7091944614237712"
YLH_AD_VEDIO_MOREDIALOG_POSTID = "7091944614237712"
} else if (channel.contains(ChannelManager.CHANNEL_SOUGOU)) {
// 开屏
YLH_AD_SPLASH_POSTID = "7081140694738761"
// 激励视频
YLH_AD_VEDIO_DRINK_POSTID = "8081841664335704"
YLH_AD_VEDIO_MAIN_POSTID = "8081841664335704"
YLH_AD_VEDIO_ERASE_POSTID = "8081841664335704"
YLH_AD_VEDIO_TURNABLE_POSTID = "8081841664335704"
YLH_AD_VEDIO_MOREDIALOG_POSTID = "8081841664335704"
} else if (channel.contains(ChannelManager.CHANNEL_QUTOUTIAO)) {
// 开屏
YLH_AD_SPLASH_POSTID = "8001943784580831"
// 激励视频
YLH_AD_VEDIO_DRINK_POSTID = "1001649784690072"
YLH_AD_VEDIO_MAIN_POSTID = "1001649784690072"
YLH_AD_VEDIO_ERASE_POSTID = "1001649784690072"
YLH_AD_VEDIO_TURNABLE_POSTID = "1001649784690072"
YLH_AD_VEDIO_MOREDIALOG_POSTID = "1001649784690072"
}
}
}
\ No newline at end of file
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