Merge branch 'hotfix-v5.10.4-554-generic_crashs' into 'legacy-release'

捕抓一些非关键异常

See merge request halo/android/assistant-android!290
This commit is contained in:
陈君陶
2022-07-15 10:41:19 +08:00
2 changed files with 26 additions and 16 deletions

View File

@ -9,28 +9,30 @@ import android.os.Build
import android.os.Bundle
import android.text.TextUtils
import androidx.appcompat.app.AppCompatActivity
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.base.activity.BaseActivity_TabLayout
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout
import com.gh.gamecenter.core.AppExecutor
import com.gh.common.constant.Config
import com.gh.gamecenter.common.constant.Constants
import com.gh.common.exposure.ExposureEvent
import com.gh.common.exposure.ExposureEvent.Companion.createEvent
import com.gh.common.exposure.ExposureManager.log
import com.gh.common.exposure.ExposureTraceUtils.appendTrace
import com.gh.common.exposure.ExposureType
import com.gh.gamecenter.common.constant.EntranceConsts.*
import com.gh.common.util.EntranceUtils.*
import com.gh.common.util.EntranceUtils.jumpActivity
import com.gh.gamecenter.*
import com.gh.gamecenter.amway.AmwayActivity
import com.gh.gamecenter.catalog.CatalogActivity
import com.gh.gamecenter.category.CategoryDirectoryActivity
import com.gh.gamecenter.category2.CategoryV2Activity
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.base.activity.BaseActivity_TabLayout
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.EntranceConsts.*
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.AppExecutor
import com.gh.gamecenter.core.utils.RunningUtils
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.download.DownloadFragment.Companion.INDEX_UPDATE
import com.gh.gamecenter.entity.*
import com.gh.gamecenter.eventbus.EBSkip
@ -57,7 +59,6 @@ import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity
import com.gh.gamecenter.qa.questions.newdetail.NewQuestionDetailActivity
import com.gh.gamecenter.qa.subject.CommunitySubjectActivity
import com.gh.gamecenter.qa.video.detail.ForumVideoDetailActivity
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.security.BindPhoneActivity
import com.gh.gamecenter.servers.GameServerTestActivity
@ -803,7 +804,11 @@ object DirectUtils {
if (context !is AppCompatActivity) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
context.startActivity(intent)
try {
context.startActivity(intent)
} catch (e: ActivityNotFoundException) {
ToastUtils.toast("无法跳转至QQ请稍后再试")
}
} else {
// 没有安装QQ 复制账号
qq?.copyTextAndToast("已复制 QQ $qq")

View File

@ -1,9 +1,10 @@
package com.gh.gamecenter.packagehelper
import android.annotation.SuppressLint
import com.gh.gamecenter.common.utils.toRequestBody
import com.gh.gamecenter.entity.PackageFilter
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.common.utils.toRequestBody
import com.gh.gamecenter.common.utils.tryWithDefaultCatch
import com.gh.gamecenter.entity.PackageFilter
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.room.AppDatabase
import io.reactivex.schedulers.Schedulers
@ -47,13 +48,17 @@ object PackageFilterManager {
if (!appendOnly) {
mValidPackageNameSet.clear()
AppDatabase.getInstance().packageFilterDao().deleteAllPackageName()
tryWithDefaultCatch {
AppDatabase.getInstance().packageFilterDao().deleteAllPackageName()
}
}
for (packageName in data.packages) {
AppDatabase.getInstance().packageFilterDao().addPackageName(
FilterPackageNameEntity(packageName)
)
tryWithDefaultCatch {
AppDatabase.getInstance().packageFilterDao().addPackageName(
FilterPackageNameEntity(packageName)
)
}
partialPackageList.add(packageName)
mValidPackageNameSet.add(packageName)