Compare commits

...

43 Commits

Author SHA1 Message Date
b7a0f3e74b fix: 1. 测试版本没有 从SD卡安装 的问题。2. 重复卸载安装不生效的bug 2024-10-31 16:06:12 +08:00
c75a7444a9 Merge branch 'feat/GHZSCY-5889-therouter' into 'dev'
feat: 光环助手跳转链接规则优化(路由框架切换至 theRouter) https://jira.shanqu.cc/browse/GHZSCY-5889

See merge request halo/android/assistant-android!1925
2024-10-28 17:42:56 +08:00
0ae6279d60 feat: 光环助手跳转链接规则优化(路由框架切换至 theRouter) https://jira.shanqu.cc/browse/GHZSCY-5889 2024-10-28 17:42:56 +08:00
f4b54cbfa0 chore: 版本更新至 5.39.0
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-25 11:23:43 +08:00
8f8ac99dae chore: 版本更新至 5.38.2
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-23 12:37:29 +08:00
0be7db94ad Merge branch 'hotfix/v5.38.1-1111/crashes' into 'release'
修复 5.38.1 的部分闪退问题

See merge request halo/android/assistant-android!1947
2024-10-23 11:52:09 +08:00
ae80359b48 Merge branch 'fix/catch_view_lifecycle_owner_crash' into 'release'
fix: 捕获加载图片时获取ViewLifecycleOwner出现的闪退问题

See merge request halo/android/assistant-android!1946
2024-10-23 11:47:53 +08:00
81281855a1 fix: 修复继续下载 VA 插件异常时的闪退问题(遇到异常尝试重下) https://sentry.shanqu.cc/organizations/lightgame/issues/416793
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-23 11:28:58 +08:00
a5174c6931 fix: 捕获加载图片时获取ViewLifecycleOwner出现的闪退问题 2024-10-23 11:16:36 +08:00
a3cc74afb3 fix: 修复部分位置在处理图片选择回调时处理不合理造成的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/416811
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-23 10:13:39 +08:00
84e78de6fc fix: 当 PackageName 为空时的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/416770
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-23 09:54:50 +08:00
9bf4c73250 chore: 版本更新至 5.38.1
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-22 15:13:34 +08:00
57a222b87a Merge branch 'hotfix/v5.38.0-1110/get_install_list_anr' into 'release'
fix: 修复错误使用全量已安装应用列表进行应用是否已安装判断依据的问题

See merge request halo/android/assistant-android!1945
2024-10-22 10:42:53 +08:00
3e125b90a2 fix: 修复错误使用全量已安装应用列表进行应用是否已安装判断依据的问题
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-22 10:32:33 +08:00
1809265d4f Merge branch 'fix/sentry-415534' into 'release'
fixed: Sentry415534 VA启动游戏弹窗报“Can not perform this action after onSaveInstanceState”的异常问题

See merge request halo/android/assistant-android!1944
2024-10-22 10:10:36 +08:00
3b3774596d fixed: Sentry415534 VA启动游戏弹窗报“Can not perform this action after onSaveInstanceState”的异常问题 2024-10-22 09:58:40 +08:00
bded49c366 Merge branch 'hotfix/v5.38.0-1110/remove_duplicated_sentry_log' into 'release'
fix: 移除部分 Sentry 日志上报,避免数据量过大

See merge request halo/android/assistant-android!1943
2024-10-21 18:04:47 +08:00
841711b5f1 fix: 移除部分 Sentry 日志上报,避免数据量过大
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-21 18:02:17 +08:00
7a080115a7 Merge branch 'hotfix/v5.38.0-1110/remove_duplicated_sentry_log' into 'release'
fix: 移除 AndroidException 类型的 Sentry 日志上报,避免数据量过大

See merge request halo/android/assistant-android!1942
2024-10-21 17:31:24 +08:00
337c4724a7 fix: 移除 AndroidException 类型的 Sentry 日志上报,避免数据量过大
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-21 17:28:44 +08:00
2119691bf6 Merge branch 'fix/GHZSCY-6799' into 'release'
fix: 【光环助手】V5.38版本群测汇总(1) https://jira.shanqu.cc/browse/GHZSCY-6799

See merge request halo/android/assistant-android!1941
2024-10-18 16:12:03 +08:00
caf50055c9 fix: 【光环助手】V5.38版本群测汇总(1) https://jira.shanqu.cc/browse/GHZSCY-6799 2024-10-18 16:11:13 +08:00
3ee3c2453f Merge branch 'fix/GHZSCY-6799' into 'release'
fix: 【光环助手】V5.38版本群测汇总(3) https://jira.shanqu.cc/browse/GHZSCY-6799

See merge request halo/android/assistant-android!1940
2024-10-18 15:27:05 +08:00
5e431e8a61 fix: 【光环助手】V5.38版本群测汇总(3) https://jira.shanqu.cc/browse/GHZSCY-6799 2024-10-18 15:14:18 +08:00
ff72c7cac8 Merge branch 'fix/navigation_bar_view_issue' into 'release'
fix: 修复 navigationBarView 的高度占位问题 https://jira.shanqu.cc/browse/GHZSCY-6799

See merge request halo/android/assistant-android!1939
2024-10-18 14:54:48 +08:00
047325e9bc fix: 修复 navigationBarView 的高度占位问题
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-18 11:27:31 +08:00
afbb758740 Merge branch 'refactor/sync-va' into 'dev'
feat: 更新插件1.0.3 正式版本 url

See merge request halo/android/assistant-android!1938
2024-10-17 15:43:21 +08:00
5de629cfdd feat: 更新插件1.0.3 正式版本 url 2024-10-17 15:42:59 +08:00
f026623600 Merge branch 'refactor/sync-va' into 'dev'
chore: va组件升级到2.0.6

See merge request halo/android/assistant-android!1937
2024-10-17 11:24:35 +08:00
2f5ee0eb91 chore: va组件升级到2.0.6
refactor: update commit id
2024-10-17 11:24:12 +08:00
e7651e8092 Merge branch 'feat/GHZSCY-6708-patch' into 'dev'
feat: CPM微信小游戏API接入兼容OkHttp 4.x

See merge request halo/android/assistant-android!1936
2024-10-17 11:23:47 +08:00
82d51d6375 feat: CPM微信小游戏API接入兼容OkHttp 4.x 2024-10-17 11:23:24 +08:00
6080edfd8a Merge branch 'feat/GHZSCY-6708' into 'dev'
feat: CPM微信小游戏API接入工作—客户端 https://jira.shanqu.cc/browse/GHZSCY-6708

See merge request halo/android/assistant-android!1911
2024-10-17 10:17:19 +08:00
d9713571c9 feat: CPM微信小游戏API接入工作—客户端 https://jira.shanqu.cc/browse/GHZSCY-6708 2024-10-17 10:17:19 +08:00
b466525e8b Merge branch 'feat/GHZSCY-6790' into 'dev'
feat: 更新 OkHttp 至 4.X 最新版本并启用 brotli 压缩 https://jira.shanqu.cc/browse/GHZSCY-6790

See merge request halo/android/assistant-android!1935
2024-10-16 16:56:07 +08:00
2a25675dce feat: 更新 OkHttp 至 4.X 最新版本并启用 brotli 压缩 https://jira.shanqu.cc/browse/GHZSCY-6790 2024-10-16 16:56:06 +08:00
5486ad8818 Merge branch 'fix/home_appbar_style' into 'dev'
fix: 修复多tab导航页在无Tab样式下AppBar变色异常的问题

See merge request halo/android/assistant-android!1934
2024-10-16 13:47:17 +08:00
5552fcf7bc Merge branch 'fix/stop_banner_play_on_pause' into 'dev'
fix: 修复部分轮播图没有在页面暂停时停止播放的问题

See merge request halo/android/assistant-android!1933
2024-10-16 13:47:10 +08:00
782a0af13c fix: 修复多tab导航页在无Tab样式下AppBar变色异常的问题 2024-10-16 11:44:44 +08:00
c6c2d9cd12 fix: 修复部分轮播图没有在页面暂停时停止播放的问题 2024-10-16 10:09:51 +08:00
f929a08e46 Merge branch 'fix/GHZSCY-6685' into 'dev'
fix: 修复 Fresco 不能根据 ViewPager/ViewPager2 页面可见性变更动图播放状态的问题 https://jira.shanqu.cc/browse/GHZSCY-6685

See merge request halo/android/assistant-android!1930
2024-10-15 18:16:41 +08:00
e48f96d7d7 fix: 修复 Fresco 不能根据 ViewPager/ViewPager2 页面可见性变更动图播放状态的问题 https://jira.shanqu.cc/browse/GHZSCY-6685 2024-10-15 18:16:41 +08:00
3cc95dbc08 Merge branch 'fix/system-properties-sensitive' into 'dev'
fix: 修复xcrash敏感行为【读取系统属性】

See merge request halo/android/assistant-android!1929
2024-10-15 15:08:29 +08:00
582 changed files with 4273 additions and 9375 deletions

View File

