diff --git a/app/build.gradle b/app/build.gradle index b737287f82..92b8f8cdd9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -125,15 +125,11 @@ android { } } - flavorDimensions "nonsense" + flavorDimensions ("env") - /** - * 多渠道打包,渠道请参考"channel.txt"文件,所有渠道值均通过java code设置 - */ productFlavors { - // publish release host publish { - dimension "nonsense" + dimension "env" buildConfigField "String", "API_HOST", "\"${API_HOST}\"" buildConfigField "String", "SENSITIVE_API_HOST", "\"${SENSITIVE_API_HOST}\"" @@ -142,9 +138,8 @@ android { buildConfigField "String", "UMENG_MESSAGE_SECRET", "\"${UMENG_MESSAGE_SECRET}\"" buildConfigField "String", "BUGLY_APPID", "\"${BUGLY_APPID}\"" } - // internal test dev host internal { - dimension "nonsense" + dimension "env" versionNameSuffix "-debug" buildConfigField "String", "API_HOST", "\"${DEV_API_HOST}\"" @@ -288,7 +283,7 @@ dependencies { debugImplementation "com.github.nichbar.chucker:library:$chucker" releaseImplementation "com.github.nichbar.chucker:library-no-op:$chucker" - implementation "com.bytedance.applog:RangersAppLog-Lite-cn:$bytedanceApplog" +// implementation "com.bytedance.applog:RangersAppLog-Lite-cn:$bytedanceApplog" // implementation "com.bytedance.ies.ugc.aweme:opensdk-china-external:$bytedanceAweme" // implementation "com.bytedance.ies.ugc.aweme:opensdk-common:$bytedanceAweme" diff --git a/app/libs/GDTActionSDK.min.1.6.10.aar b/app/libs/GDTActionSDK.min.1.6.10.aar deleted file mode 100644 index 17ddcbc8e3..0000000000 Binary files a/app/libs/GDTActionSDK.min.1.6.10.aar and /dev/null differ diff --git a/app/src/main/java/com/gh/common/util/GdtHelper.kt b/app/src/main/java/com/gh/common/util/GdtHelper.kt index e4ecdc9404..15293e281a 100644 --- a/app/src/main/java/com/gh/common/util/GdtHelper.kt +++ b/app/src/main/java/com/gh/common/util/GdtHelper.kt @@ -3,9 +3,6 @@ package com.gh.common.util import android.app.Application import android.text.TextUtils import com.halo.assistant.HaloApp -import com.lightgame.utils.Utils -import com.qq.gdt.action.GDTAction -import org.json.JSONObject import java.util.* /** @@ -25,15 +22,15 @@ object GdtHelper { const val PLATFORM = "PLATFORM" fun init(application: Application, channel: String) { - if (shouldUseGdtHelper()) { - if (channel == "GH_728") { - GDTAction.init(application, "1111012969", "9d3d9da5b0948a317c03d08f14d445dc") - } else if (channel == "GH_729") { - GDTAction.init(application, "1111013063", "f53dabf458a356b101d99fc4069eb7f1") - } else { - GDTAction.init(application, "1110680399", "f5ddaafbf520d7d7385499232a408d0a") - } - } +// if (shouldUseGdtHelper()) { +// if (channel == "GH_728") { +// GDTAction.init(application, "1111012969", "9d3d9da5b0948a317c03d08f14d445dc") +// } else if (channel == "GH_729") { +// GDTAction.init(application, "1111013063", "f53dabf458a356b101d99fc4069eb7f1") +// } else { +// GDTAction.init(application, "1110680399", "f5ddaafbf520d7d7385499232a408d0a") +// } +// } } fun logAction(type: String) { @@ -44,22 +41,22 @@ object GdtHelper { } fun logAction(type: String, vararg kv: String?) { - try { - val actionParam = JSONObject() - for (i in kv.indices) { - if (i % 2 != 0) { - val key = kv[i - 1] - val value = kv[i] - if (!TextUtils.isEmpty(key) && !TextUtils.isEmpty(value)) { - actionParam.put(key, value) - } - } - } - Utils.log("GDT", "$type + [${kv.joinToString(" , ")}]") - GDTAction.logAction(type, actionParam) - } catch (e: Exception) { - e.printStackTrace() - } +// try { +// val actionParam = JSONObject() +// for (i in kv.indices) { +// if (i % 2 != 0) { +// val key = kv[i - 1] +// val value = kv[i] +// if (!TextUtils.isEmpty(key) && !TextUtils.isEmpty(value)) { +// actionParam.put(key, value) +// } +// } +// } +// Utils.log("GDT", "$type + [${kv.joinToString(" , ")}]") +// GDTAction.logAction(type, actionParam) +// } catch (e: Exception) { +// e.printStackTrace() +// } } // TODO 确认开启的渠道条件 diff --git a/app/src/main/java/com/gh/common/util/TeaHelper.kt b/app/src/main/java/com/gh/common/util/TeaHelper.kt index 8e7a19b091..6363b729e2 100644 --- a/app/src/main/java/com/gh/common/util/TeaHelper.kt +++ b/app/src/main/java/com/gh/common/util/TeaHelper.kt @@ -1,13 +1,6 @@ package com.gh.common.util import android.content.Context -import com.bytedance.applog.AppLog -import com.bytedance.applog.GameReportHelper -import com.bytedance.applog.InitConfig -import com.bytedance.applog.util.UriConfig -import com.gh.common.exposure.meta.MetaUtil -import com.halo.assistant.HaloApp -import com.lightgame.utils.Utils /** * 今日头条的激活统计 SDK https://gitlab.ghzs.com/pm/halo-app-issues/issues/567 @@ -18,22 +11,22 @@ object TeaHelper { @JvmStatic fun init(context: Context, channel: String) { - val config = InitConfig("163824", channel) - config.setUriConfig(UriConfig.DEFAULT) - config.appName = "guanghuan1" - config.setEnablePlay(true) - AppLog.setEnableLog(false) - AppLog.init(context, config) - - AppLog.setOaidObserver { - HaloApp.getInstance().oaid = it.id - Utils.log("oaid is $it.id") - MetaUtil.refreshMeta() - } - - // gameReportHelper ?! - GameReportHelper.onEventRegister("wechat", true) - GameReportHelper.onEventPurchase("gift", "flower", "008", 1, "wechat", "¥", true, 1) +// val config = InitConfig("163824", channel) +// config.setUriConfig(UriConfig.DEFAULT) +// config.appName = "guanghuan1" +// config.setEnablePlay(true) +// AppLog.setEnableLog(false) +// AppLog.init(context, config) +// +// AppLog.setOaidObserver { +// HaloApp.getInstance().oaid = it.id +// Utils.log("oaid is $it.id") +// MetaUtil.refreshMeta() +// } +// +// // gameReportHelper ?! +// GameReportHelper.onEventRegister("wechat", true) +// GameReportHelper.onEventPurchase("gift", "flower", "008", 1, "wechat", "¥", true, 1) } } \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/SplashScreenActivity.java b/app/src/main/java/com/gh/gamecenter/SplashScreenActivity.java index 5068913050..c6a41a1105 100644 --- a/app/src/main/java/com/gh/gamecenter/SplashScreenActivity.java +++ b/app/src/main/java/com/gh/gamecenter/SplashScreenActivity.java @@ -29,11 +29,9 @@ import com.gh.common.constant.Constants; import com.gh.common.dialog.PrivacyDialogFragment; import com.gh.common.util.DataUtils; import com.gh.common.util.DeviceTokenUtils; -import com.gh.common.util.DeviceUtils; import com.gh.common.util.DialogUtils; import com.gh.common.util.EmptyCallback; import com.gh.common.util.GameSubstituteRepositoryHelper; -import com.gh.common.util.GdtHelper; import com.gh.common.util.GsonUtils; import com.gh.common.util.MtaHelper; import com.gh.common.util.PackageUtils; @@ -53,7 +51,6 @@ import com.gh.gamecenter.retrofit.RetrofitManager; import com.halo.assistant.HaloApp; import com.lightgame.download.DownloadEntity; import com.lightgame.download.FileUtils; -import com.qq.gdt.action.ActionType; import org.jetbrains.annotations.NotNull; import org.json.JSONObject; @@ -288,7 +285,7 @@ public class SplashScreenActivity extends BaseActivity { // 在可能获取了相关权限后才初始化SDK/发送激活数据 TeaHelper.init(getApplication(), HaloApp.getInstance().getChannel()); - GdtHelper.INSTANCE.logAction(ActionType.START_APP, GdtHelper.NETWORK_TYPE, DeviceUtils.getNetwork(this)); +// GdtHelper.INSTANCE.logAction(ActionType.START_APP, GdtHelper.NETWORK_TYPE, DeviceUtils.getNetwork(this)); Bundle bundle = getIntent().getExtras(); Intent intent = new Intent(SplashScreenActivity.this, MainActivity.class);