Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
Quick Fix R3.15.0.1
Browse files Browse the repository at this point in the history
回滚appcenter-analytics: 4.4.1 -> 4.3.1,更新数据会Crash
改进用户提示取消逻辑
  • Loading branch information
ryuunoakaihitomi committed Dec 12, 2021
1 parent 983fb89 commit 4b18f58
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
8 changes: 5 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ android {
//targetSdkVersion compileSdkVersion
targetSdkVersion 31
// 版本号:发布日期
versionCode 20211211
versionCode 20211212
// 版本名说明: R3.x.y.z (R3:Refactoring 第三次重构,z:Quick Fix序号)
// 不要包含非ASCII可打印字符,会导致Github release文件名异常
versionName 'R3.15'
versionName 'R3.15.0.1'
resConfigs "en", "zh-rCN"

buildConfigField 'String', 'BUILD_TIME', '\"' + new Date() + '\"'
Expand Down Expand Up @@ -132,7 +132,9 @@ dependencies {
normalImplementation 'com.google.firebase:firebase-analytics-ktx'
normalImplementation 'com.google.firebase:firebase-crashlytics-ktx'

normalImplementation 'com.microsoft.appcenter:appcenter-analytics:4.4.1'
// 4.4.1升级会Crash
//noinspection GradleDependency
normalImplementation 'com.microsoft.appcenter:appcenter-analytics:4.3.1'

/* ------- 其他第三方开源组件 ------- */

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package github.ryuunoakaihitomi.powerpanel.ui
package github.ryuunoakaihitomi.powerpanel.desc

import android.app.*
import android.content.Intent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import github.ryuunoakaihitomi.poweract.PowerAct
import github.ryuunoakaihitomi.poweract.PowerActX
import github.ryuunoakaihitomi.powerpanel.BuildConfig
import github.ryuunoakaihitomi.powerpanel.R
import github.ryuunoakaihitomi.powerpanel.desc.AccessibilityHint.request
import github.ryuunoakaihitomi.powerpanel.stat.Statistics
import github.ryuunoakaihitomi.powerpanel.ui.AccessibilityHint.request
import github.ryuunoakaihitomi.powerpanel.ui.ShortcutActivity
import github.ryuunoakaihitomi.powerpanel.ui.main.MainActivity
import github.ryuunoakaihitomi.powerpanel.util.uiLog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,28 @@ fun Activity.checkBuiltInSupport(lv: ListView) {
else myApp().hasCheckedBuiltInSupport = true

val configKey = "checkBuiltInSupport"
val maxCheckCount = 3
val maxTipCount = 3
var count: Int
getPreferences(Context.MODE_PRIVATE).run {
count = getInt(configKey, 0)
if (count >= maxCheckCount) {
Timber.d("checkBuiltInSupport() disabled after $count checks.")
if (count >= maxTipCount) {
Timber.d("checkBuiltInSupport() disabled after $count tips.")
return
}
edit().putInt(configKey, count + 1).apply()
}

if (DeviceCompatibility.isMiui() &&
// 这是已经经过测试的版本: Android M 的 MIUI 10
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
) {
lv.topSnackBar(R.string.snack_main_migrate_tip_for_miui)
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
lv.topSnackBar(R.string.snack_main_migrate_tip_for_a12)
var hasShown = false
if (DeviceCompatibility.isMiui() &&
// 这是已经经过测试的版本: Android M 的 MIUI 10
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
) {
lv.topSnackBar(R.string.snack_main_migrate_tip_for_miui)
hasShown = true
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
lv.topSnackBar(R.string.snack_main_migrate_tip_for_a12)
hasShown = true
}

if (hasShown) edit().putInt(configKey, count + 1).apply()
}
}

Expand Down

0 comments on commit 4b18f58

Please sign in to comment.