From 6e85f7985282045d60ae76fc509adc0cefc15857 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sat, 25 Apr 2026 10:55:51 +0800 Subject: [PATCH] Preserve complex profile items during deduplication https://github.com/2dust/v2rayN/issues/9184 --- v2rayN/ServiceLib/Handler/ConfigHandler.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/v2rayN/ServiceLib/Handler/ConfigHandler.cs b/v2rayN/ServiceLib/Handler/ConfigHandler.cs index deafb301..d319118f 100644 --- a/v2rayN/ServiceLib/Handler/ConfigHandler.cs +++ b/v2rayN/ServiceLib/Handler/ConfigHandler.cs @@ -1041,13 +1041,19 @@ public static class ConfigHandler foreach (var item in lstProfile) { - if (!lstKeep.Exists(i => CompareProfileItem(i, item, false))) + if (item.IsComplex()) { lstKeep.Add(item); + continue; + } + + if (lstKeep.Exists(i => CompareProfileItem(i, item, false))) + { + lstRemove.Add(item); } else { - lstRemove.Add(item); + lstKeep.Add(item); } } await RemoveServers(config, lstRemove);