Merge branch 'fix/vgame_backup_issue' into 'dev-5.28.0'
fix: 修复部分设备卸载重装后无法恢复畅玩历史数据的问题 See merge request halo/android/assistant-android!1138
This commit is contained in:
@ -51,6 +51,7 @@ import java.io.IOException
|
||||
import java.io.InputStreamReader
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
/**
|
||||
* 引导页面
|
||||
@ -182,20 +183,6 @@ class SplashScreenActivity : BaseActivity() {
|
||||
private fun showPrivacyDialog(guideLayout: ViewPager) {
|
||||
NewPrivacyPolicyDialogFragment.show(this, null) { isSuccess: Boolean ->
|
||||
if (isSuccess) {
|
||||
// guideLayout.visibility = View.VISIBLE
|
||||
// SPUtils.setBoolean(Constants.SP_BRAND_NEW_USER, false)
|
||||
//
|
||||
// // 恢复畅玩数据
|
||||
// VHelper.recoverVDataIfPossible()
|
||||
//
|
||||
// requestPermission()
|
||||
//
|
||||
// // 检查是否有旧版本光环,有就删掉
|
||||
// AppExecutor.ioExecutor.execute { deleteOutdatedUpdatePackage() }
|
||||
// if (mStartMainActivityDirectly) {
|
||||
// launchMainActivity()
|
||||
// }
|
||||
|
||||
mShouldPrefetchData = false
|
||||
prefetchData()
|
||||
|
||||
@ -220,12 +207,10 @@ class SplashScreenActivity : BaseActivity() {
|
||||
} else {
|
||||
DialogUtils.showPrivacyPolicyDisallowDialog(
|
||||
this,
|
||||
PrivacyPolicyEntity.createDefaultData(),
|
||||
object : EmptyCallback {
|
||||
override fun onCallback() {
|
||||
showPrivacyDialog(guideLayout)
|
||||
}
|
||||
})
|
||||
PrivacyPolicyEntity.createDefaultData()
|
||||
) {
|
||||
showPrivacyDialog(guideLayout)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -434,11 +419,8 @@ class SplashScreenActivity : BaseActivity() {
|
||||
@AfterPermissionGranted(REQUEST_PERMISSION_TAG)
|
||||
private fun checkAndRequestPermission() {
|
||||
if (EasyPermissions.hasPermissions(this, *mPermissions)) {
|
||||
// 恢复畅玩数据
|
||||
VHelper.recoverVDataIfPossible()
|
||||
onPermissionsGranted(REQUEST_PERMISSION_TAG, ArrayList(mPermissions.toList()))
|
||||
|
||||
// 检查是否有旧版本光环,有就删掉
|
||||
runOnIoThread { deleteOutdatedUpdatePackage() }
|
||||
if (mStartMainActivityDirectly) {
|
||||
if (com.gh.gamecenter.common.BuildConfig.BUILD_TIME != 0L) {
|
||||
showGitLogDialogIfNeeded()
|
||||
@ -461,6 +443,17 @@ class SplashScreenActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPermissionsGranted(requestCode: Int, perms: MutableList<String>?) {
|
||||
super.onPermissionsGranted(requestCode, perms)
|
||||
|
||||
if (perms?.contains(Manifest.permission.READ_EXTERNAL_STORAGE) == true) {
|
||||
// 恢复畅玩数据
|
||||
VHelper.recoverVDataIfPossible()
|
||||
// 检查是否有旧版本光环,有就删掉
|
||||
runOnIoThread { deleteOutdatedUpdatePackage() }
|
||||
}
|
||||
}
|
||||
|
||||
// 检查下载文件夹下是否有旧版本的光环助手的包,有则删除
|
||||
private fun deleteOutdatedUpdatePackage() {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user