1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2025-02-16 22:53:13 +03:00

修复MTProto可能潜在的Bug

This commit is contained in:
ProxySU 2020-10-22 01:10:25 +08:00
parent bf39e88ace
commit fd646363f5
4 changed files with 24 additions and 6 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.4.6" Height="675" Width="650">
Title="ProxySU - v2.4.7" Height="675" Width="650">
<!--以下样式参考自https://yq.aliyun.com/articles/331878
https://docs.microsoft.com/en-us/dotnet/desktop-wpf/fundamentals/styles-templates-overview-->
<Window.Resources>

View File

@ -4910,10 +4910,25 @@ namespace ProxySU
MainWindowsShowInfo(currentStatus);
//读取生成的代理参数
sshShellCommand = @"cat /usr/local/etc/mtg_info.json";
currentShellCommandResult = client.RunCommand(sshShellCommand).Result;
//结果保存在ReceiveConfigurationParameters[9]中
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
ReceiveConfigurationParameters[9] = currentShellCommandResult;
if (currentShellCommandResult.Contains(@"No such file or directory"))
{
sshShellCommand = @"systemctl stop mtg";
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
sshShellCommand = @"cat /usr/local/etc/mtg.sh";
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
sshShellCommand = currentShellCommandResult;
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
sshShellCommand = @"cat /usr/local/etc/mtg_info.json";
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
ReceiveConfigurationParameters[9] = currentShellCommandResult;
sshShellCommand = @"pkill mtg";
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
sshShellCommand = @"systemctl restart mtg";
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
}
client.Disconnect();//断开服务器ssh连接
//Thread.Sleep(1000);
@ -5924,6 +5939,9 @@ namespace ProxySU
sshShellCommand = @"rm -rf /usr/local/etc/mtg_info.json";
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
sshShellCommand = @"rm -rf /usr/local/etc/mtg.sh";
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
sshShellCommand = @"find / -name mtg";
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);

View File

@ -51,5 +51,5 @@ using System.Windows;
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.4.6.0")]
[assembly: AssemblyFileVersion("2.4.6.0")]
[assembly: AssemblyVersion("2.4.7.0")]
[assembly: AssemblyFileVersion("2.4.7.0")]

Binary file not shown.