Skip to content

Commit e0bc813

Browse files
[bot] AutoMerging: merge all upstream's changes:
* https://github.com/proxysu/windows: 修复潜在的可能出现域名检测错误2 proxysu#71
2 parents 3703e6b + 2ffbd9f commit e0bc813

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

ProxySU/MainWindow.xaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:local="clr-namespace:ProxySU"
77
mc:Ignorable="d"
8-
Title="ProxySU - v2.5.3 Beta2" Height="675" Width="660">
8+
Title="ProxySU - v2.5.4 Beta1" Height="675" Width="660">
99
<!--以下样式参考自:https://yq.aliyun.com/articles/331878
1010
https://docs.microsoft.co/en-us/dotnet/desktop-wpf/fundamentals/styles-templates-overview-->
1111
<Window.Resources>

ProxySU/MainWindow.xaml.cs

+6-5
Original file line numberDiff line numberDiff line change
@@ -9941,8 +9941,9 @@ private bool DomainResolutionCurrentIPDetect(SshClient client)
99419941
{
99429942
string nativeIp = ipv4;
99439943

9944-
//sshShellCommand = "ping " + ReceiveConfigurationParameters[4] + " -c1 | grep -oE -m1 \"([0-9]{1,3}\\.){3}[0-9]{1,3}\"";
9945-
sshShellCommand = $"dig @resolver1.opendns.com A {ReceiveConfigurationParameters[4]} +short -4";
9944+
//string cmdFilter = "";
9945+
string cmdFilter = @"| grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | head -n 1";
9946+
sshShellCommand = $"dig @resolver1.opendns.com A {ReceiveConfigurationParameters[4]} +short -4 {cmdFilter}";
99469947
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
99479948

99489949
string resultTestDomainCmd = currentShellCommandResult.TrimEnd('\r', '\n');
@@ -9959,11 +9960,11 @@ private bool DomainResolutionCurrentIPDetect(SshClient client)
99599960
}
99609961
else
99619962
{
9962-
99639963
string nativeIp = ipv6;
99649964

9965-
//sshShellCommand = "ping6 " + ReceiveConfigurationParameters[4] + " -c1 | grep -oE -m1 \"([0-9]{1,3}\\.){3}[0-9]{1,3}\"";
9966-
sshShellCommand = $"dig @resolver1.opendns.com AAAA {ReceiveConfigurationParameters[4]} +short -6";
9965+
//string cmdFilter = "";
9966+
string cmdFilter = @"| grep -oE '(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))' | head -n 1";
9967+
sshShellCommand = $"dig @resolver1.opendns.com AAAA {ReceiveConfigurationParameters[4]} +short -6 {cmdFilter}";
99679968
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
99689969

99699970
string resultTestDomainCmd = currentShellCommandResult.TrimEnd('\r', '\n');

ProxySU/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
5252
// 方法是按如下所示使用“*”: :
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("2.5.3.0")]
55-
[assembly: AssemblyFileVersion("2.5.3.0")]
54+
[assembly: AssemblyVersion("2.5.4.0")]
55+
[assembly: AssemblyFileVersion("2.5.4.0")]

ProxySU/bin/Beta/Beta.zip

231 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)