chore: bump version to 1.2.0 (versionCode 3)
This commit is contained in:
1 parent
8b49607efe
commit
02a206d384
7 files changed
+10
-10
No files matched your search
@@ -18,8 +18,8 @@ android {
|
||||
applicationId = "com.lzxnone.openloc"
|
||||
minSdk = 28
|
||||
targetSdk = 36
|
||||
versionCode = 2
|
||||
versionName = "1.1.0"
|
||||
versionCode = 3
|
||||
versionName = "1.2.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ object UpdateChecker {
|
||||
/**
|
||||
* 检查 GitHub 是否有新版本
|
||||
*/
|
||||
suspend fun checkUpdate(currentVersion: String = "v1.1.0"): Result<UpdateInfo> = withContext(Dispatchers.IO) {
|
||||
suspend fun checkUpdate(currentVersion: String = "v1.2.0"): Result<UpdateInfo> = withContext(Dispatchers.IO) {
|
||||
try {
|
||||
val url = URL(GITHUB_API_URL)
|
||||
val conn = (url.openConnection() as HttpURLConnection).apply {
|
||||
|
||||
@@ -94,7 +94,7 @@ fun MainScreen(
|
||||
// 每次进入软件,若开启了自动检查更新,则在后台静默检测,发现新版才弹窗
|
||||
LaunchedEffect(Unit) {
|
||||
if (AppPreferences.isAutoCheckUpdateEnabled) {
|
||||
val result = UpdateChecker.checkUpdate(currentVersion = "v1.1.0")
|
||||
val result = UpdateChecker.checkUpdate(currentVersion = "v1.2.0")
|
||||
result.getOrNull()?.let { info ->
|
||||
if (info.hasUpdate) {
|
||||
updateInfoToDisplay = info
|
||||
@@ -105,12 +105,12 @@ fun MainScreen(
|
||||
|
||||
val checkingUpdateText = stringResource(id = R.string.home_checking_update)
|
||||
val checkFailedText = stringResource(id = R.string.home_check_update_failed)
|
||||
val alreadyLatestText = stringResource(id = R.string.home_already_latest, "v1.1.0")
|
||||
val alreadyLatestText = stringResource(id = R.string.home_already_latest, "v1.2.0")
|
||||
|
||||
val performManualCheck: () -> Unit = {
|
||||
Toast.makeText(context, checkingUpdateText, Toast.LENGTH_SHORT).show()
|
||||
coroutineScope.launch {
|
||||
val result = UpdateChecker.checkUpdate(currentVersion = "v1.1.0")
|
||||
val result = UpdateChecker.checkUpdate(currentVersion = "v1.2.0")
|
||||
result.onSuccess { info ->
|
||||
if (info.hasUpdate) {
|
||||
updateInfoToDisplay = info
|
||||
|
||||
@@ -58,7 +58,7 @@ fun HomeScreen(
|
||||
|
||||
// 4. 版本与更新模块卡片
|
||||
VersionCard(
|
||||
versionName = "v1.1.0",
|
||||
versionName = "v1.2.0",
|
||||
isAutoCheckEnabled = AppPreferences.isAutoCheckUpdateEnabled,
|
||||
onAutoCheckChange = { AppPreferences.updateAutoCheckUpdateEnabled(it) },
|
||||
onCheckUpdate = onCheckUpdate
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
|
||||
<!-- 版本与更新 -->
|
||||
<string name="home_version_card_title">当前版本</string>
|
||||
<string name="home_version_name">v1.1.0</string>
|
||||
<string name="home_version_name">v1.2.0</string>
|
||||
<string name="home_check_updates_btn">检查更新</string>
|
||||
<string name="home_auto_check_update_title">启动时自动检查更新</string>
|
||||
<string name="home_auto_check_update_desc">每次进入软件自动联网检测 GitHub 最新版本</string>
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
|
||||
<!-- 版本与更新 -->
|
||||
<string name="home_version_card_title">当前版本</string>
|
||||
<string name="home_version_name">v1.1.0</string>
|
||||
<string name="home_version_name">v1.2.0</string>
|
||||
<string name="home_check_updates_btn">检查更新</string>
|
||||
<string name="home_auto_check_update_title">启动时自动检查更新</string>
|
||||
<string name="home_auto_check_update_desc">每次进入软件自动联网检测 GitHub 最新版本</string>
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
|
||||
<!-- Version & Updates -->
|
||||
<string name="home_version_card_title">Current Version</string>
|
||||
<string name="home_version_name">v1.1.0</string>
|
||||
<string name="home_version_name">v1.2.0</string>
|
||||
<string name="home_check_updates_btn">Check for Updates</string>
|
||||
<string name="home_auto_check_update_title">Auto Check on Launch</string>
|
||||
<string name="home_auto_check_update_desc">Automatically check for new releases when opening the app</string>
|
||||
|
||||
Reference in new issue
Block a user