diff --git a/src-tauri/src/core/profiles.rs b/src-tauri/src/core/profiles.rs index e81b892..551deeb 100644 --- a/src-tauri/src/core/profiles.rs +++ b/src-tauri/src/core/profiles.rs @@ -329,7 +329,9 @@ pub async fn activate_profile( // begin to generate the new profile config let def_config = config::read_yaml::(file_path.clone()); - let mut new_config = Mapping::new(); + + // use the clash config except 5 keys below + let mut new_config = clash_config.clone(); // Only the following fields are allowed: // proxies/proxy-providers/proxy-groups/rule-providers/rules @@ -348,24 +350,6 @@ pub async fn activate_profile( } }); - // add some of the clash `config.yaml` config to it - let valid_keys = vec![ - "mixed-port", - "log-level", - "allow-lan", - "external-controller", - "secret", - "mode", - "ipv6", - ]; - valid_keys.iter().for_each(|key| { - let key = Value::String(key.to_string()); - if clash_config.contains_key(&key) { - let value = clash_config[&key].clone(); - new_config.insert(key, value); - } - }); - config::save_yaml( temp_path.clone(), &new_config,