@ -2,7 +2,9 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' // kotlin
apply plugin: 'kotlin-parcelize'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'kotlin-kapt'
apply plugin: 'therouter'
import groovy.xml.XmlUtil
@ -51,6 +53,10 @@ android {
}
}
ksp {
arg("ROUTER_MODULE_NAME", project.getName())
}
defaultConfig {
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
@ -101,6 +107,8 @@ android {
buildConfigField "String", "NEW_API_HOST", "\"${NEW_API_HOST}\""
buildConfigField "String", "LOG_HUB_PROJECT", "\"${LOG_HUB_PROJECT}\""
buildConfigField "String", "VAPI_HOST", "\"${VAPI_HOST}\""
buildConfigField "String", "WGAME_CPM_BUSIAPPID", "\"${WGAME_CPM_BUSIAPPID}\""
buildConfigField "String", "WGAME_CPM_API_HOST", "\"${WGAME_CPM_API_HOST}\""
buildConfigField "String", "WECHAT_APPID", "\"${WECHAT_APPID}\""
buildConfigField "String", "WECHAT_SECRET", "\"${WECHAT_SECRET}\""
buildConfigField "String", "TENCENT_APPID", "\"${TENCENT_APPID}\""
@ -121,12 +129,6 @@ android {
}
}
kapt {
arguments {
arg("AROUTER_MODULE_NAME", project.name)
}
}
packagingOptions {
// exclude 部分冗余的文件
exclude 'META-INF/gradle/incremental.annotation.processors'
@ -195,7 +197,7 @@ android {
java.srcDirs = ['src/main/java', "src/default/java"]
}
internal {
java.srcDirs = ['src/main/java', "src/default/java"]
java.srcDirs = ['src/main/java', "src/default/java", "src/internal/java"]
}
tea {
java.srcDirs = ['src/main/java', 'src/tea/java']
@ -370,13 +372,15 @@ dependencies {
// debugImplementation "com.gu.android:toolargetool:${toolargetool}" // 需要使用调试时才启用
debugImplementation "com.github.nichbar:WhatTheStack:${whatTheStack}"
ksp project(":feature:route_doc")
implementation "androidx.multidex:multidex:${multiDex}"
implementation "androidx.fragment:fragment-ktx:${fragment}"
implementation "androidx.annotation:annotation:${annotation}"
implementation "androidx.viewpager2:viewpager2:${viewpager2}"
kapt "androidx.room:room-compiler:${room}"
ksp("androidx.room:room-compiler:${room}")
implementation "com.tencent.vasdolly:helper:${apkChannelPackage}"
implementation "com.tencent.vasdolly:writer:${apkChannelPackage}"
@ -426,7 +430,8 @@ dependencies {
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:${desugarJdkLibs}"
kapt "com.alibaba:arouter-compiler:$arouterVersion"
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
ksp "cn.therouter:apt:${routerVersion}"
implementation project(':ndownload')
implementation project(':vspace-bridge:vspace')
@ -444,13 +449,13 @@ dependencies {
exclude group: 'androidx.swiperefreshlayout'
}
implementation(project(':module_setting')) {
exclude group: 'androidx.swiperefreshlayout'
}
// implementation(project(':module_setting')) {
// exclude group: 'androidx.swiperefreshlayout'
// }
// implementation(project(':module_setting_compose')) {
// exclude group: 'androidx.swiperefreshlayout'
// }
implementation(project(':module_setting_compose')) {
exclude group: 'androidx.swiperefreshlayout'
}
if (!gradle.ext.excludeOptionalModules || gradle.ext.enablePkg) {
implementation(project(':feature:pkg'))

View File

@ -638,7 +638,7 @@
<!-- android:theme="@android:style/Theme.Translucent" />-->
<activity
android:name="com.gh.gamecenter.SkipActivity"
android:name="com.gh.gamecenter.SkipCompatActivity"
android:exported="true"
android:theme="@style/Theme.AppCompat.Light.Fullscreen.Transparent">
<intent-filter>

View File

@ -588,7 +588,7 @@ document.addEventListener("selectionchange", function(e) {
});
document.addEventListener("selectionchange", function(e) {
RE.enabledEditingItems(e)
setTimeout(() => RE.enabledEditingItems(e), 10)
});
RE.recursion = function(dom) {

View File

@ -12,7 +12,7 @@ import android.widget.FrameLayout
import android.widget.TextView
import androidx.appcompat.content.res.AppCompatResources
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.launcher.ARouter
import com.therouter.TheRouter
import com.facebook.drawee.view.SimpleDraweeView
import com.gh.common.exposure.ExposureManager
import com.gh.common.util.DirectUtils.directToLinkPage
@ -94,8 +94,7 @@ object AdDelegateHelper {
private fun initAdSdkInternal(context: Context) {
// 初始化穿山甲
if (mCsjAdImpl == null) {
mCsjAdImpl =
ARouter.getInstance().build(RouteConsts.provider.csjAd).navigation() as? ICsjAdProvider
mCsjAdImpl = TheRouter.get(ICsjAdProvider::class.java)
val csjAppId = if (EnvHelper.isDevEnv) BuildConfig.DEV_CSJ_APPID else BuildConfig.CSJ_APPID
mCsjAdImpl?.initSDK(context, csjAppId, HaloApp.getInstance().oaid)
// 监听亮色/暗色模式切换

View File

@ -1,13 +1,10 @@
package com.gh.ad
import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.view.ViewStub
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.provider.ILaunchAd
import com.gh.gamecenter.common.utils.SensorsBridge
import com.gh.gamecenter.common.utils.goneIf
@ -15,10 +12,8 @@ import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.entity.AdConfig
@Route(path = RouteConsts.provider.vaAd, name = "畅玩启动页广告")
@com.therouter.inject.ServiceProvider
class LaunchAdImpl : ILaunchAd {
override fun init(context: Context?) {
}
override fun requestAd(fragment: Fragment, container: ViewGroup, maskView: View, topViewStub: ViewStub, bottomViewStub: ViewStub, adClickAction: () -> Unit): View {
if (AdDelegateHelper.shouldShowHelperLaunchAd()) {
@ -104,4 +99,4 @@ class LaunchAdImpl : ILaunchAd {
companion object {
private const val AD_PLACEMENT = "畅玩启动"
}
}
}

View File

@ -4,7 +4,7 @@ import android.app.Activity
import android.app.Application
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.alibaba.android.arouter.launcher.ARouter
import com.therouter.TheRouter
import com.gh.ad.AdDelegateHelper
import com.gh.common.util.FloatingBackViewManager
import com.gh.common.xapk.XapkInstaller
@ -53,7 +53,7 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
if (GlobalActivityManager.activityCount == 1) {
// 清除桌面角标
if (activity !is SplashScreenActivity && activity !is AuthorizationActivity) {
val pushProvider = ARouter.getInstance().build(RouteConsts.provider.push).navigation() as? IPushProvider
val pushProvider = TheRouter.get(IPushProvider::class.java)
pushProvider?.cleanBadgeNumber(activity.applicationContext)
}
}
@ -126,9 +126,7 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
}
private fun isSuggestionActivity(activity: Activity): Boolean {
val helpAndFeedbackProvider =
ARouter.getInstance().build(RouteConsts.provider.helpAndFeedback)
.navigation() as? IHelpAndFeedbackProvider
val helpAndFeedbackProvider = TheRouter.get(IHelpAndFeedbackProvider::class.java)
return helpAndFeedbackProvider?.isSuggestionActivity(activity) ?: false
}

View File

@ -11,7 +11,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import com.alibaba.android.arouter.launcher.ARouter
import com.therouter.TheRouter
import com.gh.common.exposure.ExposureManager
import com.gh.common.util.*
import com.gh.common.util.LogUtils
@ -345,7 +345,7 @@ class DefaultJsApi(
@JavascriptInterface
fun getPushId(): String {
val pushProvider = ARouter.getInstance().build(RouteConsts.provider.push).navigation() as? IPushProvider
val pushProvider = TheRouter.get(IPushProvider::class.java)
return pushProvider?.getRegistrationId(HaloApp.getInstance()) ?: "unknown"
}
@ -424,8 +424,7 @@ class DefaultJsApi(
@JavascriptInterface
fun showQaFeedbackDialog(msg: Any) {
val mHelpAndFeedbackHelp =
ARouter.getInstance().build(RouteConsts.provider.helpAndFeedback).navigation() as? IHelpAndFeedbackProvider
val mHelpAndFeedbackHelp = TheRouter.get(IHelpAndFeedbackProvider::class.java)
mHelpAndFeedbackHelp?.showQaFeedbackDialogFragment(context as AppCompatActivity, msg.toString())
}

View File

@ -15,6 +15,7 @@ import com.gh.common.util.DirectUtils.directToLegacyVideoDetail
import com.gh.common.util.DirectUtils.directToLinkPage
import com.gh.common.util.DirectUtils.directToQa
import com.gh.common.util.PackageUtils
import com.gh.gamecenter.SkipCompatActivity
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
@ -66,6 +67,10 @@ object DefaultUrlHandler {
bringAppToFront: Boolean = false,
sourceEntrance: String = ""): Boolean {
val uri = Uri.parse(url)
// 优先交给新的路由拦截处理
if (SkipCompatActivity.handleSkip(context, uri)) return true
if ("ghzhushou" == uri.scheme) {
Utils.log("url = $url")
Utils.log("url = " + uri.scheme!!)
@ -374,7 +379,7 @@ object DefaultUrlHandler {
val iconSubscript = uri.getQueryParameter("game_icon_subscript") ?: ""
val gameEntity =
if (forumType == BbsType.OFFICIAL_BBS.value && gameId.isNotEmpty() && gameName.isNotEmpty() && icon.isNotEmpty()) {
GameEntity(id = gameId, mName = gameName, mIcon = icon, mIconSubscript = iconSubscript)
GameEntity(_id = gameId, mName = gameName, mIcon = icon, mIconSubscript = iconSubscript)
} else null
val activityLabelEntity = if (activityId.isNotEmpty() && activityName.isNotEmpty()) {
ActivityLabelEntity(

View File

@ -63,6 +63,9 @@ public class Config {
public static final String NEW_API_HOST = EnvHelper.getNewHost();
public static final String VAPI_HOST = EnvHelper.getVHost();
public static final String WGAME_CPM_BUSIAPPID = BuildConfig.WGAME_CPM_BUSIAPPID;
public static final String WGAME_CPM_API_HOST = EnvHelper.getWGameCPMHost();
// Third-Party confs
public static final String WECHAT_APPID = BuildConfig.WECHAT_APPID;
public static final String WECHAT_SECRET = BuildConfig.WECHAT_SECRET;

View File

@ -6,6 +6,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.LayoutManager
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.feature.exposure.ExposureEvent
import io.reactivex.functions.Consumer
@ -16,8 +17,9 @@ class ExposureListener(var fragment: Fragment, var exposable: IExposable) : Recy
val throttleBus: ExposureThrottleBus by lazy {
ExposureThrottleBus(
Consumer { commitExposure(it) },
Consumer(Throwable::printStackTrace)
{ commitExposure(it) },
Consumer(Throwable::printStackTrace),
{ commitWXCPMExposure(it) }
)
}
var layoutManager: LayoutManager? = null
@ -93,4 +95,32 @@ class ExposureListener(var fragment: Fragment, var exposable: IExposable) : Recy
ExposureManager.log(eventList)
}
/**
* 微信小游戏CPM曝光事件接口上报由于普通曝光事件的上报通道存在节流特性不符合CPM接口对于数据上报的实时性和准确性的要求所以使用额外的通道进行上报
*/
private fun commitWXCPMExposure(visibleState: ExposureThrottleBus.VisibleState) {
val eventList = arrayListOf<ExposureEvent>()
for (pos in visibleState.firstVisiblePosition..visibleState.lastVisiblePosition) {
try {
exposable.getEventByPosition(pos)?.let {
if (it.payload.miniGameType == Constants.WECHAT_MINI_GAME_CPM) {
eventList.add(it)
}
}
exposable.getEventListByPosition(pos)?.let { list ->
list.forEach {
if (it.payload.miniGameType == Constants.WECHAT_MINI_GAME_CPM) {
eventList.add(it)
}
}
}
} catch (ignore: Exception) {
// Just ignore the error.
}
}
ExposureManager.logCPM(eventList)
}
}

View File

@ -1,11 +1,13 @@
package com.gh.common.exposure
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.loghub.TLogHubHelper
import com.gh.gamecenter.common.utils.FixedSizeLinkedHashSet
import com.gh.gamecenter.common.utils.toJson
import com.gh.gamecenter.core.AppExecutor
import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.feature.minigame.wechat.WGameSubjectCPMListReportHelper
import com.lightgame.utils.Utils
import com.volcengine.model.tls.LogItem
@ -32,6 +34,9 @@ object ExposureManager {
*/
fun log(event: ExposureEvent) {
AppExecutor.logExecutor.execute {
if (event.payload.miniGameType == Constants.WECHAT_MINI_GAME_CPM) {
WGameSubjectCPMListReportHelper.reportExposure(event)
}
if (!exposureCache.contains(event.id)) {
exposureSet.add(event)
exposureCache.add(event.id)
@ -58,6 +63,17 @@ object ExposureManager {
}
}
/**
* Log a wechat mini game cpm collection of exposure event.
*/
fun logCPM(eventList: List<ExposureEvent>) {
AppExecutor.logExecutor.execute {
if (eventList.isNotEmpty()) {
WGameSubjectCPMListReportHelper.reportExposure(eventList.toSet())
}
}
}
/**
* @param forcedUpload Ignore all restrictions.
*/

View File

@ -3,16 +3,20 @@ package com.gh.common.exposure
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
import io.reactivex.subjects.PublishSubject
import io.reactivex.subjects.BehaviorSubject
import java.util.concurrent.TimeUnit
class ExposureThrottleBus(var onSuccess: Consumer<VisibleState>, var onError: Consumer<Throwable>) {
class ExposureThrottleBus(
var onSuccess: Consumer<VisibleState>,
var onError: Consumer<Throwable>,
onPreSuccess: Consumer<VisibleState>
) {
companion object {
private const val THRESHOLD_TIME = 300L
}
private val mPublishSubject: PublishSubject<VisibleState> = PublishSubject.create()
private val mPublishSubject: BehaviorSubject<VisibleState> = BehaviorSubject.create()
private val mCompositeDisposable: CompositeDisposable = CompositeDisposable()
init {
@ -24,6 +28,7 @@ class ExposureThrottleBus(var onSuccess: Consumer<VisibleState>, var onError: Co
*/
val disposable = mPublishSubject
.distinctUntilChanged()
.doOnNext(onPreSuccess)
.throttleWithTimeout(THRESHOLD_TIME, TimeUnit.MILLISECONDS)
.subscribeOn(Schedulers.io())
.subscribe(onSuccess, onError)

View File

@ -103,7 +103,6 @@ class AccelerateNotificationHandler(priority: Int) : PriorityChainHandler(priori
context = activity,
gameId = gameEntity.id,
entrance = "首页插件上架弹窗",
defaultTab = -1,
isSkipGameComment = false,
scrollToLibao = false,
openVideoStreaming = false,

View File

@ -1,18 +0,0 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.ActivationHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IActivationProvider
@Route(path = RouteConsts.provider.activation, name = "ActivationHelper暴露服务")
class ActivationProviderImpl : IActivationProvider {
override fun init(context: Context?) {
// Do nothing
}
override fun sendActivationInfo() {
ActivationHelper.sendActivationInfo()
}
}

View File

@ -1,19 +0,0 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.AdHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.SettingsEntity
import com.gh.gamecenter.feature.provider.IAdHelperProvider
@Route(path = RouteConsts.provider.adHelper, name = "AdHelper暴露服务")
class AdHelperProviderImpl : IAdHelperProvider {
override fun getSuggestionFunctionAd(): SettingsEntity.AD? {
return AdHelper.getAd(AdHelper.LOCATION_SUGGESTION_FUNCTION)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,20 +1,15 @@
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
import com.gh.gamecenter.core.provider.IFlavorProvider
import com.gh.gamecenter.va.VCore
import com.halo.assistant.HaloApp
@Route(path = RouteConsts.provider.app, name = "Application暴露服务")
@com.therouter.inject.ServiceProvider
class AppProviderImpl : IAppProvider {
override fun init(context: Context?) {
// Do nothing
}
override fun getAppName(): String {
return HaloApp.getInstance().getString(R.string.app_name)
@ -93,4 +88,5 @@ class AppProviderImpl : IAppProvider {
override fun initImageLoaderIfNeeded() {
HaloApp.getInstance().initFresco()
}
}

View File

@ -1,16 +1,13 @@
package com.gh.common.provider
import android.content.Context
import android.view.View
import android.widget.LinearLayout
import android.widget.TextView
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.databind.BindingAdapters
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.provider.IBindingAdaptersProvider
@Route(path = RouteConsts.provider.bindingAdapters, name = "BindingAdapters暴露服务")
@com.therouter.inject.ServiceProvider
class BindingAdaptersProviderImpl : IBindingAdaptersProvider {
override fun setGameName(
view: TextView,
@ -31,8 +28,4 @@ class BindingAdaptersProviderImpl : IBindingAdaptersProvider {
override fun setGame(view: View, gameEntity: GameEntity) {
BindingAdapters.setGame(view, gameEntity)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,12 +1,9 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.download.server.BrowserInstallHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IBrowserInstallHelperProvider
@Route(path = RouteConsts.provider.browserInstallHelper, name = "BrowserInstallHelper暴露服务")
@com.therouter.inject.ServiceProvider
class BrowserInstallHelperProviderImpl : IBrowserInstallHelperProvider {
override fun isUseBrowserToInstallEnabled(): Boolean = BrowserInstallHelper.isUseBrowserToInstallEnabled()
@ -15,9 +12,4 @@ class BrowserInstallHelperProviderImpl : IBrowserInstallHelperProvider {
override fun logSwitchInstallSettingEvent() {
BrowserInstallHelper.logOrdinaryBrowserEvent(BrowserInstallHelper.Type.SWITCH_INSTALL_SETTING)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,17 +1,10 @@
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.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IBuildConfigProvider
@Route(path = RouteConsts.provider.buildConfig, name = "BuildConfig暴露服务")
@com.therouter.inject.ServiceProvider
class BuildConfigImpl : IBuildConfigProvider {
override fun init(context: Context?) {
// Do nothing
}
override fun getApplicationId(): String = BuildConfig.APPLICATION_ID
override fun getVersionName(): String = BuildConfig.VERSION_NAME
@ -33,5 +26,9 @@ class BuildConfigImpl : IBuildConfigProvider {
override fun getVDevApiHost(): String = BuildConfig.DEV_VAPI_HOST
override fun getWGameCPMApiHost(): String = BuildConfig.WGAME_CPM_API_HOST
override fun getWGameCPMBusiAppId(): String = BuildConfig.WGAME_CPM_BUSIAPPID
override fun getLogProducerProject(): String = BuildConfig.LOG_HUB_PROJECT
}

View File

@ -1,18 +1,12 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.CheckLoginUtils
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.ICheckLoginProvider
@Route(path = RouteConsts.provider.checkLogin, name = "CheckLoginUtils暴露服务")
@com.therouter.inject.ServiceProvider
class CheckLoginProviderImpl : ICheckLoginProvider {
override fun checkLogin(context: Context, entrance: String, action: (() -> Unit)?) {
CheckLoginUtils.checkLogin(context, entrance, action)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -3,20 +3,16 @@ package com.gh.common.provider
import android.content.Context
import android.content.Intent
import android.os.Parcelable
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.CommentDetailActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.provider.ICommentDetailProvider
import com.gh.gamecenter.feature.entity.MessageEntity
@Route(path = RouteConsts.provider.commentDetail, name = "CommentDetailActivity暴露服务")
@com.therouter.inject.ServiceProvider
class CommentDetailProviderImpl : ICommentDetailProvider {
override fun getIntent(context: Context, commentId: String?, message: Parcelable): Intent {
return CommentDetailActivity.getIntent(context, commentId, message as MessageEntity.Article)
}
override fun init(context: Context?) {
// Do nothing
}
}
}

View File

@ -1,18 +1,14 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.ICommentManagerProvider
import com.gh.gamecenter.manager.CommentManager
@Route(path = RouteConsts.provider.commentManager, name = "CommentManager暴露服务")
@com.therouter.inject.ServiceProvider
class CommentManagerProviderImpl : ICommentManagerProvider {
override fun addUrl(ids: String) {
CommentManager.getInstance().addUrl(ids)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -2,12 +2,12 @@ package com.gh.common.provider
import android.content.Context
import android.widget.TextView
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.util.CommentUtils
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.provider.ICommentUtilsProvider
@Route(path = RouteConsts.provider.commentUtils, name = "CommentUtils暴露服务")
@com.therouter.inject.ServiceProvider
class CommentUtilsProviderImpl : ICommentUtilsProvider {
override fun setCommentTime(textView: TextView, time: Long) {
CommentUtils.setCommentTime(textView, time)
@ -16,8 +16,4 @@ class CommentUtilsProviderImpl : ICommentUtilsProvider {
override fun getCommentTime(timestamp: Long): String {
return CommentUtils.getCommentTime(timestamp)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -8,7 +8,7 @@ import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.viewbinding.ViewBinding
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.facebook.drawee.view.SimpleDraweeView
import com.gh.common.util.ConcernContentUtils
import com.gh.common.view.ImageContainerView
@ -18,7 +18,7 @@ import com.gh.gamecenter.common.utils.toArrayList
import com.gh.gamecenter.core.provider.IConcernArticleUtilsProvider
import com.gh.gamecenter.databinding.RecyclerGameArticleBinding
@Route(path = RouteConsts.provider.concernContentUtils, name = "ConcernContentUtils暴露服务")
@com.therouter.inject.ServiceProvider
class ConcernArticleUtilsProviderImpl : IConcernArticleUtilsProvider {
override fun addContentPic(
context: Context,
@ -95,8 +95,4 @@ class ConcernArticleUtilsProviderImpl : IConcernArticleUtilsProvider {
override fun getTvComment(binding: ViewBinding): TextView = (binding as RecyclerGameArticleBinding).tvComment
override fun getTvShare(binding: ViewBinding): TextView = (binding as RecyclerGameArticleBinding).tvShare
override fun init(context: Context?) {
// Do nothing
}
}
}

View File

@ -6,14 +6,14 @@ import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.viewbinding.ViewBinding
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.goneIf
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.core.provider.IConcernGiftPackUtilsProvider
import com.gh.gamecenter.databinding.RecyclerGiftPackBinding
@Route(path = RouteConsts.provider.concernGiftPackUtils, name = "ConcernGiftPackUtils暴露服务")
@com.therouter.inject.ServiceProvider
class ConcernGiftPackUtilsProviderImpl : IConcernGiftPackUtilsProvider {
override fun createBinding(parent: ViewGroup): ViewBinding {
val inflater = LayoutInflater.from(parent.context)
@ -48,7 +48,4 @@ class ConcernGiftPackUtilsProviderImpl : IConcernGiftPackUtilsProvider {
override fun getTvGiftPackContent(viewBinding: ViewBinding) =
(viewBinding as RecyclerGiftPackBinding).tvGiftPackContent
override fun init(context: Context?) {
// Do Nothing
}
}
}

View File

@ -2,19 +2,15 @@ package com.gh.common.provider
import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.ConcernActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IConcernProvider
@Route(path = RouteConsts.provider.concernActivity, name = "ConcernActivity暴露服务")
@com.therouter.inject.ServiceProvider
class ConcernProviderImpl : IConcernProvider {
override fun getIntent(context: Context, entrance: String): Intent {
return ConcernActivity.getIntent(context, entrance)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -2,18 +2,14 @@ package com.gh.common.provider
import android.content.Context
import androidx.appcompat.app.AppCompatActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IConcernShareNewsProvider
import com.gh.gamecenter.newsdetail.NewsShareDialog
@Route(path = RouteConsts.provider.concernShareNews, name = "ConcernShareNews暴露服务")
@com.therouter.inject.ServiceProvider
class ConcernShareNewsProviderImpl : IConcernShareNewsProvider {
override fun share(activity: AppCompatActivity, shortId: String?, id: String?, gameIcon: String?, title: String?) {
NewsShareDialog.show(activity, shortId, id, gameIcon, title)
}
override fun init(context: Context?) {
// Do Nothing
}
}

View File

@ -1,12 +1,9 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.constant.Config
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IConfigProvider
@Route(path = RouteConsts.provider.config, name = "Config暴露服务")
@com.therouter.inject.ServiceProvider
class ConfigProviderImpl : IConfigProvider {
override fun getTencentAppId(): String {
return Config.TENCENT_APPID
@ -103,8 +100,4 @@ class ConfigProviderImpl : IConfigProvider {
override fun isJiguangSwitch(): Boolean {
return Config.getNewApiSettingsEntity()?.jiguangSwitch ?: false
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,19 +1,12 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.constant.Config
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.SettingsEntity
import com.gh.gamecenter.feature.provider.IConfigSettingProvider
@Route(path = RouteConsts.provider.configSetting, name = "Config.getSettings暴露服务")
@com.therouter.inject.ServiceProvider
class ConfigSettingProviderImpl : IConfigSettingProvider {
override fun getSettings(): SettingsEntity? {
return Config.getSettings()
}
override fun init(context: Context?) {
// do nothing
}
}

View File

@ -1,12 +1,12 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.util.DataCollectionUtils
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.provider.IDataCollectionProvider
@Route(path = RouteConsts.provider.dataCollection, name = "DataCollectionUtils暴露服务")
@com.therouter.inject.ServiceProvider
class DataCollectionProviderImpl : IDataCollectionProvider {
override fun uploadClick(context: Context, vararg args: String) {
DataCollectionUtils.uploadClick(context, *args)
@ -15,8 +15,4 @@ class DataCollectionProviderImpl : IDataCollectionProvider {
override fun uploadConcern(context: Context, vararg args: String) {
DataCollectionUtils.uploadConcern(context, *args)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,20 +1,12 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.DataUtils
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IDataUtilsProvider
import com.halo.assistant.HaloApp
@Route(path = RouteConsts.provider.dataUtils, name = "DataUtils暴露服务")
@com.therouter.inject.ServiceProvider
class DataUtilsProviderImpl : IDataUtilsProvider {
override fun getDeviceCertification() {
DataUtils.getDeviceCertification(HaloApp.getInstance().gid)
}
override fun init(context: Context?) {
// Do nothing
}
}
}

View File

@ -1,12 +1,12 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.DefaultUrlHandler
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IDefaultUrlHandlerProvider
@Route(path = RouteConsts.provider.defaultUrlHandler, name = "DefaultUrlHandler暴露服务")
@com.therouter.inject.ServiceProvider
class DefaultUrlHandlerProviderImpl : IDefaultUrlHandlerProvider {
override fun interceptUrl(
@ -19,7 +19,4 @@ class DefaultUrlHandlerProviderImpl : IDefaultUrlHandlerProvider {
return DefaultUrlHandler.interceptUrl(context, url, null, entrance, bringAppToFront, sourceEntrance)
}
override fun init(context: Context?) {
// Do nothing
}
}
}

View File

@ -2,14 +2,12 @@ package com.gh.common.provider
import android.app.Dialog
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.DialogUtils
import com.gh.gamecenter.common.callback.CancelListener
import com.gh.gamecenter.common.callback.ConfirmListener
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IDialogUtilsProvider
@Route(path = RouteConsts.provider.dialogUtils, name = "DialogUtils暴露服务")
@com.therouter.inject.ServiceProvider
class DialogUtilsProviderImpl : IDialogUtilsProvider {
override fun showRegulationTestDialog(context: Context, confirm: () -> Unit, cancel: () -> Unit) {
DialogUtils.showRegulationTestDialog(context, object : ConfirmListener {
@ -45,8 +43,4 @@ class DialogUtilsProviderImpl : IDialogUtilsProvider {
}
override fun showBindPhoneDialog(context: Context, confirm: () -> Unit): Dialog = DialogUtils.showBindPhoneDialog(context) { confirm.invoke() }
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -3,12 +3,12 @@ package com.gh.common.provider
import android.app.Activity
import android.content.Context
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.util.DirectUtils
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IDirectProvider
@Route(path = RouteConsts.provider.directUtils, name = "DirectUtils暴露服务")
@com.therouter.inject.ServiceProvider
class DirectProviderImpl : IDirectProvider {
override fun directToWebView(context: Context, url: String, entrance: String?) {
@ -62,7 +62,13 @@ class DirectProviderImpl : IDirectProvider {
DirectUtils.directToCommunityArticle(context, articleId, communityId, entrance, path, sourceEntrance)
}
override fun directToVideoDetail(context: Context, videoId: String, entrance: String?, path: String?, sourceEntrance: String) {
override fun directToVideoDetail(
context: Context,
videoId: String,
entrance: String?,
path: String?,
sourceEntrance: String
) {
DirectUtils.directToVideoDetail(context, videoId, entrance, path, sourceEntrance)
}
@ -78,15 +84,16 @@ class DirectProviderImpl : IDirectProvider {
DirectUtils.directToQQGameById(activity, qqAppId)
}
override fun directToWechatGameById(activity: Activity, qqAppId: String) {
DirectUtils.directToWechatGameById(activity, qqAppId)
override fun directToWechatGameById(
activity: Activity,
wechatAppId: String,
wechatAppPath: String,
wechatAppExtData: String
) {
DirectUtils.directToWechatGameById(activity, wechatAppId, wechatAppPath, wechatAppExtData)
}
override fun directToExternalBrowser(context: Context, url: String) {
DirectUtils.directToExternalBrowser(context, url)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,10 +1,7 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.common.base.GlobalActivityManager
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.exposure.ExposureSource
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.entity.GameUpdateEntity
@ -17,7 +14,7 @@ import com.gh.gamecenter.packagehelper.PackageRepository
import com.lightgame.download.DownloadEntity
import com.lightgame.utils.Utils
@Route(path = RouteConsts.provider.downloadButtonClickedHandler, name = "DownloadButton点击事件暴露服务")
@com.therouter.inject.ServiceProvider
class DownloadButtonClickedProviderImpl : IDownloadButtonClickedProvider {
override fun onClicked(downloadButton: DownloadButton) {
var gameId = ""
@ -139,8 +136,4 @@ class DownloadButtonClickedProviderImpl : IDownloadButtonClickedProvider {
}
}
override fun init(context: Context?) {
// do nothing
}
}

View File

@ -1,13 +1,10 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.download.DownloadManager
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IDownloadManagerProvider
import com.lightgame.download.DownloadEntity
@Route(path = RouteConsts.provider.downloadManager, name = "DownloadManager暴露服务")
@com.therouter.inject.ServiceProvider
class DownloadManagerProviderImpl : IDownloadManagerProvider {
override fun getDownloadEntityByUrl(url: String): DownloadEntity? {
@ -18,8 +15,4 @@ class DownloadManagerProviderImpl : IDownloadManagerProvider {
DownloadManager.getInstance().resumeAllInvisiblePendingTask()
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -5,15 +5,16 @@ import android.content.Intent
import android.os.Build
import android.os.Bundle
import androidx.fragment.app.FragmentActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.util.EntranceUtils
import com.gh.gamecenter.common.avoidcallback.Callback
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IEntranceUtilsProvider
import com.lightgame.utils.AppManager
@Route(path = RouteConsts.provider.entranceUtils, name = "EntranceUtils暴露服务")
@com.therouter.inject.ServiceProvider
class EntranceUtilsProviderImpl : IEntranceUtilsProvider {
override fun jumpActivity(context: Context, bundle: Bundle) {
EntranceUtils.jumpActivity(context, bundle)
}
@ -32,10 +33,6 @@ class EntranceUtilsProviderImpl : IEntranceUtilsProvider {
} else {
EntranceUtils.jumpActivityCompat(AppManager.getInstance().currentActivity(), bundle)
}
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,14 +1,11 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.ErrorHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IErrorHelperProvider
import com.gh.gamecenter.login.user.LoginTag
import retrofit2.HttpException
@Route(path = RouteConsts.provider.errorHelper, name = "ErrorHelper暴露服务")
@com.therouter.inject.ServiceProvider
class ErrorHelperProviderImpl : IErrorHelperProvider {
override fun handleError(
@ -28,7 +25,4 @@ class ErrorHelperProviderImpl : IErrorHelperProvider {
ErrorHelper.handleLoginError(context, httpException, loginTagChinese, isCertificate)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,20 +1,15 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.exposure.ExposureManager
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.feature.provider.IExposureManagerProvider
@Route(path = RouteConsts.provider.exposureManager, name = "ExposureManager暴露服务")
@com.therouter.inject.ServiceProvider
class ExposureManagerProviderImpl: IExposureManagerProvider {
override fun logExposure(exposureEvent: ExposureEvent) {
ExposureManager.log(exposureEvent)
}
override fun init(context: Context?) {
// do nothing
}
}

View File

@ -1,18 +1,11 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.FixedRateJobHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IFixedRateJobHelperProvider
@Route(path = RouteConsts.provider.fixedRateJobHelper, name = "FixedRateJobHelper暴露服务")
@com.therouter.inject.ServiceProvider
class FixedRateJobHelperProviderImpl : IFixedRateJobHelperProvider {
override fun getTimeDeltaBetweenServerAndClient(): Long {
return FixedRateJobHelper.timeDeltaBetweenServerAndClient
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -2,12 +2,12 @@ package com.gh.common.provider
import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.provider.IGameCollectionDetailProvider
import com.gh.gamecenter.gamecollection.detail.GameCollectionDetailActivity
@Route(path = RouteConsts.provider.gameCollectionDetail, name = "GameCollectionDetailActivity暴露服务")
@com.therouter.inject.ServiceProvider
class GameCollectionDetailProviderImpl : IGameCollectionDetailProvider {
override fun getIntent(context: Context, gameCollectionId: String, isFromSquare: Boolean): Intent {
return GameCollectionDetailActivity.getIntent(context, gameCollectionId, isFromSquare)
@ -16,9 +16,4 @@ class GameCollectionDetailProviderImpl : IGameCollectionDetailProvider {
override fun getSpecifiedCommentIntent(context: Context, gameCollectionId: String, topCommentId: String): Intent {
return GameCollectionDetailActivity.getSpecifiedCommentIntent(context, gameCollectionId, topCommentId)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,14 +1,12 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.GameDetailActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.feature.provider.IGameDetailProvider
@Route(path = RouteConsts.provider.gameDetail, name = "GameDetailActivity暴露服务")
@com.therouter.inject.ServiceProvider
class GameDetailProviderImpl : IGameDetailProvider {
override fun startGameDetailActivity(
context: Context,
@ -54,7 +52,6 @@ class GameDetailProviderImpl : IGameDetailProvider {
context: Context,
gameId: String,
entrance: String?,
defaultTab: Int,
isSkipGameComment: Boolean,
scrollToLibao: Boolean,
openVideoStreaming: Boolean,
@ -65,7 +62,6 @@ class GameDetailProviderImpl : IGameDetailProvider {
context,
gameId,
entrance,
defaultTab,
isSkipGameComment,
scrollToLibao,
openVideoStreaming,
@ -73,8 +69,4 @@ class GameDetailProviderImpl : IGameDetailProvider {
traceEvent
)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,18 +1,14 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.util.GameTrendsHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IGameTrendsHelperProvider
@Route(path = RouteConsts.provider.gameTrendsHelper, name = "GameTrendsHelper暴露服务")
@com.therouter.inject.ServiceProvider
class GameTrendsHelperProviderImpl : IGameTrendsHelperProvider {
override fun updateReadPostTime() {
GameTrendsHelper.updateReadPostTime()
}
override fun init(context: Context?) {
// do nothing
}
}

View File

@ -1,17 +1,14 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.filter.RegionSettingHelper
import com.gh.gamecenter.feature.utils.ApkActiveUtils
import com.gh.download.DownloadManager
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.countOccurrences
import com.gh.gamecenter.core.provider.IHandleGameResponseProvider
import com.gh.gamecenter.feature.entity.GameEntity
@Route(path = RouteConsts.provider.handleGameResponse, name = "处理游戏类型返回")
@com.therouter.inject.ServiceProvider
class HandleGameResponseProviderImpl : IHandleGameResponseProvider {
override fun handleGameResponse(response: List<Any>, entrance: String): List<Any> {
@ -37,8 +34,4 @@ class HandleGameResponseProviderImpl : IHandleGameResponseProvider {
return response
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,18 +1,11 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.history.HistoryHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IHistoryHelperProvider
@Route(path = RouteConsts.provider.historyHelper, name = "HistoryHelper暴露服务")
@com.therouter.inject.ServiceProvider
class HistoryHelperProviderImpl : IHistoryHelperProvider {
override fun emptyDatabase() {
HistoryHelper.emptyDatabase()
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,13 +1,13 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.util.LibaoUtils
import com.gh.common.util.LibaoUtils.PostLibaoListener
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.ILibaoUtilsProvider
@Route(path = RouteConsts.provider.libaoUtils, name = "LibaoUtils暴露服务")
@com.therouter.inject.ServiceProvider
class LibaoUtilsProviderImpl : ILibaoUtilsProvider {
override fun getLibaoStatus(ids: String, successCallback: ((Any?) -> Unit)?, failureCallback: (() -> Unit)?) {
LibaoUtils.getLibaoStatus(ids, object : PostLibaoListener {
@ -20,8 +20,4 @@ class LibaoUtilsProviderImpl : ILibaoUtilsProvider {
}
})
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,7 +1,7 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.util.DirectUtils
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.entity.CommunityEntity
@ -10,7 +10,7 @@ import com.gh.gamecenter.common.entity.SuggestType
import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.feature.provider.ILinkDirectUtilsProvider
@Route(path = RouteConsts.provider.linkDirectUtils, name = "DirectUtils暴露服务主要是暴露directToLinkPage方法")
@com.therouter.inject.ServiceProvider
class LinkDirectUtilsProviderImpl : ILinkDirectUtilsProvider {
override fun directToLinkPage(
@ -61,7 +61,4 @@ class LinkDirectUtilsProviderImpl : ILinkDirectUtilsProvider {
DirectUtils.directToCommunityColumn(context, community, subjectId, entrance, path)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,19 +1,13 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.*
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.*
@Route(path = RouteConsts.provider.logUtils, name = "LogUtils暴露服务")
@com.therouter.inject.ServiceProvider
class LogUtilsProviderImpl : ILogUtilsProvider {
override fun login(loginStep: String, loginType: String, entrance: String) {
LogUtils.login(loginStep, loginType, entrance)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,19 +0,0 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.DirectUtils
import com.gh.gamecenter.MainActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IMainProvider
@Route(path = RouteConsts.provider.mainActivity, name = "MainActivity暴露服务")
class MainProviderImpl : IMainProvider {
override fun skipToMainActivity(context: Context, type: String) {
DirectUtils.directToHomeDefaultTab(context)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -2,13 +2,13 @@ package com.gh.common.provider
import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.MessageDetailActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.ConcernEntity
import com.gh.gamecenter.feature.provider.IMessageDetailProvider
@Route(path = RouteConsts.provider.messageDetail, name = "MessageDetailActivity暴露服务")
@com.therouter.inject.ServiceProvider
class MessageDetailProviderImpl : IMessageDetailProvider {
override fun getIntentById(
@ -24,8 +24,4 @@ class MessageDetailProviderImpl : IMessageDetailProvider {
override fun getIntentByEntity(context: Context, concernEntity: ConcernEntity, entrance: String): Intent? {
return MessageDetailActivity.getIntentByEntity(context, concernEntity, entrance)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,16 +1,13 @@
package com.gh.common.provider
import android.content.Context
import androidx.lifecycle.MediatorLiveData
import androidx.lifecycle.MutableLiveData
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.MessageUnreadCount
import com.gh.gamecenter.feature.entity.MessageUnreadEntity
import com.gh.gamecenter.feature.provider.IMessageUnreadRepositoryProvider
import com.gh.gamecenter.message.MessageUnreadRepository
@Route(path = RouteConsts.provider.messageUnreadRepository, name = "MessageUnreadRepository暴露服务")
@com.therouter.inject.ServiceProvider
class MessageUnreadRepositoryProviderImpl : IMessageUnreadRepositoryProvider {
override fun loadMessageUnreadData() {
@ -33,7 +30,4 @@ class MessageUnreadRepositoryProviderImpl : IMessageUnreadRepositoryProvider {
return MessageUnreadRepository.messageUnreadCountLiveData
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,13 +1,13 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IMiniGameRecentlyPlayedProvider
import com.gh.gamecenter.minigame.MiniGameRecentlyPlayUseCase
@Route(path = RouteConsts.provider.miniGameRecentPlayed, name = "MiniGameRecentlyPlayed暴露服务")
@com.therouter.inject.ServiceProvider
class MiniGameRecentlyPlayedProviderImpl : IMiniGameRecentlyPlayedProvider {
override fun clearMiniGameRecentlyPlayed(gameType: String) {
MiniGameRecentlyPlayUseCase.clearRecentlyPlayedMiniGameList(gameType)
@ -16,8 +16,4 @@ class MiniGameRecentlyPlayedProviderImpl : IMiniGameRecentlyPlayedProvider {
override fun refreshQQMiniRecentPlayed() {
MiniGameRecentlyPlayUseCase.loadRecentlyPlayedMiniGameList(Constants.QQ_MINI_GAME)
}
override fun init(context: Context?) {
// no implement
}
}

View File

@ -2,12 +2,12 @@ package com.gh.common.provider
import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.provider.INewCommentDetailProvider
import com.gh.gamecenter.qa.comment.NewCommentDetailActivity
@Route(path = RouteConsts.provider.newCommentDetail, name = "NewCommentDetailActivity暴露服务")
@com.therouter.inject.ServiceProvider
class NewCommentDetailProviderImpl : INewCommentDetailProvider {
override fun getAnswerCommentIntent(
@ -76,8 +76,4 @@ class NewCommentDetailProviderImpl : INewCommentDetailProvider {
path
)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,19 +0,0 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.PackageHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IPackageHelperProvider
@Route(path = RouteConsts.provider.packageHelper, name = "PackageHelper暴露服务")
class PackageHelperProviderImpl : IPackageHelperProvider {
override fun getLocalPackageNameSet(): Set<String> {
return PackageHelper.localPackageNameSet
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,13 +1,11 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.PackageInstaller
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IPackageInstallerProvider
import com.lightgame.download.DownloadEntity
@Route(path = RouteConsts.provider.packageInstaller, name = "PackageInstaller暴露服务")
@com.therouter.inject.ServiceProvider
class PackageInstallerProviderImpl : IPackageInstallerProvider {
override fun install(context: Context, downloadEntity: DownloadEntity, showUnzipToast: Boolean) {
@ -18,7 +16,4 @@ class PackageInstallerProviderImpl : IPackageInstallerProvider {
PackageInstaller.uninstall(context, path)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -2,14 +2,12 @@ package com.gh.common.provider
import android.content.Context
import android.content.pm.PackageInfo
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.PackageHelper
import com.gh.common.util.PackageUtils
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IPackageUtilsProvider
import com.gh.gamecenter.core.utils.ProcessUtil
@Route(path = RouteConsts.provider.packageUtils, name = "PackageUtils暴露服务")
@com.therouter.inject.ServiceProvider
class PackageUtilsProviderImpl : IPackageUtilsProvider {
override fun obtainProcessName(): String? {
return ProcessUtil.getCurrentProcessName()
@ -50,8 +48,4 @@ class PackageUtilsProviderImpl : IPackageUtilsProvider {
override fun getVersionNameByPackageName(packageName: String): String {
return PackageUtils.getVersionNameByPackageName(packageName) ?: ""
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,13 +1,10 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.GameInstall
import com.gh.gamecenter.feature.provider.IPackagesManagerProvider
import com.gh.gamecenter.manager.PackagesManager
@Route(path = RouteConsts.provider.packagesManager, name = "PackagesManager暴露服务")
@com.therouter.inject.ServiceProvider
class PackagesManagerProviderImpl: IPackagesManagerProvider {
override fun isCanPluggable(gameId: String?, packageName: String?): Boolean {
return PackagesManager.isCanPluggable(gameId, packageName)
@ -16,8 +13,4 @@ class PackagesManagerProviderImpl: IPackagesManagerProvider {
override fun getFilterSameApkInstalledList(): ArrayList<GameInstall> {
return PackagesManager.getFilterSameApkInstalledList()
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,14 +1,11 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.filter.RegionSettingHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.entity.IpInfo
import com.gh.gamecenter.feature.provider.IRegionSettingHelperProvider
@Route(path = RouteConsts.provider.regionSettingHelper, name = "RegionSettingHelper暴露服务")
@com.therouter.inject.ServiceProvider
class RegionSettingHelperProviderImpl : IRegionSettingHelperProvider {
override fun shouldThisGameDisplayMirrorInfo(gameId: String): Boolean {
return RegionSettingHelper.shouldThisGameDisplayMirrorInfo(gameId)
@ -33,8 +30,4 @@ class RegionSettingHelperProviderImpl : IRegionSettingHelperProvider {
override fun shouldThisGameBeFiltered(gameId: String?): Boolean {
return RegionSettingHelper.shouldThisGameBeFiltered(gameId)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,12 +1,9 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.repository.ReservationRepository
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IReservationRepositoryProvider
@Route(path = RouteConsts.provider.reservationRepository, name = "ReservationRepository暴露服务")
@com.therouter.inject.ServiceProvider
class ReservationRepositoryProviderImpl : IReservationRepositoryProvider {
override fun refreshReservations() {
@ -16,8 +13,4 @@ class ReservationRepositoryProviderImpl : IReservationRepositoryProvider {
override fun clearReservations() {
ReservationRepository.clearReservations()
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -5,12 +5,12 @@ import androidx.fragment.app.Fragment
import androidx.lifecycle.LiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.ISearchTabUtilsProvider
import com.gh.gamecenter.search.viewmodel.SearchTabViewModel
@Route(path = RouteConsts.provider.searchTabUtils, name = "SearchTabUtils暴露服务")
@com.therouter.inject.ServiceProvider
class SearchTabUtilsProviderImpl : ISearchTabUtilsProvider {
override fun obtainParentViewModel(fragment: Fragment): ViewModel {
@ -29,8 +29,4 @@ class SearchTabUtilsProviderImpl : ISearchTabUtilsProvider {
null
}
override fun init(context: Context?) {
// no implement
}
}
}

View File

@ -1,19 +0,0 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.ShareCardPicActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.ConcernEntity
import com.gh.gamecenter.feature.provider.IShareCardPicProvider
@Route(path = RouteConsts.provider.shareCardPicActivity, name = "ShareCardPicActivity暴露服务")
class ShareCardPicProviderImpl : IShareCardPicProvider {
override fun startShareCardPicActivity(context: Context, concernEntity: ConcernEntity, entrance: String) {
ShareCardPicActivity.startShareCardPicActivity(context, concernEntity, entrance)
}
override fun init(context: Context?) {
// do nothing
}
}

View File

@ -1,20 +0,0 @@
package com.gh.common.provider
import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.ShareCardActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.ConcernEntity
import com.gh.gamecenter.feature.provider.IShareCardProvider
@Route(path = RouteConsts.provider.shareCardActivity, name = "ShareCardActivity暴露服务")
class ShareCardProviderImpl : IShareCardProvider {
override fun getIntent(context: Context, concernEntity: ConcernEntity, shareContent: String): Intent {
return ShareCardActivity.getIntent(context, concernEntity, shareContent)
}
override fun init(context: Context?) {
// do nothing
}
}

View File

@ -3,17 +3,11 @@ package com.gh.common.provider
import android.content.Context
import android.content.Intent
import android.os.Parcelable
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.ShellActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IShellProvider
@Route(path = RouteConsts.provider.shellActivity, name = "ShellActivity暴露服务")
@com.therouter.inject.ServiceProvider
class ShellProviderImpl : IShellProvider {
override fun getSwitchInstallMethodIntent(context: Context, extraParcelable: Parcelable?): Intent =
ShellActivity.getIntent(context, ShellActivity.Type.SWITCH_INSTALL_METHOD, extraParcelable)
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -2,19 +2,15 @@ package com.gh.common.provider
import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.provider.ISimpleAnswerDetailProvider
import com.gh.gamecenter.qa.answer.detail.SimpleAnswerDetailActivity
@Route(path = RouteConsts.provider.simpleAnswerDetail, name = "SimpleAnswerDetailActivity暴露服务")
@com.therouter.inject.ServiceProvider
class SimpleAnswerDetailProviderImpl : ISimpleAnswerDetailProvider {
override fun getIntent(context: Context, answerId: String, entrance: String, path: String): Intent {
return SimpleAnswerDetailActivity.getIntent(context, answerId, entrance, path)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,12 +1,12 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.provider.ISubjectProvider
import com.gh.gamecenter.subject.SubjectActivity
@Route(path = RouteConsts.provider.subject, name = "SubjectActivity暴露服务")
@com.therouter.inject.ServiceProvider
class SubjectProviderImpl : ISubjectProvider {
override fun startSubjectActivity(
context: Context,
@ -17,8 +17,4 @@ class SubjectProviderImpl : ISubjectProvider {
) {
SubjectActivity.startSubjectActivity(context, id, name, isOrder, null, entrance)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,19 +0,0 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.feature.exposure.time.TimeUtil
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.ITimeUtilProvider
@Route(path = RouteConsts.provider.timeUtil, name = "TimeUtil暴露服务")
class TimeUtilProviderImpl : ITimeUtilProvider {
override fun currentTimeMillis() = TimeUtil.currentTimeMillis()
override fun currentTime() = TimeUtil.currentTime()
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,15 +1,12 @@
package com.gh.common.provider
import android.content.Context
import androidx.fragment.app.FragmentActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.DialogUtils
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IUpdateManagerProvider
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.update.UpdateHelper
@Route(path = RouteConsts.provider.updateManager, name = "UpdateManager暴露服务")
@com.therouter.inject.ServiceProvider
class UpdateManagerProviderImpl: IUpdateManagerProvider {
override fun checkUpdate(activity: FragmentActivity, ignoreSuppressOption: Boolean) {
val dialog = DialogUtils.showWaitDialog(activity, "检查更新中...")
@ -26,8 +23,4 @@ class UpdateManagerProviderImpl: IUpdateManagerProvider {
}
}
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -3,20 +3,16 @@ package com.gh.common.provider
import android.content.Context
import android.os.Build
import androidx.annotation.RequiresApi
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.util.UsageStatsHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IUsageStatsHelperProvider
@Route(path = RouteConsts.provider.usageStatsHelper, name = "UsageStatsHelper暴露服务")
@com.therouter.inject.ServiceProvider
class UsageStatsHelperProviderImpl : IUsageStatsHelperProvider {
@RequiresApi(Build.VERSION_CODES.LOLLIPOP_MR1)
override fun checkForPermission(): Boolean = UsageStatsHelper.checkForPermission()
override fun skipToUsageStats(context: Context, requestCode: Int) {
UsageStatsHelper.skipToUsageStats(context, requestCode)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,13 +1,11 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.InstallGameEntity
import com.gh.gamecenter.feature.provider.IVHelperProvider
import com.gh.vspace.VHelper
@Route(path = RouteConsts.provider.vhelper, name = "VHelper暴露服务")
@com.therouter.inject.ServiceProvider
class VHelperProviderImpl: IVHelperProvider {
override fun isVGameOn(): Boolean {
return VHelper.isVGameOn()
@ -20,8 +18,4 @@ class VHelperProviderImpl: IVHelperProvider {
override fun launch(context: Context, packageName: String, ignoreGApps: Boolean, showLoading: Boolean) {
VHelper.launch(context, packageName, ignoreGApps, showLoading)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,12 +1,12 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IVisitManagerProvider
import com.gh.gamecenter.manager.VisitManager
@Route(path = RouteConsts.provider.visitManager, name = "VisitManager暴露服务")
@com.therouter.inject.ServiceProvider
class VisitManagerProviderImpl : IVisitManagerProvider {
override fun updateOkhttpCache(context: Context, newsId: String) {
VisitManager.updateOkhttpCache(context, newsId)
@ -15,8 +15,4 @@ class VisitManagerProviderImpl : IVisitManagerProvider {
override fun addUrl(ids: String) {
VisitManager.getInstance().addUrl(ids)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -2,12 +2,10 @@ package com.gh.common.provider
import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IWebProvider
@Route(path = RouteConsts.provider.webActivity, name = "WebActivity暴露服务")
@com.therouter.inject.ServiceProvider
class WebProviderImpl : IWebProvider {
override fun getIntent(context: Context, url: String, autoCompletionTitle: Boolean): Intent {
return WebActivity.getIntent(context, url, autoCompletionTitle)
@ -40,8 +38,4 @@ class WebProviderImpl : IWebProvider {
): Intent {
return WebActivity.getIntentByNews(context, concernLink, concernGameName, concernId, entrance)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,23 +1,15 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.WechatBindHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.entity.WechatConfigEntity
import com.gh.gamecenter.core.provider.IWechatBindHelperProvider
@Route(path = RouteConsts.provider.wechatHelper, name = "WechatHelper暴露服务")
class WechatHelperProviderImpl : IWechatBindHelperProvider<WechatConfigEntity> {
@com.therouter.inject.ServiceProvider
class WechatHelperProviderImpl : IWechatBindHelperProvider {
override fun getWechatConfig(callback: ((WechatConfigEntity) -> Unit)?) {
override fun getWechatConfig(callback: ((Any) -> Unit)?) {
WechatBindHelper.getWechatConfig {
callback?.invoke(it)
}
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -52,7 +52,7 @@ public class CheckLoginUtils {
}
if (context != null) {
QuickLoginHelper.startLogin(context, entrance, callback);
QuickLoginHelper.startLogin(context, entrance, null, callback);
}
}

View File

@ -9,7 +9,7 @@ import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.util.Log;
import com.alibaba.android.arouter.launcher.ARouter;
import com.therouter.TheRouter;
import com.gh.ad.AdDelegateHelper;
import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.common.constant.Constants;
@ -55,7 +55,7 @@ public class DataUtils {
}
private static void initSentry(Context context, String channel) {
ISentryProvider sentryProvider = (ISentryProvider) ARouter.getInstance().build(RouteConsts.provider.sentry).navigation();
ISentryProvider sentryProvider = TheRouter.get(ISentryProvider.class);
if (sentryProvider != null) {
sentryProvider.init(context, channel, BuildConfig.FLAVOR, BuildConfig.VERSION_NAME);
}

View File

@ -11,7 +11,7 @@ import android.os.Bundle
import android.text.TextUtils
import androidx.appcompat.app.AppCompatActivity
import androidx.core.os.bundleOf
import com.alibaba.android.arouter.launcher.ARouter
import com.therouter.TheRouter
import com.gh.ad.AdPluginDownloadHelper
import com.gh.common.constant.Config
import com.gh.common.exposure.ExposureManager.log
@ -56,7 +56,6 @@ import com.gh.gamecenter.gamecollection.detail.GameCollectionDetailActivity
import com.gh.gamecenter.gamecollection.hotlist.GameCollectionHotListActivity
import com.gh.gamecenter.gamecollection.hotlist.GameCollectionListDetailActivity
import com.gh.gamecenter.gamecollection.square.GameCollectionSquareActivity
import com.gh.gamecenter.gamedetail.GameDetailFragment
import com.gh.gamecenter.gamedetail.fuli.kaifu.ServersCalendarActivity
import com.gh.gamecenter.gamedetail.fuli.kaifu.ServersCalendarManagementActivity
import com.gh.gamecenter.gamedetail.fuli.kaifu.ServersSubscribedGameListActivity
@ -69,7 +68,6 @@ import com.gh.gamecenter.minigame.MiniGameRecentlyPlayUseCase
import com.gh.gamecenter.minigame.MiniGameSearchActivity
import com.gh.gamecenter.minigame.qq.QGameHomeWrapperActivity
import com.gh.gamecenter.newsdetail.NewsDetailActivity
import com.gh.gamecenter.personalhome.UserHomeActivity
import com.gh.gamecenter.personalhome.background.PersonalityBackgroundActivity
import com.gh.gamecenter.personalhome.border.AvatarBorderActivity
import com.gh.gamecenter.personalhome.home.UserHistoryViewModel
@ -485,11 +483,13 @@ object DirectUtils {
ColumnCollectionDetailFragment.TYPE_QQ_MINI_GAME_COLUMN -> directToQGameHome(context)
// QQ游戏专题详情页
ViewPagerFragmentHelper.TYPE_QQ_MINI_GAME_COLUMN, ViewPagerFragmentHelper.TYPE_WECHAT_GAME_COLUMN -> {
val subjectType = if (linkEntity.type == ViewPagerFragmentHelper.TYPE_QQ_MINI_GAME_COLUMN) {
SubjectData.SubjectType.QQ_GAME
} else {
SubjectData.SubjectType.WECHAT_GAME
ViewPagerFragmentHelper.TYPE_QQ_MINI_GAME_COLUMN,
ViewPagerFragmentHelper.TYPE_WECHAT_GAME_COLUMN,
ViewPagerFragmentHelper.TYPE_WECHAT_GAME_CPM_COLUMN -> {
val subjectType = when (linkEntity.type) {
ViewPagerFragmentHelper.TYPE_QQ_MINI_GAME_COLUMN -> SubjectData.SubjectType.QQ_GAME
ViewPagerFragmentHelper.TYPE_WECHAT_GAME_CPM_COLUMN -> SubjectData.SubjectType.WECHAT_GAME_CPM
else -> SubjectData.SubjectType.WECHAT_GAME
}
directToSubject(
context = context,
@ -588,12 +588,16 @@ object DirectUtils {
@JvmStatic
fun directToQa(context: Context, text: String? = "", id: String) {
if (id.isEmpty()) return
val destination = RouteConsts.activity.qaActivity.toDestinationClass()
val bundle = Bundle()
bundle.putString(KEY_TO, destination?.name ?: "")
bundle.putString(KEY_NAVIGATION_TITLE, text)
bundle.putString(KEY_QA_ID, id)
jumpActivity(context, bundle)
TheRouter.build(RouteConsts.activity.qaActivity)
.fillParams {
it.putAll(bundle)
}
.navigation(context)
}
/**
@ -602,12 +606,16 @@ object DirectUtils {
@JvmStatic
fun directToQaCollection(context: Context, text: String, id: String) {
if (id.isEmpty()) return
val destination = RouteConsts.activity.qaActivity.toDestinationClass()
val bundle = Bundle()
bundle.putString(KEY_TO, destination?.name ?: "")
bundle.putString(KEY_NAVIGATION_TITLE, text)
bundle.putString(KEY_QA_COLLECTION_ID, id)
jumpActivity(context, bundle)
TheRouter.build(RouteConsts.activity.qaActivity)
.fillParams {
it.putAll(bundle)
}
.navigation(context)
}
/**
@ -718,7 +726,7 @@ object DirectUtils {
*/
@JvmStatic
fun directToHomeActivity(context: Context, userId: String?, entrance: String? = null, path: String? = null) {
context.startActivity(UserHomeActivity.getIntent(context, userId ?: "", entrance, path))
directToHomeActivity(context, userId, entrance, path, 0)
}
@JvmStatic
@ -757,17 +765,20 @@ object DirectUtils {
entrance: String? = null,
path: String? = null
) {
IntegralLogHelper.log("view_homepage", "个人主页")
val bundle = Bundle()
bundle.putString(KEY_USER_ID, userId)
bundle.putString(KEY_TO, UserHomeActivity::class.java.name)
bundle.putString(KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
bundle.putString(KEY_PATH, path)
bundle.putString(KEY_TYPE, UserHistoryViewModel.TYPE.fromValue(type).value)
bundle.putString(KEY_GAME, gameType)
bundle.putInt(KEY_POSITION, position ?: 0)
jumpActivity(context, bundle)
val uri = Uri.Builder()
.path(RouteConsts.activity.userHomeActivity)
.appendQueryParameter(KEY_USER_ID, userId)
.appendQueryParameter(KEY_TAB_INDEX, position.toString())
.appendQueryParameter(KEY_PATH, BaseActivity.mergeEntranceAndPath(entrance, path))
.appendQueryParameter(KEY_COMMUNITY_TYPE, UserHistoryViewModel.TYPE.fromValue(type).value)
.appendQueryParameter(KEY_GAME_TYPE, gameType)
.build()
TheRouter
.build(uri.toString())
.navigation(context)
}
@ -799,10 +810,10 @@ object DirectUtils {
bundle.putString(KEY_GAMEID, id)
if (!TextUtils.isEmpty(tab)) {
when (tab) {
"comment" -> bundle.putString(KEY_TARGET, GameDetailFragment.TAB_RATING)
"desc" -> bundle.putString(KEY_TARGET, GameDetailFragment.TAB_DESC)
"forum" -> bundle.putString(KEY_TARGET, GameDetailFragment.TAB_BBS)
"zone" -> bundle.putString(KEY_TARGET, GameDetailFragment.TAB_TRENDS)
"comment" -> bundle.putString(KEY_TARGET, EntranceConsts.TAB_TYPE_RATING)
"desc" -> bundle.putString(KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
"forum" -> bundle.putString(KEY_TARGET, EntranceConsts.TAB_TYPE_BBS)
"zone" -> bundle.putString(KEY_TARGET, EntranceConsts.TAB_TYPE_TRENDS)
}
}
if (traceEvent != null) {
@ -847,7 +858,7 @@ object DirectUtils {
bundle.putString(KEY_ENTRANCE, entrance)
bundle.putString(KEY_GAMEID, id)
bundle.putBoolean(KEY_OPEN_VIDEO_STREAMING, true)
bundle.putString(KEY_TARGET, GameDetailFragment.TAB_DESC)
bundle.putString(KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
jumpActivity(context, bundle)
}
@ -855,7 +866,7 @@ object DirectUtils {
fun directToGameDetail(
context: Context,
id: String,
defaultTab: String = GameDetailFragment.TAB_DESC,
defaultTab: String = EntranceConsts.TAB_TYPE_DESC,
entrance: String? = null
) {
val bundle = Bundle()
@ -1513,7 +1524,7 @@ object DirectUtils {
response?.apply {
if (zone.status == "on") {
if (zone.style == "link") {
directToGameDetail(context, gameId, GameDetailFragment.TAB_TRENDS, entrance)
directToGameDetail(context, gameId, EntranceConsts.TAB_TYPE_TRENDS, entrance)
} else {
directToWebView(context, url, entrance)
}
@ -1624,11 +1635,11 @@ object DirectUtils {
*/
@JvmStatic
fun directToHelpAndFeedback(context: Context, bundle: Bundle? = null) {
val destination = RouteConsts.activity.helpAndFeedbackActivity.toDestinationClass()
val newBundle = Bundle()
newBundle.putString(KEY_TO, destination?.name ?: "")
bundle?.let { newBundle.putAll(it) }
jumpActivityCompat(context, newBundle)
TheRouter.build(RouteConsts.activity.helpAndFeedbackActivity)
.fillParams {
it.putAll(bundle)
}
.navigation(context)
}
@ -1725,8 +1736,7 @@ object DirectUtils {
@JvmStatic
fun directToConcernInfo(context: Context, entrance: String) {
context.startActivity(
(ARouter.getInstance().build(RouteConsts.provider.concernInfo)
.navigation() as? IConcernInfoProvider)?.getIntent(context, entrance)
TheRouter.get(IConcernInfoProvider::class.java)?.getIntent(context, entrance)
)
}
@ -1983,10 +1993,7 @@ object DirectUtils {
return
}
val qGameProvider = ARouter
.getInstance()
.build(RouteConsts.provider.qGame)
.navigation() as? IQGameProvider
val qGameProvider = TheRouter.get(IQGameProvider::class.java)
if (qGameProvider == null) return
@ -2009,6 +2016,8 @@ object DirectUtils {
fun directToWechatGameById(
activity: Activity,
wechatAppId: String,
wechatAppPath: String = "",
wechatAppExtData: String = ""
) {
val wxApiProxy = WXAPIFactory.createWXAPI(
@ -2023,8 +2032,9 @@ object DirectUtils {
wxApiProxy.sendReq(
WXLaunchMiniProgram.Req().apply {
userName = wechatAppId
path = Constants.WECHAT_MINI_GAME_PCS
miniprogramType = WXLaunchMiniProgram.Req.MINIPTOGRAM_TYPE_RELEASE;
path = wechatAppPath.ifEmpty { Constants.WECHAT_MINI_GAME_PCS }
extData = wechatAppExtData
miniprogramType = WXLaunchMiniProgram.Req.MINIPTOGRAM_TYPE_RELEASE
}
)
@ -2032,8 +2042,14 @@ object DirectUtils {
}
@JvmStatic
fun directToMessageCenter(defaultTabIndex: Int) {
ARouter.getInstance().build(RouteConsts.activity.messageWrapperActivity)
fun directToMessageCenter(defaultTabIndex: Int, source: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.messageWrapperActivity)
.appendQueryParameter(RouteConsts.QueryParams.REQUIRE_LOGIN, "true")
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
TheRouter.build(uri.toString())
.withInt(BaseActivity_TabLayout.PAGE_INDEX, defaultTabIndex)
.navigation()
}

View File

@ -880,7 +880,7 @@ object DownloadItemUtils {
}
if (gameEntity.isMiniGame()) {
downloadBtn.setOnClickListener {
MiniGameItemHelper.launchMiniGame(gameEntity.miniGameAppId, gameEntity.miniGameType)
MiniGameItemHelper.launchMiniGame(gameEntity)
clickCallback?.onCallback()
allStateClickCallback?.onCallback()
}

View File

@ -494,7 +494,7 @@ object DownloadObserver {
java.lang.Boolean.parseBoolean(downloadEntity.getMetaExtra(Constants.IS_PLATFORM_RECOMMEND))
val exposureEvent = ExposureUtils.logADownloadCompleteExposureEvent(
GameEntity(
id = downloadEntity.gameId,
_id = downloadEntity.gameId,
mName = downloadEntity.name.removeSuffix(Constants.GAME_NAME_DECORATOR),
gameVersion = downloadEntity.versionName ?: "",
isPlatformRecommend = isPlatformRecommend,

View File

@ -1,9 +1,6 @@
package com.gh.common.util;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Handler;
import android.os.Message;
@ -19,10 +16,8 @@ import org.greenrobot.eventbus.EventBus;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 下载完成跳安装,
*/
@ -49,15 +44,15 @@ public class InstallUtils {
@Override
public void handleMessage(Message msg) {
if (msg.what == INSTALL_WHAT && packageManager != null) {
List<String> packageNameList = PackageHelper.INSTANCE.getInstalledPackageNameList(context, 0);
ArrayList<String> list = new ArrayList<>(packageNameList);
if (installMap != null && installMap.size() != 0) {
ArrayList<String> keys = new ArrayList<>();
for (String packageName : installMap.keySet()) {
if (TextUtils.isEmpty(packageName)) continue;
long time = installMap.get(packageName);
if (System.currentTimeMillis() - time >= MAX_TIME) {
keys.add(packageName);
} else if (list.contains(packageName)) {
} else if (PackageUtils.isInstalled(context, packageName)) {
keys.add(packageName);
DownloadEntity downloadEntity = DownloadManager.getInstance().getDownloadEntityByPackageName(packageName);
@ -80,7 +75,7 @@ public class InstallUtils {
long time = uninstallMap.get(packageName);
if (System.currentTimeMillis() - time >= MAX_TIME) {
keys.add(packageName);
} else if (!list.contains(packageName)) {
} else if (!PackageUtils.isInstalled(context, packageName)) {
keys.add(packageName);
EventBus.getDefault().post(new EBPackage("卸载", packageName, "", false));
}
@ -105,6 +100,8 @@ public class InstallUtils {
}
public void addInstall(String packageName) {
if (TextUtils.isEmpty(packageName)) return;
if (installMap == null) {
installMap = Collections.synchronizedMap(new HashMap<String, Long>());
}

View File

@ -814,7 +814,7 @@ object PackageHelper {
uploadUIDGapLog = false
val uidGap = (android.os.Process.LAST_APPLICATION_UID - lastValidUid) / 100 * 100
SentryHelper.onEvent("UID_GAP", "gap", uidGap.toString())
// SentryHelper.onEvent("UID_GAP", "gap", uidGap.toString())
}
return packageList

View File

@ -225,17 +225,6 @@ public class PackageUtils {
}
} catch (Exception e) {
e.printStackTrace();
if (e instanceof AndroidException) {
// 有些设备会出现 DeadSystemException
SentryHelper.INSTANCE.onEvent(
"GET_META_DATA_ERROR",
"packageName",
packageName,
"exception_digest",
e.getLocalizedMessage()
);
}
}
return null;
}
@ -497,7 +486,6 @@ public class PackageUtils {
}
} catch (Exception e) {
e.printStackTrace();
SentryHelper.INSTANCE.onEvent("GET_PACKAGE_INFO_ERROR", "path", path);
}
return null;
@ -640,17 +628,6 @@ public class PackageUtils {
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT).versionName;
} catch (Exception e) {
e.printStackTrace();
if (e instanceof AndroidException) {
// 有些设备会出现 DeadSystemException
SentryHelper.INSTANCE.onEvent(
"GET_VERSION_NAME_ERROR",
"packageName",
packageName,
"exception_digest",
e.getLocalizedMessage()
);
}
}
return null;
}
@ -664,16 +641,6 @@ public class PackageUtils {
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT).versionCode;
} catch (Exception e) {
e.printStackTrace();
if (e instanceof AndroidException) {
// 有些设备会出现 DeadSystemException
SentryHelper.INSTANCE.onEvent(
"GET_VERSION_CODE_ERROR",
"packageName",
packageName,
"exception_digest",
e.getLocalizedMessage()
);
}
}
return 0;
}
@ -688,16 +655,6 @@ public class PackageUtils {
return packageManager.getApplicationIcon(packageName);
} catch (Exception e) {
e.printStackTrace();
if (e instanceof AndroidException) {
// 有些设备会出现 DeadSystemException
SentryHelper.INSTANCE.onEvent(
"GET_ICON_ERROR",
"packageName",
packageName,
"exception_digest",
e.getLocalizedMessage()
);
}
}
return null;
}
@ -731,17 +688,6 @@ public class PackageUtils {
return jsonObject;
} catch (Exception e) {
e.printStackTrace();
if (e instanceof AndroidException) {
// 有些设备会出现 DeadSystemException
SentryHelper.INSTANCE.onEvent(
"GET_APP_BASIC_INFO_BY_PACKAGE_NAME",
"packageName",
packageName,
"exception_digest",
e.getLocalizedMessage()
);
}
return jsonObject;
}
}

View File

@ -2,7 +2,7 @@ package com.gh.common.util
import android.annotation.SuppressLint
import android.content.Context
import com.alibaba.android.arouter.launcher.ARouter
import com.therouter.TheRouter
import com.gh.gamecenter.common.constant.Constants
import com.gh.common.repository.ReservationRepository
import com.gh.gamecenter.WebActivity
@ -231,7 +231,7 @@ object ReservationHelper {
@JvmStatic
fun getReserveRequestBody(game: GameEntity?, context: Context): RequestBody {
val jPushId =
(ARouter.getInstance().build(RouteConsts.provider.push).navigation() as? IPushProvider)
(TheRouter.get(IPushProvider::class.java))
?.getRegistrationId(context) ?: ""
var mirrorPosition = game?.getMirrorPosition() ?: 0
if (mirrorPosition == -1) {

View File

@ -27,7 +27,9 @@ import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import com.lightgame.utils.Utils
import okhttp3.MediaType
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.RequestBody
import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.ResponseBody
import org.json.JSONArray
import org.json.JSONObject
@ -176,7 +178,7 @@ object UsageStatsHelper {
return
}
val body = RequestBody.create(MediaType.parse("application/json"), postBody.toString())
val body = postBody.toString().toRequestBody("application/json".toMediaTypeOrNull())
mApi.postUsageStatus(body, UserManager.getInstance().userId)
.subscribe(object : BiResponse<ResponseBody>() {
override fun onSuccess(data: ResponseBody) {

View File

@ -2,7 +2,7 @@ package com.gh.common.util
import android.os.Bundle
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.launcher.ARouter
import com.therouter.TheRouter
import com.gh.common.iinterface.ISuperiorChain
import com.gh.gamecenter.amway.AmwayFragment
import com.gh.gamecenter.category2.CategoryV2Fragment
@ -65,6 +65,7 @@ object ViewPagerFragmentHelper {
const val TYPE_COLUMN = "column" // 游戏专题详情页
const val TYPE_QQ_MINI_GAME_COLUMN = "qq_mini_game_column_detail" // QQ小游戏专题详情页
const val TYPE_WECHAT_GAME_COLUMN = "wechat_game_column_detail" // 微信小游戏专题详情页
const val TYPE_WECHAT_GAME_CPM_COLUMN = "wechat_game_cpm_column_detail" // 微信小游戏CPM专题详情页
const val TYPE_COLUMN_COLLECTION = "column_collection" // 专题合集详情页
const val TYPE_SERVER = "server" // 开服表
const val TYPE_COLUMN_TEST = "column_test_v2" // 新游开测
@ -128,9 +129,7 @@ object ViewPagerFragmentHelper {
}
// 帮助与反馈
TYPE_FEEDBACK -> {
val helpAndFeedbackProvider =
ARouter.getInstance().build(RouteConsts.provider.helpAndFeedback)
.navigation() as? IHelpAndFeedbackProvider
val helpAndFeedbackProvider = TheRouter.get(IHelpAndFeedbackProvider::class.java)
if (helpAndFeedbackProvider != null) {
helpAndFeedbackProvider.getHelpAndFeedbackFragment().with(bundle)
} else {
@ -163,10 +162,11 @@ object ViewPagerFragmentHelper {
className = GameCollectionSquareFragment::class.java.name
}
// 游戏专题详情页/QQ游戏专题详情页
TYPE_COLUMN, TYPE_QQ_MINI_GAME_COLUMN, TYPE_WECHAT_GAME_COLUMN -> {
TYPE_COLUMN, TYPE_QQ_MINI_GAME_COLUMN, TYPE_WECHAT_GAME_COLUMN, TYPE_WECHAT_GAME_CPM_COLUMN -> {
val subjectType = when(entity.type) {
TYPE_QQ_MINI_GAME_COLUMN -> SubjectData.SubjectType.QQ_GAME
TYPE_WECHAT_GAME_COLUMN -> SubjectData.SubjectType.WECHAT_GAME
TYPE_WECHAT_GAME_CPM_COLUMN -> SubjectData.SubjectType.WECHAT_GAME_CPM
else -> SubjectData.SubjectType.NORMAL
}
className = SubjectFragment::class.java.name
@ -248,9 +248,7 @@ object ViewPagerFragmentHelper {
}
// QA
TYPE_QA -> {
val helpAndFeedbackProvider =
ARouter.getInstance().build(RouteConsts.provider.helpAndFeedback)
.navigation() as? IHelpAndFeedbackProvider
val helpAndFeedbackProvider = TheRouter.get(IHelpAndFeedbackProvider::class.java)
helpAndFeedbackProvider?.let {
className = it.getHelpContainerFragmentClass()

View File

@ -34,7 +34,9 @@ import com.lightgame.utils.Utils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import okhttp3.MediaType
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.RequestBody
import okhttp3.RequestBody.Companion.toRequestBody
import org.json.JSONException
import org.json.JSONObject
import java.util.*
@ -216,7 +218,7 @@ object PackageObserver {
try {
jsonObject.put("game_id", gameId)
jsonObject.put("package", packageName)
val rBody = RequestBody.create(MediaType.parse("application/json"), jsonObject.toString())
val rBody = jsonObject.toString().toRequestBody("application/json".toMediaTypeOrNull())
RetrofitManager.getInstance().api
.postPlayedGame(UserManager.getInstance().userId, rBody)
.subscribeOn(Schedulers.io())

View File

@ -94,8 +94,8 @@ object ExoCacheManager {
response =
OkHttpClient.Builder().connectTimeout(5, TimeUnit.SECONDS).readTimeout(5, TimeUnit.SECONDS).build()
.newCall(request).execute()
if (response!!.isSuccessful && response.body() != null) {
val length = response.body()!!.contentLength()
if (response!!.isSuccessful && response.body != null) {
val length = response.body!!.contentLength()
contentLength = if (length == 0L) -1L else length
}
} catch (e: Exception) {

View File

@ -27,12 +27,24 @@ object SimpleDownloadManager {
val downloadStatus = mDownloadQueue.getStatus(config.uniqueId)
if (downloadStatus != DownloadStatus.PAUSED) {
ExecutorProvider.getInstance().backgroundExecutor.execute {
DownloadMessageHandler.insertDownloadToDatabase(getDownloadEntity(config))
mDownloadQueue.submitNewTask(config)
}
createNewTaskAndDownload(config)
} else {
resume(config.uniqueId)
try {
resume(config.uniqueId)
} catch (e: IllegalArgumentException) {
createNewTaskAndDownload(config)
}
}
}
/**
* 创建新任务并下载
*/
private fun createNewTaskAndDownload(config: DownloadConfig) {
ExecutorProvider.getInstance().backgroundExecutor.execute {
mDownloadQueue.cancel(config.uniqueId)
DownloadMessageHandler.insertDownloadToDatabase(getDownloadEntity(config))
mDownloadQueue.submitNewTask(config)
}
}

View File

@ -6,7 +6,7 @@ import android.os.Bundle;
import androidx.annotation.NonNull;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.therouter.router.Route;
import com.gh.gamecenter.common.base.activity.ToolBarActivity;
import com.gh.gamecenter.common.constant.EntranceConsts;
import com.gh.gamecenter.common.constant.RouteConsts;

View File

@ -5,12 +5,17 @@ import android.content.ContextWrapper
import android.content.Intent
import android.os.Bundle
import android.view.View
import com.therouter.router.Autowired
import com.therouter.router.Route
import com.therouter.TheRouter
import com.gh.base.DownloadToolbarActivity
import com.gh.common.exposure.ExposureManager.log
import com.gh.common.exposure.ExposureManager
import com.gh.common.exposure.ExposureTraceUtils.appendTrace
import com.gh.gamecenter.common.base.GlobalActivityManager
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.base.activity.ToolBarActivity.NORMAL_FRAGMENT_BUNDLE
import com.gh.gamecenter.common.base.activity.ToolBarActivity.NORMAL_FRAGMENT_NAME
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.toArrayList
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.entity.GamePlatform
@ -20,15 +25,54 @@ import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.feature.exposure.ExposureEvent.Companion.createEvent
import com.gh.gamecenter.feature.exposure.ExposureType
import com.gh.gamecenter.gamedetail.GameDetailFragment
import com.halo.assistant.HaloApp
/**
* Created by khy on 2017/3/24.
* 游戏详情页
*/
@Route(
path = RouteConsts.activity.gameDetailActivity,
description = "游戏详情页"
)
class GameDetailActivity : DownloadToolbarActivity() {
@JvmField
@Autowired(name = EntranceConsts.KEY_GAME_ID, description = "游戏 id", required = true)
var gameId: String? = null
@JvmField
@Autowired(name = EntranceConsts.KEY_GAME_ENTITY, description = "游戏摘要实体,如果你不懂这个是什么,那么不要用它,直接传入游戏 id 即可")
var gameEntity: GameEntity? = null
@JvmField
@Autowired(name = EntranceConsts.KEY_ENTRANCE, description = "入口埋点字段(开发内部使用)")
var entrance: String? = ""
@JvmField
@Autowired(name = EntranceConsts.KEY_DEFAULT_TAB, description = "默认选中 tab 的类型(目前可选的有五个类型 `详情`, `专区``云存档``评价``论坛`),首次进入匹配并切换至对应 tab")
var defaultTab: String = ""
@JvmField
@Autowired(name = EntranceConsts.KEY_COMMENT_AS_DEFAULT_TAB, description = "跳转到评论 tab首次进入直接跳转到评论 tab")
var commentAsDefaultTab: Boolean = false
@JvmField
@Autowired(name = EntranceConsts.KEY_SCROLL_TO_LIBAO, description = "滚动到礼包区域,首次进入滚动到礼包区域")
var scrollToLibao: Boolean = false
@JvmField
@Autowired(name = EntranceConsts.KEY_SCROLL_TO_SERVER, description = "滚动到开服表区域,首次进入滚动到开服表区域")
var scrollToServer: Boolean = false
@JvmField
@Autowired(name = EntranceConsts.KEY_OPEN_VIDEO_STREAMING, description = "打开视频流,首次进入打开视频流")
var openVideoStreaming: Boolean = false
@JvmField
@Autowired(name = EntranceConsts.KEY_OPEN_PLATFORM_WINDOW, description = "打开多版本窗口,首次进入打开多版本窗口")
var openPlatformWindow: Boolean = false
override fun onCreate(savedInstanceState: Bundle?) {
TheRouter.inject(this)
generateDataFromRoute()
super.onCreate(savedInstanceState)
DisplayUtils.transparentStatusBar(this)
}
@ -37,37 +81,21 @@ class GameDetailActivity : DownloadToolbarActivity() {
return getTargetIntent(this, GameDetailActivity::class.java, GameDetailFragment::class.java)
}
override fun getLayoutId(): Int {
return R.layout.activity_game_detail
}
override fun getLayoutId() = R.layout.activity_game_detail
override fun showToolbarAtLeft(): Boolean {
return true
}
override fun showToolbarAtLeft() = true
override fun showDownloadMenu() = true
override fun showDownloadMenu(): Boolean {
return true
}
override fun onDestroy() {
super.onDestroy()
HaloApp.remove(Constants.GAME_DETAIL_COME_IN)
}
override fun getActivityNameInChinese(): String {
return "游戏详情"
}
override fun getActivityNameInChinese() = "游戏详情"
override fun getBusinessId(): Pair<String, String> {
val fragment = targetFragment as? GameDetailFragment?
return if (fragment?.arguments != null) {
Pair(fragment.requireArguments().getString(EntranceConsts.KEY_GAMEID) ?: "", "")
return if (!gameId.isNullOrEmpty()) {
Pair(gameId ?: "", "")
} else {
super.getBusinessId()
}
}
override fun attachBaseContext(newBase: Context) {
super.attachBaseContext(object : ContextWrapper(newBase) {
override fun getSystemService(name: String): Any? {
@ -96,6 +124,13 @@ class GameDetailActivity : DownloadToolbarActivity() {
)
}
private fun generateDataFromRoute() {
val bundle = intent.extras
intent?.putExtra(NORMAL_FRAGMENT_NAME, GameDetailFragment::class.java.canonicalName)
intent?.putExtra(NORMAL_FRAGMENT_BUNDLE, bundle)
}
companion object {
@JvmStatic
@ -131,9 +166,10 @@ class GameDetailActivity : DownloadToolbarActivity() {
if (traceEvent != null) {
val clickEvent = createEvent(gameEntity, traceEvent.source, appendTrace(traceEvent), ExposureType.CLICK)
log(clickEvent)
ExposureManager.log(clickEvent)
bundle.putParcelable(EntranceConsts.KEY_TRACE_EVENT, clickEvent)
}
if (gameEntity != null && traceEvent != null && gameEntity.id != traceEvent.payload.gameId) {
// 当游戏 ID 跟曝光 traceEvent 的游戏ID 不一样的时候更新 traceEvent 的游戏ID
val (payload) = createEvent(
@ -144,31 +180,35 @@ class GameDetailActivity : DownloadToolbarActivity() {
)
traceEvent.payload = payload
}
if (defaultTab.isNotEmpty()) {
bundle.putString(EntranceConsts.KEY_TARGET, defaultTab)
}
if (isSkipGameComment) {
bundle.putBoolean(EntranceConsts.KEY_SKIP_GAME_COMMENT, true)
bundle.putBoolean(EntranceConsts.KEY_COMMENT_AS_DEFAULT_TAB, true)
}
if (scrollToLibao) {
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
bundle.putString(EntranceConsts.KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_LIBAO, true)
}
if (scrollToServer) {
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
bundle.putString(EntranceConsts.KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_SERVER, true)
}
bundle.putString(EntranceConsts.KEY_GAMEID, gameEntity?.id)
bundle.putString(EntranceConsts.KEY_GAME_ID, gameEntity?.id)
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
bundle.putParcelable(GameEntity.TAG, gameEntity)
context.startActivity(
getTargetIntent(
context,
GameDetailActivity::class.java,
GameDetailFragment::class.java,
bundle
)
)
bundle.putParcelable(EntranceConsts.KEY_GAME_ENTITY, gameEntity)
TheRouter
.build(RouteConsts.activity.gameDetailActivity)
.fillParams {
it.putAll(bundle)
}
.navigation(context)
}
@JvmStatic
@ -178,7 +218,7 @@ class GameDetailActivity : DownloadToolbarActivity() {
entrance: String?,
traceEvent: ExposureEvent?
) {
startGameDetailActivity(context, gameId, entrance, -1, traceEvent = traceEvent)
startGameDetailActivity(context, gameId, entrance, isSkipGameComment = false, traceEvent = traceEvent)
}
@JvmStatic
@ -186,7 +226,6 @@ class GameDetailActivity : DownloadToolbarActivity() {
context: Context,
gameId: String,
entrance: String?,
defaultTab: Int = -1,
isSkipGameComment: Boolean = false,
scrollToLibao: Boolean = false,
openVideoStreaming: Boolean = false,
@ -197,7 +236,6 @@ class GameDetailActivity : DownloadToolbarActivity() {
context,
gameId,
entrance,
defaultTab,
isSkipGameComment,
scrollToLibao,
openVideoStreaming,
@ -211,7 +249,6 @@ class GameDetailActivity : DownloadToolbarActivity() {
/**
* @param gameId 游戏Id
* @param defaultTab 默认定位到哪个tab
* @param isSkipGameComment 是否跳转到评论tab
* @param scrollToLibao 滚动到礼包区域
* @param openVideoStreaming 是否打开视频流
@ -225,7 +262,6 @@ class GameDetailActivity : DownloadToolbarActivity() {
context: Context,
gameId: String,
entrance: String?,
defaultTab: Int = -1,
isSkipGameComment: Boolean = false,
scrollToLibao: Boolean = false,
openVideoStreaming: Boolean = false,
@ -248,7 +284,7 @@ class GameDetailActivity : DownloadToolbarActivity() {
appendTrace(traceEvent),
ExposureType.CLICK
)
log(clickEvent)
ExposureManager.log(clickEvent)
bundle.putParcelable(EntranceConsts.KEY_TRACE_EVENT, clickEvent)
}
if (traceEvent != null && gameId != traceEvent.payload.gameId) {
@ -261,15 +297,12 @@ class GameDetailActivity : DownloadToolbarActivity() {
)
traceEvent.payload = payload
}
if (defaultTab != -1) {
bundle.putInt(EntranceConsts.KEY_TARGET, defaultTab)
}
if (isSkipGameComment) {
bundle.putBoolean(EntranceConsts.KEY_SKIP_GAME_COMMENT, true)
bundle.putBoolean(EntranceConsts.KEY_COMMENT_AS_DEFAULT_TAB, true)
}
if (openVideoStreaming) {
bundle.putBoolean(EntranceConsts.KEY_OPEN_VIDEO_STREAMING, true)
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
bundle.putString(EntranceConsts.KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
}
if (openPlatformWindow) {
bundle.putBoolean(EntranceConsts.KEY_OPEN_PLATFORM_WINDOW, true)
@ -283,10 +316,10 @@ class GameDetailActivity : DownloadToolbarActivity() {
}
}
if (scrollToLibao) {
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
bundle.putString(EntranceConsts.KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_LIBAO, true)
}
bundle.putString(EntranceConsts.KEY_GAMEID, gameId)
bundle.putString(EntranceConsts.KEY_GAME_ID, gameId)
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
bundle.putParcelable(EntranceConsts.KEY_CUSTOM_PAGE_TRACK_DATA, customPageTrackData)
bundle.putString(EntranceConsts.KEY_LAST_PAGE_ID, GlobalActivityManager.getLastPageEntity().pageId)
@ -295,14 +328,13 @@ class GameDetailActivity : DownloadToolbarActivity() {
EntranceConsts.KEY_LAST_PAGE_BUSINESS_ID,
GlobalActivityManager.getLastPageEntity().pageBusinessId
)
context.startActivity(
getTargetIntent(
context,
GameDetailActivity::class.java,
GameDetailFragment::class.java,
bundle
)
)
TheRouter
.build(RouteConsts.activity.gameDetailActivity)
.fillParams {
it.putAll(bundle)
}
.navigation(context)
}
}

View File

@ -34,7 +34,7 @@ import androidx.transition.*
import androidx.viewpager.widget.PagerAdapter
import androidx.viewpager.widget.ViewPager
import androidx.viewpager.widget.ViewPager.OnPageChangeListener
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.imagepipeline.core.ImagePipeline

View File

@ -408,7 +408,7 @@ public class SkipActivity extends BaseActivity {
try {
JSONObject extJsonObject = new JSONObject(extJson);
String qqGameId = extJsonObject.optString("aid");
MiniGameItemHelper.INSTANCE.launchMiniGame(qqGameId, Constants.QQ_MINI_GAME);
MiniGameItemHelper.INSTANCE.launchMiniGame(qqGameId, Constants.QQ_MINI_GAME, "", "");
} catch (JSONException ignored) {
}
break;
@ -445,24 +445,6 @@ public class SkipActivity extends BaseActivity {
break;
}
}
} else if ("market".equals(uri.getScheme())) {
String host = uri.getHost();
String id = "";
try {
id = uri.getQueryParameter("id");
} catch (UnsupportedOperationException e) {
e.printStackTrace();
}
if (host != null) {
if ("details".equals(host)) {
bundle = new Bundle();
bundle.putString(KEY_TO, EntranceConsts.KEY_MARKET_DETAILS);
bundle.putString(KEY_DATA, id);
EntranceUtils.jumpActivity(this, bundle);
} else {
EntranceUtils.jumpActivity(this, new Bundle()); // 跳转至首页
}
}
}
}

View File

@ -0,0 +1,107 @@
package com.gh.gamecenter
import android.app.Activity
import android.content.Context
import android.net.Uri
import android.os.Bundle
import com.therouter.router.Navigator
import com.therouter.router.interceptor.NavigationCallback
import com.therouter.TheRouter
import com.gh.common.util.EntranceUtils
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.utils.DialogHelper
import com.gh.gamecenter.common.utils.dropSchemeAndHost
import com.halo.assistant.HaloApp
import com.lightgame.utils.Utils
class SkipCompatActivity : SkipActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
val uri = intent.data
if (handleSkip(this, uri)) {
intent.setData(null)
}
super.onCreate(savedInstanceState)
finish()
}
companion object {
const val TAG = "SkipCompat"
const val HOST = "app"
const val SCHEME = "ghzhushou"
const val MARKET = "market"
fun handleSkip(context: Context, uri: Uri?): Boolean {
if (uri == null) return false
// Handle skip
if (uri.scheme == SCHEME) {
Utils.log(TAG, "handleSkip: $uri")
val host = uri.host
if (host == HOST) {
TheRouter
.build(uri.dropSchemeAndHost())
.navigation(context, object : NavigationCallback() {
override fun onFound(postcard: Navigator) {
Utils.log(TAG, "navigate to postcard ${postcard.originalUrl} onFound" )
}
override fun onLost(postcard: Navigator, requestCode: Int) {
Utils.log(TAG, "navigate to postcard ${postcard.originalUrl} onLost" )
if (HaloApp.getInstance().isAlreadyUpAndRunning) {
// 在光环应用内时,显示不支持弹窗
// 显示不支持弹窗
DialogHelper.showUpgradeDialog(context)
} else {
// 在光环应用外跳转时,重定向至首页
EntranceUtils.jumpActivity(context, Bundle())
}
}
override fun onArrival(postcard: Navigator) {
Utils.log(TAG, "navigate to postcard ${postcard.originalUrl} onArrival" )
}
override fun onActivityCreated(postcard: Navigator, activity: Activity) {
Utils.log(TAG, "navigate to postcard ${postcard.originalUrl} onActivityCreated" )
}
})
return true
}
} else if (uri.scheme == MARKET) {
val host = uri.host
var id = ""
try {
id = uri.getQueryParameter("id") ?: ""
} catch (e: Exception) {
e.printStackTrace()
}
if (host != null) {
if ("details" == host) {
val bundle = Bundle()
bundle.putString(
EntranceConsts.KEY_TO,
EntranceConsts.KEY_MARKET_DETAILS
)
bundle.putString(EntranceConsts.KEY_DATA, id)
EntranceUtils.jumpActivity(context, bundle)
} else {
EntranceUtils.jumpActivity(context, Bundle()) // 跳转至首页
}
return true
}
}
return false
}
}
}

View File

@ -14,8 +14,8 @@ import androidx.core.app.NotificationCompat
import androidx.core.text.bold
import androidx.core.text.buildSpannedString
import androidx.core.text.color
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.therouter.router.Route
import com.therouter.TheRouter
import com.gh.common.dialog.NewPrivacyPolicyDialogFragment
import com.gh.common.util.DeviceTokenUtils
import com.gh.common.util.DialogUtils
@ -29,6 +29,7 @@ import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.tracker.TrackerLogger
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.iinterface.ISplashScreen
import com.gh.gamecenter.core.provider.IAppProvider
import com.gh.gamecenter.core.provider.IPackageUtilsProvider
import com.gh.gamecenter.core.provider.IPushProvider
@ -47,7 +48,7 @@ import java.util.*
* 引导页面
*/
@Route(path = RouteConsts.activity.splashActivity)
class SplashScreenActivity : BaseActivity() {
class SplashScreenActivity : BaseActivity(), ISplashScreen {
private var mSharedPreferences: SharedPreferences? = null
private var mIsNewForThisVersion = false
@ -136,9 +137,8 @@ class SplashScreenActivity : BaseActivity() {
}
private fun logAppLaunch() {
val packageUtilsConfig =
ARouter.getInstance().build(RouteConsts.provider.packageUtils).navigation() as? IPackageUtilsProvider
val appProvider = ARouter.getInstance().build(RouteConsts.provider.app).navigation() as? IAppProvider
val packageUtilsConfig = TheRouter.get(IPackageUtilsProvider::class.java)
val appProvider = TheRouter.get(IAppProvider::class.java)
val signatureHash = packageUtilsConfig?.getApkSignatureByPackageName(this, packageName)?.get(0)
val sideLoadInfo = packageUtilsConfig?.getSideLoadedInfo()
val trackEvent = JSONObject()
@ -282,7 +282,7 @@ class SplashScreenActivity : BaseActivity() {
SensorsBridge.init(HaloApp.getInstance(), HaloApp.getInstance().channel)
SensorsBridge.setOAID(HaloApp.getInstance().oaid)
val pushProvider = ARouter.getInstance().build(RouteConsts.provider.push).navigation() as? IPushProvider
val pushProvider = TheRouter.get(IPushProvider::class.java)
val registrationId = pushProvider?.getRegistrationId(this)
if (!registrationId.isNullOrEmpty()) {
SensorsBridge.profileAppend(KEY_REGISTRATION_ID, registrationId)

View File

@ -6,7 +6,7 @@ import android.os.Bundle
import android.text.TextUtils
import android.view.KeyEvent
import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts

View File

@ -19,8 +19,8 @@ import android.util.Base64;
import androidx.annotation.NonNull;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.therouter.router.Route;
import com.therouter.TheRouter;
import com.gh.common.constant.Config;
import com.gh.common.util.IntegralLogHelper;
import com.gh.gamecenter.common.callback.BiCallback;
@ -52,7 +52,7 @@ import java.io.ByteArrayOutputStream;
*/
@Route(path = RouteConsts.activity.weiBoShareActivity)
public class WeiBoShareActivity extends Activity implements WbShareCallback {
private IAppProvider mAppProvider = (IAppProvider) ARouter.getInstance().build(RouteConsts.provider.app).navigation();
private final IAppProvider mAppProvider = TheRouter.get(IAppProvider.class);
private static final String WEIBO_SCOPE = (
"email,direct_messages_read,direct_messages_write,"

View File

@ -27,7 +27,7 @@ open class BaseCloudArchiveViewModel(application: Application, private val mConf
)
.enqueue(object : Callback {
override fun onResponse(call: Call, response: Response) {
mArchiveConfigStr = response.body()?.string() ?: ""
mArchiveConfigStr = response.body?.string() ?: ""
callback?.invoke(mArchiveConfigStr)
}

View File

@ -93,7 +93,7 @@ class AdGameBannerAdapter(
it.name ?: ""
)
if (it.isMiniGame()) {
MiniGameItemHelper.launchMiniGame(it.miniGameAppId, it.miniGameType)
MiniGameItemHelper.launchMiniGame(it)
} else {
GameDetailActivity.startGameDetailActivity(
mContext,

View File

@ -9,14 +9,16 @@ import kotlinx.parcelize.Parcelize
@Parcelize
data class SearchSubjectEntity(
val name: String = "",
val games: List<GameEntity> = listOf(),
var games: List<GameEntity> = listOf(),
val location: Int = 0,
@SerializedName("column_id")
val columnId: String = "",
val adId: String = "", // 广告ID(本地字段),不为空时为广告专题
val codeId: String = "", // 广告CODE_ID(本地字段),不为空时为广告专题
@SerializedName("ad_icon_active")
val adIconActive: Boolean = false
val adIconActive: Boolean = false,
// 本地字段标记是否为微信小游戏CPM专题
var isWGameSubjectCPM: Boolean = false
) : Parcelable {
fun getFilterGame() = RegionSettingHelper.filterGame(games)
}

View File

@ -63,6 +63,11 @@ class SubjectData(
/**
* 微信小游戏专题
*/
WECHAT_GAME
WECHAT_GAME,
/**
* 微信小游戏CPM专题
*/
WECHAT_GAME_CPM,
}
}

View File

@ -104,6 +104,8 @@ data class SubjectEntity(
@SerializedName("is_wechat_column")
var isWechatColumn: Boolean = false,
var isWechatColumnCPM: Boolean = false,
var explain: String = "", // 游戏单合集说明
@SerializedName("show_star")
@ -130,6 +132,7 @@ data class SubjectEntity(
val subjectType: SubjectData.SubjectType get() = when {
isQQColumn -> SubjectData.SubjectType.QQ_GAME
isWechatColumnCPM -> SubjectData.SubjectType.WECHAT_GAME_CPM
isWechatColumn -> SubjectData.SubjectType.WECHAT_GAME
else -> SubjectData.SubjectType.NORMAL
}

View File

@ -1,7 +1,7 @@
package com.gh.gamecenter.entity
import android.os.Parcelable
import com.alibaba.android.arouter.launcher.ARouter
import com.therouter.TheRouter
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IConfigProvider
import com.gh.gamecenter.feature.entity.*
@ -93,7 +93,7 @@ open class VideoEntity(
get() = _count ?: Count()
fun getThumb(): String {
val configProvider = ARouter.getInstance().build(RouteConsts.provider.config).navigation() as? IConfigProvider
val configProvider = TheRouter.get(IConfigProvider::class.java)
return if (!configProvider?.getVideoSnapshotSuffix().isNullOrEmpty()) {
"$url${configProvider?.getVideoSnapshotSuffix()},t_0,f_jpg,w_0,h_0,ar_auto"
} else {

Some files were not shown because too many files have changed in this diff Show More