Commit 7679d37c authored by mengcuiguang's avatar mengcuiguang

1.0.5提交

parent 5da9d27c
...@@ -9,8 +9,8 @@ android { ...@@ -9,8 +9,8 @@ android {
applicationId "com.mints.fairyland" applicationId "com.mints.fairyland"
minSdkVersion rootProject.ext.androidMinSdkVersion minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 4 versionCode 5
versionName "1.0.4" versionName "1.0.5"
flavorDimensions "default" flavorDimensions "default"
// dex突破65535的限制 // dex突破65535的限制
......
package com.mints.fairyland.manager
import android.app.Application
import android.text.TextUtils
import com.bytedance.embedapplog.AppLog
import com.bytedance.embedapplog.InitConfig
import com.bytedance.embedapplog.util.UriConfig
import com.bytedance.hume.readapk.HumeSDK
import com.mints.fairyland.BuildConfig
import com.mints.fairyland.MintsApplication
import com.mints.fairyland.manager.ChannelManager
import com.mints.library.utils.CommonUtils
/**
* 描述:巨量引擎
*/
object TouTiaoRangersManager {
private const val APP_ID = "208609"
/**
* 初始化
*
* 只有头条分包才初始化
*/
fun init(application: Application) {
try {
var channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
if (channel.contains(ChannelManager.CHANNEL_TOUTIAO)) {
// 穿山甲分包渠道
val ttChannel = HumeSDK.getChannel(MintsApplication.getContext())
if (!TextUtils.isEmpty(ttChannel)) {
// appid和渠道,appid须保证与广告后台申请记录一致,渠道可自定义,如有多个马甲包建议设置渠道号唯一标识一个马甲包。
val config = InitConfig(APP_ID, channel + "_" + ttChannel)
// 域名默认国内: DEFAULT
config.setUriConfig(UriConfig.DEFAULT);
// 是否在控制台输出日志,可用于观察用户行为日志上报情况,建议仅在调试时使用,release版本请设置为false !
AppLog.setEnableLog(BuildConfig.DEBUG)
AppLog.init(application, config)
}
}
} catch (e: Exception) {
e.printStackTrace()
}
}
}
\ No newline at end of file
...@@ -8,6 +8,7 @@ import com.mints.fairyland.MintsApplication ...@@ -8,6 +8,7 @@ import com.mints.fairyland.MintsApplication
import com.mints.fairyland.R import com.mints.fairyland.R
import com.mints.fairyland.common.AppConfig import com.mints.fairyland.common.AppConfig
import com.mints.fairyland.common.Constant import com.mints.fairyland.common.Constant
import com.mints.fairyland.common.DeviceInfo
import com.mints.fairyland.ui.activitys.base.BaseActivity import com.mints.fairyland.ui.activitys.base.BaseActivity
import com.mints.fairyland.utils.ToastUtil import com.mints.fairyland.utils.ToastUtil
import com.mints.library.utils.CommonUtils import com.mints.library.utils.CommonUtils
...@@ -36,6 +37,7 @@ class AboutusActivity : BaseActivity(), View.OnClickListener { ...@@ -36,6 +37,7 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
ivAboutasIcon.setOnLongClickListener { ivAboutasIcon.setOnLongClickListener {
ToastUtil.showLong(MintsApplication.getContext(), "自有渠道:" + CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME") + ToastUtil.showLong(MintsApplication.getContext(), "自有渠道:" + CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME") +
"\n 广告代码位:" + AppConfig.user_channel_ad + "\n 广告代码位:" + AppConfig.user_channel_ad +
"\n versionCode:" + DeviceInfo.instance.versionCode +
"\n 头条渠道:" + HumeSDK.getChannel(context)) "\n 头条渠道:" + HumeSDK.getChannel(context))
true true
} }
......
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