From 9b8c59f888731efa89b9aeab5fac048f509220d0 Mon Sep 17 00:00:00 2001 From: Alireza Date: Sat, 23 Mar 2024 01:35:47 +0100 Subject: [PATCH] store without parse --- v2rayN/v2rayN/Handler/ConfigHandler.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/v2rayN/v2rayN/Handler/ConfigHandler.cs b/v2rayN/v2rayN/Handler/ConfigHandler.cs index 774c5a6a..23f3de7f 100644 --- a/v2rayN/v2rayN/Handler/ConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/ConfigHandler.cs @@ -1180,8 +1180,8 @@ namespace v2rayN.Handler ProfileItem profileItem = new(); //Is v2ray array configuration - var v2rayArrayConfig = JsonUtile.Deserialize(clipboardData); - if (v2rayArrayConfig != null && v2rayArrayConfig.Length > 0) + var configObjects = JsonUtile.Deserialize(clipboardData); + if (configObjects != null && configObjects.Length > 0) { if (isSub && !Utile.IsNullOrEmpty(subid)) { @@ -1189,13 +1189,14 @@ namespace v2rayN.Handler } profileItem = new(); int count = 0; - foreach (var v2rayJson in v2rayArrayConfig) + foreach (var configObject in configObjects) { + var objectString = JsonUtile.Serialize(configObject); + var v2rayJson = JsonUtile.Deserialize(objectString); if (v2rayJson?.inbounds?.Count > 0 && v2rayJson.outbounds?.Count > 0) { var fileName = Utile.GetTempPath($"{Utile.GetGUID(false)}.json"); - var v2rayConfigString = JsonUtile.Serialize(v2rayJson); - File.WriteAllText(fileName, v2rayConfigString); + File.WriteAllText(fileName, objectString); profileItem.coreType = ECoreType.Xray; profileItem.address = fileName;