Compare commits
1 Commits
v0.8.86-pr
...
v0.8.85-pr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
851935ed92 |
16
CHANGELOG.md
16
CHANGELOG.md
@@ -1,19 +1,3 @@
|
||||
## v0.8.85
|
||||
|
||||
- Support override script
|
||||
|
||||
- Support proxies search
|
||||
|
||||
- Support svg display
|
||||
|
||||
- Optimize config persistence
|
||||
|
||||
- Add some scenes auto close connections
|
||||
|
||||
- Update core
|
||||
|
||||
- Optimize more details
|
||||
|
||||
## v0.8.84
|
||||
|
||||
- Fix windows service verify issues
|
||||
|
||||
@@ -104,7 +104,7 @@ fun ConnectivityManager.resolveDns(network: Network?): List<String> {
|
||||
fun InetAddress.asSocketAddressText(port: Int): String {
|
||||
return when (this) {
|
||||
is Inet6Address ->
|
||||
"[${numericToTextFormat(this)}]:$port"
|
||||
"[${numericToTextFormat(this.address)}]:$port"
|
||||
|
||||
is Inet4Address ->
|
||||
"${this.hostAddress}:$port"
|
||||
@@ -141,8 +141,7 @@ fun Context.getActionPendingIntent(action: String): PendingIntent {
|
||||
}
|
||||
}
|
||||
|
||||
private fun numericToTextFormat(address: Inet6Address): String {
|
||||
val src = address.address
|
||||
private fun numericToTextFormat(src: ByteArray): String {
|
||||
val sb = StringBuilder(39)
|
||||
for (i in 0 until 8) {
|
||||
sb.append(
|
||||
@@ -155,10 +154,6 @@ private fun numericToTextFormat(address: Inet6Address): String {
|
||||
sb.append(":")
|
||||
}
|
||||
}
|
||||
if (address.scopeId > 0) {
|
||||
sb.append("%")
|
||||
sb.append(address.scopeId)
|
||||
}
|
||||
return sb.toString()
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,6 @@ data object VpnPlugin : FlutterPlugin, MethodChannel.MethodCallHandler {
|
||||
}
|
||||
|
||||
fun handleStart(options: VpnOptions): Boolean {
|
||||
onUpdateNetwork();
|
||||
if (options.enable != this.options?.enable) {
|
||||
this.flClashService = null
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ Future<void> _service(List<String> flags) async {
|
||||
vpn?.addListener(
|
||||
_VpnListenerWithService(
|
||||
onDnsChanged: (String dns) {
|
||||
print("handle dns $dns");
|
||||
clashLibHandler.updateDns(dns);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -200,24 +200,6 @@ class Tun with _$Tun {
|
||||
}
|
||||
}
|
||||
|
||||
extension TunExt on Tun {
|
||||
Tun getRealTun(RouteMode routeMode) {
|
||||
final mRouteAddress = routeMode == RouteMode.bypassPrivate
|
||||
? defaultBypassPrivateRouteAddress
|
||||
: routeAddress;
|
||||
return switch (system.isDesktop) {
|
||||
true => copyWith(
|
||||
autoRoute: true,
|
||||
routeAddress: [],
|
||||
),
|
||||
false => copyWith(
|
||||
autoRoute: mRouteAddress.isEmpty ? true : false,
|
||||
routeAddress: mRouteAddress,
|
||||
),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@freezed
|
||||
class FallbackFilter with _$FallbackFilter {
|
||||
const factory FallbackFilter({
|
||||
|
||||
@@ -94,7 +94,7 @@ final coreStateProvider = AutoDisposeProvider<CoreState>.internal(
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
typedef CoreStateRef = AutoDisposeProviderRef<CoreState>;
|
||||
String _$updateParamsHash() => r'012df72ab0e769a51c573f4692031506d7b1f1b4';
|
||||
String _$updateParamsHash() => r'79fd7a5a8650fabac3a2ca7ce903c1d9eb363ed2';
|
||||
|
||||
/// See also [updateParams].
|
||||
@ProviderFor(updateParams)
|
||||
@@ -126,7 +126,7 @@ final proxyStateProvider = AutoDisposeProvider<ProxyState>.internal(
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
typedef ProxyStateRef = AutoDisposeProviderRef<ProxyState>;
|
||||
String _$trayStateHash() => r'61c99bbae2cb7ed69dc9ee0f2149510eb6a87df4';
|
||||
String _$trayStateHash() => r'39ff84c50ad9c9cc666fa2538fe13ec0d7236b2e';
|
||||
|
||||
/// See also [trayState].
|
||||
@ProviderFor(trayState)
|
||||
|
||||
@@ -105,15 +105,10 @@ CoreState coreState(Ref ref) {
|
||||
|
||||
@riverpod
|
||||
UpdateParams updateParams(Ref ref) {
|
||||
final routeMode = ref.watch(
|
||||
networkSettingProvider.select(
|
||||
(state) => state.routeMode,
|
||||
),
|
||||
);
|
||||
return ref.watch(
|
||||
patchClashConfigProvider.select(
|
||||
(state) => UpdateParams(
|
||||
tun: state.tun.getRealTun(routeMode),
|
||||
tun: state.tun,
|
||||
allowLan: state.allowLan,
|
||||
findProcessMode: state.findProcessMode,
|
||||
mode: state.mode,
|
||||
@@ -158,11 +153,9 @@ TrayState trayState(Ref ref) {
|
||||
final appSetting = ref.watch(
|
||||
appSettingProvider,
|
||||
);
|
||||
final groups = ref
|
||||
.watch(
|
||||
currentGroupsStateProvider,
|
||||
)
|
||||
.value;
|
||||
final groups = ref.watch(
|
||||
groupsProvider,
|
||||
);
|
||||
final brightness = ref.watch(
|
||||
appBrightnessProvider,
|
||||
);
|
||||
|
||||
@@ -315,9 +315,19 @@ class GlobalState {
|
||||
final profileId = profile.id;
|
||||
final configMap = await getProfileConfig(profileId);
|
||||
final rawConfig = await handleEvaluate(configMap);
|
||||
final realPatchConfig = patchConfig.copyWith(
|
||||
tun: patchConfig.tun.getRealTun(config.networkProps.routeMode),
|
||||
);
|
||||
final routeAddress =
|
||||
config.networkProps.routeMode == RouteMode.bypassPrivate
|
||||
? defaultBypassPrivateRouteAddress
|
||||
: patchConfig.tun.routeAddress;
|
||||
final realPatchConfig = !system.isDesktop
|
||||
? patchConfig.copyWith.tun(
|
||||
autoRoute: routeAddress.isEmpty ? true : false,
|
||||
routeAddress: routeAddress,
|
||||
)
|
||||
: patchConfig.copyWith.tun(
|
||||
autoRoute: true,
|
||||
routeAddress: [],
|
||||
);
|
||||
rawConfig["external-controller"] = realPatchConfig.externalController.value;
|
||||
rawConfig["external-ui"] = "";
|
||||
rawConfig["interface-name"] = "";
|
||||
@@ -401,23 +411,21 @@ class GlobalState {
|
||||
for (final host in realPatchConfig.hosts.entries) {
|
||||
rawConfig["hosts"][host.key] = host.value.splitByMultipleSeparators;
|
||||
}
|
||||
if (rawConfig["dns"] == null) {
|
||||
rawConfig["dns"] = {};
|
||||
}
|
||||
final isEnableDns = rawConfig["dns"]["enable"] == true;
|
||||
final overrideDns = globalState.config.overrideDns;
|
||||
if (overrideDns || !isEnableDns) {
|
||||
final dns = switch (!isEnableDns) {
|
||||
true => realPatchConfig.dns.copyWith(
|
||||
nameserver: [...realPatchConfig.dns.nameserver, "system://"]),
|
||||
false => realPatchConfig.dns,
|
||||
};
|
||||
rawConfig["dns"] = dns.toJson();
|
||||
if (overrideDns) {
|
||||
rawConfig["dns"] = realPatchConfig.dns.toJson();
|
||||
rawConfig["dns"]["nameserver-policy"] = {};
|
||||
for (final entry in dns.nameserverPolicy.entries) {
|
||||
for (final entry in realPatchConfig.dns.nameserverPolicy.entries) {
|
||||
rawConfig["dns"]["nameserver-policy"][entry.key] =
|
||||
entry.value.splitByMultipleSeparators;
|
||||
}
|
||||
} else {
|
||||
if (rawConfig["dns"] == null) {
|
||||
rawConfig["dns"] = {};
|
||||
}
|
||||
if (rawConfig["dns"]["enable"] != false) {
|
||||
rawConfig["dns"]["enable"] = true;
|
||||
}
|
||||
}
|
||||
var rules = [];
|
||||
if (rawConfig["rules"] != null) {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fl_clash/clash/clash.dart';
|
||||
import 'package:fl_clash/common/common.dart';
|
||||
import 'package:fl_clash/enum/enum.dart';
|
||||
import 'package:fl_clash/models/models.dart';
|
||||
@@ -26,7 +27,7 @@ class _OverrideProfileViewState extends State<OverrideProfileView> {
|
||||
_initState(WidgetRef ref) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
Future.delayed(Duration(milliseconds: 300), () async {
|
||||
final rawConfig = await globalState.getProfileConfig(widget.profileId);
|
||||
final rawConfig = await clashCore.getConfig(widget.profileId);
|
||||
final snippet = ClashConfigSnippet.fromJson(rawConfig);
|
||||
final overrideData = ref.read(
|
||||
getProfileOverrideDataProvider(widget.profileId),
|
||||
@@ -597,7 +598,7 @@ class RuleContent extends ConsumerWidget {
|
||||
tag: CacheTag.rules,
|
||||
itemBuilder: (context, index) {
|
||||
final rule = rules[index];
|
||||
return ReorderableDelayedDragStartListener(
|
||||
return ReorderableDragStartListener(
|
||||
key: ObjectKey(rule),
|
||||
index: index,
|
||||
child: _buildItem(
|
||||
|
||||
@@ -288,7 +288,7 @@ class ListInputPage extends StatelessWidget {
|
||||
final e = items[index];
|
||||
return _InputItem(
|
||||
key: ValueKey(e),
|
||||
ReorderableDelayedDragStartListener(
|
||||
ReorderableDragStartListener(
|
||||
index: index,
|
||||
child: CommonCard(
|
||||
child: ListItem(
|
||||
@@ -440,7 +440,7 @@ class MapInputPage extends StatelessWidget {
|
||||
final e = items[index];
|
||||
return _InputItem(
|
||||
key: ValueKey(e.key),
|
||||
ReorderableDelayedDragStartListener(
|
||||
ReorderableDragStartListener(
|
||||
index: index,
|
||||
child: CommonCard(
|
||||
child: ListItem(
|
||||
@@ -613,7 +613,7 @@ class _InputItem extends StatelessWidget {
|
||||
color: Colors.transparent,
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
margin: EdgeInsets.symmetric(vertical: 8),
|
||||
margin: EdgeInsets.symmetric(vertical: 4),
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: fl_clash
|
||||
description: A multi-platform proxy client based on ClashMeta, simple and easy to use, open-source and ad-free.
|
||||
publish_to: 'none'
|
||||
version: 0.8.86+202506141
|
||||
version: 0.8.85+202506063
|
||||
environment:
|
||||
sdk: '>=3.1.0 <4.0.0'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user