Fix windows admin auto launch issues

Add android vpn options

Support proxies icon configuration

Optimize android immersion display

Fix some issues
This commit is contained in:
chen08209
2024-09-26 14:29:04 +08:00
parent 82767325e5
commit c91d78b63f
80 changed files with 3922 additions and 2454 deletions

View File

@@ -18,7 +18,6 @@ class GlobalState {
Timer? timer;
Timer? groupsUpdateTimer;
var isVpnService = false;
var autoRun = false;
late PackageInfo packageInfo;
Function? updateCurrentDelayDebounce;
PageController? pageController;
@@ -60,7 +59,7 @@ class GlobalState {
isCompatible: true,
selectedMap: config.currentSelectedMap,
overrideDns: config.overrideDns,
testUrl: config.testUrl,
testUrl: config.appSetting.testUrl,
),
),
);
@@ -77,11 +76,13 @@ class GlobalState {
}) async {
clashCore.start();
if (globalState.isVpnService) {
await vpn?.startVpn(clashConfig.mixedPort);
await vpn?.startVpn();
startListenUpdate();
return;
}
startTime ??= DateTime.now();
await preferences.saveClashConfig(clashConfig);
await preferences.saveConfig(config);
await service?.init();
startListenUpdate();
}
@@ -129,20 +130,20 @@ class GlobalState {
config: config,
clashConfig: clashConfig,
);
clashCore.setState(
CoreState(
enable: config.vpnProps.enable,
accessControl: config.isAccessControl ? config.accessControl : null,
ipv6: config.vpnProps.ipv6,
allowBypass: config.vpnProps.allowBypass,
systemProxy: config.vpnProps.systemProxy,
mixedPort: clashConfig.mixedPort,
onlyProxy: config.onlyProxy,
currentProfileName:
config.currentProfile?.label ?? config.currentProfileId ?? "",
),
);
}
clashCore.setState(
CoreState(
enable: config.vpnProps.enable,
accessControl: config.isAccessControl ? config.accessControl : null,
ipv6: config.vpnProps.ipv6,
allowBypass: config.vpnProps.allowBypass,
systemProxy: config.vpnProps.systemProxy,
onlyProxy: config.appSetting.onlyProxy,
bypassDomain: config.vpnProps.bypassDomain,
currentProfileName:
config.currentProfile?.label ?? config.currentProfileId ?? "",
),
);
updateCoreVersionInfo(appState);
}
@@ -202,7 +203,7 @@ class GlobalState {
proxyName: proxyName,
),
);
if (config.isCloseConnections) {
if (config.appSetting.closeConnections) {
clashCore.closeConnections();
}
}
@@ -228,7 +229,7 @@ class GlobalState {
final traffic = clashCore.getTraffic();
if (Platform.isAndroid && isVpnService == true) {
vpn?.startForeground(
title: clashCore.getState().currentProfileName,
title: clashCore.getCurrentProfileName(),
content: "$traffic",
);
} else {