From 5f9f677467d011ee431e119a3597b29101a406ce Mon Sep 17 00:00:00 2001 From: DHR60 Date: Fri, 11 Apr 2025 09:27:34 +0800 Subject: [PATCH 1/5] Adjust menu items (#7100) * Adjust menu items * fix #7089 --- v2rayN/ServiceLib/Services/SpeedtestService.cs | 4 ++-- v2rayN/v2rayN.Desktop/Views/MainWindow.axaml | 4 ++-- v2rayN/v2rayN/Views/MainWindow.xaml | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/v2rayN/ServiceLib/Services/SpeedtestService.cs b/v2rayN/ServiceLib/Services/SpeedtestService.cs index 2a605d36..f4cd64a2 100644 --- a/v2rayN/ServiceLib/Services/SpeedtestService.cs +++ b/v2rayN/ServiceLib/Services/SpeedtestService.cs @@ -357,8 +357,8 @@ public class SpeedtestService private List> GetTestBatchItem(List lstSelected, int pageSize) { List> lstTest = new(); - var lst1 = lstSelected.Where(t => t.ConfigType is not (EConfigType.Hysteria2 or EConfigType.TUIC or EConfigType.WireGuard)).ToList(); - var lst2 = lstSelected.Where(t => t.ConfigType is EConfigType.Hysteria2 or EConfigType.TUIC or EConfigType.WireGuard).ToList(); + var lst1 = lstSelected.Where(t => t.ConfigType is not (EConfigType.Hysteria2 or EConfigType.TUIC)).ToList(); + var lst2 = lstSelected.Where(t => t.ConfigType is EConfigType.Hysteria2 or EConfigType.TUIC).ToList(); for (var num = 0; num < (int)Math.Ceiling(lst1.Count * 1.0 / pageSize); num++) { diff --git a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml index f5d1b947..bbc78a72 100644 --- a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml @@ -39,13 +39,13 @@ + + - - diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml b/v2rayN/v2rayN/Views/MainWindow.xaml index 5417da0c..9fb2a3ae 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml +++ b/v2rayN/v2rayN/Views/MainWindow.xaml @@ -81,6 +81,14 @@ x:Name="menuAddShadowsocksServer" Height="{StaticResource MenuItemHeight}" Header="{x:Static resx:ResUI.menuAddShadowsocksServer}" /> + + - - From 666c874998f8814c8fa4500db25cdc060dffcd5f Mon Sep 17 00:00:00 2001 From: Reza Bakhshi Laktasaraei <74649066+rezabakhshilaktasaraei@users.noreply.github.com> Date: Fri, 11 Apr 2025 04:58:34 +0330 Subject: [PATCH 2/5] Add accessibility labels to improve screen reader support (#7105) * Add accessibility with AutomationProperties.Name to menus * Add accessibility labels to StatusBarView using ResUI resources * Add accessibility labels to ProfilesView using ResUI resources --- v2rayN/v2rayN/Views/MainWindow.xaml | 24 +++++++++++++------- v2rayN/v2rayN/Views/ProfilesView.xaml | 12 ++++++---- v2rayN/v2rayN/Views/StatusBarView.xaml | 31 +++++++++++++++++--------- 3 files changed, 44 insertions(+), 23 deletions(-) diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml b/v2rayN/v2rayN/Views/MainWindow.xaml index 9fb2a3ae..2537983e 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml +++ b/v2rayN/v2rayN/Views/MainWindow.xaml @@ -42,7 +42,8 @@ ClipToBounds="True" Style="{StaticResource MaterialDesignToolBar}"> - + - + - + - + - + - + - + - + + ToolTip="{x:Static resx:ResUI.menuSubEdit}" + AutomationProperties.Name="{x:Static resx:ResUI.menuSubEdit}"> @@ -60,7 +62,8 @@ Height="30" Margin="{StaticResource MarginLeftRight8}" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" - ToolTip="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}"> + ToolTip="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}" + AutomationProperties.Name="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}"> + Style="{StaticResource DefTextBox}" + AutomationProperties.Name="{x:Static resx:ResUI.MsgServerTitle}" /> + VerticalAlignment="Center" AutomationProperties.Name="{x:Static resx:ResUI.TbEnableTunAs}" /> + Style="{StaticResource MaterialDesignFloatingHintComboBox}" + AutomationProperties.Name="{x:Static resx:ResUI.menuSystemproxy}"> @@ -89,7 +90,8 @@ materialDesign:HintAssist.Hint="{x:Static resx:ResUI.menuRouting}" DisplayMemberPath="Remarks" FontSize="{DynamicResource StdFontSize}" - Style="{StaticResource MaterialDesignFloatingHintComboBox}" /> + Style="{StaticResource MaterialDesignFloatingHintComboBox}" + AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}"/> @@ -107,7 +109,8 @@ ToolTipText="v2rayN"> - + - + - + - + - + + Style="{StaticResource MaterialDesignFilledComboBox}" + AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}"/> - + + Style="{StaticResource MaterialDesignFilledComboBox}" + AutomationProperties.Name="{x:Static resx:ResUI.menuServers}"/> From 519e5881244744f3e17773cab2f882a6ecc4244f Mon Sep 17 00:00:00 2001 From: DHR60 Date: Sat, 12 Apr 2025 09:52:20 +0800 Subject: [PATCH 3/5] fix #7105 (#7109) --- v2rayN/v2rayN/Views/MainWindow.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml b/v2rayN/v2rayN/Views/MainWindow.xaml index 2537983e..6c233ef4 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml +++ b/v2rayN/v2rayN/Views/MainWindow.xaml @@ -147,7 +147,7 @@ - From cf5913748109cfc50529297a9b1dac5a8722ac60 Mon Sep 17 00:00:00 2001 From: DHR60 Date: Sat, 12 Apr 2025 10:00:18 +0800 Subject: [PATCH 4/5] fix dns leak (#7110) --- v2rayN/ServiceLib/Models/V2rayConfig.cs | 1 + v2rayN/ServiceLib/Sample/dns_v2ray_normal | 1 + v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs | 1 + 3 files changed, 3 insertions(+) diff --git a/v2rayN/ServiceLib/Models/V2rayConfig.cs b/v2rayN/ServiceLib/Models/V2rayConfig.cs index d080d14c..2e5ed4b4 100644 --- a/v2rayN/ServiceLib/Models/V2rayConfig.cs +++ b/v2rayN/ServiceLib/Models/V2rayConfig.cs @@ -210,6 +210,7 @@ public class DnsServer4Ray { public string? address { get; set; } public List? domains { get; set; } + public bool? skipFallback { get; set; } } public class Routing4Ray diff --git a/v2rayN/ServiceLib/Sample/dns_v2ray_normal b/v2rayN/ServiceLib/Sample/dns_v2ray_normal index 9aecbd6e..3f9c8b22 100644 --- a/v2rayN/ServiceLib/Sample/dns_v2ray_normal +++ b/v2rayN/ServiceLib/Sample/dns_v2ray_normal @@ -15,6 +15,7 @@ }, { "address": "223.5.5.5", + "skipFallback": true, "domains": [ "geosite:cn" ], diff --git a/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs b/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs index 1bd23872..95511836 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs @@ -1185,6 +1185,7 @@ public class CoreConfigV2rayService var dnsServer = new DnsServer4Ray() { address = string.IsNullOrEmpty(dNSItem?.DomainDNSAddress) ? Global.DomainDNSAddress.FirstOrDefault() : dNSItem?.DomainDNSAddress, + skipFallback = true, domains = [node.Address] }; servers.AsArray().Add(JsonUtils.SerializeToNode(dnsServer)); From ce6572af3da479b546bc9ea764a4462050ea0ba5 Mon Sep 17 00:00:00 2001 From: DHR60 Date: Sat, 12 Apr 2025 19:03:34 +0800 Subject: [PATCH 5/5] Fix xray wireguard chained proxies not working (#7113) * Fix chained proxies not working * Add domain field for WireGuard exit node --- .../CoreConfig/CoreConfigV2rayService.cs | 54 ++++++++++++++++++- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs b/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs index 95511836..7b940d07 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs @@ -1176,20 +1176,70 @@ public class CoreConfigV2rayService private async Task GenDnsDomains(ProfileItem? node, JsonNode dns, DNSItem? dNSItem) { if (node == null) - { return 0; } + { + return 0; + } var servers = dns["servers"]; if (servers != null) { + var domainList = new List(); + string? wireguardEndpointDomain = null; if (Utils.IsDomain(node.Address)) + { + domainList.Add(node.Address); + } + var subItem = await AppHandler.Instance.GetSubItem(node.Subid); + if (subItem is not null) + { + // Previous proxy + var prevNode = await AppHandler.Instance.GetProfileItemViaRemarks(subItem.PrevProfile); + if (prevNode is not null + && prevNode.ConfigType != EConfigType.Custom + && prevNode.ConfigType != EConfigType.Hysteria2 + && prevNode.ConfigType != EConfigType.TUIC + && Utils.IsDomain(prevNode.Address)) + { + domainList.Add(prevNode.Address); + } + + // Next proxy + var nextNode = await AppHandler.Instance.GetProfileItemViaRemarks(subItem.NextProfile); + if (nextNode is not null + && nextNode.ConfigType != EConfigType.Custom + && nextNode.ConfigType != EConfigType.Hysteria2 + && nextNode.ConfigType != EConfigType.TUIC + && Utils.IsDomain(nextNode.Address)) + { + if (nextNode.ConfigType == EConfigType.WireGuard) + { + wireguardEndpointDomain = nextNode.Address; + } + else + { + domainList.Add(nextNode.Address); + } + } + } + if (domainList.Count > 0) { var dnsServer = new DnsServer4Ray() { address = string.IsNullOrEmpty(dNSItem?.DomainDNSAddress) ? Global.DomainDNSAddress.FirstOrDefault() : dNSItem?.DomainDNSAddress, skipFallback = true, - domains = [node.Address] + domains = domainList }; servers.AsArray().Add(JsonUtils.SerializeToNode(dnsServer)); } + if (wireguardEndpointDomain is not null) + { + var dnsServer = new DnsServer4Ray() + { + address = string.IsNullOrEmpty(dNSItem?.DomainDNSAddress) ? Global.DomainDNSAddress.FirstOrDefault() : dNSItem?.DomainDNSAddress, + skipFallback = true, + domains = new() { wireguardEndpointDomain } + }; + servers.AsArray().Insert(0, JsonUtils.SerializeToNode(dnsServer)); + } } return await Task.FromResult(0); }