Rollback partial modification
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fl_clash/clash/clash.dart';
|
||||
import 'package:fl_clash/plugins/app.dart';
|
||||
@@ -67,7 +66,6 @@ Future<void> vpnService() async {
|
||||
clashCore.setFdMap(fd.id);
|
||||
},
|
||||
onProcess: (Process process) async {
|
||||
print(process);
|
||||
var packageName = await app?.resolverProcess(process);
|
||||
clashCore.setProcessMap(
|
||||
ProcessMapItem(
|
||||
@@ -112,14 +110,13 @@ Future<void> vpnService() async {
|
||||
onStop: () async {
|
||||
await app?.tip(appLocalizations.stopVpn);
|
||||
await globalState.stopSystemProxy();
|
||||
exit(0);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
globalState.updateTraffic();
|
||||
globalState.updateFunctionLists = [
|
||||
() {
|
||||
() {
|
||||
globalState.updateTraffic();
|
||||
}
|
||||
];
|
||||
@@ -137,7 +134,8 @@ class ServiceMessageHandler with ServiceMessageListener {
|
||||
required Function(Process process) onProcess,
|
||||
required Function(String runTime) onStarted,
|
||||
required Function(String groupName) onLoaded,
|
||||
}) : _onProtect = onProtect,
|
||||
})
|
||||
: _onProtect = onProtect,
|
||||
_onProcess = onProcess,
|
||||
_onStarted = onStarted,
|
||||
_onLoaded = onLoaded;
|
||||
@@ -163,10 +161,11 @@ class ServiceMessageHandler with ServiceMessageListener {
|
||||
}
|
||||
}
|
||||
|
||||
@immutable
|
||||
class TileListenerWithVpn with TileListener {
|
||||
final Function() _onStop;
|
||||
|
||||
TileListenerWithVpn({
|
||||
const TileListenerWithVpn({
|
||||
required Function() onStop,
|
||||
}) : _onStop = onStop;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:fl_clash/common/common.dart';
|
||||
import 'package:fl_clash/enum/enum.dart';
|
||||
import 'package:fl_clash/models/models.dart';
|
||||
import 'package:fl_clash/state.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:proxy/proxy_platform_interface.dart';
|
||||
|
||||
@@ -80,6 +81,7 @@ class Proxy extends ProxyPlatform {
|
||||
bool get isStart => startTime != null && startTime!.isBeforeNow;
|
||||
|
||||
onStarted(int? fd) {
|
||||
debugPrint("onStarted ==> $fd");
|
||||
if (fd == null) return;
|
||||
if (receiver != null) {
|
||||
receiver!.close();
|
||||
|
||||
Reference in New Issue
Block a user