From ed630363291426bfa9486bf6cfdbf85612175519 Mon Sep 17 00:00:00 2001 From: Kr328 <39107975+Kr328@users.noreply.github.com> Date: Thu, 19 Dec 2019 21:44:15 +0800 Subject: [PATCH] fix crash on proxy only mode --- .../main/java/com/github/kr328/clash/service/ClashService.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/service/src/main/java/com/github/kr328/clash/service/ClashService.kt b/service/src/main/java/com/github/kr328/clash/service/ClashService.kt index 1388a8e..60b2073 100644 --- a/service/src/main/java/com/github/kr328/clash/service/ClashService.kt +++ b/service/src/main/java/com/github/kr328/clash/service/ClashService.kt @@ -12,6 +12,7 @@ import com.github.kr328.clash.core.Clash import com.github.kr328.clash.core.event.* import com.github.kr328.clash.core.utils.Log import java.util.concurrent.Executors +import kotlin.concurrent.thread class ClashService : Service(), IClashEventObserver { private val executor = Executors.newSingleThreadExecutor() @@ -102,6 +103,9 @@ class ClashService : Service(), IClashEventObserver { override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { super.onStartCommand(intent, flags, startId) + notification.setVpn(false) + notification.show() + instance.clash.start() return START_NOT_STICKY