Compare commits

...

3 Commits

Author SHA1 Message Date
chen08209
52d61b15fd Fix the problem that the download of remote resources failed after GeodataMode was turned on, which caused the application to flash back.
Fix edit profile error
2024-06-06 10:15:51 +08:00
chen08209
fea3c14608 Fix quickStart change proxy error 2024-06-05 17:59:53 +08:00
chen08209
84be01a38a Fix core version 2024-06-05 17:59:50 +08:00
8 changed files with 27 additions and 31 deletions

View File

@@ -325,11 +325,14 @@ func overwriteConfig(targetConfig *config.RawConfig, patchConfig config.RawConfi
targetConfig.ExternalUI = ""
targetConfig.Interface = ""
targetConfig.ExternalUIURL = ""
targetConfig.GeodataMode = false
//targetConfig.IPv6 = patchConfig.IPv6
targetConfig.LogLevel = patchConfig.LogLevel
targetConfig.Port = 0
targetConfig.SocksPort = 0
targetConfig.MixedPort = patchConfig.MixedPort
targetConfig.FindProcessMode = process.FindProcessAlways
targetConfig.AllowLan = patchConfig.AllowLan
targetConfig.MixedPort = patchConfig.MixedPort
targetConfig.Mode = patchConfig.Mode
targetConfig.Tun.Enable = patchConfig.Tun.Enable
targetConfig.Tun.Device = patchConfig.Tun.Device

View File

@@ -65,12 +65,7 @@ func validateConfig(s *C.char, port C.longlong) {
i := int64(port)
go func() {
bytes := []byte(C.GoString(s))
rawConfig, err := config.UnmarshalRawConfig(bytes)
if err != nil {
bridge.SendToPort(i, err.Error())
return
}
_, err = config.ParseRawConfig(rawConfig)
_, err := config.UnmarshalRawConfig(bytes)
if err != nil {
bridge.SendToPort(i, err.Error())
return
@@ -237,7 +232,7 @@ func asyncTestDelay(s *C.char) {
func getVersionInfo() *C.char {
versionInfo := map[string]string{
"clashName": constant.Name,
"version": "v1.18.5",
"version": "1.18.5",
}
data, err := json.Marshal(versionInfo)
if err != nil {

View File

@@ -101,7 +101,9 @@ class AppController {
updateProfile(String id) async {
final profile = config.getCurrentProfileForId(id);
if (profile != null) {
await profile.update();
final tempProfile = profile.copyWith();
await tempProfile.update();
config.setProfile(tempProfile);
}
}

View File

@@ -40,7 +40,7 @@ class _EditProfileState extends State<EditProfile> {
_handleConfirm() {
if (!_formKey.currentState!.validate()) return;
final config = widget.context.read<Config>();
final hasUpdate = widget.profile.url != urlController.text;
final hasUpdate = urlController.text.isNotEmpty && widget.profile.url != urlController.text;
widget.profile.url = urlController.text;
widget.profile.label = labelController.text;
widget.profile.autoUpdate = autoUpdate;
@@ -82,7 +82,7 @@ class _EditProfileState extends State<EditProfile> {
},
),
),
if (widget.profile.url != null)...[
if (widget.profile.url != null && widget.profile.url!.isNotEmpty == true)...[
ListItem(
title: TextFormField(
controller: urlController,

View File

@@ -139,9 +139,10 @@ class _ProfilesFragmentState extends State<ProfilesFragment> {
),
child: Selector2<AppState, Config, ProfilesSelectorState>(
selector: (_, appState, config) => ProfilesSelectorState(
profiles: config.profiles,
currentProfileId: config.currentProfileId,
viewMode: appState.viewMode),
profiles: config.profiles,
currentProfileId: config.currentProfileId,
viewMode: appState.viewMode,
),
builder: (context, state, child) {
if (state.profiles.isEmpty) {
return NullStatus(

View File

@@ -95,9 +95,6 @@ class Profile {
}
Future<void> update() async {
if (url == null) {
throw appLocalizations.unableToUpdateCurrentProfileDesc;
}
final response = await request.getFileResponseForUrl(url!);
final disposition = response.headers.value("content-disposition");
label ??= other.getFileNameForDisposition(disposition) ?? id;

View File

@@ -121,19 +121,17 @@ class GlobalState {
required Config config,
required ClashConfig clashConfig,
}) {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (config.profiles.isEmpty) {
stopSystemProxy();
return;
}
config.currentSelectedMap.forEach((key, value) {
clashCore.changeProxy(
ChangeProxyParams(
groupName: key,
proxyName: value,
),
);
});
if (config.profiles.isEmpty) {
stopSystemProxy();
return;
}
config.currentSelectedMap.forEach((key, value) {
clashCore.changeProxy(
ChangeProxyParams(
groupName: key,
proxyName: value,
),
);
});
}

View File

@@ -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.10
version: 0.8.12
environment:
sdk: '>=3.1.0 <4.0.0'