mirror of
https://github.com/proxysu/ProxySU.git
synced 2025-04-11 05:00:58 +00:00
commit
1e8f6fcb63
16 changed files with 84 additions and 27 deletions
|
@ -42,7 +42,7 @@ namespace ProxySuper.Core.Models
|
||||||
[JsonProperty("trojanGoSettings")]
|
[JsonProperty("trojanGoSettings")]
|
||||||
public TrojanGoSettings TrojanGoSettings { get; set; }
|
public TrojanGoSettings TrojanGoSettings { get; set; }
|
||||||
|
|
||||||
[JsonProperty("naiveProtoSettings")]
|
[JsonProperty("naiveProxySettings")]
|
||||||
public NaiveProxySettings NaiveProxySettings { get; set; }
|
public NaiveProxySettings NaiveProxySettings { get; set; }
|
||||||
|
|
||||||
[JsonProperty("brook")]
|
[JsonProperty("brook")]
|
||||||
|
|
|
@ -327,7 +327,7 @@ namespace ProxySuper.Core.Services
|
||||||
var result = RunCmd("id -u");
|
var result = RunCmd("id -u");
|
||||||
if (!result.Equals("0\n"))
|
if (!result.Equals("0\n"))
|
||||||
{
|
{
|
||||||
throw new Exception("ProxySU需要使用Root用户进行安装!");
|
throw new Exception("请使用Root权限账户登录!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -365,6 +365,9 @@ namespace ProxySuper.Core.Services
|
||||||
|
|
||||||
public void InstallSystemTools()
|
public void InstallSystemTools()
|
||||||
{
|
{
|
||||||
|
Progress.Desc = ("更新安装包");
|
||||||
|
RunUpdateCmd();
|
||||||
|
|
||||||
Progress.Desc = ("安装sudo工具");
|
Progress.Desc = ("安装sudo工具");
|
||||||
InstallSoftware("sudo");
|
InstallSoftware("sudo");
|
||||||
|
|
||||||
|
@ -768,6 +771,22 @@ namespace ProxySuper.Core.Services
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void RunUpdateCmd()
|
||||||
|
{
|
||||||
|
if (CmdType == CmdType.Apt)
|
||||||
|
{
|
||||||
|
RunCmd($"apt update -y");
|
||||||
|
}
|
||||||
|
else if (CmdType == CmdType.Yum)
|
||||||
|
{
|
||||||
|
RunCmd($"yum update -y");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RunCmd($"dnf update -y");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private ConnectionInfo CreateConnectionInfo()
|
private ConnectionInfo CreateConnectionInfo()
|
||||||
{
|
{
|
||||||
|
@ -799,6 +818,7 @@ namespace ProxySuper.Core.Services
|
||||||
return new ConnectionInfo(
|
return new ConnectionInfo(
|
||||||
host: _host.Address,
|
host: _host.Address,
|
||||||
username: _host.UserName,
|
username: _host.UserName,
|
||||||
|
port: _host.Port,
|
||||||
authenticationMethods: authMethods.ToArray());
|
authenticationMethods: authMethods.ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -268,7 +268,7 @@ namespace ProxySuper.Core.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#region 似有方法
|
#region 私有方法
|
||||||
|
|
||||||
private void DoUploadCert(object sender, CancelEventArgs e)
|
private void DoUploadCert(object sender, CancelEventArgs e)
|
||||||
{
|
{
|
||||||
|
@ -424,7 +424,6 @@ namespace ProxySuper.Core.Services
|
||||||
WriteToFile(configJson, "/etc/caddy/Caddyfile");
|
WriteToFile(configJson, "/etc/caddy/Caddyfile");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void UninstallXray()
|
private void UninstallXray()
|
||||||
{
|
{
|
||||||
Progress.Desc = "关闭Xray服务";
|
Progress.Desc = "关闭Xray服务";
|
||||||
|
|
|
@ -144,14 +144,14 @@
|
||||||
<Compile Include="Views\MTProxyGo\MTProxyGoInstallView.xaml.cs">
|
<Compile Include="Views\MTProxyGo\MTProxyGoInstallView.xaml.cs">
|
||||||
<DependentUpon>MTProxyGoInstallView.xaml</DependentUpon>
|
<DependentUpon>MTProxyGoInstallView.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Views\NaiveProto\NaiveProtoConfigView.xaml.cs">
|
<Compile Include="Views\NaiveProxy\NaiveProxyConfigView.xaml.cs">
|
||||||
<DependentUpon>NaiveProtoConfigView.xaml</DependentUpon>
|
<DependentUpon>NaiveProxyConfigView.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Views\NaiveProto\NaiveProtoEditorView.xaml.cs">
|
<Compile Include="Views\NaiveProxy\NaiveProxyEditorView.xaml.cs">
|
||||||
<DependentUpon>NaiveProtoEditorView.xaml</DependentUpon>
|
<DependentUpon>NaiveProxyEditorView.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Views\NaiveProto\NaiveProtoInstallView.xaml.cs">
|
<Compile Include="Views\NaiveProxy\NaiveProxyInstallView.xaml.cs">
|
||||||
<DependentUpon>NaiveProtoInstallView.xaml</DependentUpon>
|
<DependentUpon>NaiveProxyInstallView.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Views\ShareLinkView.xaml.cs">
|
<Compile Include="Views\ShareLinkView.xaml.cs">
|
||||||
<DependentUpon>ShareLinkView.xaml</DependentUpon>
|
<DependentUpon>ShareLinkView.xaml</DependentUpon>
|
||||||
|
@ -299,15 +299,15 @@
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Views\NaiveProto\NaiveProtoConfigView.xaml">
|
<Page Include="Views\NaiveProxy\NaiveProxyConfigView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Views\NaiveProto\NaiveProtoEditorView.xaml">
|
<Page Include="Views\NaiveProxy\NaiveProxyEditorView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Views\NaiveProto\NaiveProtoInstallView.xaml">
|
<Page Include="Views\NaiveProxy\NaiveProxyInstallView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"log_level": 5,
|
||||||
"run_type": "server",
|
"run_type": "server",
|
||||||
"local_addr": "0.0.0.0",
|
"local_addr": "0.0.0.0",
|
||||||
"local_port": 443,
|
"local_port": 443,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProtoConfigView"
|
<views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProxyConfigView"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Icon="/Resources/ProxySU.ico"
|
Icon="/Resources/ProxySU.ico"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
Title="NaiveProxyConfigView" Height="450" Width="800">
|
Title="NaiveProxy配置" Height="450" Width="800">
|
||||||
<Grid Margin="10">
|
<Grid Margin="10">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="140" />
|
<ColumnDefinition Width="140" />
|
|
@ -5,9 +5,9 @@ namespace ProxySuper.WPF.Views
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// NaiveProxyConfigView.xaml 的交互逻辑
|
/// NaiveProxyConfigView.xaml 的交互逻辑
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class NaiveProtoConfigView : MvxWindow
|
public partial class NaiveProxyConfigView : MvxWindow
|
||||||
{
|
{
|
||||||
public NaiveProtoConfigView()
|
public NaiveProxyConfigView()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
<views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProtoEditorView"
|
<views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProxyEditorView"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
BorderBrush="#eee"
|
BorderBrush="#eee"
|
||||||
Icon="/Resources/ProxySU.ico"
|
Icon="/Resources/ProxySU.ico"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
Title="NaiveProxy" Height="600" Width="1000">
|
Title="NaiveProxy编辑配置" Height="600" Width="1000">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="310" />
|
<ColumnDefinition Width="310" />
|
|
@ -5,9 +5,9 @@ namespace ProxySuper.WPF.Views
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// NaiveProxyEditorView.xaml 的交互逻辑
|
/// NaiveProxyEditorView.xaml 的交互逻辑
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class NaiveProtoEditorView : MvxWindow
|
public partial class NaiveProxyEditorView : MvxWindow
|
||||||
{
|
{
|
||||||
public NaiveProtoEditorView()
|
public NaiveProxyEditorView()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
<views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProxy.NaiveProtoInstallView"
|
<views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProxy.NaiveProxyInstallView"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
xmlns:views="clr-namespace:MvvmCross.Platforms.Wpf.Views;assembly=MvvmCross.Platforms.Wpf"
|
xmlns:views="clr-namespace:MvvmCross.Platforms.Wpf.Views;assembly=MvvmCross.Platforms.Wpf"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
Title="TrojanGoInstallView" Height="600" Width="1000">
|
Title="TrojanGo安装" Height="600" Width="1000">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<ctrl:ProgressControl />
|
<ctrl:ProgressControl />
|
||||||
|
|
|
@ -18,9 +18,9 @@ namespace ProxySuper.WPF.Views.NaiveProxy
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// NaiveProxyInstallViewModel.xaml 的交互逻辑
|
/// NaiveProxyInstallViewModel.xaml 的交互逻辑
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class NaiveProtoInstallView : MvxWindow
|
public partial class NaiveProxyInstallView : MvxWindow
|
||||||
{
|
{
|
||||||
public NaiveProtoInstallView()
|
public NaiveProxyInstallView()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
|
@ -22,6 +22,7 @@
|
||||||
BorderThickness="1,0,1,0"
|
BorderThickness="1,0,1,0"
|
||||||
BorderBrush="#DDD"
|
BorderBrush="#DDD"
|
||||||
TabStripPlacement="Left"
|
TabStripPlacement="Left"
|
||||||
|
x:Name="TabCtrl"
|
||||||
SelectionChanged="BuildQrCode">
|
SelectionChanged="BuildQrCode">
|
||||||
<TabItem Width="200" Height="40"
|
<TabItem Width="200" Height="40"
|
||||||
Tag="{x:Static models:RayType.VLESS_TCP}"
|
Tag="{x:Static models:RayType.VLESS_TCP}"
|
||||||
|
|
|
@ -31,6 +31,22 @@ namespace ProxySuper.WPF.Views.V2ray
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnRender(DrawingContext drawingContext)
|
||||||
|
{
|
||||||
|
base.OnRender(drawingContext);
|
||||||
|
|
||||||
|
for (int i = 0; i < TabCtrl.Items.Count; i++)
|
||||||
|
{
|
||||||
|
var tabItem = TabCtrl.Items[i] as TabItem;
|
||||||
|
|
||||||
|
if (Settings.Types.Contains((RayType)tabItem.Tag))
|
||||||
|
{
|
||||||
|
TabCtrl.SelectedIndex = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public V2raySettings Settings
|
public V2raySettings Settings
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
Padding="10"
|
Padding="10"
|
||||||
BorderThickness="1,0,1,0"
|
BorderThickness="1,0,1,0"
|
||||||
BorderBrush="#DDD"
|
BorderBrush="#DDD"
|
||||||
|
x:Name="TabCtrl"
|
||||||
TabStripPlacement="Left"
|
TabStripPlacement="Left"
|
||||||
SelectionChanged="BuildQrCode">
|
SelectionChanged="BuildQrCode">
|
||||||
<TabItem Width="200" Height="40"
|
<TabItem Width="200" Height="40"
|
||||||
|
|
|
@ -7,6 +7,7 @@ using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
|
|
||||||
namespace ProxySuper.WPF.Views
|
namespace ProxySuper.WPF.Views
|
||||||
|
@ -21,6 +22,22 @@ namespace ProxySuper.WPF.Views
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnRender(DrawingContext drawingContext)
|
||||||
|
{
|
||||||
|
base.OnRender(drawingContext);
|
||||||
|
|
||||||
|
for (int i = 0; i < TabCtrl.Items.Count; i++)
|
||||||
|
{
|
||||||
|
var tabItem = TabCtrl.Items[i] as TabItem;
|
||||||
|
|
||||||
|
if (Settings.Types.Contains((RayType)tabItem.Tag))
|
||||||
|
{
|
||||||
|
TabCtrl.SelectedIndex = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public XraySettings Settings
|
public XraySettings Settings
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -29,8 +46,6 @@ namespace ProxySuper.WPF.Views
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void BuildQrCode(object sender, SelectionChangedEventArgs e)
|
private void BuildQrCode(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
var tabControl = e.Source as TabControl;
|
var tabControl = e.Source as TabControl;
|
||||||
|
|
|
@ -110,3 +110,7 @@ Microsoft [.NET Framework 4.8](https://dotnet.microsoft.com/download/dotnet-fram
|
||||||
* 在线提问 https://github.com/proxysu/windows/issues
|
* 在线提问 https://github.com/proxysu/windows/issues
|
||||||
|
|
||||||
在使用遇到问题时,请先看一下[常见问题集锦](https://github.com/proxysu/windows/wiki/CommonError),如果还不能解决,可以到以上平台询问,个人精力有限,尽力解答。
|
在使用遇到问题时,请先看一下[常见问题集锦](https://github.com/proxysu/windows/wiki/CommonError),如果还不能解决,可以到以上平台询问,个人精力有限,尽力解答。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue