File tree Expand file tree Collapse file tree
src/main/java/io/linuxdo/accelerator/android Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[package ]
22name = " linuxdo-accelerator"
3- version = " 0.1.9 "
3+ version = " 0.1.10 "
44edition = " 2024"
55build = " build.rs"
66authors = [" fjh1997 <549308442@qq.com>" ]
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ android {
2020 applicationId = " io.linuxdo.accelerator.android"
2121 minSdk = 28
2222 targetSdk = 35
23- versionCode = 2
24- versionName = " 0.1.9 -android"
23+ versionCode = 3
24+ versionName = " 0.1.10 -android"
2525 }
2626
2727 buildTypes {
Original file line number Diff line number Diff line change @@ -69,7 +69,9 @@ class LinuxdoVpnService : VpnService() {
6969 }
7070
7171 override fun onDestroy () {
72- stopAccelerator(" 服务已销毁" )
72+ if (running.get() || vpnInterface != null ) {
73+ stopAccelerator(" 服务已销毁" )
74+ }
7375 super .onDestroy()
7476 }
7577
@@ -356,6 +358,21 @@ class LinuxdoVpnService : VpnService() {
356358 return Triple (true , status, detail)
357359 }
358360
361+ if (! savedRunning && savedStatus == " 服务已销毁" ) {
362+ val status = " 已停止"
363+ val detail = if (savedDetail.isBlank()) {
364+ " Android VPN DNS 接管已关闭。"
365+ } else {
366+ savedDetail
367+ }
368+ prefs.edit()
369+ .putBoolean(PREF_RUNNING , false )
370+ .putString(PREF_STATUS , status)
371+ .putString(PREF_DETAIL , detail)
372+ .apply ()
373+ return Triple (false , status, detail)
374+ }
375+
359376 if (! savedRunning) {
360377 return Triple (false , savedStatus, savedDetail)
361378 }
Original file line number Diff line number Diff line change @@ -99,9 +99,10 @@ class MainActivity : AppCompatActivity() {
9999 super .onStart()
100100 registerStatusReceiver()
101101 val (running, status, detail) = LinuxdoVpnService .readCurrentStatus(this )
102+ val normalizedStatus = if (! running && status == " 服务已销毁" ) " 已停止" else status
102103 renderState(
103104 running,
104- status ,
105+ normalizedStatus ,
105106 if (detail.isBlank()) {
106107 " 配置文件和 Android 壳已就绪,点击开始加速后会申请 VPN 权限,并强制通过自定义 DoH 接管 linux.do 相关 DNS。"
107108 } else {
You can’t perform that action at this time.
0 commit comments