stopService method
停止 Windows 系统服务;helper.exe 缺失或异常时返回 false。
Implementation
@override
Future<bool> stopService() async {
try {
final io.Directory dir = await ProfileStorage().getStorageDirectory();
final io.File helperExe = io.File(p.join(dir.path, WindowsConstants.helperFileName));
if (!await helperExe.exists()) {
return false;
}
final cli = _buildCli(dir);
return await cli.stop();
} catch (e) {
debugPrint('flutter_sing_box 插件停止服务失败, $e');
return false;
}
}