浏览代码

fix: 修复被其他VPN挤掉后无法再次连接

lilu 5 月之前
父节点
当前提交
aeb6eb54ea
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      android/app/src/main/kotlin/app/xixi/nomo/XRayService.kt

+ 2 - 0
android/app/src/main/kotlin/app/xixi/nomo/XRayService.kt

@@ -213,6 +213,8 @@ class XRayService : VpnService() {
                 VLog.i(TAG, "XRay proxy started successfully")
             } ?: run {
                 VLog.e(TAG, "Failed to establish VPN tunnel")
+                dealStopMsg()
+                stopSelf()
             }
         } catch (e: Exception) {
             VLog.e(TAG, "启动 XRay 失败", e)