mirror of
https://github.com/proxysu/ProxySU.git
synced 2024-11-29 00:26:09 +03:00
fix 线程同步问题
This commit is contained in:
parent
30d81716ac
commit
01f4b49995
5
.idea/.idea.ProxySU/.idea/codeStyles/codeStyleConfig.xml
Normal file
5
.idea/.idea.ProxySU/.idea/codeStyles/codeStyleConfig.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
32
.idea/.idea.ProxySU/.idea/contentModel.xml
Normal file
32
.idea/.idea.ProxySU/.idea/contentModel.xml
Normal file
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ContentModelStore">
|
||||
<e p="C:\Users\huife\AppData\Local\JetBrains\Rider2020.2\extResources" t="IncludeRecursive" />
|
||||
<e p="C:\Users\huife\AppData\Local\JetBrains\Rider2020.2\resharper-host\Local\Transient\Rider\v202\SolutionCaches\_ProxySU.1010492592.00" t="ExcludeRecursive" />
|
||||
<e p="E:\dev\ProxySU" t="IncludeFlat">
|
||||
<e p="packages" t="ExcludeRecursive" />
|
||||
<e p="ProxySU" t="IncludeRecursive">
|
||||
<e p="ProxySU.csproj" t="IncludeRecursive" />
|
||||
</e>
|
||||
<e p="ProxySU.sln" t="IncludeFlat" />
|
||||
<e p="WpfApp1" t="IncludeRecursive">
|
||||
<e p="App.xaml" t="Include" />
|
||||
<e p="App.xaml.cs" t="Include" />
|
||||
<e p="AssemblyInfo.cs" t="Include" />
|
||||
<e p="bin" t="ExcludeRecursive" />
|
||||
<e p="MainWindow.xaml" t="Include" />
|
||||
<e p="MainWindow.xaml.cs" t="Include" />
|
||||
<e p="obj" t="ExcludeRecursive">
|
||||
<e p="Debug" t="Include">
|
||||
<e p="netcoreapp3.1-windows" t="Include">
|
||||
<e p="App.g.cs" t="Include" />
|
||||
<e p="MainWindow.g.cs" t="Include" />
|
||||
<e p="WpfApp1.AssemblyInfo.cs" t="Include" />
|
||||
</e>
|
||||
</e>
|
||||
</e>
|
||||
<e p="WpfApp1.csproj" t="IncludeRecursive" />
|
||||
</e>
|
||||
</e>
|
||||
</component>
|
||||
</project>
|
4
.idea/.idea.ProxySU/.idea/encodings.xml
Normal file
4
.idea/.idea.ProxySU/.idea/encodings.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||
</project>
|
8
.idea/.idea.ProxySU/.idea/indexLayout.xml
Normal file
8
.idea/.idea.ProxySU/.idea/indexLayout.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ContentModelUserStore">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
8
.idea/.idea.ProxySU/.idea/modules.xml
Normal file
8
.idea/.idea.ProxySU/.idea/modules.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/.idea.ProxySU/riderModule.iml" filepath="$PROJECT_DIR$/.idea/.idea.ProxySU/riderModule.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
6
.idea/.idea.ProxySU/.idea/projectSettingsUpdater.xml
Normal file
6
.idea/.idea.ProxySU/.idea/projectSettingsUpdater.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RiderProjectSettingsUpdater">
|
||||
<option name="vcsConfiguration" value="2" />
|
||||
</component>
|
||||
</project>
|
6
.idea/.idea.ProxySU/.idea/vcs.xml
Normal file
6
.idea/.idea.ProxySU/.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
121
.idea/.idea.ProxySU/.idea/workspace.xml
Normal file
121
.idea/.idea.ProxySU/.idea/workspace.xml
Normal file
@ -0,0 +1,121 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoGeneratedRunConfigurationManager">
|
||||
<projectFile>ProxySU/ProxySU.csproj</projectFile>
|
||||
<projectFile>WpfApp1/WpfApp1.csproj</projectFile>
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="669dc0ab-dc83-4456-b675-b70a2f5f75b2" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/ProxySU.sln" beforeDir="false" afterPath="$PROJECT_DIR$/ProxySU.sln" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ProxySU/bin/Beta/Beta.zip" beforeDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="HighlightingSettingsPerFile">
|
||||
<setting file="file://$PROJECT_DIR$/ProxySU/MainWindow.xaml" root0="SKIP_HIGHLIGHTING" />
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/WpfApp1/MainWindow.xaml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectId" id="1lRuJq6UGgT2UlI6dsaBIqwjatG" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="dart.analysis.tool.window.visible" value="false" />
|
||||
<property name="vue.rearranger.settings.migration" value="true" />
|
||||
</component>
|
||||
<component name="RunManager" selected=".NET Project.WpfApp1">
|
||||
<configuration name="ProxySU" type="DotNetProject" factoryName=".NET Project">
|
||||
<option name="EXE_PATH" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="USE_MONO" value="0" />
|
||||
<option name="RUNTIME_ARGUMENTS" value="" />
|
||||
<option name="PROJECT_PATH" value="$PROJECT_DIR$/ProxySU/ProxySU.csproj" />
|
||||
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||
<option name="PROJECT_KIND" value="Console" />
|
||||
<option name="PROJECT_TFM" value="" />
|
||||
<method v="2">
|
||||
<option name="Build" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="WpfApp1" type="DotNetProject" factoryName=".NET Project">
|
||||
<option name="EXE_PATH" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="USE_MONO" value="0" />
|
||||
<option name="RUNTIME_ARGUMENTS" value="" />
|
||||
<option name="PROJECT_PATH" value="$PROJECT_DIR$/WpfApp1/WpfApp1.csproj" />
|
||||
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||
<option name="PROJECT_TFM" value="" />
|
||||
<method v="2">
|
||||
<option name="Build" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="669dc0ab-dc83-4456-b675-b70a2f5f75b2" name="Default Changelist" comment="" />
|
||||
<created>1607572158648</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1607572158648</updated>
|
||||
<workItem from="1607572166623" duration="517000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
<component name="UnityProjectConfiguration" hasMinimizedUI="null" />
|
||||
<component name="UnityUnitTestConfiguration" currentTestLauncher="NUnit" />
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
|
||||
</component>
|
||||
<component name="WindowStateProjectService">
|
||||
<state width="1877" height="275" key="GridCell.Tab.0.bottom" timestamp="1607572691215">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="275" key="GridCell.Tab.0.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1607572691215" />
|
||||
<state width="1877" height="275" key="GridCell.Tab.0.center" timestamp="1607572691215">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="275" key="GridCell.Tab.0.center/0.0.1920.1040@0.0.1920.1040" timestamp="1607572691215" />
|
||||
<state width="1877" height="275" key="GridCell.Tab.0.left" timestamp="1607572691215">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="275" key="GridCell.Tab.0.left/0.0.1920.1040@0.0.1920.1040" timestamp="1607572691215" />
|
||||
<state width="1877" height="275" key="GridCell.Tab.0.right" timestamp="1607572691215">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state width="1877" height="275" key="GridCell.Tab.0.right/0.0.1920.1040@0.0.1920.1040" timestamp="1607572691215" />
|
||||
<state x="552" y="252" key="Rider.ProjectTemplateDialog.Size" timestamp="1607572543584">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="552" y="252" key="Rider.ProjectTemplateDialog.Size/0.0.1920.1040@0.0.1920.1040" timestamp="1607572543584" />
|
||||
</component>
|
||||
</project>
|
7
.idea/.idea.ProxySU/riderModule.iml
Normal file
7
.idea/.idea.ProxySU/riderModule.iml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="RIDER_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$/../.." />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
10
ProxySU.Core/App.xaml
Normal file
10
ProxySU.Core/App.xaml
Normal file
@ -0,0 +1,10 @@
|
||||
<Application x:Class="ProxySU.Core.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:ProxySU.Core"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
17
ProxySU.Core/App.xaml.cs
Normal file
17
ProxySU.Core/App.xaml.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProxySU.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
10
ProxySU.Core/AssemblyInfo.cs
Normal file
10
ProxySU.Core/AssemblyInfo.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System.Windows;
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
28
ProxySU.Core/MainWindow.xaml
Normal file
28
ProxySU.Core/MainWindow.xaml
Normal file
@ -0,0 +1,28 @@
|
||||
<Window x:Class="ProxySU.Core.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:ProxySU.Core"
|
||||
mc:Ignorable="d"
|
||||
|
||||
Title="MainWindow" Height="450" Width="800">
|
||||
<Grid>
|
||||
<Menu Style="{DynamicResource MaterialDesignMenu}">
|
||||
<MenuItem Header="文件" Style="{DynamicResource MaterialDesignMenuItem}">
|
||||
<MenuItem Header="SubMenu">肖文杰</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem Header="文件" Style="{DynamicResource MaterialDesignMenuItem}"></MenuItem>
|
||||
<MenuItem Header="文件" Style="{DynamicResource MaterialDesignMenuItem}"></MenuItem>
|
||||
</Menu>
|
||||
|
||||
|
||||
<!--<TabControl Style="{DynamicResource MaterialDesignNavigatilRailTabControl}" >
|
||||
<TabItem Header="Item2" Style="{DynamicResource MaterialDesignNavigationRailTabItem}">
|
||||
<Button Style="{DynamicResource MaterialDesignRaisedButton}" Content="Hello!"></Button>
|
||||
</TabItem>
|
||||
<TabItem Header="Item2"></TabItem>
|
||||
|
||||
</TabControl>-->
|
||||
</Grid>
|
||||
</Window>
|
28
ProxySU.Core/MainWindow.xaml.cs
Normal file
28
ProxySU.Core/MainWindow.xaml.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace ProxySU.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
13
ProxySU.Core/ProxySU.Core.csproj
Normal file
13
ProxySU.Core/ProxySU.Core.csproj
Normal file
@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<UseWPF>true</UseWPF>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MaterialDesignThemes" Version="3.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -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.5" Height="720" Width="660">
|
||||
Title="ProxySU - v2.5.6" Height="720" Width="660">
|
||||
<!--以下样式参考自:https://yq.aliyun.com/articles/331878
|
||||
https://docs.microsoft.co/en-us/dotnet/desktop-wpf/fundamentals/styles-templates-overview-->
|
||||
<Window.Resources>
|
||||
|
@ -99,6 +99,7 @@ namespace ProxySU
|
||||
static int randomCaddyListenPort = 8800; //Caddy做伪装网站所监听的端口,随机10001-60000
|
||||
static int installationDegree = 0; //安装进度条显示的百分比
|
||||
static string saveShellScriptFileName = "install.sh"; //用来保存下载的脚本名称
|
||||
static string acmeEmail = "";
|
||||
|
||||
//****** ******
|
||||
// Application.Current.FindResource("").ToString()
|
||||
@ -564,8 +565,17 @@ namespace ProxySU
|
||||
//远程主机连接信息
|
||||
private ConnectionInfo GenerateConnectionInfo()
|
||||
{
|
||||
acmeEmail = AcmeEmailTextBox.Text;
|
||||
|
||||
ConnectionInfo connectionInfo;
|
||||
|
||||
if (string.IsNullOrEmpty(acmeEmail))
|
||||
{
|
||||
var acmeEmailDesc = Application.Current.FindResource("AcmeEmailDesc").ToString();
|
||||
MessageBox.Show(acmeEmailDesc);
|
||||
return connectionInfo = null;
|
||||
}
|
||||
|
||||
#region 检测输入的内容是否有错,并读取内容
|
||||
if (string.IsNullOrEmpty(PreTrim(TextBoxHost.Text)) == true || string.IsNullOrEmpty(PreTrim(TextBoxPort.Text)) == true || string.IsNullOrEmpty(PreTrim(TextBoxUserName.Text)) == true)
|
||||
{
|
||||
@ -5268,7 +5278,7 @@ namespace ProxySU
|
||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||
|
||||
//安装代理程序 37--40
|
||||
functionResult = ProxySoftInstall(client,@"NaiveProxy", @"https://raw.githubusercontent.com/proxysu/shellscript/master/Caddy-Naive/caddy-naive-install.sh");
|
||||
functionResult = ProxySoftInstall(client, @"NaiveProxy", @"https://raw.githubusercontent.com/proxysu/shellscript/master/Caddy-Naive/caddy-naive-install.sh");
|
||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||
|
||||
////****** "系统环境检测完毕,符合安装要求,开始布署......" ******
|
||||
@ -6792,10 +6802,10 @@ namespace ProxySU
|
||||
private string GenerateRandomStr(int length)
|
||||
{
|
||||
var rand = System.Security.Cryptography.RandomNumberGenerator.Create();
|
||||
byte[] bytes = new byte[length*2];
|
||||
byte[] bytes = new byte[length * 2];
|
||||
rand.GetBytes(bytes);
|
||||
string randStr = Convert.ToBase64String(bytes);
|
||||
randStr = randStr.Replace("+", "").Replace("/", "").Replace("=", "").Substring(0,length);
|
||||
randStr = randStr.Replace("+", "").Replace("/", "").Replace("=", "").Substring(0, length);
|
||||
//MessageBox.Show(randStr);
|
||||
return randStr;
|
||||
}
|
||||
@ -7338,12 +7348,12 @@ namespace ProxySU
|
||||
//如果未检测到有效的ip,连接就会被断开
|
||||
if (client.IsConnected == false)
|
||||
{
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
if (onlyIpv6 == true)
|
||||
{
|
||||
functionResult = SetUpNat64(client, true);
|
||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return ; }
|
||||
if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||
//SetUpNat64(client, true);
|
||||
//sshShellCommand = $"{sshCmdUpdate}";
|
||||
//currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||
@ -7419,7 +7429,7 @@ namespace ProxySU
|
||||
{
|
||||
//******"V2Ray卸载成功!"******
|
||||
SetUpProgressBarProcessing(16);
|
||||
currentStatus ="V2Ray" + Application.Current.FindResource("DisplayInstallInfo_RemoveProxySoftSuccess").ToString();
|
||||
currentStatus = "V2Ray" + Application.Current.FindResource("DisplayInstallInfo_RemoveProxySoftSuccess").ToString();
|
||||
MainWindowsShowInfo(currentStatus);
|
||||
}
|
||||
|
||||
@ -7909,15 +7919,15 @@ namespace ProxySU
|
||||
|
||||
sshShellCommand = @"command -v apt-get";
|
||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||
bool getApt = ! String.IsNullOrEmpty(currentShellCommandResult);
|
||||
bool getApt = !String.IsNullOrEmpty(currentShellCommandResult);
|
||||
|
||||
sshShellCommand = @"command -v dnf";
|
||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||
bool getDnf = ! String.IsNullOrEmpty(currentShellCommandResult);
|
||||
bool getDnf = !String.IsNullOrEmpty(currentShellCommandResult);
|
||||
|
||||
sshShellCommand = @"command -v yum";
|
||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||
bool getYum = ! String.IsNullOrEmpty(currentShellCommandResult);
|
||||
bool getYum = !String.IsNullOrEmpty(currentShellCommandResult);
|
||||
|
||||
SetUpProgressBarProcessing(55);
|
||||
|
||||
@ -9138,9 +9148,9 @@ namespace ProxySU
|
||||
}
|
||||
|
||||
//设置Nat64与删除设置Nat64
|
||||
private bool SetUpNat64(SshClient client,bool set)
|
||||
private bool SetUpNat64(SshClient client, bool set)
|
||||
{
|
||||
if(set == true)
|
||||
if (set == true)
|
||||
{
|
||||
//****** "正在查找最快的Nat64网关......" ******
|
||||
currentStatus = Application.Current.FindResource("DisplayInstallInfo_FindFastestSetUpNat64").ToString();
|
||||
@ -9251,7 +9261,7 @@ namespace ProxySU
|
||||
functionResult = true;
|
||||
}
|
||||
string[] returnstr = new string[listCount];
|
||||
for(int i=0;i<listCount;i++)
|
||||
for (int i = 0; i < listCount; i++)
|
||||
{
|
||||
returnstr[i] = NatDns64s[i].IpAddr;
|
||||
}
|
||||
@ -9289,7 +9299,7 @@ namespace ProxySU
|
||||
}
|
||||
|
||||
//安装过程所运行的命令与相应结果
|
||||
private string MainWindowsShowCmd(SshClient client,string sshShellCommand)
|
||||
private string MainWindowsShowCmd(SshClient client, string sshShellCommand, bool stopIfError = true)
|
||||
{
|
||||
TextBoxMonitorCommandResults.Dispatcher.BeginInvoke(updateMonitorAction, TextBoxMonitorCommandResults, sshShellCommand);//显示执行的命令
|
||||
SshCommand cmdResult = client.RunCommand(sshShellCommand);
|
||||
@ -9297,8 +9307,9 @@ namespace ProxySU
|
||||
string currentShellCommandError = cmdResult.Error; //命令执行出错的提示
|
||||
int cmdExitStatus = cmdResult.ExitStatus;
|
||||
//if (String.IsNullOrEmpty(currentShellCommandResult) == true)
|
||||
if(cmdExitStatus == 1)
|
||||
if (cmdExitStatus == 1)
|
||||
{
|
||||
if (stopIfError) { }
|
||||
//currentShellCommandResult = currentShellCommandError;
|
||||
TextBoxMonitorCommandResults.Dispatcher.BeginInvoke(updateMonitorAction, TextBoxMonitorCommandResults, currentShellCommandError);//显示命令执行错误的提示
|
||||
}
|
||||
@ -9380,7 +9391,7 @@ namespace ProxySU
|
||||
//condition---已安装的条件
|
||||
//functionResult = SoftInstalledIsNoYes(client, "v2ray", @"/usr/local/bin/v2ray");
|
||||
//if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||
private bool SoftInstalledIsNoYes(SshClient client,string soft,string condition)
|
||||
private bool SoftInstalledIsNoYes(SshClient client, string soft, string condition)
|
||||
{
|
||||
//******"检测系统是否已经安装......"******03
|
||||
SetUpProgressBarProcessing(8);
|
||||
@ -9447,15 +9458,15 @@ namespace ProxySU
|
||||
|
||||
sshShellCommand = @"command -v apt-get";
|
||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||
getApt = ! String.IsNullOrEmpty(currentShellCommandResult);
|
||||
getApt = !String.IsNullOrEmpty(currentShellCommandResult);
|
||||
|
||||
sshShellCommand = @"command -v dnf";
|
||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||
getDnf = ! String.IsNullOrEmpty(currentShellCommandResult);
|
||||
getDnf = !String.IsNullOrEmpty(currentShellCommandResult);
|
||||
|
||||
sshShellCommand = @"command -v yum";
|
||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||
getYum = ! String.IsNullOrEmpty(currentShellCommandResult);
|
||||
getYum = !String.IsNullOrEmpty(currentShellCommandResult);
|
||||
|
||||
SetUpProgressBarProcessing(13);
|
||||
|
||||
@ -9465,11 +9476,11 @@ namespace ProxySU
|
||||
|
||||
sshShellCommand = @"command -v systemctl";
|
||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||
bool getSystemd = ! String.IsNullOrEmpty(currentShellCommandResult);
|
||||
bool getSystemd = !String.IsNullOrEmpty(currentShellCommandResult);
|
||||
|
||||
sshShellCommand = @"command -v getenforce";
|
||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||
bool getGetenforce = ! String.IsNullOrEmpty(currentShellCommandResult);
|
||||
bool getGetenforce = !String.IsNullOrEmpty(currentShellCommandResult);
|
||||
|
||||
|
||||
//没有安装apt-get,也没有安装dnf\yum,也没有安装zypper,或者没有安装systemd的,不满足安装条件
|
||||
@ -9806,7 +9817,7 @@ namespace ProxySU
|
||||
sshShellCommand = @"firewall-cmd --state";
|
||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||
|
||||
if(String.Equals(currentShellCommandResult.Trim(), "running") == false)
|
||||
if (String.Equals(currentShellCommandResult.Trim(), "running") == false)
|
||||
{
|
||||
sshShellCommand = @"systemctl restart firewalld";
|
||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||
@ -9995,7 +10006,7 @@ namespace ProxySU
|
||||
//安装代理程序 37--40
|
||||
//functionResult = ProxySoftInstall(client,@"",@"");
|
||||
//if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||
private bool ProxySoftInstall(SshClient client,string proxyName,string downloadUrl)
|
||||
private bool ProxySoftInstall(SshClient client, string proxyName, string downloadUrl)
|
||||
{
|
||||
//****** "系统环境检测完毕,符合安装要求,开始布署......" ******
|
||||
SetUpProgressBarProcessing(37);
|
||||
@ -10036,7 +10047,7 @@ namespace ProxySU
|
||||
//condition---成功安装的条件
|
||||
//functionResult = SoftInstalledSuccessOrFail(client,"v2ray",@"/usr/local/bin/v2ray");
|
||||
//if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||
private bool SoftInstalledSuccessOrFail(SshClient client,string soft,string condition)
|
||||
private bool SoftInstalledSuccessOrFail(SshClient client, string soft, string condition)
|
||||
{
|
||||
SetUpProgressBarProcessing(41);
|
||||
//sshShellCommand = $"find / -name {soft}";
|
||||
@ -10085,7 +10096,6 @@ namespace ProxySU
|
||||
//if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||
private bool AcmeShInstall(SshClient client)
|
||||
{
|
||||
|
||||
//****** "正在安装acme.sh......" ******22
|
||||
SetUpProgressBarProcessing(51);
|
||||
currentStatus = Application.Current.FindResource("DisplayInstallInfo_StartInstallAcmeSh").ToString();
|
||||
@ -10103,7 +10113,7 @@ namespace ProxySU
|
||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||
|
||||
//sshShellCommand = $"curl https://raw.githubusercontent.com/acmesh-official/acme.sh/master/acme.sh | INSTALLONLINE=1 sh";
|
||||
sshShellCommand = $"curl https://raw.githubusercontent.com/acmesh-official/acme.sh/master/acme.sh | sh -s -- --install-online -m {AcmeEmailTextBox.Text}";
|
||||
sshShellCommand = $"curl https://raw.githubusercontent.com/acmesh-official/acme.sh/master/acme.sh | sh -s -- --install-online -m {acmeEmail}";
|
||||
currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand);
|
||||
|
||||
if (currentShellCommandResult.Contains("Install success") == true)
|
||||
@ -10305,7 +10315,7 @@ namespace ProxySU
|
||||
//设置Caddy配置文件
|
||||
//functionResult = SetCaddyfile(client, @"/etc/caddy/Caddyfile");
|
||||
//if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||
private bool SetCaddyfile(SshClient client,string upLoadPath)
|
||||
private bool SetCaddyfile(SshClient client, string upLoadPath)
|
||||
{
|
||||
|
||||
//设置Caddyfile文件中的tls 邮箱,在caddy2中已经不需要设置。
|
||||
@ -10347,7 +10357,7 @@ namespace ProxySU
|
||||
//condition---成功启动的条件
|
||||
//functionResult = SoftStartDetect(client, "v2ray", @"/usr/local/bin/v2ray");
|
||||
//if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; }
|
||||
private bool SoftStartDetect(SshClient client,string soft,string condition)
|
||||
private bool SoftStartDetect(SshClient client, string soft, string condition)
|
||||
{
|
||||
//****** "正在启动......" ******33
|
||||
//SetUpProgressBarProcessing(87);
|
||||
|
@ -51,5 +51,5 @@ using System.Windows;
|
||||
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
|
||||
// 方法是按如下所示使用“*”: :
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.5.5.0")]
|
||||
[assembly: AssemblyFileVersion("2.5.5.0")]
|
||||
[assembly: AssemblyVersion("2.5.6.0")]
|
||||
[assembly: AssemblyFileVersion("2.5.6.0")]
|
||||
|
@ -9,5 +9,9 @@
|
||||
<ErrorReportUrlHistory />
|
||||
<FallbackCulture>zh-CN</FallbackCulture>
|
||||
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<EnableSecurityDebugging>false</EnableSecurityDebugging>
|
||||
</PropertyGroup>
|
||||
</Project>
|
4
ProxySU/packages.config
Normal file
4
ProxySU/packages.config
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="SSH.NET" version="2016.1.0" targetFramework="net40" />
|
||||
</packages>
|
Loading…
Reference in New Issue
Block a user