Merge branch 'feat/GHZS-2910' into 'dev'
feat: 关于我们页面新增安装包隐藏信息提示 https://jira.shanqu.cc/browse/GHZS-2910 See merge request halo/android/assistant-android!1212
This commit is contained in:
@ -2,6 +2,7 @@ package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.gamecenter.BuildConfig
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IAppProvider
|
||||
@ -70,6 +71,10 @@ class AppProviderImpl : IAppProvider {
|
||||
return HaloApp.getInstance().flavorProvider
|
||||
}
|
||||
|
||||
override fun getFlavor(): String {
|
||||
return BuildConfig.FLAVOR
|
||||
}
|
||||
|
||||
override fun getIsBrandNewInstall(): Boolean {
|
||||
return HaloApp.getInstance().isBrandNewInstall
|
||||
}
|
||||
|
||||
@ -0,0 +1,48 @@
|
||||
package com.gh.gamecenter.pkg
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.gamecenter.BuildConfig
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.utils.toJsonIgnoredNull
|
||||
import com.gh.gamecenter.core.provider.IPkgConfigProvider
|
||||
import com.halo.assistant.HaloApp
|
||||
|
||||
@Route(path = RouteConsts.provider.pkgConfig, name = "PkgConfig暴露服务")
|
||||
class PkgConfigProviderImpl: IPkgConfigProvider {
|
||||
|
||||
override fun getPkgConfig(): ArrayList<String> {
|
||||
val configList = arrayListOf<String>()
|
||||
|
||||
val sdk = when (BuildConfig.FLAVOR) {
|
||||
"tea" -> "头条"
|
||||
"kuaishou" -> "快手"
|
||||
"gdt" -> "广点通"
|
||||
else -> "普通包"
|
||||
} + " " + BuildConfig.SDK_VERSION + " (仅头条有效)"
|
||||
|
||||
val coreEvent = if (PkgHelper.getCoreEventGameCategory() == "online") {
|
||||
"网游"
|
||||
} else {
|
||||
"普通"
|
||||
}
|
||||
|
||||
configList.add(sdk)
|
||||
if (BuildConfig.FLAVOR == "kuaishou") {
|
||||
configList.add("appid: ${BuildConfig.SDK_APP_ID.ifEmpty { "81537" }}")
|
||||
configList.add("appname: ${BuildConfig.SDK_APP_NAME.ifEmpty { "guanghuanzhushou_1"}}")
|
||||
}
|
||||
|
||||
configList.add(HaloApp.getInstance().channel)
|
||||
configList.add("${PkgHelper.getActivateRatio()}%")
|
||||
configList.add(coreEvent)
|
||||
configList.add(PkgHelper.getPkgConfigLink()?.toJsonIgnoredNull() ?: "")
|
||||
|
||||
return configList
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
}
|
||||
@ -11,6 +11,7 @@ import com.gh.gamecenter.core.utils.SPUtils
|
||||
import java.nio.charset.Charset
|
||||
|
||||
object PkgHelper {
|
||||
private var mTempPkgConfigEntity : PkgConfigEntity.PkgLinkEntity? = null
|
||||
|
||||
private var mPkgConfigLink: PkgConfigEntity.PkgLinkEntity? = null
|
||||
private const val SP_PKG_CONFIG_IS_USED = "pkg_config_is_used"
|
||||
@ -49,6 +50,8 @@ object PkgHelper {
|
||||
mPkgConfigLink =
|
||||
String(Base64.decode(BuildConfig.FIRST_LAUNCH, Base64.DEFAULT), Charset.defaultCharset()).toObject()
|
||||
|
||||
mTempPkgConfigEntity = mPkgConfigLink
|
||||
|
||||
return if (isFromHomeTopTab) {
|
||||
if (mPkgConfigLink?.shouldStayAtHomePage != true && mPkgConfigLink?.homeBottomTab == "home") {
|
||||
markConfigUsed()
|
||||
@ -61,6 +64,10 @@ object PkgHelper {
|
||||
}
|
||||
}
|
||||
|
||||
if (mPkgConfigLink != null) {
|
||||
mTempPkgConfigEntity = mPkgConfigLink
|
||||
}
|
||||
|
||||
return mPkgConfigLink
|
||||
}
|
||||
|
||||
@ -80,7 +87,10 @@ object PkgHelper {
|
||||
mActivateRatioFromInternet = it.data?.activateRatio ?: 0
|
||||
mCoreEventGameCategory = it.data?.coreEventGameCategory
|
||||
}
|
||||
}
|
||||
|
||||
fun getPkgConfigLink(): PkgConfigEntity.PkgLinkEntity? {
|
||||
return mTempPkgConfigEntity
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user