Skip to content

Commit fd64636

Browse files
committed
修复MTProto可能潜在的Bug
1 parent bf39e88 commit fd64636

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
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.4.6" Height="675" Width="650">
8+
Title="ProxySU - v2.4.7" Height="675" Width="650">
99
<!--以下样式参考自:https://yq.aliyun.com/articles/331878
1010
https://docs.microsoft.com/en-us/dotnet/desktop-wpf/fundamentals/styles-templates-overview-->
1111
<Window.Resources>

ProxySU/MainWindow.xaml.cs

+21-3
Original file line numberDiff line numberDiff line change
@@ -4910,10 +4910,25 @@ private void StartSetUpMtg(ConnectionInfo connectionInfo)
49104910
MainWindowsShowInfo(currentStatus);
49114911
//读取生成的代理参数
49124912
sshShellCommand = @"cat /usr/local/etc/mtg_info.json";
4913-
currentShellCommandResult = client.RunCommand(sshShellCommand).Result;
4914-
4915-
//结果保存在ReceiveConfigurationParameters[9]中
4913+
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
49164914
ReceiveConfigurationParameters[9] = currentShellCommandResult;
4915+
if (currentShellCommandResult.Contains(@"No such file or directory"))
4916+
{
4917+
sshShellCommand = @"systemctl stop mtg";
4918+
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
4919+
sshShellCommand = @"cat /usr/local/etc/mtg.sh";
4920+
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
4921+
sshShellCommand = currentShellCommandResult;
4922+
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
4923+
sshShellCommand = @"cat /usr/local/etc/mtg_info.json";
4924+
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
4925+
ReceiveConfigurationParameters[9] = currentShellCommandResult;
4926+
sshShellCommand = @"pkill mtg";
4927+
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
4928+
sshShellCommand = @"systemctl restart mtg";
4929+
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
4930+
}
4931+
49174932
client.Disconnect();//断开服务器ssh连接
49184933

49194934
//Thread.Sleep(1000);
@@ -5924,6 +5939,9 @@ private void StartRemoveProxySoft(ConnectionInfo connectionInfo)
59245939
sshShellCommand = @"rm -rf /usr/local/etc/mtg_info.json";
59255940
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
59265941

5942+
sshShellCommand = @"rm -rf /usr/local/etc/mtg.sh";
5943+
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
5944+
59275945
sshShellCommand = @"find / -name mtg";
59285946
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
59295947

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.4.6.0")]
55-
[assembly: AssemblyFileVersion("2.4.6.0")]
54+
[assembly: AssemblyVersion("2.4.7.0")]
55+
[assembly: AssemblyFileVersion("2.4.7.0")]

ProxySU/bin/Beta/Beta.zip

75 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)