Skip to content

Commit

Permalink
添加非root账户登录提示,优化代码2
Browse files Browse the repository at this point in the history
  • Loading branch information
proxysu committed May 30, 2020
1 parent 4f10189 commit 082fe80
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ProxySU/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<TextBlock Text="程序版本:1.6.2" Grid.Column="0" Grid.Row="0"></TextBlock>
<TextBlock Text="程序版本:1.6.3" Grid.Column="0" Grid.Row="0"></TextBlock>

</Grid>

Expand Down
16 changes: 8 additions & 8 deletions ProxySU/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ private void StartSetUpV2ray(ConnectionInfo connectionInfo,TextBlock textBlockNa
}
//检测是否运行在root权限下
string testRootAuthority = client.RunCommand(@"id -u").Result;
if (testRootAuthority.Equals("0")==false)
if (testRootAuthority.Equals("0\n")==false)
{
MessageBox.Show("请使用具有root权限的账户登录主机!!");
client.Disconnect();
Expand Down Expand Up @@ -1236,7 +1236,7 @@ private void ButtonClearOccupiedPorts_Click(object sender, RoutedEventArgs e)

//检测是否运行在root权限下
string testRootAuthority = client.RunCommand(@"id -u").Result;
if (testRootAuthority.Equals("0") == false)
if (testRootAuthority.Equals("0\n") == false)
{
MessageBox.Show("请使用具有root权限的账户登录主机!!");
client.Disconnect();
Expand Down Expand Up @@ -1413,7 +1413,7 @@ private void StartSetUpTrojan(ConnectionInfo connectionInfo, TextBlock textBlock

//检测是否运行在root权限下
string testRootAuthority = client.RunCommand(@"id -u").Result;
if (testRootAuthority.Equals("0") == false)
if (testRootAuthority.Equals("0\n") == false)
{
MessageBox.Show("请使用具有root权限的账户登录主机!!");
client.Disconnect();
Expand Down Expand Up @@ -2031,7 +2031,7 @@ private void StartSetUpNaive(ConnectionInfo connectionInfo, TextBlock textBlockN
}
//检测是否运行在root权限下
string testRootAuthority = client.RunCommand(@"id -u").Result;
if (testRootAuthority.Equals("0") == false)
if (testRootAuthority.Equals("0\n") == false)
{
MessageBox.Show("请使用具有root权限的账户登录主机!!");
client.Disconnect();
Expand Down Expand Up @@ -2519,7 +2519,7 @@ private void StartTestAndEnableBBR(ConnectionInfo connectionInfo, TextBlock text
}
//检测是否运行在root权限下
string testRootAuthority = client.RunCommand(@"id -u").Result;
if (testRootAuthority.Equals("0") == false)
if (testRootAuthority.Equals("0\n") == false)
{
MessageBox.Show("请使用具有root权限的账户登录主机!!");
client.Disconnect();
Expand Down Expand Up @@ -2722,7 +2722,7 @@ private void UpdateV2ray(ConnectionInfo connectionInfo, TextBlock textBlockName,
}
//检测是否运行在root权限下
string testRootAuthority = client.RunCommand(@"id -u").Result;
if (testRootAuthority.Equals("0") == false)
if (testRootAuthority.Equals("0\n") == false)
{
MessageBox.Show("请使用具有root权限的账户登录主机!!");
client.Disconnect();
Expand Down Expand Up @@ -2907,7 +2907,7 @@ private void UpdateTojan(ConnectionInfo connectionInfo, TextBlock textBlockName,
}
//检测是否运行在root权限下
string testRootAuthority = client.RunCommand(@"id -u").Result;
if (testRootAuthority.Equals("0") == false)
if (testRootAuthority.Equals("0\n") == false)
{
MessageBox.Show("请使用具有root权限的账户登录主机!!");
client.Disconnect();
Expand Down Expand Up @@ -3168,7 +3168,7 @@ private void StartSetUp3in1(ConnectionInfo connectionInfo, TextBlock textBlockNa
}
//检测是否运行在root权限下
string testRootAuthority = client.RunCommand(@"id -u").Result;
if (testRootAuthority.Equals("0") == false)
if (testRootAuthority.Equals("0\n") == false)
{
MessageBox.Show("请使用具有root权限的账户登录主机!!");
client.Disconnect();
Expand Down
4 changes: 2 additions & 2 deletions ProxySU/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.6.2.0")]
[assembly: AssemblyFileVersion("1.6.2.0")]
[assembly: AssemblyVersion("1.6.3.0")]
[assembly: AssemblyFileVersion("1.6.3.0")]
Binary file modified ProxySU/bin/Beta/Beta.zip
Binary file not shown.

0 comments on commit 082fe80

Please sign in to comment.