diff --git a/V2rayNG/app/src/main/java/com/v2ray/ang/service/CoreRootService.kt b/V2rayNG/app/src/main/java/com/v2ray/ang/service/CoreRootService.kt index d5265fb8..9162af55 100644 --- a/V2rayNG/app/src/main/java/com/v2ray/ang/service/CoreRootService.kt +++ b/V2rayNG/app/src/main/java/com/v2ray/ang/service/CoreRootService.kt @@ -43,6 +43,11 @@ class CoreRootService : Service(), ServiceControl { NotificationManager.ensureForeground() LogUtil.i(AppConfig.TAG, "StartCore-Root: command received") + if (CoreServiceManager.isRunning()) { + LogUtil.i(AppConfig.TAG, "StartCore-Root: Core is already running") + return START_STICKY + } + // Start the in-process core first (this also posts the foreground notification), // then install the root routing off the main thread. if (!CoreServiceManager.startCoreLoop(null)) {