mirror of
https://github.com/proxysu/ProxySU.git
synced 2024-11-21 20:56:08 +03:00
MTProxy -> MTProto | 修复ssh私钥带密码登陆
This commit is contained in:
parent
be9ae4a8de
commit
6e61ef1ff6
@ -1,5 +1,6 @@
|
||||
using Microsoft.Win32;
|
||||
using MvvmCross.Commands;
|
||||
using Newtonsoft.Json;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
@ -6,9 +6,9 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.Models.Projects
|
||||
{
|
||||
public class MTProxyGoSettings : IProjectSettings
|
||||
public class MTProtoGoSettings : IProjectSettings
|
||||
{
|
||||
public MTProxyGoSettings()
|
||||
public MTProtoGoSettings()
|
||||
{
|
||||
Port = 443;
|
||||
|
@ -7,6 +7,6 @@
|
||||
NaiveProxy = 2,
|
||||
Brook = 3,
|
||||
V2ray = 4,
|
||||
MTProxyGo = 5,
|
||||
MTProtoGo = 5,
|
||||
}
|
||||
}
|
||||
|
@ -42,14 +42,14 @@ namespace ProxySuper.Core.Models
|
||||
[JsonProperty("trojanGoSettings")]
|
||||
public TrojanGoSettings TrojanGoSettings { get; set; }
|
||||
|
||||
[JsonProperty("naiveProxySettings")]
|
||||
[JsonProperty("naiveProtoSettings")]
|
||||
public NaiveProxySettings NaiveProxySettings { get; set; }
|
||||
|
||||
[JsonProperty("brook")]
|
||||
public BrookSettings BrookSettings { get; set; }
|
||||
|
||||
[JsonProperty("mtProxyGoSettings")]
|
||||
public MTProxyGoSettings MTProxyGoSettings { get; set; }
|
||||
[JsonProperty("mtProtoGoSettings")]
|
||||
public MTProtoGoSettings MTProtoGoSettings { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
@ -65,7 +65,7 @@ namespace ProxySuper.Core.Models
|
||||
|
||||
if (NaiveProxySettings != null) return ProjectType.NaiveProxy;
|
||||
|
||||
if (MTProxyGoSettings != null) return ProjectType.MTProxyGo;
|
||||
if (MTProtoGoSettings != null) return ProjectType.MTProtoGo;
|
||||
|
||||
return ProjectType.Brook;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@
|
||||
<Compile Include="Models\Projects\BrookType.cs" />
|
||||
<Compile Include="Models\Projects\IProjectSettings.cs" />
|
||||
<Compile Include="Models\Hosts\LocalProxy.cs" />
|
||||
<Compile Include="Models\Projects\MTProxyGoSettings.cs" />
|
||||
<Compile Include="Models\Projects\MTProtoGoSettings.cs" />
|
||||
<Compile Include="Models\Projects\NaiveProxySettings.cs" />
|
||||
<Compile Include="Models\Projects\ProjectType.cs" />
|
||||
<Compile Include="Models\Projects\TrojanGoSettings.cs" />
|
||||
@ -90,7 +90,7 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Helpers\Utils.cs" />
|
||||
<Compile Include="Services\BrookService.cs" />
|
||||
<Compile Include="Services\MTProxyGoService.cs" />
|
||||
<Compile Include="Services\MTProtoGoService.cs" />
|
||||
<Compile Include="Services\NaiveProxyService.cs" />
|
||||
<Compile Include="Services\ServiceBase.cs" />
|
||||
<Compile Include="Services\ShareLink.cs" />
|
||||
@ -105,9 +105,9 @@
|
||||
<Compile Include="ViewModels\BrookInstallViewModel.cs" />
|
||||
<Compile Include="ViewModels\EnableRootViewModel.cs" />
|
||||
<Compile Include="ViewModels\HomeViewModel.cs" />
|
||||
<Compile Include="ViewModels\MTProxyGoConfigViewModel.cs" />
|
||||
<Compile Include="ViewModels\MTProxyGoEditorViewModel.cs" />
|
||||
<Compile Include="ViewModels\MTProxyGoInstallViewModel.cs" />
|
||||
<Compile Include="ViewModels\MTProtoGoConfigViewModel.cs" />
|
||||
<Compile Include="ViewModels\MTProtoGoEditorViewModel.cs" />
|
||||
<Compile Include="ViewModels\MTProtoGoInstallViewModel.cs" />
|
||||
<Compile Include="ViewModels\NaiveProxyConfigViewModel.cs" />
|
||||
<Compile Include="ViewModels\NaiveProxyEditorViewModel.cs" />
|
||||
<Compile Include="ViewModels\NaiveProxyInstallViewModel.cs" />
|
||||
|
@ -1,5 +1,6 @@
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -72,6 +73,8 @@ namespace ProxySuper.Core.Services
|
||||
|
||||
AppendCommand("分享连接:");
|
||||
AppendCommand(ShareLink.BuildBrook(Settings));
|
||||
|
||||
NavigationService.Navigate<BrookConfigViewModel, BrookSettings>(Settings);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -1,5 +1,6 @@
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -9,9 +10,9 @@ using System.Windows;
|
||||
|
||||
namespace ProxySuper.Core.Services
|
||||
{
|
||||
public class MTProxyGoService : ServiceBase<MTProxyGoSettings>
|
||||
public class MTProtoGoService : ServiceBase<MTProtoGoSettings>
|
||||
{
|
||||
public MTProxyGoService(Host host, MTProxyGoSettings settings) : base(host, settings)
|
||||
public MTProtoGoService(Host host, MTProtoGoSettings settings) : base(host, settings)
|
||||
{
|
||||
}
|
||||
|
||||
@ -53,9 +54,9 @@ namespace ProxySuper.Core.Services
|
||||
RunCmd($"echo \"bind-to=\\\"0.0.0.0:{Settings.Port}\\\"\" >> /etc/mtg.toml");
|
||||
Progress.Percentage = 80;
|
||||
|
||||
Progress.Step = "7. 启动MTProxy服务";
|
||||
Progress.Step = "7. 启动MTProto服务";
|
||||
RunCmd($"docker run -d -v /etc/mtg.toml:/config.toml --name=mtg --restart=always -p {Settings.Port + ":" + Settings.Port} nineseconds/mtg");
|
||||
Progress.Desc = "设置自启动MTProxy服务";
|
||||
Progress.Desc = "设置自启动MTProto服务";
|
||||
|
||||
Progress.Step = "安装完成";
|
||||
Progress.Percentage = 100;
|
||||
@ -64,6 +65,7 @@ namespace ProxySuper.Core.Services
|
||||
AppendCommand("Port: " + Settings.Port);
|
||||
AppendCommand("Secret: " + Settings.SecretText);
|
||||
|
||||
NavigationService.Navigate<MTProtoGoConfigViewModel, MTProtoGoSettings>(Settings);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -79,7 +81,7 @@ namespace ProxySuper.Core.Services
|
||||
try
|
||||
{
|
||||
Progress.Percentage = 0;
|
||||
Progress.Step = "卸载MTProxy";
|
||||
Progress.Step = "卸载MTProto";
|
||||
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureRootUser();
|
||||
@ -106,9 +108,9 @@ namespace ProxySuper.Core.Services
|
||||
try
|
||||
{
|
||||
Progress.Percentage = 0;
|
||||
Progress.Step = "更新MTProxy配置";
|
||||
Progress.Step = "更新MTProto配置";
|
||||
|
||||
Progress.Desc = "暂停MTProxy服务";
|
||||
Progress.Desc = "暂停MTProto服务";
|
||||
var cid = RunCmd("docker ps -q --filter name=mtg");
|
||||
RunCmd($"docker stop {cid}");
|
||||
Progress.Percentage = 50;
|
||||
@ -122,7 +124,7 @@ namespace ProxySuper.Core.Services
|
||||
RunCmd($"echo \"bind-to=\\\"0.0.0.0:{Settings.Port}\\\"\" >> /etc/mtg.toml");
|
||||
Progress.Percentage = 80;
|
||||
|
||||
Progress.Desc = "重启MTProxy服务";
|
||||
Progress.Desc = "重启MTProto服务";
|
||||
RunCmd($"docker restart {cid}");
|
||||
|
||||
Progress.Percentage = 100;
|
@ -3,6 +3,7 @@ using MvvmCross.ViewModels;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
@ -69,6 +70,8 @@ namespace ProxySuper.Core.Services
|
||||
|
||||
AppendCommand("分享连接:");
|
||||
AppendCommand(ShareLink.BuildNaiveProxy(Settings));
|
||||
|
||||
NavigationService.Navigate<NaiveProxyConfigViewModel, NaiveProxySettings>(Settings);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -1,4 +1,6 @@
|
||||
using ProxySuper.Core.Helpers;
|
||||
using MvvmCross;
|
||||
using MvvmCross.Navigation;
|
||||
using ProxySuper.Core.Helpers;
|
||||
using ProxySuper.Core.Models;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
@ -9,6 +11,8 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Navigation;
|
||||
|
||||
namespace ProxySuper.Core.Services
|
||||
{
|
||||
@ -30,7 +34,6 @@ namespace ProxySuper.Core.Services
|
||||
{
|
||||
private Host _host;
|
||||
|
||||
|
||||
private SshClient _sshClient;
|
||||
|
||||
private ProjectProgress _progress;
|
||||
@ -41,7 +44,11 @@ namespace ProxySuper.Core.Services
|
||||
|
||||
Settings = settings;
|
||||
|
||||
_sshClient = new SshClient(CreateConnectionInfo());
|
||||
var connection = CreateConnectionInfo();
|
||||
if (connection != null)
|
||||
{
|
||||
_sshClient = new SshClient(connection);
|
||||
}
|
||||
|
||||
_progress = new ProjectProgress();
|
||||
|
||||
@ -54,6 +61,8 @@ namespace ProxySuper.Core.Services
|
||||
IPv6 = string.Empty;
|
||||
|
||||
IsOnlyIPv6 = false;
|
||||
|
||||
NavigationService = Mvx.IoCProvider.Resolve<IMvxNavigationService>();
|
||||
}
|
||||
|
||||
public string RunCmd(string command)
|
||||
@ -89,12 +98,20 @@ namespace ProxySuper.Core.Services
|
||||
|
||||
public bool IsOnlyIPv6 { get; set; }
|
||||
|
||||
public IMvxNavigationService NavigationService { get; set; }
|
||||
|
||||
|
||||
#region 公用方法
|
||||
public void Connect()
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
if (_sshClient == null)
|
||||
{
|
||||
MessageBox.Show("无法建立连接,连接参数有误!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_sshClient.IsConnected == false)
|
||||
{
|
||||
Progress.Desc = ("正在与服务器建立连接");
|
||||
@ -115,7 +132,7 @@ namespace ProxySuper.Core.Services
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
_sshClient.Disconnect();
|
||||
_sshClient?.Disconnect();
|
||||
});
|
||||
}
|
||||
|
||||
@ -314,7 +331,6 @@ namespace ProxySuper.Core.Services
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void UninstallCaddy()
|
||||
{
|
||||
Progress.Desc = "关闭Caddy服务";
|
||||
@ -751,35 +767,52 @@ namespace ProxySuper.Core.Services
|
||||
|
||||
private ConnectionInfo CreateConnectionInfo()
|
||||
{
|
||||
var authMethods = new List<AuthenticationMethod>();
|
||||
|
||||
if (!string.IsNullOrEmpty(_host.Password))
|
||||
try
|
||||
{
|
||||
authMethods.Add(new PasswordAuthenticationMethod(_host.UserName, _host.Password));
|
||||
}
|
||||
var authMethods = new List<AuthenticationMethod>();
|
||||
|
||||
if (_host.SecretType == LoginSecretType.PrivateKey)
|
||||
{
|
||||
authMethods.Add(new PrivateKeyAuthenticationMethod(_host.UserName, new PrivateKeyFile(_host.PrivateKeyPath)));
|
||||
}
|
||||
if (_host.SecretType == LoginSecretType.Password)
|
||||
{
|
||||
authMethods.Add(new PasswordAuthenticationMethod(_host.UserName, _host.Password));
|
||||
}
|
||||
|
||||
if (_host.SecretType == LoginSecretType.PrivateKey)
|
||||
{
|
||||
PrivateKeyFile keyFile;
|
||||
if (string.IsNullOrEmpty(_host.Password))
|
||||
{
|
||||
keyFile = new PrivateKeyFile(_host.PrivateKeyPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
keyFile = new PrivateKeyFile(_host.PrivateKeyPath, _host.Password);
|
||||
}
|
||||
authMethods.Add(new PrivateKeyAuthenticationMethod(_host.UserName, keyFile));
|
||||
}
|
||||
|
||||
if (_host.Proxy.Type == ProxyTypes.None)
|
||||
{
|
||||
return new ConnectionInfo(
|
||||
host: _host.Address,
|
||||
username: _host.UserName,
|
||||
authenticationMethods: authMethods.ToArray());
|
||||
}
|
||||
|
||||
if (_host.Proxy.Type == ProxyTypes.None)
|
||||
{
|
||||
return new ConnectionInfo(
|
||||
host: _host.Address,
|
||||
port: _host.Port,
|
||||
username: _host.UserName,
|
||||
proxyType: _host.Proxy.Type,
|
||||
proxyHost: _host.Proxy.Address,
|
||||
proxyPort: _host.Proxy.Port,
|
||||
proxyUsername: _host.Proxy.UserName, proxyPassword: _host.Proxy.Password,
|
||||
authenticationMethods: authMethods.ToArray());
|
||||
}
|
||||
|
||||
return new ConnectionInfo(
|
||||
host: _host.Address,
|
||||
port: _host.Port,
|
||||
username: _host.UserName,
|
||||
proxyType: _host.Proxy.Type,
|
||||
proxyHost: _host.Proxy.Address,
|
||||
proxyPort: _host.Proxy.Port,
|
||||
proxyUsername: _host.Proxy.UserName, proxyPassword: _host.Proxy.Password,
|
||||
authenticationMethods: authMethods.ToArray());
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
using Microsoft.Win32;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
@ -93,6 +94,10 @@ namespace ProxySuper.Core.Services
|
||||
{
|
||||
Progress.Step = "安装成功,请上传您的 TLS 证书。";
|
||||
}
|
||||
else
|
||||
{
|
||||
NavigationService.Navigate<TrojanGoConfigViewModel, TrojanGoSettings>(Settings);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -202,12 +207,12 @@ namespace ProxySuper.Core.Services
|
||||
{
|
||||
try
|
||||
{
|
||||
EnsureRootUser();
|
||||
|
||||
Progress.Step = "续签证书";
|
||||
Progress.Percentage = 0;
|
||||
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureRootUser();
|
||||
EnsureSystemEnv();
|
||||
Progress.Percentage = 20;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
using Microsoft.Win32;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
@ -88,6 +89,10 @@ namespace ProxySuper.Core.Services
|
||||
{
|
||||
Progress.Step = "安装成功,请上传您的 TLS 证书。";
|
||||
}
|
||||
else
|
||||
{
|
||||
NavigationService.Navigate<V2rayConfigViewModel, V2raySettings>(Settings);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -236,6 +241,11 @@ namespace ProxySuper.Core.Services
|
||||
Progress.Percentage = 0;
|
||||
Progress.Step = "续签证书";
|
||||
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureRootUser();
|
||||
EnsureSystemEnv();
|
||||
|
||||
Progress.Desc = "安装证书";
|
||||
InstallCert(
|
||||
dirPath: "/usr/local/etc/v2ray/ssl",
|
||||
certName: "v2ray_ssl.crt",
|
||||
|
@ -2,6 +2,7 @@
|
||||
using ProxySuper.Core.Helpers;
|
||||
using ProxySuper.Core.Models.Hosts;
|
||||
using ProxySuper.Core.Models.Projects;
|
||||
using ProxySuper.Core.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
@ -90,6 +91,10 @@ namespace ProxySuper.Core.Services
|
||||
{
|
||||
Progress.Step = "安装成功,请上传您的 TLS 证书。";
|
||||
}
|
||||
else
|
||||
{
|
||||
NavigationService.Navigate<XrayConfigViewModel, XraySettings>(Settings);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -238,6 +243,11 @@ namespace ProxySuper.Core.Services
|
||||
Progress.Percentage = 0;
|
||||
Progress.Step = "续签证书";
|
||||
|
||||
Progress.Desc = "检测系统环境";
|
||||
EnsureRootUser();
|
||||
EnsureSystemEnv();
|
||||
|
||||
Progress.Desc = "安装证书";
|
||||
InstallCert(
|
||||
dirPath: "/usr/local/etc/xray/ssl",
|
||||
certName: "xray_ssl.crt",
|
||||
|
@ -100,7 +100,7 @@ namespace ProxySuper.Core.ViewModels
|
||||
|
||||
public IMvxCommand AddNaiveProxyCommand => new MvxAsyncCommand(AddNaiveProxyRecord);
|
||||
|
||||
public IMvxCommand AddMTProxyGoCommand => new MvxAsyncCommand(AddMTProxyGoRecord);
|
||||
public IMvxCommand AddMTProtoGoCommand => new MvxAsyncCommand(AddMTProtoGoRecord);
|
||||
|
||||
public IMvxCommand AddBrookCommand => new MvxAsyncCommand(AddBrookRecord);
|
||||
|
||||
@ -155,14 +155,14 @@ namespace ProxySuper.Core.ViewModels
|
||||
SaveToJson();
|
||||
}
|
||||
|
||||
public async Task AddMTProxyGoRecord()
|
||||
public async Task AddMTProtoGoRecord()
|
||||
{
|
||||
Record record = new Record();
|
||||
record.Id = Utils.GetTickID();
|
||||
record.Host = new Host();
|
||||
record.MTProxyGoSettings = new MTProxyGoSettings();
|
||||
record.MTProtoGoSettings = new MTProtoGoSettings();
|
||||
|
||||
var result = await _navigationService.Navigate<MTProxyGoEditorViewModel, Record, Record>(record);
|
||||
var result = await _navigationService.Navigate<MTProtoGoEditorViewModel, Record, Record>(record);
|
||||
if (result == null) return;
|
||||
|
||||
Records.Add(result);
|
||||
@ -247,13 +247,13 @@ namespace ProxySuper.Core.ViewModels
|
||||
record.Host = result.Host;
|
||||
record.BrookSettings = result.BrookSettings;
|
||||
}
|
||||
if (record.Type == ProjectType.MTProxyGo)
|
||||
if (record.Type == ProjectType.MTProtoGo)
|
||||
{
|
||||
result = await _navigationService.Navigate<MTProxyGoEditorViewModel, Record, Record>(record);
|
||||
result = await _navigationService.Navigate<MTProtoGoEditorViewModel, Record, Record>(record);
|
||||
if (result == null) return;
|
||||
|
||||
record.Host = result.Host;
|
||||
record.MTProxyGoSettings = result.MTProxyGoSettings;
|
||||
record.MTProtoGoSettings = result.MTProtoGoSettings;
|
||||
}
|
||||
|
||||
SaveToJson();
|
||||
@ -299,9 +299,9 @@ namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
await _navigationService.Navigate<BrookConfigViewModel, BrookSettings>(record.BrookSettings);
|
||||
}
|
||||
if (record.Type == ProjectType.MTProxyGo)
|
||||
if (record.Type == ProjectType.MTProtoGo)
|
||||
{
|
||||
await _navigationService.Navigate<MTProxyGoConfigViewModel, MTProxyGoSettings>(record.MTProxyGoSettings);
|
||||
await _navigationService.Navigate<MTProtoGoConfigViewModel, MTProtoGoSettings>(record.MTProtoGoSettings);
|
||||
}
|
||||
}
|
||||
|
||||
@ -331,9 +331,9 @@ namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
await _navigationService.Navigate<BrookInstallViewModel, Record>(record);
|
||||
}
|
||||
if (record.Type == ProjectType.MTProxyGo)
|
||||
if (record.Type == ProjectType.MTProtoGo)
|
||||
{
|
||||
await _navigationService.Navigate<MTProxyGoInstallViewModel, Record>(record);
|
||||
await _navigationService.Navigate<MTProtoGoInstallViewModel, Record>(record);
|
||||
}
|
||||
|
||||
SaveToJson();
|
||||
|
@ -9,11 +9,11 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class MTProxyGoConfigViewModel : MvxViewModel<MTProxyGoSettings>
|
||||
public class MTProtoGoConfigViewModel : MvxViewModel<MTProtoGoSettings>
|
||||
{
|
||||
public MTProxyGoSettings Settings { get; set; }
|
||||
public MTProtoGoSettings Settings { get; set; }
|
||||
|
||||
public override void Prepare(MTProxyGoSettings parameter)
|
||||
public override void Prepare(MTProtoGoSettings parameter)
|
||||
{
|
||||
Settings = parameter;
|
||||
}
|
@ -13,9 +13,9 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class MTProxyGoEditorViewModel : MvxViewModel<Record, Record>
|
||||
public class MTProtoGoEditorViewModel : MvxViewModel<Record, Record>
|
||||
{
|
||||
public MTProxyGoEditorViewModel(IMvxNavigationService navigationService)
|
||||
public MTProtoGoEditorViewModel(IMvxNavigationService navigationService)
|
||||
{
|
||||
NavigationService = navigationService;
|
||||
}
|
||||
@ -30,7 +30,7 @@ namespace ProxySuper.Core.ViewModels
|
||||
|
||||
public Host Host { get; set; }
|
||||
|
||||
public MTProxyGoSettings Settings { get; set; }
|
||||
public MTProtoGoSettings Settings { get; set; }
|
||||
|
||||
public override void Prepare(Record parameter)
|
||||
{
|
||||
@ -38,7 +38,7 @@ namespace ProxySuper.Core.ViewModels
|
||||
|
||||
Id = record.Id;
|
||||
Host = record.Host;
|
||||
Settings = record.MTProxyGoSettings;
|
||||
Settings = record.MTProtoGoSettings;
|
||||
}
|
||||
|
||||
private void Save()
|
||||
@ -47,7 +47,7 @@ namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
Id = this.Id,
|
||||
Host = this.Host,
|
||||
MTProxyGoSettings = Settings,
|
||||
MTProtoGoSettings = Settings,
|
||||
});
|
||||
}
|
||||
|
||||
@ -57,10 +57,10 @@ namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
Id = this.Id,
|
||||
Host = this.Host,
|
||||
MTProxyGoSettings = Settings,
|
||||
MTProtoGoSettings = Settings,
|
||||
};
|
||||
NavigationService.Close(this, record);
|
||||
NavigationService.Navigate<MTProxyGoInstallViewModel, Record>(record);
|
||||
NavigationService.Navigate<MTProtoGoInstallViewModel, Record>(record);
|
||||
}
|
||||
}
|
||||
}
|
@ -13,26 +13,26 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace ProxySuper.Core.ViewModels
|
||||
{
|
||||
public class MTProxyGoInstallViewModel : MvxViewModel<Record>
|
||||
public class MTProtoGoInstallViewModel : MvxViewModel<Record>
|
||||
{
|
||||
Host _host;
|
||||
|
||||
MTProxyGoSettings _settings;
|
||||
MTProtoGoSettings _settings;
|
||||
|
||||
MTProxyGoService _mtproxyService;
|
||||
MTProtoGoService _mtproxyService;
|
||||
|
||||
Action _onSave;
|
||||
|
||||
public override void Prepare(Record parameter)
|
||||
{
|
||||
_host = parameter.Host;
|
||||
_settings = parameter.MTProxyGoSettings;
|
||||
_settings = parameter.MTProtoGoSettings;
|
||||
_onSave = parameter.OnSave;
|
||||
}
|
||||
|
||||
public override Task Initialize()
|
||||
{
|
||||
_mtproxyService = new MTProxyGoService(_host, _settings);
|
||||
_mtproxyService = new MTProtoGoService(_host, _settings);
|
||||
_mtproxyService.Progress.StepUpdate = () => RaisePropertyChanged("Progress");
|
||||
_mtproxyService.Progress.LogsUpdate = () => RaisePropertyChanged("Logs");
|
||||
_mtproxyService.Connect();
|
@ -144,14 +144,14 @@
|
||||
<Compile Include="Views\MTProxyGo\MTProxyGoInstallView.xaml.cs">
|
||||
<DependentUpon>MTProxyGoInstallView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\NaiveProxy\NaiveProxyConfigView.xaml.cs">
|
||||
<DependentUpon>NaiveProxyConfigView.xaml</DependentUpon>
|
||||
<Compile Include="Views\NaiveProto\NaiveProtoConfigView.xaml.cs">
|
||||
<DependentUpon>NaiveProtoConfigView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\NaiveProxy\NaiveProxyEditorView.xaml.cs">
|
||||
<DependentUpon>NaiveProxyEditorView.xaml</DependentUpon>
|
||||
<Compile Include="Views\NaiveProto\NaiveProtoEditorView.xaml.cs">
|
||||
<DependentUpon>NaiveProtoEditorView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\NaiveProxy\NaiveProxyInstallView.xaml.cs">
|
||||
<DependentUpon>NaiveProxyInstallView.xaml</DependentUpon>
|
||||
<Compile Include="Views\NaiveProto\NaiveProtoInstallView.xaml.cs">
|
||||
<DependentUpon>NaiveProtoInstallView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ShareLinkView.xaml.cs">
|
||||
<DependentUpon>ShareLinkView.xaml</DependentUpon>
|
||||
@ -299,15 +299,15 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\NaiveProxy\NaiveProxyConfigView.xaml">
|
||||
<Page Include="Views\NaiveProto\NaiveProtoConfigView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\NaiveProxy\NaiveProxyEditorView.xaml">
|
||||
<Page Include="Views\NaiveProto\NaiveProtoEditorView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\NaiveProxy\NaiveProxyInstallView.xaml">
|
||||
<Page Include="Views\NaiveProto\NaiveProtoInstallView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
|
@ -127,9 +127,9 @@
|
||||
<sys:String x:Key="NaiveProxyPassword">Password</sys:String>
|
||||
<sys:String x:Key="NaiveProxyMaskDomain">GuiseHost</sys:String>
|
||||
|
||||
<!--MTProxy Go-->
|
||||
<sys:String x:Key="MTProxyDomain">Address</sys:String>
|
||||
<sys:String x:Key="MTProxyPort">Port</sys:String>
|
||||
<sys:String x:Key="MTProxyCleartext">Cleantext</sys:String>
|
||||
<sys:String x:Key="MTProxySecretText">Secret</sys:String>
|
||||
<!--MTProto Go-->
|
||||
<sys:String x:Key="MTProtoDomain">Address</sys:String>
|
||||
<sys:String x:Key="MTProtoPort">Port</sys:String>
|
||||
<sys:String x:Key="MTProtoCleartext">Cleantext</sys:String>
|
||||
<sys:String x:Key="MTProtoSecretText">Secret</sys:String>
|
||||
</ResourceDictionary>
|
@ -127,9 +127,9 @@
|
||||
<sys:String x:Key="NaiveProxyPassword">密碼</sys:String>
|
||||
<sys:String x:Key="NaiveProxyMaskDomain">偽裝網站</sys:String>
|
||||
|
||||
<!--MTProxy Go-->
|
||||
<sys:String x:Key="MTProxyDomain">域名/IP</sys:String>
|
||||
<sys:String x:Key="MTProxyPort">端口</sys:String>
|
||||
<sys:String x:Key="MTProxyCleartext">加密前字符</sys:String>
|
||||
<sys:String x:Key="MTProxySecretText">密鑰</sys:String>
|
||||
<!--MTProto Go-->
|
||||
<sys:String x:Key="MTProtoDomain">域名/IP</sys:String>
|
||||
<sys:String x:Key="MTProtoPort">端口</sys:String>
|
||||
<sys:String x:Key="MTProtoCleartext">加密前字符</sys:String>
|
||||
<sys:String x:Key="MTProtoSecretText">密鑰</sys:String>
|
||||
</ResourceDictionary>
|
@ -128,9 +128,9 @@
|
||||
<sys:String x:Key="NaiveProxyPassword">密码</sys:String>
|
||||
<sys:String x:Key="NaiveProxyMaskDomain">伪装网站</sys:String>
|
||||
|
||||
<!--MTProxy Go-->
|
||||
<sys:String x:Key="MTProxyDomain">域名/IP</sys:String>
|
||||
<sys:String x:Key="MTProxyPort">端口</sys:String>
|
||||
<sys:String x:Key="MTProxyCleartext">加密前字符</sys:String>
|
||||
<sys:String x:Key="MTProxySecretText">密钥</sys:String>
|
||||
<!--MTProto Go-->
|
||||
<sys:String x:Key="MTProtoDomain">域名/IP</sys:String>
|
||||
<sys:String x:Key="MTProtoPort">端口</sys:String>
|
||||
<sys:String x:Key="MTProtoCleartext">加密前字符</sys:String>
|
||||
<sys:String x:Key="MTProtoSecretText">密钥</sys:String>
|
||||
</ResourceDictionary>
|
@ -17,7 +17,7 @@
|
||||
<MenuItem Header="{DynamicResource MainMenuAddHost}" Padding="10,3">
|
||||
<MenuItem Padding="0,5" Header="Xray" Command="{Binding AddXrayCommand}"></MenuItem>
|
||||
<MenuItem Padding="0,5" Header="V2ray" Command="{Binding AddV2rayCommand}"></MenuItem>
|
||||
<MenuItem Padding="0,5" Header="MTProxy-Go" Command="{Binding AddMTProxyGoCommand}"></MenuItem>
|
||||
<MenuItem Padding="0,5" Header="MTProto-Go" Command="{Binding AddMTProtoGoCommand}"></MenuItem>
|
||||
<MenuItem Padding="0,5" Header="Trojan-Go" Command="{Binding AddTrojanGoCommand}"></MenuItem>
|
||||
<MenuItem Padding="0,5" Header="NaiveProxy" Command="{Binding AddNaiveProxyCommand}"></MenuItem>
|
||||
<MenuItem Padding="0,5" Header="Brook" Command="{Binding AddBrookCommand}"></MenuItem>
|
||||
|
@ -1,14 +1,14 @@
|
||||
<views:MvxWindow x:Class="ProxySuper.WPF.Views.MTProxyGo.MTProxyGoConfigView"
|
||||
<views:MvxWindow x:Class="ProxySuper.WPF.Views.MTProtoGo.MTProtoGoConfigView"
|
||||
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:ProxySuper.WPF.Views.MTProxyGo"
|
||||
xmlns:local="clr-namespace:ProxySuper.WPF.Views.MTProtoGo"
|
||||
xmlns:views="clr-namespace:MvvmCross.Platforms.Wpf.Views;assembly=MvvmCross.Platforms.Wpf"
|
||||
mc:Ignorable="d"
|
||||
Icon="/Resources/ProxySU.ico"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Title="MTProxy-Go节点配置" Height="450" Width="800">
|
||||
Title="MTProto-Go节点配置" Height="450" Width="800">
|
||||
<Grid Margin="10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="140" />
|
||||
|
@ -13,14 +13,14 @@ using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace ProxySuper.WPF.Views.MTProxyGo
|
||||
namespace ProxySuper.WPF.Views.MTProtoGo
|
||||
{
|
||||
/// <summary>
|
||||
/// MTProxyGoConfigView.xaml 的交互逻辑
|
||||
/// MTProtoGoConfigView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class MTProxyGoConfigView : MvxWindow
|
||||
public partial class MTProtoGoConfigView : MvxWindow
|
||||
{
|
||||
public MTProxyGoConfigView()
|
||||
public MTProtoGoConfigView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
<views:MvxWindow x:Class="ProxySuper.WPF.Views.MTProxyGo.MTProxyGoEditorView"
|
||||
<views:MvxWindow x:Class="ProxySuper.WPF.Views.MTProtoGo.MTProtoGoEditorView"
|
||||
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:ProxySuper.WPF.Views.MTProxyGo"
|
||||
xmlns:local="clr-namespace:ProxySuper.WPF.Views.MTProtoGo"
|
||||
xmlns:views="clr-namespace:MvvmCross.Platforms.Wpf.Views;assembly=MvvmCross.Platforms.Wpf"
|
||||
xmlns:ctrl="clr-namespace:ProxySuper.WPF.Controls"
|
||||
mc:Ignorable="d"
|
||||
@ -11,7 +11,7 @@
|
||||
BorderBrush="#eee"
|
||||
Icon="/Resources/ProxySU.ico"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Title="MTProxy-Go编辑配置" Height="600" Width="1000">
|
||||
Title="MTProto-Go编辑配置" Height="600" Width="1000">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="310" />
|
||||
@ -36,13 +36,13 @@
|
||||
<ColumnDefinition Width="200" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Content="{DynamicResource MTProxyDomain}" Grid.Row="0" Grid.Column="0" />
|
||||
<Label Content="{DynamicResource MTProtoDomain}" Grid.Row="0" Grid.Column="0" />
|
||||
<TextBox Text="{Binding Settings.Domain}" Grid.Row="0" Grid.Column="1" />
|
||||
|
||||
<Label Content="{DynamicResource MTProxyPort}" Grid.Row="1" Grid.Column="0" />
|
||||
<Label Content="{DynamicResource MTProtoPort}" Grid.Row="1" Grid.Column="0" />
|
||||
<TextBox Text="{Binding Settings.Port}" Grid.Row="1" Grid.Column="1" />
|
||||
|
||||
<Label Content="{DynamicResource MTProxyCleartext}" Grid.Row="2" Grid.Column="0" />
|
||||
<Label Content="{DynamicResource MTProtoCleartext}" Grid.Row="2" Grid.Column="0" />
|
||||
<TextBox Text="{Binding Settings.Cleartext}" Grid.Row="2" Grid.Column="1" />
|
||||
</Grid>
|
||||
|
||||
|
@ -13,14 +13,14 @@ using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace ProxySuper.WPF.Views.MTProxyGo
|
||||
namespace ProxySuper.WPF.Views.MTProtoGo
|
||||
{
|
||||
/// <summary>
|
||||
/// MTProxyGoEditorView.xaml 的交互逻辑
|
||||
/// MTProtoGoEditorView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class MTProxyGoEditorView : MvxWindow
|
||||
public partial class MTProtoGoEditorView : MvxWindow
|
||||
{
|
||||
public MTProxyGoEditorView()
|
||||
public MTProtoGoEditorView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
<views:MvxWindow x:Class="ProxySuper.WPF.Views.MTProxyGo.MTProxyGoInstallView"
|
||||
<views:MvxWindow x:Class="ProxySuper.WPF.Views.MTProtoGo.MTProtoGoInstallView"
|
||||
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:ProxySuper.WPF.Views.MTProxyGo"
|
||||
xmlns:local="clr-namespace:ProxySuper.WPF.Views.MTProtoGo"
|
||||
xmlns:ctrl="clr-namespace:ProxySuper.WPF.Controls"
|
||||
xmlns:views="clr-namespace:MvvmCross.Platforms.Wpf.Views;assembly=MvvmCross.Platforms.Wpf"
|
||||
mc:Ignorable="d"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Title="MTProxy-Go安装" Height="600" Width="1000">
|
||||
Title="MTProto-Go安装" Height="600" Width="1000">
|
||||
<StackPanel>
|
||||
<ctrl:ProgressControl />
|
||||
|
||||
|
@ -13,14 +13,14 @@ using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace ProxySuper.WPF.Views.MTProxyGo
|
||||
namespace ProxySuper.WPF.Views.MTProtoGo
|
||||
{
|
||||
/// <summary>
|
||||
/// MTProxyInstallView.xaml 的交互逻辑
|
||||
/// MTProtoInstallView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class MTProxyGoInstallView : MvxWindow
|
||||
public partial class MTProtoGoInstallView : MvxWindow
|
||||
{
|
||||
public MTProxyGoInstallView()
|
||||
public MTProtoGoInstallView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProxyConfigView"
|
||||
<views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProtoConfigView"
|
||||
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"
|
@ -5,9 +5,9 @@ namespace ProxySuper.WPF.Views
|
||||
/// <summary>
|
||||
/// NaiveProxyConfigView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class NaiveProxyConfigView : MvxWindow
|
||||
public partial class NaiveProtoConfigView : MvxWindow
|
||||
{
|
||||
public NaiveProxyConfigView()
|
||||
public NaiveProtoConfigView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
<views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProxyEditorView"
|
||||
<views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProtoEditorView"
|
||||
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"
|
@ -5,9 +5,9 @@ namespace ProxySuper.WPF.Views
|
||||
/// <summary>
|
||||
/// NaiveProxyEditorView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class NaiveProxyEditorView : MvxWindow
|
||||
public partial class NaiveProtoEditorView : MvxWindow
|
||||
{
|
||||
public NaiveProxyEditorView()
|
||||
public NaiveProtoEditorView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
<views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProxy.NaiveProxyInstallView"
|
||||
<views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProxy.NaiveProtoInstallView"
|
||||
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"
|
@ -18,9 +18,9 @@ namespace ProxySuper.WPF.Views.NaiveProxy
|
||||
/// <summary>
|
||||
/// NaiveProxyInstallViewModel.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class NaiveProxyInstallView : MvxWindow
|
||||
public partial class NaiveProtoInstallView : MvxWindow
|
||||
{
|
||||
public NaiveProxyInstallView()
|
||||
public NaiveProtoInstallView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
Loading…
Reference in New Issue
Block a user