1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-11-25 06:36:08 +03:00

fix something2

This commit is contained in:
ProxySU 2020-11-26 22:26:45 +08:00
parent 471e919161
commit 1c0290c57d
4 changed files with 80 additions and 4 deletions

View File

@ -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">
<!--以下样式参考自https://yq.aliyun.com/articles/331878
https://docs.microsoft.co/en-us/dotnet/desktop-wpf/fundamentals/styles-templates-overview-->
<Window.Resources>

View File

@ -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)
{

View File

@ -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();

Binary file not shown.