File tree Expand file tree Collapse file tree 4 files changed +15
-7
lines changed
java/io/nekohasekai/sagernet/ui Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import androidx.preference.PreferenceDataStore
1818import com.google.android.material.dialog.MaterialAlertDialogBuilder
1919import com.google.android.material.navigation.NavigationView
2020import com.google.android.material.snackbar.Snackbar
21+ import io.nekohasekai.sagernet.BuildConfig
2122import io.nekohasekai.sagernet.GroupType
2223import io.nekohasekai.sagernet.Key
2324import io.nekohasekai.sagernet.R
@@ -117,7 +118,8 @@ class MainActivity : ThemedActivity(),
117118 }
118119
119120 if (isPreview) {
120- MaterialAlertDialogBuilder (this ).setTitle(R .string.preview_version)
121+ MaterialAlertDialogBuilder (this )
122+ .setTitle(BuildConfig .PRE_VERSION_NAME )
121123 .setMessage(R .string.preview_version_hint)
122124 .setPositiveButton(android.R .string.ok, null )
123125 .show()
Original file line number Diff line number Diff line change 486486 <string name =" global_allow_insecure" >总是跳过 TLS 证书验证</string >
487487 <string name =" network_change_reset_connections" >当网络发生变化时重置出站连接</string >
488488 <string name =" wake_reset_connections" >当设备从睡眠状态唤醒时重置出站连接</string >
489- <string name =" preview_version" >预览版</string >
490489 <string name =" preview_version_hint" >本应用为预览版,可能存在诸多问题。若您不愿参与测试,请前往GitHub下载正式发布版本!</string >
491490 <string name =" check_update_preview" >检查预览版更新</string >
492- <string name =" check_update_release" >检查正式版 </string >
491+ <string name =" check_update_release" >检查正式版更新 </string >
493492 <string name =" update_dialog_title" >发现新版本</string >
494493 <string name =" update_dialog_message" >当前版本:%1$s\n可升级版本:%2$s\n是否前往下载?</string >
495494 <string name =" check_update_no" >检查成功,但没有更新。</string >
Original file line number Diff line number Diff line change 566566 <string name =" padding" >Padding</string >
567567 <string name =" network_change_reset_connections" >Reset outbound connections when network changes</string >
568568 <string name =" wake_reset_connections" >Reset outbound connections when device wake from sleep</string >
569- <string name =" preview_version" >Preview version</string >
570569 <string name =" preview_version_hint" >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!</string >
571570 <string name =" check_update_preview" >Check for preview version updates</string >
572571 <string name =" check_update_release" >Check for release version updates</string >
Original file line number Diff line number Diff line change @@ -193,9 +193,17 @@ fun Project.setupApp() {
193193 applicationVariants.all {
194194 outputs.all {
195195 this as BaseVariantOutputImpl
196- outputFileName = outputFileName.replace(project.name, " NekoBox-$versionName " )
197- .replace(" -release" , " " )
198- .replace(" -oss" , " " )
196+ val isPreview = outputFileName.contains(" -preview" )
197+ outputFileName = if (isPreview) {
198+ outputFileName.replace(
199+ project.name,
200+ " NekoBox-" + requireMetadata().getProperty(" PRE_VERSION_NAME" )
201+ ).replace(" -preview" , " " )
202+ } else {
203+ outputFileName.replace(project.name, " NekoBox-$versionName " )
204+ .replace(" -release" , " " )
205+ .replace(" -oss" , " " )
206+ }
199207 }
200208 }
201209
You can’t perform that action at this time.
0 commit comments