diff --git a/app/src/main/java/io/nekohasekai/sagernet/ui/MainActivity.kt b/app/src/main/java/io/nekohasekai/sagernet/ui/MainActivity.kt
index 9e63cab..a60012e 100644
--- a/app/src/main/java/io/nekohasekai/sagernet/ui/MainActivity.kt
+++ b/app/src/main/java/io/nekohasekai/sagernet/ui/MainActivity.kt
@@ -18,6 +18,7 @@ import androidx.preference.PreferenceDataStore
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.navigation.NavigationView
import com.google.android.material.snackbar.Snackbar
+import io.nekohasekai.sagernet.BuildConfig
import io.nekohasekai.sagernet.GroupType
import io.nekohasekai.sagernet.Key
import io.nekohasekai.sagernet.R
@@ -117,7 +118,8 @@ class MainActivity : ThemedActivity(),
}
if (isPreview) {
- MaterialAlertDialogBuilder(this).setTitle(R.string.preview_version)
+ MaterialAlertDialogBuilder(this)
+ .setTitle(BuildConfig.PRE_VERSION_NAME)
.setMessage(R.string.preview_version_hint)
.setPositiveButton(android.R.string.ok, null)
.show()
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index 6345801..7b6ddda 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -486,10 +486,9 @@
总是跳过 TLS 证书验证
当网络发生变化时重置出站连接
当设备从睡眠状态唤醒时重置出站连接
- 预览版
本应用为预览版,可能存在诸多问题。若您不愿参与测试,请前往GitHub下载正式发布版本!
检查预览版更新
- 检查正式版
+ 检查正式版更新
发现新版本
当前版本:%1$s\n可升级版本:%2$s\n是否前往下载?
检查成功,但没有更新。
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index b638f05..523c164 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -566,7 +566,6 @@
Padding
Reset outbound connections when network changes
Reset outbound connections when device wake from sleep
- Preview version
This application is a preview version and may contain many problems. If you do not want to test it, please go to GitHub to download the Release version!
Check for preview version updates
Check for release version updates
diff --git a/buildSrc/src/main/kotlin/Helpers.kt b/buildSrc/src/main/kotlin/Helpers.kt
index 0c8ec14..3561cdd 100644
--- a/buildSrc/src/main/kotlin/Helpers.kt
+++ b/buildSrc/src/main/kotlin/Helpers.kt
@@ -193,9 +193,17 @@ fun Project.setupApp() {
applicationVariants.all {
outputs.all {
this as BaseVariantOutputImpl
- outputFileName = outputFileName.replace(project.name, "NekoBox-$versionName")
- .replace("-release", "")
- .replace("-oss", "")
+ val isPreview = outputFileName.contains("-preview")
+ outputFileName = if (isPreview) {
+ outputFileName.replace(
+ project.name,
+ "NekoBox-" + requireMetadata().getProperty("PRE_VERSION_NAME")
+ ).replace("-preview", "")
+ } else {
+ outputFileName.replace(project.name, "NekoBox-$versionName")
+ .replace("-release", "")
+ .replace("-oss", "")
+ }
}
}