Compare commits
19 Commits
feat/cloud
...
feat/test_
| Author | SHA1 | Date | |
|---|---|---|---|
| 72303637d8 | |||
| 8084cda37d | |||
| e624f34de1 | |||
| b832c0c14f | |||
| 6610c43937 | |||
| ec29d94fb7 | |||
| b6ec74d789 | |||
| 2d7224cf16 | |||
| 3f45344b54 | |||
| 1c3dbce08d | |||
| 7844800b0e | |||
| ebcfd9c85d | |||
| 3825315f65 | |||
| 3ffe4f9bc6 | |||
| b2fc01ae48 | |||
| 06f932af14 | |||
| c2fe3bb64a | |||
| b1b231a309 | |||
| e5161ae350 |
@ -386,6 +386,15 @@ dependencies {
|
||||
implementation "com.j256.ormlite:ormlite-android:${ormlite}"
|
||||
implementation "com.j256.ormlite:ormlite-core:${ormlite}"
|
||||
|
||||
implementation("io.coil-kt:coil:2.6.0") {
|
||||
exclude group: "androidx.core"
|
||||
exclude group: "androidx.lifecycle"
|
||||
}
|
||||
implementation("io.coil-kt:coil-svg:2.6.0") {
|
||||
exclude group: "androidx.core"
|
||||
exclude group: "androidx.lifecycle"
|
||||
}
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import com.gh.common.util.PackageUtils
|
||||
import com.gh.gamecenter.core.provider.IAcceleratorDataHolderProvider
|
||||
import com.gh.gamecenter.feature.entity.VipEntity
|
||||
import com.halo.assistant.accelerator.repository.AcceleratorDataHolder
|
||||
@ -20,6 +21,10 @@ class IAcceleratorDataHolderProviderImpl : IAcceleratorDataHolderProvider {
|
||||
return AcceleratorDataHolder.instance.initResults
|
||||
}
|
||||
|
||||
override fun getGhVersionName(): String {
|
||||
return PackageUtils.getGhVersionName()
|
||||
}
|
||||
|
||||
override fun clear() {
|
||||
AcceleratorDataHolder.instance.clear()
|
||||
}
|
||||
|
||||
@ -208,20 +208,7 @@ object XapkInstaller : XApkUnZipCallback, XApkUnZipOutputFactory {
|
||||
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, df.uri)
|
||||
}
|
||||
|
||||
tempLauncher =
|
||||
activity.registerActivityResultLauncher(ActivityResultContracts.OpenDocumentTree()) { uri ->
|
||||
if (uri != null) {
|
||||
activity.contentResolver.takePersistableUriPermission(
|
||||
uri,
|
||||
Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION
|
||||
)
|
||||
|
||||
useDocStyleToUnzip = true
|
||||
unzipAction.invoke()
|
||||
}
|
||||
|
||||
tempLauncher?.unregister()
|
||||
}
|
||||
tempLauncher = null
|
||||
|
||||
tempLauncher?.launch(obbUri)
|
||||
},
|
||||
|
||||
@ -45,6 +45,7 @@ import com.gh.gamecenter.common.base.fragment.BaseLazyFragment
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.entity.LinkEntity
|
||||
import com.gh.gamecenter.common.eventbus.EBReuse
|
||||
import com.gh.gamecenter.common.exposure.ExposureSource
|
||||
import com.gh.gamecenter.common.json.json
|
||||
import com.gh.gamecenter.common.mvvm.Status
|
||||
@ -1111,6 +1112,13 @@ class GameDetailWrapperFragment : BaseLazyFragment(), IScrollable {
|
||||
return true
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onEventMainThread(reuse: EBReuse) {
|
||||
if ("download" == reuse.type) {
|
||||
downloadBinding.detailProgressbar.performClick()
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onEventMainThread(status: EBDownloadStatus) {
|
||||
updateDownloadCountHint(packageViewModel.filterSameUpdateLiveData.value)
|
||||
|
||||
@ -21,13 +21,14 @@ class StartingAcceleratorViewModel : ViewModel() {
|
||||
|
||||
val useCase = AccelerationUseCase()
|
||||
|
||||
private val _restartingAcceleratorAction = MutableLiveData<Event<Boolean>>()
|
||||
val restartingAcceleratorAction: LiveData<Event<Boolean>> = _restartingAcceleratorAction
|
||||
private val _restartingAcceleratorAction = MutableLiveData<Event<Unit>>()
|
||||
val restartingAcceleratorAction: LiveData<Event<Unit>> = _restartingAcceleratorAction
|
||||
fun loadAcceleratorToken() {
|
||||
val userId = UserManager.getInstance().userId
|
||||
if (userId.isNotBlank()) {
|
||||
UserRepository.getInstance().setAcceleratorToken(userId) {
|
||||
_restartingAcceleratorAction.value = Event(it)
|
||||
// 这里就算setToken失败,也要调用启动加速,失败会走正常的日志上报
|
||||
_restartingAcceleratorAction.value = Event(Unit)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -307,7 +307,7 @@ class GameDetailFragment : LazyFragment(), IScrollable {
|
||||
|
||||
private fun initDetailRv() {
|
||||
binding.detailRv.run {
|
||||
(itemAnimator as DefaultItemAnimator).supportsChangeAnimations = false
|
||||
itemAnimator = null
|
||||
layoutManager = detailLayoutManager
|
||||
adapter = detailListAdapter
|
||||
addOnScrollListener(object : OnScrollListener() {
|
||||
|
||||
@ -46,7 +46,7 @@ class GameDetailBriefItemViewHolder(
|
||||
highlightedTextClickListener = TextHelper.CopyToClipboardHighlightedTextClick()
|
||||
)
|
||||
briefTv.post {
|
||||
expandTv.isVisible = briefTv.lineCount == 3 && briefTv.layout.getEllipsisCount(2) > 0
|
||||
expandTv.isVisible = briefTv.lineCount == 3 && (briefTv.layout?.getEllipsisCount(2) ?: 0) > 0
|
||||
}
|
||||
expandTv.setOnClickListener {
|
||||
SensorsBridge.trackGameDetailModuleClick(
|
||||
|
||||
@ -194,6 +194,8 @@ class GameDetailComprehensivePanelItemViewHolder(
|
||||
maxLines = if (parentViewHolder.showPart && !parentViewHolder.isExpand) 1 else Int.MAX_VALUE
|
||||
text = data.text
|
||||
post {
|
||||
if (layout == null) return@post
|
||||
|
||||
val hasEllipsize = layout.getEllipsisCount(0) > 0
|
||||
if (parentViewHolder.showPart && hasEllipsize && !parentViewHolder.binding.expandTv.isVisible) {
|
||||
parentViewHolder.binding.expandTv.isVisible = true
|
||||
|
||||
@ -27,7 +27,7 @@ class GameDetailDeveloperWordItemViewHolder(
|
||||
.fromHtmlCompat(PicassoImageGetter(contentTv), ExtraTagHandler())
|
||||
)
|
||||
contentTv.post {
|
||||
expandTv.isVisible = (contentTv.lineCount == 3 && contentTv.layout.getEllipsisCount(2) > 0) || contentTv.lineCount > 3
|
||||
expandTv.isVisible = (contentTv.lineCount == 3 && (contentTv.layout?.getEllipsisCount(2) ?: 0) > 0) || contentTv.lineCount > 3
|
||||
}
|
||||
expandTv.background = R.drawable.bg_ui_surface_expand_gradient.toDrawable(context)
|
||||
expandTv.setTextColor(com.gh.gamecenter.common.R.color.text_theme.toColor(context))
|
||||
|
||||
@ -36,7 +36,7 @@ class GameDetailUpdateItemViewHolder(
|
||||
}
|
||||
contentTv.text = entity.updateDes
|
||||
contentTv.post {
|
||||
expandTv.isVisible = contentTv.lineCount == 3 && contentTv.layout.getEllipsisCount(2) > 0
|
||||
expandTv.isVisible = contentTv.lineCount == 3 && (contentTv.layout?.getEllipsisCount(2) ?: 0) > 0
|
||||
}
|
||||
expandTv.background = R.drawable.bg_ui_surface_expand_gradient.toDrawable(context)
|
||||
expandTv.setTextColor(com.gh.gamecenter.common.R.color.text_theme.toColor(context))
|
||||
|
||||
@ -63,7 +63,7 @@ class HistoryApkListAdapter(
|
||||
holder.binding.expandTv.setTextColor(com.gh.gamecenter.common.R.color.text_theme.toColor(mContext))
|
||||
holder.binding.updateDescTv.text = apkEntity.updateDesc
|
||||
holder.binding.updateDescTv.post {
|
||||
holder.binding.expandTv.isVisible = holder.binding.updateDescTv.lineCount == 3 && holder.binding.updateDescTv.layout.getEllipsisCount(2) > 0
|
||||
holder.binding.expandTv.isVisible = holder.binding.updateDescTv.lineCount == 3 && (holder.binding.updateDescTv.layout?.getEllipsisCount(2) ?: 0) > 0
|
||||
}
|
||||
holder.binding.versionTv.text = "版本${apkEntity.version}"
|
||||
holder.binding.releaseDateTv.text = TimeUtils.getFormatTime(apkEntity.updateTime)
|
||||
|
||||
@ -52,7 +52,7 @@ class UploadThread(
|
||||
.setCancelHook(true)
|
||||
.setCheckpointFile(recordDirectory)
|
||||
.setPartSize(10 * 1024 * 1024)
|
||||
.setTaskNum(2)
|
||||
.setTaskNum(1)
|
||||
.setDataTransferListener {
|
||||
Utils.log(
|
||||
"OssUpload",
|
||||
@ -74,9 +74,9 @@ class UploadThread(
|
||||
mUploadInput = this
|
||||
}
|
||||
val config = TransportConfig.builder()
|
||||
.readTimeoutMills(15 * 1000)
|
||||
.writeTimeoutMills(15 * 1000)
|
||||
.connectTimeoutMills(15 * 1000)
|
||||
.readTimeoutMills(5 * 1000)
|
||||
.writeTimeoutMills(5 * 1000)
|
||||
.connectTimeoutMills(5 * 1000)
|
||||
.maxRetryCount(2)
|
||||
.build()
|
||||
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package com.gh.gamecenter.wrapper
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Paint
|
||||
import android.graphics.PorterDuff
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
@ -14,6 +17,11 @@ import androidx.core.text.color
|
||||
import androidx.core.view.doOnNextLayout
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
import coil.Coil
|
||||
import coil.decode.SvgDecoder
|
||||
import coil.load
|
||||
import coil.request.ImageRequest
|
||||
import coil.transform.Transformation
|
||||
import com.ethanhua.skeleton.Skeleton
|
||||
import com.ethanhua.skeleton.SkeletonScreen
|
||||
import com.gh.common.iinterface.ISuperiorChain
|
||||
@ -39,6 +47,7 @@ import com.gh.gamecenter.entity.BottomTab
|
||||
import com.gh.gamecenter.login.entity.UserInfoEntity
|
||||
import com.halo.assistant.HaloApp
|
||||
import com.lightgame.listeners.OnBackPressedListener
|
||||
import com.lightgame.utils.Utils
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
|
||||
class MainWrapperFragment : BaseBottomTabFragment<PieceBottomTabBinding>(), OnBackPressedListener, ISuperiorChain, IBusiness {
|
||||
@ -158,6 +167,15 @@ class MainWrapperFragment : BaseBottomTabFragment<PieceBottomTabBinding>(), OnBa
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
val request = ImageRequest.Builder(requireContext())
|
||||
.data("https://www.svgrepo.com/show/43967/colours-samples.svg") // Provide the SVG resource ID
|
||||
.decoderFactory(SvgDecoder.Factory())
|
||||
.transformations(SvgColorTintTransformation(requireContext().getColor(com.gh.gamecenter.common.R.color.primary_theme)))
|
||||
.target(mBinding.svgIv)
|
||||
.build()
|
||||
|
||||
Coil.imageLoader(requireContext()).enqueue(request)
|
||||
|
||||
mViewModel?.tabSelectedLiveData?.observe(viewLifecycleOwner) {
|
||||
val selectedTab = it.getContentWithHandled()
|
||||
if (selectedTab is MainSelectedEvent.SelectedTab && selectedTab.bottomTabIndex != -1) {
|
||||
@ -443,3 +461,19 @@ class MainWrapperFragment : BaseBottomTabFragment<PieceBottomTabBinding>(), OnBa
|
||||
|
||||
override fun getBusinessId(): Pair<String, String> = (mCurrentFragment as? IBusiness)?.getBusinessId() ?: Pair("", "")
|
||||
}
|
||||
|
||||
class SvgColorTintTransformation(
|
||||
private val tintColor: Int
|
||||
) : Transformation {
|
||||
|
||||
override val cacheKey: String = "${javaClass.name}-$tintColor"
|
||||
|
||||
override suspend fun transform(input: Bitmap, size: coil.size.Size): Bitmap {
|
||||
val bitmap = input.copy(Bitmap.Config.ARGB_8888, true) // Create a mutable copy
|
||||
val canvas = Canvas(bitmap)
|
||||
val paint = Paint()
|
||||
paint.colorFilter = android.graphics.PorterDuffColorFilter(tintColor, PorterDuff.Mode.SRC_IN)
|
||||
canvas.drawBitmap(input, 0f, 0f, paint)
|
||||
return bitmap
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,7 +106,8 @@ class RealNameInfoFragment : ToolbarFragment() {
|
||||
}
|
||||
|
||||
private fun initEditingView() {
|
||||
val bodyString = getText(R.string.realname_body_tv)
|
||||
val bodyString =
|
||||
"为响应《国家新闻出版署关于防止未成年沉迷网络游戏的通知》,请认真填写您的身份信息。您提供的证件信息将受到严格保护,仅用于用户实名制认证,不会用作其他用途,请放心填写。前往了解更多信息>>"
|
||||
mBinding.bodyTv.text =
|
||||
SpanBuilder(bodyString)
|
||||
.click(
|
||||
@ -124,13 +125,13 @@ class RealNameInfoFragment : ToolbarFragment() {
|
||||
.build()
|
||||
mBinding.bodyTv.movementMethod = CustomLinkMovementMethod.getInstance()
|
||||
|
||||
val hintString = getText(R.string.realname_hint_tv)
|
||||
val hintString = "特别说明:由于部分用户之前的实名信息不正确或认证失败,可能需要重新认证,请提交真实的信息进行认证即可。部分游戏仅对成年用户进行开放"
|
||||
mBinding.hintTv.text =
|
||||
SpanBuilder(hintString)
|
||||
.bold(0, 5)
|
||||
.build()
|
||||
|
||||
val manualHintString = getText(R.string.realname_manual_hint_tv)
|
||||
val manualHintString = "若您提交的真实身份信息未通过认证或者您持有的为港澳台\\国外身份证件,可转交人工审核"
|
||||
mBinding.manualHintTv.text =
|
||||
SpanBuilder(manualHintString)
|
||||
.click(
|
||||
@ -160,9 +161,6 @@ class RealNameInfoFragment : ToolbarFragment() {
|
||||
mBinding.nameEt.doOnTextChanged { _, _, _, _ ->
|
||||
updateSubmitBtn()
|
||||
}
|
||||
mBinding.textDotIndicator.setOnClickListener {
|
||||
mBinding.nameEt.text.insert(mBinding.nameEt.selectionStart, "\u00B7")
|
||||
}
|
||||
mBinding.idCardEt.doOnTextChanged { _, _, _, _ ->
|
||||
updateSubmitBtn()
|
||||
}
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="2dp" />
|
||||
<stroke android:color="@color/ui_skeleton_frame" android:width="1dp" />
|
||||
</shape>
|
||||
@ -1,4 +1,5 @@
|
||||
<com.gh.gamecenter.common.view.MaterializedConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.gh.gamecenter.common.view.MaterializedConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@ -109,8 +110,8 @@
|
||||
android:id="@+id/installApiContentTv"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="您未授予已安装列表权限,可能导致无法安装及更新等异常情况,建议开启权限!"
|
||||
android:textSize="@dimen/secondary_size"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@ -152,4 +153,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/svgIv"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp" />
|
||||
|
||||
</com.gh.gamecenter.common.view.MaterializedConstraintLayout>
|
||||
@ -34,7 +34,7 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="@string/realname_body_tv" />
|
||||
tools:text="为响应《国家新闻出版署关于防止未成年沉迷网络游戏的通知》,请认真填写您的身份信息。您提供的证件信息将受到严格保护,仅用于用户实名制认证,不会用作其他用途,请放心填写。前往了解更多信息>>" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/hintTv"
|
||||
@ -48,7 +48,7 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/bodyTv"
|
||||
tools:text="@string/realname_hint_tv" />
|
||||
tools:text="特别说明:由于部分用户之前的实名信息不正确或认证失败,可能需要重新认证,请提交真实的信息进行认证即可。部分游戏仅对成年用户进行开放" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/badgeContainer"
|
||||
@ -109,10 +109,9 @@
|
||||
|
||||
<EditText
|
||||
android:id="@+id/nameEt"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@drawable/bg_shape_fa_radius_2"
|
||||
android:hint="请输入真实姓名"
|
||||
android:padding="8dp"
|
||||
@ -121,22 +120,8 @@
|
||||
android:textColorHint="@color/text_instance"
|
||||
android:textCursorDrawable="@drawable/cursor_color"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textDotIndicator"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/nameTv" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textDotIndicator"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="@drawable/bg_stroke_fa_radius_2"
|
||||
android:gravity="center"
|
||||
android:text="@string/realname_dot_indicator"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/text_secondary"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/nameEt" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/idCardTv"
|
||||
android:layout_width="wrap_content"
|
||||
@ -192,7 +177,7 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/submitBtn"
|
||||
tools:text="@string/realname_manual_hint_tv" />
|
||||
tools:text="若您提交的真实身份信息未通过认证或者您持有的为港澳台\国外身份证件,可转交人工审核" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/errorHintTv"
|
||||
|
||||
@ -412,9 +412,6 @@
|
||||
<string name="realname_success_badge_hint_extra_underage">當前認証狀態:未成年</string>
|
||||
<string name="realname_pending_badge_hint">實名信息認証中...</string>
|
||||
<string name="realname_pending_badge_hint_extra">認証期間不影響您正常的遊戲體驗</string>
|
||||
<string name="realname_body_tv">爲響應《國家新聞出版署關於防止未成年沉迷網絡遊戲的通知》,請認真填冩您的身份信息。您提供的証件信息將受到嚴格保護,僅用於用戶實名製認証,不會用作其他用途,請放心填冩。前往了解更多信息>></string>
|
||||
<string name="realname_hint_tv">特別説明:由於部分用戶之前的實名信息不正確或認証失敗,可能需要重新認証,請提交真實的信息進行認証即可。部分遊戲僅對成年用戶進行開放。(特殊字符“·”可通過快捷鍵進行添加)</string>
|
||||
<string name="realname_manual_hint_tv">若您提交的真實身份信息未通過認証或者您持有的爲港澳颱\國外身份証件,可轉交人工審核</string>
|
||||
|
||||
<string name="interested_game_footer_hint">去 <Data><![CDATA[<font color="#1383EB">設置偏好</font>]]></Data> ,讓推薦更懂你的心~</string>
|
||||
|
||||
|
||||
@ -412,10 +412,7 @@
|
||||
<string name="realname_success_badge_hint_extra_underage">当前认证状态:未成年</string>
|
||||
<string name="realname_pending_badge_hint">实名信息认证中...</string>
|
||||
<string name="realname_pending_badge_hint_extra">部分游戏在认证期间无法进行下载</string>
|
||||
<string name="realname_body_tv">为响应《国家新闻出版署关于防止未成年沉迷网络游戏的通知》,请认真填写您的身份信息。您提供的证件信息将受到严格保护,仅用于用户实名制认证,不会用作其他用途,请放心填写。前往了解更多信息>></string>
|
||||
<string name="realname_hint_tv">特别说明:由于部分用户之前的实名信息不正确或认证失败,可能需要重新认证,请提交真实的信息进行认证即可。部分游戏仅对成年用户进行开放。(特殊字符“·”可通过快捷键进行添加)</string>
|
||||
<string name="realname_manual_hint_tv">若您提交的真实身份信息未通过认证或者您持有的为港澳台\国外身份证件,可转交人工审核</string>
|
||||
<string name="realname_dot_indicator" translatable="false">•</string>
|
||||
|
||||
<string name="interested_game_footer_hint">去 <Data><![CDATA[<font color="#1383EB">设置偏好</font>]]></Data> ,让推荐更懂你的心~</string>
|
||||
|
||||
<item name="download_item_type" type="id" />
|
||||
|
||||
@ -7,8 +7,8 @@ ext {
|
||||
targetSdkVersion = 30 // 升级targetSdkVersion到 34 时需要根据官方文档补全前台服务的权限类型。比如 NDownloadService,KeepAliveService
|
||||
|
||||
// application info (每个大版本之间的 versionCode 增加 20)
|
||||
versionCode = 1150
|
||||
versionName = "5.40.0"
|
||||
versionCode = 1151
|
||||
versionName = "5.40.1"
|
||||
applicationId = "com.gh.gamecenter"
|
||||
applicationIdGat = "com.gh.gamecenter.intl"
|
||||
|
||||
@ -100,7 +100,7 @@ ext {
|
||||
skeleton = "1.1.5"
|
||||
mta = "6.8.0"
|
||||
romChecker = "1.0.3"
|
||||
oss = "2.6.0"
|
||||
oss = "2.8.8"
|
||||
desugarJdkLibs = "1.1.5"
|
||||
toolargetool = "0.3.0"
|
||||
chart = "3.1.0"
|
||||
@ -150,7 +150,7 @@ ext {
|
||||
|
||||
xcrashVersion = "3.1.0"
|
||||
aliPayVersion = "15.8.17"
|
||||
acceleratorVersion = "1.0.1"
|
||||
acceleratorVersion = "2.0.2"
|
||||
}
|
||||
|
||||
apply from: 'dependencies_vasdk.gradle'
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.gh.gamecenter.accelerator.provider
|
||||
|
||||
import android.app.Application
|
||||
import com.gh.gamecenter.common.utils.EnvHelper
|
||||
import com.gh.gamecenter.core.HaloApp
|
||||
import com.gh.gamecenter.core.callback.AccelerateState
|
||||
import com.gh.gamecenter.core.callback.OnAccelerateListener
|
||||
import com.gh.gamecenter.core.provider.IAcceleratorDataHolderProvider
|
||||
@ -105,16 +107,29 @@ class AcceleratorProviderImpl : IAcceleratorProvider {
|
||||
// 避免外部多次设置相同的token
|
||||
return
|
||||
}
|
||||
QyAccelerator.getInstance().setQyUserToken(token, setResultCallback = { isSuccess, errMsg ->
|
||||
Utils.log(LOG_TAG, "setQyUserToken:$token --isSuccess:$isSuccess --errMsg:$errMsg")
|
||||
if (isSuccess) {
|
||||
_token = token
|
||||
} else {
|
||||
// 将setToken错误事件上报的sentry,便于后期分析原因
|
||||
SentryHelper.onEventInAllChannel(SENTRY_EVENT_ID, KEY_SET_TOKEN_ERROR_MESSAGE, errMsg)
|
||||
}
|
||||
callback?.invoke(isSuccess)
|
||||
})
|
||||
fun setToken() {
|
||||
QyAccelerator.getInstance().setQyUserToken(token, setResultCallback = { isSuccess, errMsg ->
|
||||
Utils.log(LOG_TAG, "setQyUserToken:$token --isSuccess:$isSuccess --errMsg:$errMsg")
|
||||
if (isSuccess) {
|
||||
_token = token
|
||||
} else {
|
||||
// 将setToken错误事件上报的sentry,便于后期分析原因
|
||||
SentryHelper.onEventInAllChannel(SENTRY_EVENT_ID, KEY_SET_TOKEN_ERROR_MESSAGE, errMsg)
|
||||
}
|
||||
callback?.invoke(isSuccess)
|
||||
})
|
||||
|
||||
}
|
||||
if (QyAccelerator.getInstance().checkApplicationContextIsInit()) {
|
||||
setToken()
|
||||
} else {
|
||||
// 初始化失败,再次初始化之后在setToken
|
||||
val ghVersionName = TheRouter.get(IAcceleratorDataHolderProvider::class.java)?.getGhVersionName() ?: ""
|
||||
init(EnvHelper.isDevEnv, HaloApp.getInstance(), ghVersionName)
|
||||
// 不管初始化成功还是失败,都需要再次setToken,如果失败,正常上报失败日志
|
||||
setToken()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun deleteQyUserToken(): Boolean {
|
||||
@ -173,8 +188,6 @@ class AcceleratorProviderImpl : IAcceleratorProvider {
|
||||
private const val LOG_TAG = "AcceleratorProviderImpl"
|
||||
private const val SENTRY_EVENT_ID = "ACCELERATOR_SET_TOKEN_ERROR"
|
||||
private const val KEY_SET_TOKEN_ERROR_MESSAGE = "set_token_error"
|
||||
private const val KEY_ACC_FAILURE_ERROR = "key_acc_failure_error"
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -44,7 +44,7 @@ object EnvHelper {
|
||||
fun getHost(): String {
|
||||
val buildConfig = TheRouter.get(IBuildConfigProvider::class.java)
|
||||
return if (!PackageFlavorHelper.IS_TEST_FLAVOR) {
|
||||
buildConfig?.getApiHost() ?: ""
|
||||
buildConfig?.getApiHost() ?: "https://and-api.ghzs6.com/v5d5d0/"
|
||||
} else {
|
||||
if (isDevEnv) {
|
||||
buildConfig?.getDevApiHost() ?: ""
|
||||
@ -58,7 +58,7 @@ object EnvHelper {
|
||||
fun getVHost(): String {
|
||||
val buildConfig = TheRouter.get(IBuildConfigProvider::class.java)
|
||||
return if (!PackageFlavorHelper.IS_TEST_FLAVOR) {
|
||||
buildConfig?.getVDevApiHost() ?: ""
|
||||
buildConfig?.getVApiHost() ?: "https://app-api.796697.com"
|
||||
} else {
|
||||
if (isDevEnv) {
|
||||
buildConfig?.getVDevApiHost() ?: ""
|
||||
@ -72,7 +72,7 @@ object EnvHelper {
|
||||
fun getNewHost(): String {
|
||||
val buildConfig = TheRouter.get(IBuildConfigProvider::class.java)
|
||||
return if (!PackageFlavorHelper.IS_TEST_FLAVOR) {
|
||||
buildConfig?.getNewApiHost() ?: ""
|
||||
buildConfig?.getNewApiHost() ?: "https://app-api.ghzs6.com/"
|
||||
} else {
|
||||
if (isDevEnv) {
|
||||
buildConfig?.getNewDevApiHost() ?: ""
|
||||
|
||||
@ -1179,10 +1179,15 @@ fun DownloadEntity.putGameCategory(gameCategory: String) {
|
||||
|
||||
inline fun doOnMainProcessOnly(f: () -> Unit) {
|
||||
val buildConfig = TheRouter.get(IBuildConfigProvider::class.java)
|
||||
val packageUtilsConfig = TheRouter.get(IPackageUtilsProvider::class.java)
|
||||
val processName = packageUtilsConfig?.obtainProcessName()
|
||||
val processName = ProcessUtil.getCurrentProcessName()
|
||||
var applicationId = buildConfig?.getApplicationId()
|
||||
|
||||
if (processName == null || buildConfig?.getApplicationId() == processName) {
|
||||
// buildConfig 为空的兜底方案,至于你说为什么会为空,我也不知道
|
||||
if (applicationId.isNullOrEmpty()) {
|
||||
applicationId = HaloApp.getInstance().packageName ?: "com.gh.gamecenter"
|
||||
}
|
||||
|
||||
if (processName == null || applicationId == processName) {
|
||||
f.invoke()
|
||||
} else {
|
||||
tryWithDefaultCatch {
|
||||
|
||||
@ -8,5 +8,7 @@ interface IAcceleratorDataHolderProvider {
|
||||
|
||||
fun getInitFunResults(): List<String>
|
||||
|
||||
fun getGhVersionName(): String
|
||||
|
||||
fun clear()
|
||||
}
|
||||
2
vasdk
2
vasdk
Submodule vasdk updated: 932474708c...2ee1c3d532
Reference in New Issue
Block a user