Skip to content

Commit

Permalink
Merge pull request #87 from dmzz-yyhyy/update_fix
Browse files Browse the repository at this point in the history
修复检查更新渠道及日志
  • Loading branch information
dmzz-yyhyy authored Aug 30, 2024
2 parents e3fabfb + 7a38fce commit 454fccf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ android {
minSdk = 24
targetSdk = 34
// 版本号为x.y.z则versionCode为x*1000000+y*10000+z*100+debug版本号(开发需要时迭代, 两位数)
versionCode = 4_04_009
versionCode = 4_04_010
versionName = "0.4.4"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ class UpdateCheckRepository @Inject constructor(
private val updateChannel = userDataRepository.stringUserData(UserDataPath.Settings.App.UpdateChannel.path)

fun checkAppCenter(): Release {
val url = when (updateChannel.getOrDefault("Development")) {
"Release" -> developmentUrl
"Development" -> releaseUrl
val channel = updateChannel.getOrDefault("Development")
val url = when (channel) {
"Release" -> releaseUrl
"Development" -> developmentUrl
else -> developmentUrl
}

Log.i("UpdateChecker", "Checking for updates on channel \"${updateChannel.get()}\"")
Log.i("UpdateChecker", "Checking for updates on channel \"${channel}\"")

try {
val response = Jsoup
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<string name="settings_auto_check_updates">自动检查更新</string>
<string name="settings_auto_check_updates_desc">应用启动后自动检查更新</string>
<string name="settings_update_channel">更新渠道</string>
<string name="settings_update_channel_desc">检查更新渠道</string>
<string name="settings_update_channel_desc">检查更新时的首选渠道</string>
<string name="settings_get_updates">手动检查更新</string>
<string name="settings_get_updates_desc">手动获取应用更新</string>
<string name="display_settings">显示</string>
Expand Down

0 comments on commit 454fccf

Please sign in to comment.