|
@@ -84,6 +84,7 @@ class GlobalController extends GetxController {
|
|
|
// init clash core
|
|
|
|
|
|
//判断clash 程序是否在启动中,如果是可以先停止
|
|
|
+ await onIsProcessRunning(path.basename(Files.assetsCCore.path));
|
|
|
|
|
|
await controllers.service.initClashCoreConfig();
|
|
|
if (controllers.service.coreStatus.value != RunningState.running) return;
|
|
@@ -137,6 +138,11 @@ class GlobalController extends GetxController {
|
|
|
bool isRun;
|
|
|
try {
|
|
|
isRun = await _wlBaseHelpPlugin.isProcessRunning(passName) ?? false;
|
|
|
+
|
|
|
+ if (isRun){
|
|
|
+ await onKillProcess(passName);
|
|
|
+ }
|
|
|
+
|
|
|
} on PlatformException {
|
|
|
isRun = false;
|
|
|
}
|
|
@@ -144,7 +150,7 @@ class GlobalController extends GetxController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- Future<void> onkillProcess(String passName) async {
|
|
|
+ Future<void> onKillProcess(String passName) async {
|
|
|
|
|
|
try {
|
|
|
await _wlBaseHelpPlugin.killProcess(passName);
|
|
@@ -540,6 +546,7 @@ class GlobalController extends GetxController {
|
|
|
await systemProxySwitch(false);
|
|
|
await controllers.service.stopClashCore();
|
|
|
if(!controllers.service.serviceMode.value){{
|
|
|
+ await onKillProcess(path.basename(Files.assetsCCore.path));
|
|
|
await killProcess(path.basename(Files.assetsCCore.path));
|
|
|
}}
|
|
|
|