diff --git a/ProxySuper.Core/Models/Projects/XraySettings_SS.cs b/ProxySuper.Core/Models/Projects/XraySettings_SS.cs
index b7d454a..debe70a 100644
--- a/ProxySuper.Core/Models/Projects/XraySettings_SS.cs
+++ b/ProxySuper.Core/Models/Projects/XraySettings_SS.cs
@@ -12,12 +12,12 @@ namespace ProxySuper.Core.Models.Projects
///
/// ss password
///
- public string ShadowsocksPassword { get; set; }
+ public string ShadowSocksPassword { get; set; }
///
/// ss method
///
- public string ShadowsocksMethod { get; set; }
+ public string ShadowSocksMethod { get; set; }
///
/// ss port
diff --git a/ProxySuper.Core/Models/Record.cs b/ProxySuper.Core/Models/Record.cs
index 1809ca6..8aacd44 100644
--- a/ProxySuper.Core/Models/Record.cs
+++ b/ProxySuper.Core/Models/Record.cs
@@ -9,6 +9,7 @@ using ProxySuper.Core.Models.Projects;
using ProxySuper.Core.ViewModels;
using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -56,7 +57,6 @@ namespace ProxySuper.Core.Models
}
}
-
[JsonIgnore]
public IMvxCommand NavToInstallerCommand => new MvxAsyncCommand(NavigateToInstaller);
@@ -76,7 +76,6 @@ namespace ProxySuper.Core.Models
this.Host = result.Host;
this.XraySettings = result.XraySettings;
- await RaisePropertyChanged("Host");
}
if (Type == ProjectType.TrojanGo)
@@ -87,6 +86,7 @@ namespace ProxySuper.Core.Models
this.Host = result.Host;
this.TrojanGoSettings = result.TrojanGoSettings;
}
+ await RaisePropertyChanged("Host");
}
public async Task NavigateToInstaller()
diff --git a/ProxySuper.Core/Services/ShareLink.cs b/ProxySuper.Core/Services/ShareLink.cs
index 0fb6651..b82b48d 100644
--- a/ProxySuper.Core/Services/ShareLink.cs
+++ b/ProxySuper.Core/Services/ShareLink.cs
@@ -36,8 +36,8 @@ namespace ProxySuper.Core.Services
private static string BuildShadowSocksShareLink(XraySettings settings)
{
- var _method = settings.ShadowsocksMethod;
- var _password = settings.ShadowsocksPassword;
+ var _method = settings.ShadowSocksMethod;
+ var _password = settings.ShadowSocksPassword;
var _server = settings.Domain;
var _port = settings.ShadowSocksPort;
diff --git a/ProxySuper.Core/Services/XrayConfigBuilder.cs b/ProxySuper.Core/Services/XrayConfigBuilder.cs
index 39f98d5..09f19b2 100644
--- a/ProxySuper.Core/Services/XrayConfigBuilder.cs
+++ b/ProxySuper.Core/Services/XrayConfigBuilder.cs
@@ -201,8 +201,8 @@ namespace ProxySuper.Core.Services
{
var ssBound = GetBound("Shadowsocks-AEAD.json");
ssBound.port = parameters.ShadowSocksPort;
- ssBound.settings.clients[0].password = parameters.ShadowsocksPassword;
- ssBound.settings.clients[0].method = parameters.ShadowsocksMethod;
+ ssBound.settings.clients[0].password = parameters.ShadowSocksPassword;
+ ssBound.settings.clients[0].method = parameters.ShadowSocksMethod;
xrayConfig.inbounds.Add(JToken.FromObject(ssBound));
}
diff --git a/ProxySuper.Core/ViewModels/HomeViewModel.cs b/ProxySuper.Core/ViewModels/HomeViewModel.cs
index 8cfb762..4f09de9 100644
--- a/ProxySuper.Core/ViewModels/HomeViewModel.cs
+++ b/ProxySuper.Core/ViewModels/HomeViewModel.cs
@@ -23,12 +23,27 @@ namespace ProxySuper.Core.ViewModels
{
_navigationService = navigationService;
ReadRecords();
+ _navigationService.AfterClose += _navigationService_AfterClose;
+ }
+
+ private void _navigationService_AfterClose(object sender, MvvmCross.Navigation.EventArguments.IMvxNavigateEventArgs e)
+ {
+ if (e.ViewModel is XrayEditorViewModel ||
+ e.ViewModel is TrojanGoEditorViewModel)
+ {
+ SaveToJson();
+ }
}
public void ReadRecords()
{
- var json = File.ReadAllText("Data/Record.json");
- var records = JsonConvert.DeserializeObject>(json);
+ List records = new List();
+ if (File.Exists("Data/Record.json"))
+ {
+ var json = File.ReadAllText("Data/Record.json");
+ records = JsonConvert.DeserializeObject>(json);
+ }
+
this.Records = new MvxObservableCollection();
records.ForEach(item =>
@@ -41,9 +56,9 @@ namespace ProxySuper.Core.ViewModels
});
}
- public void SaveRecords()
+ public void SaveToJson()
{
- var json = JsonConvert.SerializeObject(Records);
+ var json = JsonConvert.SerializeObject(this);
File.WriteAllText("Data/Record.json", json);
}
@@ -64,6 +79,9 @@ namespace ProxySuper.Core.ViewModels
if (result == null) return;
Records.Add(result);
+ SaveToJson();
+
+
}
public async Task AddTrojanGoRecord()
diff --git a/ProxySuper.Core/ViewModels/XrayConfigViewModel.cs b/ProxySuper.Core/ViewModels/XrayConfigViewModel.cs
index 97b9f2a..3420b36 100644
--- a/ProxySuper.Core/ViewModels/XrayConfigViewModel.cs
+++ b/ProxySuper.Core/ViewModels/XrayConfigViewModel.cs
@@ -24,6 +24,76 @@ namespace ProxySuper.Core.ViewModels
Settings = parameter;
}
+ public bool Checked_VLESS_TCP_XTLS
+ {
+ get
+ {
+ return Settings.Types.Contains(XrayType.VLESS_TCP_XTLS);
+ }
+ }
+ public bool Checked_VLESS_TCP
+ {
+ get
+ {
+ return Settings.Types.Contains(XrayType.VLESS_TCP);
+ }
+ }
+
+ public bool Checked_VLESS_WS
+ {
+ get
+ {
+ return Settings.Types.Contains(XrayType.VLESS_WS);
+ }
+ }
+
+ public bool Checked_VLESS_KCP
+ {
+ get
+ {
+ return Settings.Types.Contains(XrayType.VLESS_KCP);
+ }
+ }
+
+ public bool Checked_VMESS_TCP
+ {
+ get
+ {
+ return Settings.Types.Contains(XrayType.VMESS_TCP);
+ }
+ }
+
+ public bool Checked_VMESS_WS
+ {
+ get
+ {
+ return Settings.Types.Contains(XrayType.VMESS_WS);
+ }
+ }
+
+ public bool Checked_VMESS_KCP
+ {
+ get
+ {
+ return Settings.Types.Contains(XrayType.VMESS_KCP);
+ }
+ }
+
+ public bool Checked_Trojan_TCP
+ {
+ get
+ {
+ return Settings.Types.Contains(XrayType.Trojan_TCP);
+ }
+ }
+
+ public bool CheckedShadowSocks
+ {
+ get
+ {
+ return Settings.Types.Contains(XrayType.ShadowsocksAEAD);
+ }
+ }
}
}
diff --git a/ProxySuper.Core/ViewModels/XrayEditorViewModel.cs b/ProxySuper.Core/ViewModels/XrayEditorViewModel.cs
index bc8c7b9..3a2c4c5 100644
--- a/ProxySuper.Core/ViewModels/XrayEditorViewModel.cs
+++ b/ProxySuper.Core/ViewModels/XrayEditorViewModel.cs
@@ -174,18 +174,18 @@ namespace ProxySuper.Core.ViewModels
}
public string ShadowSocksPassword
{
- get => Settings.ShadowsocksPassword;
- set => Settings.ShadowsocksPassword = value;
+ get => Settings.ShadowSocksPassword;
+ set => Settings.ShadowSocksPassword = value;
}
public string ShadowSocksMethod
{
- get => Settings.ShadowsocksMethod;
+ get => Settings.ShadowSocksMethod;
set
{
var namespaceStr = typeof(ComboBoxItem).FullName + ":";
var trimValue = value.Replace(namespaceStr, "");
trimValue = trimValue.Trim();
- Settings.ShadowsocksMethod = trimValue;
+ Settings.ShadowSocksMethod = trimValue;
RaisePropertyChanged("ShadowSocksMethod");
}
}
diff --git a/ProxySuper.WPF/Controls/HostControl.xaml b/ProxySuper.WPF/Controls/HostControl.xaml
index b86fb33..b92cfe6 100644
--- a/ProxySuper.WPF/Controls/HostControl.xaml
+++ b/ProxySuper.WPF/Controls/HostControl.xaml
@@ -38,7 +38,7 @@
-
+
@@ -111,7 +111,7 @@
-
+
diff --git a/ProxySuper.WPF/Data/Record.json b/ProxySuper.WPF/Data/Record.json
deleted file mode 100644
index b702e9f..0000000
--- a/ProxySuper.WPF/Data/Record.json
+++ /dev/null
@@ -1,54 +0,0 @@
-[
- {
- "host": {
- "tag": "123",
- "address": "122.23.36.32",
- "userName": null,
- "password": null,
- "port": 22,
- "privateKeyPath": null,
- "proxy": {
- "address": "127.0.0.1",
- "port": 1080,
- "type": 0,
- "userName": null,
- "password": null
- },
- "secretType": 0
- },
- "settings": {
- "port": 443,
- "uuid": "ac082c52-0be1-4a20-a1ee-aa7e29ce2d1e",
- "vlesS_WS_Path": "/vlessws",
- "vlesS_H2_Path": "/vlessh2",
- "vlesS_KCP_Seed": "ac082c52-0be1-4a20-a1ee-aa7e29ce2d1e",
- "vlesS_KCP_Type": "none",
- "vlesS_KCP_Port": 2001,
- "vlesS_gRPC_ServiceName": "xray_gRPC",
- "vlesS_gRPC_Port": 2002,
- "vmesS_WS_Path": "/vmessws",
- "vmesS_TCP_Path": "/vmesstcp",
- "vmesS_H2_Path": "/vmessh2",
- "vmesS_KCP_Seed": "ac082c52-0be1-4a20-a1ee-aa7e29ce2d1e",
- "vmesS_KCP_Type": "none",
- "vmesS_KCP_Port": 3001,
- "trojanPassword": "ac082c52-0be1-4a20-a1ee-aa7e29ce2d1e",
- "trojan_WS_Path": "/trojanws",
- "shadowsocksPassword": "ac082c52-0be1-4a20-a1ee-aa7e29ce2d1e",
- "shadowsocksMethod": "aes-128-gcm",
- "shadowSocksPort": 4001,
- "domain": "www.baodu.com",
- "maskDomain": null,
- "types": [
- 100,
- 101,
- 102,
- 104,
- 202,
- 204,
- 401,
- 301
- ]
- }
- }
-]
\ No newline at end of file
diff --git a/ProxySuper.WPF/ProxySuper.WPF.csproj b/ProxySuper.WPF/ProxySuper.WPF.csproj
index dcbb2df..b3456fe 100644
--- a/ProxySuper.WPF/ProxySuper.WPF.csproj
+++ b/ProxySuper.WPF/ProxySuper.WPF.csproj
@@ -258,9 +258,6 @@
ResXFileCodeGenerator
Resources.Designer.cs
-
- PreserveNewest
-
SettingsSingleFileGenerator
@@ -395,7 +392,9 @@
PreserveNewest
-
+
+
+
diff --git a/ProxySuper.WPF/Resources/Languages/en.xaml b/ProxySuper.WPF/Resources/Languages/en.xaml
index 4d230e4..466d693 100644
--- a/ProxySuper.WPF/Resources/Languages/en.xaml
+++ b/ProxySuper.WPF/Resources/Languages/en.xaml
@@ -34,13 +34,14 @@
+ Host
Tag
Address
UserName
Password
Port
SecretType
- UploadSecretKey
+ UploadKey
Password
PrivateKey
diff --git a/ProxySuper.WPF/Views/HomeView.xaml b/ProxySuper.WPF/Views/HomeView.xaml
index d8e7a43..8784b99 100644
--- a/ProxySuper.WPF/Views/HomeView.xaml
+++ b/ProxySuper.WPF/Views/HomeView.xaml
@@ -26,8 +26,8 @@
@@ -37,6 +37,7 @@
-
diff --git a/ProxySuper.WPF/Views/HomeView.xaml.cs b/ProxySuper.WPF/Views/HomeView.xaml.cs
index c9d1ec4..e2ae53f 100644
--- a/ProxySuper.WPF/Views/HomeView.xaml.cs
+++ b/ProxySuper.WPF/Views/HomeView.xaml.cs
@@ -44,16 +44,18 @@ namespace ProxySuper.WPF.Views
System.Diagnostics.Process.Start("explorer.exe", "https://github.com/proxysu/ProxySU");
}
- private void NavToEditor(object sender, RoutedEventArgs e)
+
+ ResourceDictionary resource = new ResourceDictionary();
+ private void SetSimpleChinese(object sender, RoutedEventArgs e)
{
- NavigationService.Navigate(ViewModel.Records[0]);
+ resource.Source = new Uri(@"Resources\Languages\zh_cn.xaml", UriKind.Relative);
+ Application.Current.Resources.MergedDictionaries[0] = resource;
}
- protected override void Dispose(bool disposing)
+ private void SetEnglish(object sender, RoutedEventArgs e)
{
- ViewModel.SaveRecords();
- base.Dispose(disposing);
+ resource.Source = new Uri(@"Resources\Languages\en.xaml", UriKind.Relative);
+ Application.Current.Resources.MergedDictionaries[0] = resource;
}
-
}
}
diff --git a/ProxySuper.WPF/Views/XrayConfigView.xaml b/ProxySuper.WPF/Views/XrayConfigView.xaml
index 9b410a1..477b730 100644
--- a/ProxySuper.WPF/Views/XrayConfigView.xaml
+++ b/ProxySuper.WPF/Views/XrayConfigView.xaml
@@ -25,70 +25,70 @@
SelectionChanged="BuildQrCode">
-
-
+ -->