From 0b3635b5c535f8d57a907b0445aa0aebdb1ad19b Mon Sep 17 00:00:00 2001
From: 2dust <31833384+2dust@users.noreply.github.com>
Date: Wed, 21 Feb 2024 10:17:28 +0800
Subject: [PATCH] Bug fix
---
v2rayN/v2rayN/Common/Utile.cs | 5 ++-
v2rayN/v2rayN/Handler/ConfigHandler.cs | 16 ++++++---
v2rayN/v2rayN/Resx/ResUI.Designer.cs | 48 +++++++++++++-------------
3 files changed, 40 insertions(+), 29 deletions(-)
diff --git a/v2rayN/v2rayN/Common/Utile.cs b/v2rayN/v2rayN/Common/Utile.cs
index 7b5a1f5d..c25a1818 100644
--- a/v2rayN/v2rayN/Common/Utile.cs
+++ b/v2rayN/v2rayN/Common/Utile.cs
@@ -325,7 +325,10 @@ namespace v2rayN
var key = Uri.UnescapeDataString(keyValue[0]);
var val = Uri.UnescapeDataString(keyValue[1]);
- result.Add(key, val);
+ if (result[key] is null)
+ {
+ result.Add(key, val);
+ }
}
return result;
diff --git a/v2rayN/v2rayN/Handler/ConfigHandler.cs b/v2rayN/v2rayN/Handler/ConfigHandler.cs
index 09a52362..9c5d0469 100644
--- a/v2rayN/v2rayN/Handler/ConfigHandler.cs
+++ b/v2rayN/v2rayN/Handler/ConfigHandler.cs
@@ -956,13 +956,21 @@ namespace v2rayN.Handler
if (!Utile.IsNullOrEmpty(profileItem.streamSecurity))
{
- if (Utile.IsNullOrEmpty(profileItem.allowInsecure))
+ if (profileItem.streamSecurity != Global.StreamSecurity
+ && profileItem.streamSecurity != Global.StreamSecurityReality)
{
- profileItem.allowInsecure = config.coreBasicItem.defAllowInsecure.ToString().ToLower();
+ profileItem.streamSecurity = string.Empty;
}
- if (Utile.IsNullOrEmpty(profileItem.fingerprint) && profileItem.streamSecurity == Global.StreamSecurityReality)
+ else
{
- profileItem.fingerprint = config.coreBasicItem.defFingerprint;
+ if (Utile.IsNullOrEmpty(profileItem.allowInsecure))
+ {
+ profileItem.allowInsecure = config.coreBasicItem.defAllowInsecure.ToString().ToLower();
+ }
+ if (Utile.IsNullOrEmpty(profileItem.fingerprint) && profileItem.streamSecurity == Global.StreamSecurityReality)
+ {
+ profileItem.fingerprint = config.coreBasicItem.defFingerprint;
+ }
}
}
diff --git a/v2rayN/v2rayN/Resx/ResUI.Designer.cs b/v2rayN/v2rayN/Resx/ResUI.Designer.cs
index 0ef7edd9..da7c8307 100644
--- a/v2rayN/v2rayN/Resx/ResUI.Designer.cs
+++ b/v2rayN/v2rayN/Resx/ResUI.Designer.cs
@@ -592,7 +592,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 Url(Optional) 的本地化字符串。
+ /// 查找类似 URL(Optional) 的本地化字符串。
///
public static string LvUrl {
get {
@@ -799,7 +799,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 GlobalHotkeySetting 的本地化字符串。
+ /// 查找类似 Global Hotkey Setting 的本地化字符串。
///
public static string menuGlobalHotkeySetting {
get {
@@ -817,7 +817,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 Import old config guiNConfig 的本地化字符串。
+ /// 查找类似 Import old config (guiNConfig) 的本地化字符串。
///
public static string menuImportOldGuiConfig {
get {
@@ -844,7 +844,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 Import Rules From Sub Url 的本地化字符串。
+ /// 查找类似 Import Rules From Subscription URL 的本地化字符串。
///
public static string menuImportRulesFromUrl {
get {
@@ -961,7 +961,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 OptionSetting 的本地化字符串。
+ /// 查找类似 Option Setting 的本地化字符串。
///
public static string menuOptionSetting {
get {
@@ -988,7 +988,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 Reboot as administrator 的本地化字符串。
+ /// 查找类似 Restart as Administrator 的本地化字符串。
///
public static string menuRebootAsAdmin {
get {
@@ -1114,7 +1114,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 RoutingSetting 的本地化字符串。
+ /// 查找类似 Routing Setting 的本地化字符串。
///
public static string menuRoutingSetting {
get {
@@ -1276,7 +1276,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 Subscription group Settings 的本地化字符串。
+ /// 查找类似 Subscription group settings 的本地化字符串。
///
public static string menuSubSetting {
get {
@@ -1447,7 +1447,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 Please fill in the Url 的本地化字符串。
+ /// 查找类似 Please fill in the URL 的本地化字符串。
///
public static string MsgNeedUrl {
get {
@@ -1591,7 +1591,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 Not Run As Admin 的本地化字符串。
+ /// 查找类似 Not run as Admin 的本地化字符串。
///
public static string NotRunAsAdmin {
get {
@@ -1726,7 +1726,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 Run As Admin 的本地化字符串。
+ /// 查找类似 Run as Admin 的本地化字符串。
///
public static string RunAsAdmin {
get {
@@ -1871,7 +1871,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 Alpn 的本地化字符串。
+ /// 查找类似 ALPN 的本地化字符串。
///
public static string TbAlpn {
get {
@@ -1880,7 +1880,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 AlterId 的本地化字符串。
+ /// 查找类似 AlterID 的本地化字符串。
///
public static string TbAlterId {
get {
@@ -2069,7 +2069,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 GlobalHotkey Settings 的本地化字符串。
+ /// 查找类似 Global Hotkey Settings 的本地化字符串。
///
public static string TbGlobalHotkeySetting {
get {
@@ -2672,7 +2672,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 FontSize 的本地化字符串。
+ /// 查找类似 Font Size 的本地化字符串。
///
public static string TbSettingsFontSize {
get {
@@ -2681,7 +2681,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 Http Port 的本地化字符串。
+ /// 查找类似 HTTP Port 的本地化字符串。
///
public static string TbSettingsHttpPort {
get {
@@ -2717,7 +2717,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 Language(Restart) 的本地化字符串。
+ /// 查找类似 Language (Restart) 的本地化字符串。
///
public static string TbSettingsLanguage {
get {
@@ -2834,7 +2834,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 Socks Port 的本地化字符串。
+ /// 查找类似 SOCKS Port 的本地化字符串。
///
public static string TbSettingsSocksPort {
get {
@@ -2843,7 +2843,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 http port=socks port+1 的本地化字符串。
+ /// 查找类似 HTTP port=SOCKS port+1 的本地化字符串。
///
public static string TbSettingsSocksPortTip {
get {
@@ -2852,7 +2852,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 Speed Ping Test Url 的本地化字符串。
+ /// 查找类似 Speed Ping Test URL 的本地化字符串。
///
public static string TbSettingsSpeedPingTestUrl {
get {
@@ -2870,7 +2870,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 SpeedTest Url 的本地化字符串。
+ /// 查找类似 SpeedTest URL 的本地化字符串。
///
public static string TbSettingsSpeedTestUrl {
get {
@@ -2906,7 +2906,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 Subscription conversion Url 的本地化字符串。
+ /// 查找类似 Subscription conversion URL 的本地化字符串。
///
public static string TbSettingsSubConvert {
get {
@@ -3212,7 +3212,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 *QUIC key/Kcp seed 的本地化字符串。
+ /// 查找类似 *QUIC key/KCP seed 的本地化字符串。
///
public static string TransportPathTip3 {
get {
@@ -3230,7 +3230,7 @@ namespace v2rayN.Resx {
}
///
- /// 查找类似 *Kcp seed 的本地化字符串。
+ /// 查找类似 *kcp seed 的本地化字符串。
///
public static string TransportPathTip5 {
get {