diff --git a/ProxySU/MainWindow.xaml b/ProxySU/MainWindow.xaml index fddda06..42a9b0a 100644 --- a/ProxySU/MainWindow.xaml +++ b/ProxySU/MainWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:ProxySU" mc:Ignorable="d" - Title="ProxySU - v2.5.0 Beta1" Height="675" Width="660"> + Title="ProxySU - v2.5.0 Beta2" Height="675" Width="660"> diff --git a/ProxySU/MainWindow.xaml.cs b/ProxySU/MainWindow.xaml.cs index ee30f3f..0e4b9ef 100644 --- a/ProxySU/MainWindow.xaml.cs +++ b/ProxySU/MainWindow.xaml.cs @@ -8051,6 +8051,82 @@ namespace ProxySU } #endregion + #region 卸载Xay + + //******"检测系统是否已经安装Xray......"******03 + SetUpProgressBarProcessing(66); + currentStatus = Application.Current.FindResource("DisplayInstallInfo_TestExistSoft").ToString() + "Xray......"; + MainWindowsShowInfo(currentStatus); + + //sshShellCommand = @"find / -name v2ray"; + //currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + functionResult = FileCheckExists(client, @"/usr/local/bin/xray"); + if (functionResult == true) + { + //******"检测到已安装V2Ray!开始卸载Xray......"****** + SetUpProgressBarProcessing(68); + currentStatus = Application.Current.FindResource("DisplayInstallInfo_DiscoverProxySoft").ToString() + + "Xray!" + + Application.Current.FindResource("DisplayInstallInfo_StartRemoveProxy").ToString() + + "Xray......"; + MainWindowsShowInfo(currentStatus); + + sshShellCommand = @"systemctl stop xray"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + saveShellScriptFileName = GenerateRandomScriptFileName(GenerateRandomStr(10)); + + sshShellCommand = $"curl -o {saveShellScriptFileName} https://raw.githubusercontent.com/XTLS/Xray-install/main/install-release.sh"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + functionResult = FileCheckExists(client, $"{saveShellScriptFileName}"); + if (functionResult == false) + { + //***文件下载失败!*** + currentStatus = Application.Current.FindResource("DisplayInstallInfo_DownloadScriptFailed").ToString(); + MainWindowsShowInfo(currentStatus); + return; + } + + sshShellCommand = $"bash {saveShellScriptFileName} --remove"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = @"systemctl disable xray"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = @"rm -rf /usr/local/etc/xray /var/log/xray"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = $"rm -f {saveShellScriptFileName}"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + functionResult = FileCheckExists(client, @"/usr/local/bin/xray"); + if (functionResult == true) + //if (currentShellCommandResult.Contains("/usr/local/bin/v2ray") == true) + { + //******"V2Ray卸载失败!请向开发者问询!"****** + currentStatus = "Xray" + Application.Current.FindResource("DisplayInstallInfo_RemoveProxySoftFailed").ToString(); + MainWindowsShowInfo(currentStatus); + } + else + { + //******"V2Ray卸载成功!"****** + SetUpProgressBarProcessing(70); + currentStatus = "Xray" + Application.Current.FindResource("DisplayInstallInfo_RemoveProxySoftSuccess").ToString(); + MainWindowsShowInfo(currentStatus); + } + + } + else + { + //******"检测结果:未安装Xray!"******04 + SetUpProgressBarProcessing(70); + currentStatus = Application.Current.FindResource("DisplayInstallInfo_NoInstalledSoft").ToString() + "Xray!"; + MainWindowsShowInfo(currentStatus); + } + + #endregion + //如果是纯ipv6主机,则需要删除前面设置的Nat64网关 if (onlyIpv6 == true) { diff --git a/ProxySU/ResultClientInformation.xaml.cs b/ProxySU/ResultClientInformation.xaml.cs index 019faf6..4b6aa9b 100644 --- a/ProxySU/ResultClientInformation.xaml.cs +++ b/ProxySU/ResultClientInformation.xaml.cs @@ -2462,7 +2462,7 @@ namespace ProxySU private void XraySetVlessTcpXtls() { GridNotTrojanParametersXray.Visibility = Visibility.Visible; - TextBlockVmessOrVlessXray.Text = Application.Current.FindResource("TabItemHeaderXrayVlessProtocol").ToString(); + TextBlockVmessOrVlessXray.Text = Application.Current.FindResource("TabItemHeaderV2RayVlessProtocol").ToString(); TextBlockVmessOrVlessXray.Visibility = Visibility.Visible; //隐藏下面的二维码显示 HideGroupBoxClientQRandURL(); @@ -2485,7 +2485,7 @@ namespace ProxySU private void XraySetVlessTcpTls() { GridNotTrojanParametersXray.Visibility = Visibility.Visible; - TextBlockVmessOrVlessXray.Text = Application.Current.FindResource("TabItemHeaderXrayVlessProtocol").ToString(); + TextBlockVmessOrVlessXray.Text = Application.Current.FindResource("TabItemHeaderV2RayVlessProtocol").ToString(); TextBlockVmessOrVlessXray.Visibility = Visibility.Visible; //隐藏下面的二维码显示 HideGroupBoxClientQRandURL(); @@ -2506,7 +2506,7 @@ namespace ProxySU private void XraySetVlessWsTls() { GridNotTrojanParametersXray.Visibility = Visibility.Visible; - TextBlockVmessOrVlessXray.Text = Application.Current.FindResource("TabItemHeaderXrayVlessProtocol").ToString(); + TextBlockVmessOrVlessXray.Text = Application.Current.FindResource("TabItemHeaderV2RayVlessProtocol").ToString(); TextBlockVmessOrVlessXray.Visibility = Visibility.Visible; //隐藏下面的二维码显示 HideGroupBoxClientQRandURL(); diff --git a/ProxySU/bin/Beta/Beta.zip b/ProxySU/bin/Beta/Beta.zip index 229c675..b1cdcdf 100644 Binary files a/ProxySU/bin/Beta/Beta.zip and b/ProxySU/bin/Beta/Beta.zip differ