Commit 7a09783f authored by mengcuiguang's avatar mengcuiguang

添加穿山甲applog归因

parent 07a9f42a
...@@ -10,8 +10,8 @@ android { ...@@ -10,8 +10,8 @@ android {
applicationId "com.duben.miaoquplayletu" applicationId "com.duben.miaoquplayletu"
minSdkVersion rootProject.ext.androidMinSdkVersion minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 710 versionCode 711
versionName "7.1.0" versionName "7.1.1"
flavorDimensions "default" flavorDimensions "default"
// dex突破65535的限制 // dex突破65535的限制
...@@ -223,6 +223,13 @@ dependencies { ...@@ -223,6 +223,13 @@ dependencies {
// 穿山甲聚合 接入【穿山甲、快手】 // 穿山甲聚合 接入【穿山甲、快手】
implementation "com.pangle.cn:mediation-sdk:6.1.2.5" implementation "com.pangle.cn:mediation-sdk:6.1.2.5"
// 穿山甲Applog 上报组件(必须)
implementation 'com.bytedance.applog:RangersAppLog-Lite-cn:6.16.3'
// 穿山甲商业化转化组件(必须)
implementation 'com.bytedance.ads:AppConvert:1.3.0.5'
//埋点开发工具,DevTools是 Debug 环境下辅助开发者或测试人员进行应用内埋点验证和 SDK 接入问题排查的组件。请使用 debug 依赖,建议仅在 debug 下做调试
debugImplementation 'com.bytedance.applog:RangersAppLog-DevTools:3.3.4'
// 腾讯播放器 // 腾讯播放器
implementation "com.tencent.liteav:LiteAVSDK_Player:11.3.0.13176" implementation "com.tencent.liteav:LiteAVSDK_Player:11.3.0.13176"
......
...@@ -460,3 +460,9 @@ ...@@ -460,3 +460,9 @@
# ======================= 腾讯播放器 END ================ # ======================= 腾讯播放器 END ================
-keep class com.tencent.** { *; } -keep class com.tencent.** { *; }
# ======================= 腾讯播放器 END ================ # ======================= 腾讯播放器 END ================
# ======================= 穿山甲商业化转化组件 END ================
-keep class com.bytedance.ads.convert.broadcast.common.EncryptionTools {*;}
# ======================= 穿山甲商业化转化组件 END ================
...@@ -11,6 +11,7 @@ import com.downloader.PRDownloader; ...@@ -11,6 +11,7 @@ import com.downloader.PRDownloader;
import com.downloader.PRDownloaderConfig; import com.downloader.PRDownloaderConfig;
import com.duben.miaoquplayletu.ad.TTAdManagerHolder; import com.duben.miaoquplayletu.ad.TTAdManagerHolder;
import com.duben.miaoquplayletu.common.Constant; import com.duben.miaoquplayletu.common.Constant;
import com.duben.miaoquplayletu.manager.CsjAppLogManager;
import com.duben.miaoquplayletu.manager.TXCSDKService; import com.duben.miaoquplayletu.manager.TXCSDKService;
import com.duben.miaoquplayletu.manager.TalkingDataManager; import com.duben.miaoquplayletu.manager.TalkingDataManager;
import com.duben.miaoquplayletu.net.LoanService; import com.duben.miaoquplayletu.net.LoanService;
...@@ -81,6 +82,8 @@ public class MintsApplication extends MultiDexApplication { ...@@ -81,6 +82,8 @@ public class MintsApplication extends MultiDexApplication {
TXCSDKService.init(this); TXCSDKService.init(this);
CsjAppLogManager.INSTANCE.init(this);
TalkingDataManager.INSTANCE.init(this); TalkingDataManager.INSTANCE.init(this);
// PR下载附件 // PR下载附件
...@@ -91,6 +94,7 @@ public class MintsApplication extends MultiDexApplication { ...@@ -91,6 +94,7 @@ public class MintsApplication extends MultiDexApplication {
// bugly // bugly
CrashReport.initCrashReport(this, "d035276c5b", BuildConfig.DEBUG); CrashReport.initCrashReport(this, "d035276c5b", BuildConfig.DEBUG);
} }
/** /**
......
package com.duben.miaoquplayletu.manager
import android.app.Application
import android.text.TextUtils
import com.bytedance.ads.convert.BDConvert
import com.bytedance.applog.AppLog
import com.bytedance.applog.InitConfig
import com.bytedance.applog.util.UriConstants
import com.bytedance.hume.readapk.HumeSDK
import com.duben.miaoquplayletu.MintsApplication
import com.duben.miaoquplayletu.BuildConfig
import com.duben.miaoquplayletu.utils.MateUtils.getAppMetaData
/**
* CsjAppLogManager
*/
object CsjAppLogManager {
fun init(application:Application) {
// 第一个参数APPID: 参考2.1节获取
// 第二个参数CHANNEL: 填写渠道信息,请注意不能为空
val config = InitConfig(BuildConfig.GROMORE_APP_ID, createChannel())
// 设置数据上送地址
config.setUriConfig(UriConstants.DEFAULT)
config.isImeiEnable = false //建议关停获取IMEI(出于合规考虑)
config.isAutoTrackEnabled = false // 全埋点开关,true开启,false关闭
config.isLogEnable = BuildConfig.LOG_DEBUG // true:开启日志,参考4.3节设置logger,false:关闭日志
AppLog.setEncryptAndCompress(true) // 加密开关,true开启,false关闭
config.setEnablePlay(true) // 配置心跳事件(时长统计)
//SDK会采集OAID、ANDROID_ID和其他的设备特征字段,请遵循相关合规要求在隐私弹窗后采集
//传入需要init的AppLog实例,若没有多个AppLog实例,则传入AppLog.getInstance()即可
BDConvert.getInstance().init(application, AppLog.getInstance())
// 如果在 onCreate 阶段初始化拿不到 XXXActivity 则不需要传递第三个参数
AppLog.init(application, config)
AppLog.setHeaderInfo("csj_attribution",1)
}
/**
* 创建渠道
*
* @return
*/
private fun createChannel(): String {
var channel = getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
try {
// 穿山甲分包渠道
val ttChannel = HumeSDK.getChannel(MintsApplication.getContext())
if (!TextUtils.isEmpty(ttChannel)) {
// 此处方式不能修改,已和后端约定
channel = channel + "_" + ttChannel
}
} catch (e: Exception) {
e.printStackTrace()
}
return channel
}
}
\ 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