Compare commits
98 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f612ce5db8 | ||
|
|
831a20ff91 | ||
|
|
38ae669070 | ||
|
|
fed7e7764e | ||
|
|
f3804fce40 | ||
|
|
88e7cd09d7 | ||
|
|
1ce5571ac6 | ||
|
|
355bf84af4 | ||
|
|
6e8a3a4867 | ||
|
|
bf6dcdf2bd | ||
|
|
165454dc57 | ||
|
|
34b4b9d099 | ||
|
|
0808ec1612 | ||
|
|
6b12549cd9 | ||
|
|
92baf9025a | ||
|
|
d58861ab88 | ||
|
|
142230e56a | ||
|
|
b8959c8f12 | ||
|
|
3fa22fdc55 | ||
|
|
a1c743e59c | ||
|
|
ebd0f45c10 | ||
|
|
fce6c46250 | ||
|
|
6114e4ff55 | ||
|
|
cc3d1ff7de | ||
|
|
2f721c8535 | ||
|
|
ddb790104f | ||
|
|
181dfd2f51 | ||
|
|
fca062f75a | ||
|
|
52b84c3201 | ||
|
|
e1021a6832 | ||
|
|
aa338d2da5 | ||
|
|
44471c4926 | ||
|
|
930c7e4ce5 | ||
|
|
2e64f23ef9 | ||
|
|
801d1fd320 | ||
|
|
cfffb5756e | ||
|
|
b30daf8e56 | ||
|
|
84eba671f0 | ||
|
|
f28b93daa0 | ||
|
|
dc16136c59 | ||
|
|
e47caf8c4f | ||
|
|
8ad80bb75d | ||
|
|
22475e459d | ||
|
|
73ad33dfc9 | ||
|
|
f1782c78f4 | ||
|
|
b544dde2c6 | ||
|
|
1a7dca8e58 | ||
|
|
23c7d7fb46 | ||
|
|
65fda407dc | ||
|
|
12ebad436a | ||
|
|
c7297dba7e | ||
|
|
e61368a26e | ||
|
|
b98da3a5dc | ||
|
|
12f3400894 | ||
|
|
4b5508fc3c | ||
|
|
5f40e6e0b7 | ||
|
|
080d660cfa | ||
|
|
790209efbc | ||
|
|
f1679e444c | ||
|
|
9dc6ba182a | ||
|
|
785a30e623 | ||
|
|
f09efdad66 | ||
|
|
4e73b3ae28 | ||
|
|
6213f86f81 | ||
|
|
0a6955cd59 | ||
|
|
6ee8f03ec0 | ||
|
|
b1a82d95c2 | ||
|
|
30bc9ded29 | ||
|
|
5a32892e94 | ||
|
|
e33de896b6 | ||
|
|
3ba92444a5 | ||
|
|
4f120e8eb4 | ||
|
|
08aebf5736 | ||
|
|
5a4966ba8d | ||
|
|
9ba963fc45 | ||
|
|
ccc10dbae4 | ||
|
|
d858342269 | ||
|
|
63f251d1fd | ||
|
|
83efe66f3e | ||
|
|
3f5729044f | ||
|
|
045af7e8df | ||
|
|
6f181053b2 | ||
|
|
4ff1dc2982 | ||
|
|
a883ba8808 | ||
|
|
961bd6140c | ||
|
|
5f364b48c9 | ||
|
|
5a04911c7c | ||
|
|
8ff248aa62 | ||
|
|
046ac95dc3 | ||
|
|
6fb17a4b74 | ||
|
|
f84397393d | ||
|
|
800c93e2aa | ||
|
|
df6179a1a8 | ||
|
|
3e3a079ba1 | ||
|
|
0bf4a43663 | ||
|
|
5e9f4ad926 | ||
|
|
ba702ba041 | ||
|
|
c40d88d0b6 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -16,3 +16,4 @@
|
|||||||
/v2rayN/v2rayUpgrade/bin/Release
|
/v2rayN/v2rayUpgrade/bin/Release
|
||||||
/v2rayN/v2rayUpgrade/obj/
|
/v2rayN/v2rayUpgrade/obj/
|
||||||
*.user
|
*.user
|
||||||
|
/.vs/v2rayN
|
||||||
|
|||||||
19
README.md
19
README.md
@@ -1,5 +1,5 @@
|
|||||||
# v2rayN
|
# v2rayN
|
||||||
A V2Ray client for Windows, support [Xray core](https://github.com/XTLS/Xray-core) and [v2fly core](https://github.com/v2fly/v2ray-core)
|
A GUI client for Windows, support [Xray core](https://github.com/XTLS/Xray-core) and [v2fly core](https://github.com/v2fly/v2ray-core) and [others](https://github.com/2dust/v2rayN/wiki/List-of-supported-cores)
|
||||||
|
|
||||||
|
|
||||||
[](https://github.com/2dust/v2rayN/commits/master)
|
[](https://github.com/2dust/v2rayN/commits/master)
|
||||||
@@ -7,15 +7,16 @@ A V2Ray client for Windows, support [Xray core](https://github.com/XTLS/Xray-cor
|
|||||||
[](https://github.com/2dust/v2rayN/releases)
|
[](https://github.com/2dust/v2rayN/releases)
|
||||||
[](https://t.me/v2rayn)
|
[](https://t.me/v2rayn)
|
||||||
|
|
||||||
### How to use
|
|
||||||
- If you are new to this, please download v2rayN-Core.zip from [releases](https://github.com/2dust/v2rayN/releases)
|
## How to use
|
||||||
- Otherwise please download v2rayN.zip (you will also need to download v2ray core into the same folder with v2rayN.exe)
|
- If you are new to this, please download v2rayN-With-Core.zip from [releases](https://github.com/2dust/v2rayN/releases)
|
||||||
|
- Otherwise please download v2rayN.zip (you will also need to download cores in the bin directory)
|
||||||
- Run v2rayN.exe
|
- Run v2rayN.exe
|
||||||
|
|
||||||
### Requirements
|
## Requirements
|
||||||
- Microsoft [.NET Framework 4.8 Runtime](https://dotnet.microsoft.com/zh-cn/download/dotnet-framework/thank-you/net48-offline-installer)
|
- [Microsoft .NET 6.0 Desktop Runtime ](https://download.visualstudio.microsoft.com/download/pr/513d13b7-b456-45af-828b-b7b7981ff462/edf44a743b78f8b54a2cec97ce888346/windowsdesktop-runtime-6.0.15-win-x64.exe)
|
||||||
- v2fly core [https://github.com/v2fly/v2ray-core/releases](https://github.com/v2fly/v2ray-core/releases)
|
- [Supported cores](https://github.com/2dust/v2rayN/wiki/List-of-supported-cores)
|
||||||
- Xray core [https://github.com/XTLS/Xray-core/releases](https://github.com/XTLS/Xray-core/releases)
|
|
||||||
|
|
||||||
### Telegram Channel
|
|
||||||
|
## Telegram Channel
|
||||||
[github_2dust](https://t.me/github_2dust)
|
[github_2dust](https://t.me/github_2dust)
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ public class PacHandler
|
|||||||
private static bool _isRunning;
|
private static bool _isRunning;
|
||||||
private static bool _needRestart = true;
|
private static bool _needRestart = true;
|
||||||
|
|
||||||
|
|
||||||
public static void Start(string configPath, int httpPort, int pacPort)
|
public static void Start(string configPath, int httpPort, int pacPort)
|
||||||
{
|
{
|
||||||
_needRestart = (configPath != _configPath || httpPort != _httpPort || pacPort != _pacPort || !_isRunning);
|
_needRestart = (configPath != _configPath || httpPort != _httpPort || pacPort != _pacPort || !_isRunning);
|
||||||
@@ -83,9 +82,7 @@ public class PacHandler
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}, TaskCreationOptions.LongRunning);
|
}, TaskCreationOptions.LongRunning);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Stop()
|
public static void Stop()
|
||||||
|
|||||||
@@ -9,13 +9,9 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Google.Protobuf">
|
<PackageReference Include="Google.Protobuf" Version="3.22.3" />
|
||||||
<Version>3.21.9</Version>
|
<PackageReference Include="Grpc.Net.Client" Version="2.52.0" />
|
||||||
</PackageReference>
|
<PackageReference Include="Grpc.Tools" Version="2.53.0">
|
||||||
<PackageReference Include="Grpc.Core">
|
|
||||||
<Version>2.46.5</Version>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="Grpc.Tools" Version="2.50.0">
|
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ namespace ProtosLib
|
|||||||
|
|
||||||
public Tests()
|
public Tests()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
<Application
|
<Application
|
||||||
x:Class="v2rayN.App"
|
x:Class="v2rayN.App"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:conv="clr-namespace:v2rayN.Converters"
|
xmlns:conv="clr-namespace:v2rayN.Converters"
|
||||||
xmlns:local="clr-namespace:v2rayN"
|
|
||||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
||||||
ShutdownMode="OnExplicitShutdown"
|
ShutdownMode="OnExplicitShutdown"
|
||||||
StartupUri="Views/MainWindow.xaml">
|
StartupUri="Views/MainWindow.xaml">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
@@ -141,10 +140,6 @@
|
|||||||
TargetType="{x:Type ListBoxItem}">
|
TargetType="{x:Type ListBoxItem}">
|
||||||
<Setter Property="Margin" Value="-2,0" />
|
<Setter Property="Margin" Value="-2,0" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
|
|
||||||
</Application>
|
</Application>
|
||||||
@@ -30,8 +30,9 @@ namespace v2rayN
|
|||||||
{
|
{
|
||||||
Global.ExePathKey = Utils.GetMD5(Utils.GetExePath());
|
Global.ExePathKey = Utils.GetMD5(Utils.GetExePath());
|
||||||
|
|
||||||
|
var rebootas = (e.Args ?? new string[] { }).Any(t => t == Global.RebootAs);
|
||||||
ProgramStarted = new EventWaitHandle(false, EventResetMode.AutoReset, Global.ExePathKey, out bool bCreatedNew);
|
ProgramStarted = new EventWaitHandle(false, EventResetMode.AutoReset, Global.ExePathKey, out bool bCreatedNew);
|
||||||
if (!bCreatedNew)
|
if (!rebootas && !bCreatedNew)
|
||||||
{
|
{
|
||||||
ProgramStarted.Set();
|
ProgramStarted.Set();
|
||||||
Current.Shutdown();
|
Current.Shutdown();
|
||||||
@@ -42,17 +43,16 @@ namespace v2rayN
|
|||||||
Global.processJob = new Job();
|
Global.processJob = new Job();
|
||||||
|
|
||||||
Logging.Setup();
|
Logging.Setup();
|
||||||
|
Init();
|
||||||
|
Logging.LoggingEnabled(_config.guiItem.enableLog);
|
||||||
Utils.SaveLog($"v2rayN start up | {Utils.GetVersion()} | {Utils.GetExePath()}");
|
Utils.SaveLog($"v2rayN start up | {Utils.GetVersion()} | {Utils.GetExePath()}");
|
||||||
Logging.ClearLogs();
|
Logging.ClearLogs();
|
||||||
|
|
||||||
Init();
|
|
||||||
|
|
||||||
Thread.CurrentThread.CurrentUICulture = new(_config.uiItem.currentLanguage);
|
Thread.CurrentThread.CurrentUICulture = new(_config.uiItem.currentLanguage);
|
||||||
|
|
||||||
base.OnStartup(e);
|
base.OnStartup(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void Init()
|
private void Init()
|
||||||
{
|
{
|
||||||
if (ConfigHandler.LoadConfig(ref _config) != 0)
|
if (ConfigHandler.LoadConfig(ref _config) != 0)
|
||||||
@@ -62,7 +62,12 @@ namespace v2rayN
|
|||||||
Environment.Exit(0);
|
Environment.Exit(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//if (RuntimeInformation.ProcessArchitecture != Architecture.X86 && RuntimeInformation.ProcessArchitecture != Architecture.X64)
|
||||||
|
//{
|
||||||
|
// _config.guiItem.enableStatistics = false;
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||||
{
|
{
|
||||||
Utils.SaveLog("App_DispatcherUnhandledException", e.Exception);
|
Utils.SaveLog("App_DispatcherUnhandledException", e.Exception);
|
||||||
@@ -77,7 +82,7 @@ namespace v2rayN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
|
private void TaskScheduler_UnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs e)
|
||||||
{
|
{
|
||||||
Utils.SaveLog("TaskScheduler_UnobservedTaskException", e.Exception);
|
Utils.SaveLog("TaskScheduler_UnobservedTaskException", e.Exception);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ namespace v2rayN.Base
|
|||||||
return reader.ReadToEnd();
|
return reader.ReadToEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task DownloadDataAsync4Speed(IWebProxy webProxy, string url, IProgress<string> progress, int timeout)
|
public async Task DownloadDataAsync4Speed(IWebProxy webProxy, string url, IProgress<string> progress, int timeout)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(url))
|
if (string.IsNullOrEmpty(url))
|
||||||
@@ -115,7 +114,7 @@ namespace v2rayN.Base
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
progress.Report("......");
|
//progress.Report("......");
|
||||||
|
|
||||||
using var stream = await downloader.DownloadFileTaskAsync(address: url, cancellationToken: cancellationToken.Token);
|
using var stream = await downloader.DownloadFileTaskAsync(address: url, cancellationToken: cancellationToken.Token);
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,13 @@ namespace v2rayN.Base
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class HttpClientHelper
|
public class HttpClientHelper
|
||||||
{
|
{
|
||||||
private readonly static Lazy<HttpClientHelper> _instance = new(() =>
|
private static readonly Lazy<HttpClientHelper> _instance = new(() =>
|
||||||
{
|
{
|
||||||
HttpClientHandler handler = new() { UseCookies = false };
|
HttpClientHandler handler = new() { UseCookies = false };
|
||||||
HttpClientHelper helper = new(new HttpClient(handler));
|
HttpClientHelper helper = new(new HttpClient(handler));
|
||||||
return helper;
|
return helper;
|
||||||
});
|
});
|
||||||
|
|
||||||
public static HttpClientHelper Instance => _instance.Value;
|
public static HttpClientHelper Instance => _instance.Value;
|
||||||
private readonly HttpClient httpClient;
|
private readonly HttpClient httpClient;
|
||||||
|
|
||||||
@@ -82,7 +83,6 @@ namespace v2rayN.Base
|
|||||||
if (canReportProgress)
|
if (canReportProgress)
|
||||||
{
|
{
|
||||||
progress!.Report(101);
|
progress!.Report(101);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,6 +153,5 @@ namespace v2rayN.Base
|
|||||||
}
|
}
|
||||||
} while (isMoreToRead);
|
} while (isMoreToRead);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,5 @@ namespace v2rayN.Base
|
|||||||
internal class MyDGTextColumn : DataGridTextColumn
|
internal class MyDGTextColumn : DataGridTextColumn
|
||||||
{
|
{
|
||||||
public string ExName { get; set; }
|
public string ExName { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
|
using SQLite;
|
||||||
using SQLite;
|
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
|
||||||
namespace v2rayN.Base
|
namespace v2rayN.Base
|
||||||
@@ -25,14 +24,24 @@ namespace v2rayN.Base
|
|||||||
return _db.CreateTable<T>();
|
return _db.CreateTable<T>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Add(object model)
|
public int Insert(object model)
|
||||||
{
|
{
|
||||||
return _db.Insert(model);
|
return _db.Insert(model);
|
||||||
}
|
}
|
||||||
public async Task<int> AddAsync(object model)
|
|
||||||
|
public int InsertAll(IEnumerable models)
|
||||||
|
{
|
||||||
|
lock (objLock)
|
||||||
|
{
|
||||||
|
return _db.InsertAll(models);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<int> InsertAsync(object model)
|
||||||
{
|
{
|
||||||
return await _dbAsync.InsertAsync(model);
|
return await _dbAsync.InsertAsync(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Replace(object model)
|
public int Replace(object model)
|
||||||
{
|
{
|
||||||
lock (objLock)
|
lock (objLock)
|
||||||
@@ -40,6 +49,7 @@ namespace v2rayN.Base
|
|||||||
return _db.InsertOrReplace(model);
|
return _db.InsertOrReplace(model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<int> Replacesync(object model)
|
public async Task<int> Replacesync(object model)
|
||||||
{
|
{
|
||||||
return await _dbAsync.InsertOrReplaceAsync(model);
|
return await _dbAsync.InsertOrReplaceAsync(model);
|
||||||
@@ -52,10 +62,12 @@ namespace v2rayN.Base
|
|||||||
return _db.Update(model);
|
return _db.Update(model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<int> UpdateAsync(object model)
|
public async Task<int> UpdateAsync(object model)
|
||||||
{
|
{
|
||||||
return await _dbAsync.UpdateAsync(model);
|
return await _dbAsync.UpdateAsync(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int UpdateAll(IEnumerable models)
|
public int UpdateAll(IEnumerable models)
|
||||||
{
|
{
|
||||||
lock (objLock)
|
lock (objLock)
|
||||||
@@ -71,22 +83,27 @@ namespace v2rayN.Base
|
|||||||
return _db.Delete(model);
|
return _db.Delete(model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<int> DeleteAsync(object model)
|
public async Task<int> DeleteAsync(object model)
|
||||||
{
|
{
|
||||||
return await _dbAsync.DeleteAsync(model);
|
return await _dbAsync.DeleteAsync(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<T> Query<T>(string sql) where T : new()
|
public List<T> Query<T>(string sql) where T : new()
|
||||||
{
|
{
|
||||||
return _db.Query<T>(sql);
|
return _db.Query<T>(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<T>> QueryAsync<T>(string sql) where T : new()
|
public async Task<List<T>> QueryAsync<T>(string sql) where T : new()
|
||||||
{
|
{
|
||||||
return await _dbAsync.QueryAsync<T>(sql);
|
return await _dbAsync.QueryAsync<T>(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Execute(string sql)
|
public int Execute(string sql)
|
||||||
{
|
{
|
||||||
return _db.Execute(sql);
|
return _db.Execute(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<int> ExecuteAsync(string sql)
|
public async Task<int> ExecuteAsync(string sql)
|
||||||
{
|
{
|
||||||
return await _dbAsync.ExecuteAsync(sql);
|
return await _dbAsync.ExecuteAsync(sql);
|
||||||
@@ -96,6 +113,7 @@ namespace v2rayN.Base
|
|||||||
{
|
{
|
||||||
return _db.Table<T>();
|
return _db.Table<T>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public AsyncTableQuery<T> TableAsync<T>() where T : new()
|
public AsyncTableQuery<T> TableAsync<T>() where T : new()
|
||||||
{
|
{
|
||||||
return _dbAsync.Table<T>();
|
return _dbAsync.Table<T>();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using System.IO;
|
|||||||
|
|
||||||
namespace v2rayN.Base
|
namespace v2rayN.Base
|
||||||
{
|
{
|
||||||
static class StringEx
|
internal static class StringEx
|
||||||
{
|
{
|
||||||
public static bool IsNullOrEmpty([NotNullWhen(false)] this string? value)
|
public static bool IsNullOrEmpty([NotNullWhen(false)] this string? value)
|
||||||
{
|
{
|
||||||
@@ -32,7 +32,6 @@ namespace v2rayN.Base
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static IEnumerable<string> NonWhiteSpaceLines(this TextReader reader)
|
public static IEnumerable<string> NonWhiteSpaceLines(this TextReader reader)
|
||||||
{
|
{
|
||||||
string? line;
|
string? line;
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
namespace v2rayN
|
namespace v2rayN
|
||||||
{
|
{
|
||||||
class Global
|
internal class Global
|
||||||
{
|
{
|
||||||
#region const
|
#region const
|
||||||
|
|
||||||
public const string githubUrl = "https://github.com";
|
public const string githubUrl = "https://github.com";
|
||||||
public const string githubApiUrl = "https://api.github.com/repos";
|
public const string githubApiUrl = "https://api.github.com/repos";
|
||||||
public const string v2rayWebsiteUrl = @"https://www.v2fly.org/";
|
public const string v2rayWebsiteUrl = @"https://www.v2fly.org/";
|
||||||
@@ -43,7 +44,7 @@
|
|||||||
public const string directTag = "direct";
|
public const string directTag = "direct";
|
||||||
public const string blockTag = "block";
|
public const string blockTag = "block";
|
||||||
public const string StreamSecurity = "tls";
|
public const string StreamSecurity = "tls";
|
||||||
public const string StreamSecurityX = "xtls";
|
public const string StreamSecurityReality = "reality";
|
||||||
public const string InboundSocks = "socks";
|
public const string InboundSocks = "socks";
|
||||||
public const string InboundHttp = "http";
|
public const string InboundHttp = "http";
|
||||||
public const string InboundSocks2 = "socks2";
|
public const string InboundSocks2 = "socks2";
|
||||||
@@ -80,6 +81,7 @@
|
|||||||
public const string DelayUnit = "";
|
public const string DelayUnit = "";
|
||||||
public const string SpeedUnit = "";
|
public const string SpeedUnit = "";
|
||||||
public const int MinFontSize = 10;
|
public const int MinFontSize = 10;
|
||||||
|
public const string RebootAs = "rebootas";
|
||||||
|
|
||||||
public static readonly List<string> IEProxyProtocols = new() {
|
public static readonly List<string> IEProxyProtocols = new() {
|
||||||
"{ip}:{http_port}",
|
"{ip}:{http_port}",
|
||||||
@@ -88,18 +90,31 @@
|
|||||||
"http=http://{ip}:{http_port};https=http://{ip}:{http_port}",
|
"http=http://{ip}:{http_port};https=http://{ip}:{http_port}",
|
||||||
""
|
""
|
||||||
};
|
};
|
||||||
public static readonly List<string> vmessSecuritys = new() { "aes-128-gcm", "chacha20-poly1305", "auto", "none", "zero" };
|
|
||||||
public static readonly List<string> ssSecuritys = new() { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "none", "plain" };
|
public static readonly List<string> SubConvertUrls = new List<string> {
|
||||||
public static readonly List<string> ssSecuritysInSagerNet = new() { "none", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305", "aes-128-gcm", "aes-192-gcm", "aes-256-gcm", "chacha20-ietf-poly1305", "xchacha20-ietf-poly1305", "rc4", "rc4-md5", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-cfb8", "aes-192-cfb8", "aes-256-cfb8", "aes-128-ofb", "aes-192-ofb", "aes-256-ofb", "bf-cfb", "cast5-cfb", "des-cfb", "idea-cfb", "rc2-cfb", "seed-cfb", "camellia-128-cfb", "camellia-192-cfb", "camellia-256-cfb", "camellia-128-cfb8", "camellia-192-cfb8", "camellia-256-cfb8", "salsa20", "chacha20", "chacha20-ietf", "xchacha20" };
|
@"https://sub.xeton.dev/sub?url={0}",
|
||||||
public static readonly List<string> ssSecuritysInXray = new() { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "xchacha20-poly1305", "xchacha20-ietf-poly1305", "none", "plain", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305" };
|
@"https://api.dler.io/sub?url={0}",
|
||||||
public static readonly List<string> xtlsFlows = new() { "", "xtls-rprx-origin", "xtls-rprx-origin-udp443", "xtls-rprx-direct", "xtls-rprx-direct-udp443", "xtls-rprx-vision", "xtls-rprx-vision-udp443" };
|
@"http://127.0.0.1:25500/sub?url={0}",
|
||||||
public static readonly List<string> networks = new() { "tcp", "kcp", "ws", "h2", "quic", "grpc" };
|
""
|
||||||
public static readonly List<string> kcpHeaderTypes = new() { "srtp", "utp", "wechat-video", "dtls", "wireguard" };
|
};
|
||||||
public static readonly List<string> coreTypes = new() { "v2fly", "SagerNet", "Xray", "v2fly_v5" };
|
|
||||||
public static readonly List<string> domainStrategys = new() { "AsIs", "IPIfNonMatch", "IPOnDemand" };
|
public static readonly List<string> SubConvertConfig = new List<string> {
|
||||||
public static readonly List<string> domainMatchers = new() { "linear", "mph", "" };
|
@"https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online.ini"
|
||||||
public static readonly List<string> fingerprints = new() { "chrome", "firefox", "safari", "ios", "android", "edge", "360", "qq", "random", "randomized", "" };
|
};
|
||||||
public static readonly List<string> userAgent = new() { "chrome", "firefox", "safari", "edge", "none" };
|
|
||||||
|
public static readonly List<string> SubConvertTargets = new List<string> {
|
||||||
|
"",
|
||||||
|
"mixed",
|
||||||
|
"v2ray",
|
||||||
|
"clash",
|
||||||
|
"ss",
|
||||||
|
};
|
||||||
|
|
||||||
|
public static readonly List<string> SpeedTestUrls = new() {
|
||||||
|
@"http://cachefly.cachefly.net/100mb.test",
|
||||||
|
@"http://cachefly.cachefly.net/10mb.test"
|
||||||
|
};
|
||||||
|
|
||||||
public static readonly Dictionary<string, string> userAgentTxt = new()
|
public static readonly Dictionary<string, string> userAgentTxt = new()
|
||||||
{
|
{
|
||||||
{"chrome","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36" },
|
{"chrome","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36" },
|
||||||
@@ -108,6 +123,21 @@
|
|||||||
{"edge","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Edg/91.0.864.70" },
|
{"edge","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Edg/91.0.864.70" },
|
||||||
{"none",""}
|
{"none",""}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public static readonly List<string> vmessSecuritys = new() { "aes-128-gcm", "chacha20-poly1305", "auto", "none", "zero" };
|
||||||
|
public static readonly List<string> ssSecuritys = new() { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "none", "plain" };
|
||||||
|
public static readonly List<string> ssSecuritysInSagerNet = new() { "none", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305", "aes-128-gcm", "aes-192-gcm", "aes-256-gcm", "chacha20-ietf-poly1305", "xchacha20-ietf-poly1305", "rc4", "rc4-md5", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-cfb8", "aes-192-cfb8", "aes-256-cfb8", "aes-128-ofb", "aes-192-ofb", "aes-256-ofb", "bf-cfb", "cast5-cfb", "des-cfb", "idea-cfb", "rc2-cfb", "seed-cfb", "camellia-128-cfb", "camellia-192-cfb", "camellia-256-cfb", "camellia-128-cfb8", "camellia-192-cfb8", "camellia-256-cfb8", "salsa20", "chacha20", "chacha20-ietf", "xchacha20" };
|
||||||
|
public static readonly List<string> ssSecuritysInXray = new() { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "xchacha20-poly1305", "xchacha20-ietf-poly1305", "none", "plain", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305" };
|
||||||
|
public static readonly List<string> flows = new() { "", "xtls-rprx-vision", "xtls-rprx-vision-udp443" };
|
||||||
|
public static readonly List<string> networks = new() { "tcp", "kcp", "ws", "h2", "quic", "grpc" };
|
||||||
|
public static readonly List<string> kcpHeaderTypes = new() { "srtp", "utp", "wechat-video", "dtls", "wireguard" };
|
||||||
|
public static readonly List<string> coreTypes = new() { "v2fly", "SagerNet", "Xray", "v2fly_v5" };
|
||||||
|
public static readonly List<string> coreTypes4VLESS = new() { "Xray" };
|
||||||
|
public static readonly List<string> domainStrategys = new() { "AsIs", "IPIfNonMatch", "IPOnDemand" };
|
||||||
|
public static readonly List<string> domainMatchers = new() { "linear", "mph", "" };
|
||||||
|
public static readonly List<string> fingerprints = new() { "chrome", "firefox", "safari", "ios", "android", "edge", "360", "qq", "random", "randomized", "" };
|
||||||
|
public static readonly List<string> userAgent = new() { "chrome", "firefox", "safari", "edge", "none" };
|
||||||
|
|
||||||
public static readonly List<string> allowInsecures = new() { "true", "false", "" };
|
public static readonly List<string> allowInsecures = new() { "true", "false", "" };
|
||||||
public static readonly List<string> domainStrategy4Freedoms = new() { "AsIs", "UseIP", "UseIPv4", "UseIPv6", "" };
|
public static readonly List<string> domainStrategy4Freedoms = new() { "AsIs", "UseIP", "UseIPv4", "UseIPv6", "" };
|
||||||
public static readonly List<string> Languages = new() { "zh-Hans", "en", "fa-Ir", "ru" };
|
public static readonly List<string> Languages = new() { "zh-Hans", "en", "fa-Ir", "ru" };
|
||||||
@@ -118,9 +148,8 @@
|
|||||||
public static readonly List<string> TunMtus = new() { "9000", "1500" };
|
public static readonly List<string> TunMtus = new() { "9000", "1500" };
|
||||||
public static readonly List<string> TunStacks = new() { "gvisor", "system" };
|
public static readonly List<string> TunStacks = new() { "gvisor", "system" };
|
||||||
public static readonly List<string> PresetMsgFilters = new() { "proxy", "direct", "block", "" };
|
public static readonly List<string> PresetMsgFilters = new() { "proxy", "direct", "block", "" };
|
||||||
public static readonly List<string> SpeedTestUrls = new() { @"http://cachefly.cachefly.net/100mb.test", @"http://cachefly.cachefly.net/10mb.test" };
|
|
||||||
|
|
||||||
#endregion
|
#endregion const
|
||||||
|
|
||||||
#region global variable
|
#region global variable
|
||||||
|
|
||||||
@@ -129,7 +158,6 @@
|
|||||||
public static bool ShowInTaskbar { get; set; }
|
public static bool ShowInTaskbar { get; set; }
|
||||||
public static string ExePathKey { get; set; }
|
public static string ExePathKey { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion global variable
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,7 @@ namespace v2rayN.Handler
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 本软件配置文件处理类
|
/// 本软件配置文件处理类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class ConfigHandler
|
internal class ConfigHandler
|
||||||
{
|
{
|
||||||
private static string configRes = Global.ConfigFileName;
|
private static string configRes = Global.ConfigFileName;
|
||||||
private static readonly object objLock = new();
|
private static readonly object objLock = new();
|
||||||
@@ -198,6 +198,7 @@ namespace v2rayN.Handler
|
|||||||
LazyConfig.Instance.SetConfig(config);
|
LazyConfig.Instance.SetConfig(config);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 保参数
|
/// 保参数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -205,7 +206,6 @@ namespace v2rayN.Handler
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int SaveConfig(ref Config config, bool reload = true)
|
public static int SaveConfig(ref Config config, bool reload = true)
|
||||||
{
|
{
|
||||||
|
|
||||||
ToJsonFile(config);
|
ToJsonFile(config);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -221,7 +221,6 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
//save temp file
|
//save temp file
|
||||||
var resPath = Utils.GetConfigPath(configRes);
|
var resPath = Utils.GetConfigPath(configRes);
|
||||||
var tempPath = $"{resPath}_temp";
|
var tempPath = $"{resPath}_temp";
|
||||||
@@ -342,7 +341,8 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
#endregion ConfigHandler
|
||||||
|
|
||||||
#region Server
|
#region Server
|
||||||
|
|
||||||
@@ -352,7 +352,7 @@ namespace v2rayN.Handler
|
|||||||
/// <param name="config"></param>
|
/// <param name="config"></param>
|
||||||
/// <param name="profileItem"></param>
|
/// <param name="profileItem"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int AddServer(ref Config config, ProfileItem profileItem)
|
public static int AddServer(ref Config config, ProfileItem profileItem, bool toFile = true)
|
||||||
{
|
{
|
||||||
profileItem.configType = EConfigType.VMess;
|
profileItem.configType = EConfigType.VMess;
|
||||||
|
|
||||||
@@ -370,7 +370,7 @@ namespace v2rayN.Handler
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddServerCommon(ref config, profileItem);
|
AddServerCommon(ref config, profileItem, toFile);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -383,11 +383,15 @@ namespace v2rayN.Handler
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int RemoveServer(Config config, List<ProfileItem> indexs)
|
public static int RemoveServer(Config config, List<ProfileItem> indexs)
|
||||||
{
|
{
|
||||||
|
var subid = "TempRemoveSubId";
|
||||||
foreach (var item in indexs)
|
foreach (var item in indexs)
|
||||||
{
|
{
|
||||||
RemoveProfileItem(config, item.indexId);
|
item.subid = subid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SqliteHelper.Instance.UpdateAll(indexs);
|
||||||
|
RemoveServerViaSubid(ref config, subid, false);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -399,8 +403,14 @@ namespace v2rayN.Handler
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int CopyServer(ref Config config, List<ProfileItem> indexs)
|
public static int CopyServer(ref Config config, List<ProfileItem> indexs)
|
||||||
{
|
{
|
||||||
foreach (var item in indexs)
|
foreach (var it in indexs)
|
||||||
{
|
{
|
||||||
|
var item = LazyConfig.Instance.GetProfileItem(it.indexId);
|
||||||
|
if (item is null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ProfileItem profileItem = Utils.DeepCopy(item);
|
ProfileItem profileItem = Utils.DeepCopy(item);
|
||||||
profileItem.indexId = string.Empty;
|
profileItem.indexId = string.Empty;
|
||||||
profileItem.remarks = $"{item.remarks}-clone";
|
profileItem.remarks = $"{item.remarks}-clone";
|
||||||
@@ -414,7 +424,7 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddServerCommon(ref config, profileItem);
|
AddServerCommon(ref config, profileItem, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -447,21 +457,17 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
var allItems = LazyConfig.Instance.ProfileItemIndexs("");
|
if (SqliteHelper.Instance.Table<ProfileItem>().Where(t => t.indexId == config.indexId).Any())
|
||||||
if (allItems.Where(t => t == config.indexId).Any())
|
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (lstProfile.Count > 0)
|
if (lstProfile.Count > 0)
|
||||||
{
|
{
|
||||||
return SetDefaultServerIndex(ref config, lstProfile[0].indexId);
|
return SetDefaultServerIndex(ref config, lstProfile.Where(t => t.port > 0).FirstOrDefault()?.indexId);
|
||||||
}
|
}
|
||||||
if (allItems.Count > 0)
|
return SetDefaultServerIndex(ref config, SqliteHelper.Instance.Table<ProfileItem>().Where(t => t.port > 0).Select(t => t.indexId).FirstOrDefault());
|
||||||
{
|
|
||||||
return SetDefaultServerIndex(ref config, allItems.FirstOrDefault());
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ProfileItem? GetDefaultServer(ref Config config)
|
public static ProfileItem? GetDefaultServer(ref Config config)
|
||||||
{
|
{
|
||||||
var item = LazyConfig.Instance.GetProfileItem(config.indexId);
|
var item = LazyConfig.Instance.GetProfileItem(config.indexId);
|
||||||
@@ -587,9 +593,7 @@ namespace v2rayN.Handler
|
|||||||
profileItem.remarks = $"import custom@{DateTime.Now.ToShortDateString()}";
|
profileItem.remarks = $"import custom@{DateTime.Now.ToShortDateString()}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AddServerCommon(ref config, profileItem, true);
|
||||||
AddServerCommon(ref config, profileItem);
|
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -620,7 +624,7 @@ namespace v2rayN.Handler
|
|||||||
/// <param name="config"></param>
|
/// <param name="config"></param>
|
||||||
/// <param name="profileItem"></param>
|
/// <param name="profileItem"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int AddShadowsocksServer(ref Config config, ProfileItem profileItem)
|
public static int AddShadowsocksServer(ref Config config, ProfileItem profileItem, bool toFile = true)
|
||||||
{
|
{
|
||||||
profileItem.configType = EConfigType.Shadowsocks;
|
profileItem.configType = EConfigType.Shadowsocks;
|
||||||
|
|
||||||
@@ -633,7 +637,7 @@ namespace v2rayN.Handler
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddServerCommon(ref config, profileItem);
|
AddServerCommon(ref config, profileItem, toFile);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -644,13 +648,13 @@ namespace v2rayN.Handler
|
|||||||
/// <param name="config"></param>
|
/// <param name="config"></param>
|
||||||
/// <param name="profileItem"></param>
|
/// <param name="profileItem"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int AddSocksServer(ref Config config, ProfileItem profileItem)
|
public static int AddSocksServer(ref Config config, ProfileItem profileItem, bool toFile = true)
|
||||||
{
|
{
|
||||||
profileItem.configType = EConfigType.Socks;
|
profileItem.configType = EConfigType.Socks;
|
||||||
|
|
||||||
profileItem.address = profileItem.address.TrimEx();
|
profileItem.address = profileItem.address.TrimEx();
|
||||||
|
|
||||||
AddServerCommon(ref config, profileItem);
|
AddServerCommon(ref config, profileItem, toFile);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -661,7 +665,7 @@ namespace v2rayN.Handler
|
|||||||
/// <param name="config"></param>
|
/// <param name="config"></param>
|
||||||
/// <param name="profileItem"></param>
|
/// <param name="profileItem"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int AddTrojanServer(ref Config config, ProfileItem profileItem)
|
public static int AddTrojanServer(ref Config config, ProfileItem profileItem, bool toFile = true)
|
||||||
{
|
{
|
||||||
profileItem.configType = EConfigType.Trojan;
|
profileItem.configType = EConfigType.Trojan;
|
||||||
|
|
||||||
@@ -671,17 +675,12 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
profileItem.streamSecurity = Global.StreamSecurity;
|
profileItem.streamSecurity = Global.StreamSecurity;
|
||||||
}
|
}
|
||||||
if (Utils.IsNullOrEmpty(profileItem.allowInsecure))
|
|
||||||
{
|
|
||||||
profileItem.allowInsecure = config.coreBasicItem.defAllowInsecure.ToString().ToLower();
|
|
||||||
}
|
|
||||||
|
|
||||||
AddServerCommon(ref config, profileItem);
|
AddServerCommon(ref config, profileItem, toFile);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static int SortServers(ref Config config, string subId, string colName, bool asc)
|
public static int SortServers(ref Config config, string subId, string colName, bool asc)
|
||||||
{
|
{
|
||||||
var lstModel = LazyConfig.Instance.ProfileItems(subId, "");
|
var lstModel = LazyConfig.Instance.ProfileItems(subId, "");
|
||||||
@@ -708,7 +707,6 @@ namespace v2rayN.Handler
|
|||||||
sort = t33 == null ? 0 : t33.sort
|
sort = t33 == null ? 0 : t33.sort
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
|
|
||||||
Enum.TryParse(colName, true, out EServerColName name);
|
Enum.TryParse(colName, true, out EServerColName name);
|
||||||
var propertyName = string.Empty;
|
var propertyName = string.Empty;
|
||||||
switch (name)
|
switch (name)
|
||||||
@@ -722,15 +720,19 @@ namespace v2rayN.Handler
|
|||||||
case EServerColName.streamSecurity:
|
case EServerColName.streamSecurity:
|
||||||
propertyName = name.ToString();
|
propertyName = name.ToString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EServerColName.delayVal:
|
case EServerColName.delayVal:
|
||||||
propertyName = "delay";
|
propertyName = "delay";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EServerColName.speedVal:
|
case EServerColName.speedVal:
|
||||||
propertyName = "speed";
|
propertyName = "speed";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EServerColName.subRemarks:
|
case EServerColName.subRemarks:
|
||||||
propertyName = "subid";
|
propertyName = "subid";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -781,7 +783,7 @@ namespace v2rayN.Handler
|
|||||||
/// <param name="config"></param>
|
/// <param name="config"></param>
|
||||||
/// <param name="profileItem"></param>
|
/// <param name="profileItem"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int AddVlessServer(ref Config config, ProfileItem profileItem)
|
public static int AddVlessServer(ref Config config, ProfileItem profileItem, bool toFile = true)
|
||||||
{
|
{
|
||||||
profileItem.configType = EConfigType.VLESS;
|
profileItem.configType = EConfigType.VLESS;
|
||||||
|
|
||||||
@@ -794,43 +796,56 @@ namespace v2rayN.Handler
|
|||||||
profileItem.path = profileItem.path.TrimEx();
|
profileItem.path = profileItem.path.TrimEx();
|
||||||
profileItem.streamSecurity = profileItem.streamSecurity.TrimEx();
|
profileItem.streamSecurity = profileItem.streamSecurity.TrimEx();
|
||||||
|
|
||||||
AddServerCommon(ref config, profileItem);
|
if (!Global.flows.Contains(profileItem.flow))
|
||||||
|
{
|
||||||
|
profileItem.flow = Global.flows.First();
|
||||||
|
}
|
||||||
|
|
||||||
|
AddServerCommon(ref config, profileItem, toFile);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int DedupServerList(ref Config config, ref List<ProfileItem> lstProfile)
|
public static Tuple<int, int> DedupServerList(Config config, string subId)
|
||||||
{
|
{
|
||||||
List<ProfileItem> source = lstProfile;
|
var lstProfile = LazyConfig.Instance.ProfileItems(subId);
|
||||||
bool keepOlder = config.guiItem.keepOlderDedupl;
|
|
||||||
|
|
||||||
List<ProfileItem> list = new();
|
List<ProfileItem> lstKeep = new();
|
||||||
if (!keepOlder) source.Reverse(); // Remove the early items first
|
List<ProfileItem> lstRemove = new();
|
||||||
|
if (!config.guiItem.keepOlderDedupl) lstProfile.Reverse();
|
||||||
|
|
||||||
foreach (ProfileItem item in source)
|
foreach (ProfileItem item in lstProfile)
|
||||||
{
|
{
|
||||||
if (!list.Exists(i => CompareProfileItem(i, item, false)))
|
if (!lstKeep.Exists(i => CompareProfileItem(i, item, false)))
|
||||||
{
|
{
|
||||||
list.Add(item);
|
lstKeep.Add(item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RemoveProfileItem(config, item.indexId);
|
lstRemove.Add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if (!keepOlder) list.Reverse();
|
RemoveServer(config, lstRemove);
|
||||||
//config.vmess = list;
|
|
||||||
|
|
||||||
return list.Count;
|
return new Tuple<int, int>(lstProfile.Count, lstKeep.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int AddServerCommon(ref Config config, ProfileItem profileItem)
|
public static int AddServerCommon(ref Config config, ProfileItem profileItem, bool toFile = true)
|
||||||
{
|
{
|
||||||
profileItem.configVersion = 2;
|
profileItem.configVersion = 2;
|
||||||
|
|
||||||
|
if (!Utils.IsNullOrEmpty(profileItem.streamSecurity))
|
||||||
|
{
|
||||||
if (Utils.IsNullOrEmpty(profileItem.allowInsecure))
|
if (Utils.IsNullOrEmpty(profileItem.allowInsecure))
|
||||||
{
|
{
|
||||||
profileItem.allowInsecure = config.coreBasicItem.defAllowInsecure.ToString().ToLower();
|
profileItem.allowInsecure = config.coreBasicItem.defAllowInsecure.ToString().ToLower();
|
||||||
}
|
}
|
||||||
|
if (Utils.IsNullOrEmpty(profileItem.fingerprint))
|
||||||
|
{
|
||||||
|
profileItem.fingerprint = config.coreBasicItem.defFingerprint;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!Utils.IsNullOrEmpty(profileItem.network) && !Global.networks.Contains(profileItem.network))
|
if (!Utils.IsNullOrEmpty(profileItem.network) && !Global.networks.Contains(profileItem.network))
|
||||||
{
|
{
|
||||||
profileItem.network = Global.DefaultNetwork;
|
profileItem.network = Global.DefaultNetwork;
|
||||||
@@ -842,19 +857,13 @@ namespace v2rayN.Handler
|
|||||||
var maxSort = ProfileExHandler.Instance.GetMaxSort();
|
var maxSort = ProfileExHandler.Instance.GetMaxSort();
|
||||||
ProfileExHandler.Instance.SetSort(profileItem.indexId, maxSort + 1);
|
ProfileExHandler.Instance.SetSort(profileItem.indexId, maxSort + 1);
|
||||||
}
|
}
|
||||||
else if (profileItem.indexId == config.indexId)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
if (SqliteHelper.Instance.Replace(profileItem) > 0)
|
if (toFile)
|
||||||
{
|
{
|
||||||
|
SqliteHelper.Instance.Replace(profileItem);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool CompareProfileItem(ProfileItem o, ProfileItem n, bool remarks)
|
private static bool CompareProfileItem(ProfileItem o, ProfileItem n, bool remarks)
|
||||||
{
|
{
|
||||||
@@ -863,8 +872,7 @@ namespace v2rayN.Handler
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return o.configVersion == n.configVersion
|
return o.configType == n.configType
|
||||||
&& o.configType == n.configType
|
|
||||||
&& o.address == n.address
|
&& o.address == n.address
|
||||||
&& o.port == n.port
|
&& o.port == n.port
|
||||||
&& o.id == n.id
|
&& o.id == n.id
|
||||||
@@ -903,7 +911,8 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
#endregion Server
|
||||||
|
|
||||||
#region Batch add servers
|
#region Batch add servers
|
||||||
|
|
||||||
@@ -930,16 +939,18 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
|
|
||||||
int countServers = 0;
|
int countServers = 0;
|
||||||
//var maxSort = 0;
|
//Check for duplicate indexId
|
||||||
//if (SqliteHelper.Instance.Table<ProfileItem>().Count() > 0)
|
List<string>? lstDbIndexId = null;
|
||||||
//{
|
List<ProfileItem> lstAdd = new();
|
||||||
// maxSort = SqliteHelper.Instance.Table<ProfileItem>().Max(t => t.sort);
|
var arrData = clipboardData.Split(Environment.NewLine.ToCharArray()).Where(t => !t.IsNullOrEmpty());
|
||||||
//}
|
if (isSub)
|
||||||
string[] arrData = clipboardData.Split(Environment.NewLine.ToCharArray());
|
{
|
||||||
|
arrData = arrData.Distinct();
|
||||||
|
}
|
||||||
foreach (string str in arrData)
|
foreach (string str in arrData)
|
||||||
{
|
{
|
||||||
//maybe sub
|
//maybe sub
|
||||||
if (Utils.IsNullOrEmpty(subid) && (str.StartsWith(Global.httpsProtocol) || str.StartsWith(Global.httpProtocol)))
|
if (!isSub && (str.StartsWith(Global.httpsProtocol) || str.StartsWith(Global.httpProtocol)))
|
||||||
{
|
{
|
||||||
if (AddSubItem(ref config, str) == 0)
|
if (AddSubItem(ref config, str) == 0)
|
||||||
{
|
{
|
||||||
@@ -956,11 +967,24 @@ namespace v2rayN.Handler
|
|||||||
//exist sub items
|
//exist sub items
|
||||||
if (isSub && !Utils.IsNullOrEmpty(subid))
|
if (isSub && !Utils.IsNullOrEmpty(subid))
|
||||||
{
|
{
|
||||||
var existItem = lstOriSub?.FirstOrDefault(t => CompareProfileItem(t, profileItem, true));
|
var existItem = lstOriSub?.FirstOrDefault(t => t.isSub == isSub && CompareProfileItem(t, profileItem, true));
|
||||||
if (existItem != null)
|
if (existItem != null)
|
||||||
|
{
|
||||||
|
//Check for duplicate indexId
|
||||||
|
if (lstDbIndexId is null)
|
||||||
|
{
|
||||||
|
lstDbIndexId = LazyConfig.Instance.ProfileItemIndexs("");
|
||||||
|
}
|
||||||
|
if (lstAdd.Any(t => t.indexId == existItem.indexId)
|
||||||
|
|| lstDbIndexId.Any(t => t == existItem.indexId))
|
||||||
|
{
|
||||||
|
profileItem.indexId = string.Empty;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
profileItem.indexId = existItem.indexId;
|
profileItem.indexId = existItem.indexId;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//filter
|
//filter
|
||||||
if (!Utils.IsNullOrEmpty(subFilter))
|
if (!Utils.IsNullOrEmpty(subFilter))
|
||||||
{
|
{
|
||||||
@@ -972,43 +996,39 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
profileItem.subid = subid;
|
profileItem.subid = subid;
|
||||||
profileItem.isSub = isSub;
|
profileItem.isSub = isSub;
|
||||||
//profileItem.sort = maxSort + countServers + 1;
|
var addStatus = -1;
|
||||||
|
|
||||||
if (profileItem.configType == EConfigType.VMess)
|
if (profileItem.configType == EConfigType.VMess)
|
||||||
{
|
{
|
||||||
if (AddServer(ref config, profileItem) == 0)
|
addStatus = AddServer(ref config, profileItem, false);
|
||||||
{
|
|
||||||
countServers++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (profileItem.configType == EConfigType.Shadowsocks)
|
else if (profileItem.configType == EConfigType.Shadowsocks)
|
||||||
{
|
{
|
||||||
if (AddShadowsocksServer(ref config, profileItem) == 0)
|
addStatus = AddShadowsocksServer(ref config, profileItem, false);
|
||||||
{
|
|
||||||
countServers++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (profileItem.configType == EConfigType.Socks)
|
else if (profileItem.configType == EConfigType.Socks)
|
||||||
{
|
{
|
||||||
if (AddSocksServer(ref config, profileItem) == 0)
|
addStatus = AddSocksServer(ref config, profileItem, false);
|
||||||
{
|
|
||||||
countServers++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (profileItem.configType == EConfigType.Trojan)
|
else if (profileItem.configType == EConfigType.Trojan)
|
||||||
{
|
{
|
||||||
if (AddTrojanServer(ref config, profileItem) == 0)
|
addStatus = AddTrojanServer(ref config, profileItem, false);
|
||||||
{
|
|
||||||
countServers++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (profileItem.configType == EConfigType.VLESS)
|
else if (profileItem.configType == EConfigType.VLESS)
|
||||||
{
|
{
|
||||||
if (AddVlessServer(ref config, profileItem) == 0)
|
addStatus = AddVlessServer(ref config, profileItem, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (addStatus == 0 && profileItem.port > 0)
|
||||||
{
|
{
|
||||||
countServers++;
|
countServers++;
|
||||||
|
lstAdd.Add(profileItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lstAdd.Count > 0)
|
||||||
|
{
|
||||||
|
SqliteHelper.Instance.InsertAll(lstAdd);
|
||||||
}
|
}
|
||||||
|
|
||||||
ToJsonFile(config);
|
ToJsonFile(config);
|
||||||
@@ -1105,7 +1125,6 @@ namespace v2rayN.Handler
|
|||||||
if (AddCustomServer(ref config, profileItem, true) == 0)
|
if (AddCustomServer(ref config, profileItem, true) == 0)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1172,7 +1191,15 @@ namespace v2rayN.Handler
|
|||||||
lstOriSub = LazyConfig.Instance.ProfileItems(subid);
|
lstOriSub = LazyConfig.Instance.ProfileItems(subid);
|
||||||
}
|
}
|
||||||
|
|
||||||
int counter = AddBatchServers(ref config, clipboardData, subid, isSub, lstOriSub);
|
var counter = 0;
|
||||||
|
if (Utils.IsBase64String(clipboardData))
|
||||||
|
{
|
||||||
|
counter = AddBatchServers(ref config, Utils.Base64Decode(clipboardData), subid, isSub, lstOriSub);
|
||||||
|
}
|
||||||
|
if (counter < 1)
|
||||||
|
{
|
||||||
|
counter = AddBatchServers(ref config, clipboardData, subid, isSub, lstOriSub);
|
||||||
|
}
|
||||||
if (counter < 1)
|
if (counter < 1)
|
||||||
{
|
{
|
||||||
counter = AddBatchServers(ref config, Utils.Base64Decode(clipboardData), subid, isSub, lstOriSub);
|
counter = AddBatchServers(ref config, Utils.Base64Decode(clipboardData), subid, isSub, lstOriSub);
|
||||||
@@ -1192,8 +1219,7 @@ namespace v2rayN.Handler
|
|||||||
return counter;
|
return counter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion Batch add servers
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Sub & Group
|
#region Sub & Group
|
||||||
|
|
||||||
@@ -1247,7 +1273,6 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 移除服务器
|
/// 移除服务器
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1260,6 +1285,7 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
var customProfile = SqliteHelper.Instance.Table<ProfileItem>().Where(t => t.subid == subid && t.isSub == isSub && t.configType == EConfigType.Custom).ToList();
|
||||||
if (isSub)
|
if (isSub)
|
||||||
{
|
{
|
||||||
SqliteHelper.Instance.Execute($"delete from ProfileItem where isSub = 1 and subid = '{subid}'");
|
SqliteHelper.Instance.Execute($"delete from ProfileItem where isSub = 1 and subid = '{subid}'");
|
||||||
@@ -1268,6 +1294,10 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
SqliteHelper.Instance.Execute($"delete from ProfileItem where subid = '{subid}'");
|
SqliteHelper.Instance.Execute($"delete from ProfileItem where subid = '{subid}'");
|
||||||
}
|
}
|
||||||
|
foreach (var item in customProfile)
|
||||||
|
{
|
||||||
|
File.Delete(Utils.GetConfigPath(item.address));
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1287,21 +1317,16 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
public static int MoveToGroup(Config config, List<ProfileItem> lstProfile, string subid)
|
public static int MoveToGroup(Config config, List<ProfileItem> lstProfile, string subid)
|
||||||
{
|
{
|
||||||
foreach (var it in lstProfile)
|
foreach (var item in lstProfile)
|
||||||
{
|
{
|
||||||
var item = LazyConfig.Instance.GetProfileItem(it.indexId);
|
|
||||||
if (item is null)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
item.subid = subid;
|
item.subid = subid;
|
||||||
SqliteHelper.Instance.Update(item);
|
|
||||||
}
|
}
|
||||||
|
SqliteHelper.Instance.UpdateAll(lstProfile);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
#endregion Sub & Group
|
||||||
|
|
||||||
#region Routing
|
#region Routing
|
||||||
|
|
||||||
@@ -1436,7 +1461,6 @@ namespace v2rayN.Handler
|
|||||||
rules.Remove(removeItem);
|
rules.Remove(removeItem);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1452,6 +1476,7 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RoutingItem GetDefaultRouting(ref Config config)
|
public static RoutingItem GetDefaultRouting(ref Config config)
|
||||||
{
|
{
|
||||||
var item = LazyConfig.Instance.GetRoutingItem(config.routingBasicItem.routingIndexId);
|
var item = LazyConfig.Instance.GetRoutingItem(config.routingBasicItem.routingIndexId);
|
||||||
@@ -1526,6 +1551,7 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
SqliteHelper.Instance.Delete(routingItem);
|
SqliteHelper.Instance.Delete(routingItem);
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
#endregion Routing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,7 @@ namespace v2rayN.Handler
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Core configuration file processing class
|
/// Core configuration file processing class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class CoreConfigHandler
|
internal class CoreConfigHandler
|
||||||
{
|
{
|
||||||
private static string SampleClient = Global.v2raySampleClient;
|
private static string SampleClient = Global.v2raySampleClient;
|
||||||
private static string SampleServer = Global.v2raySampleServer;
|
private static string SampleServer = Global.v2raySampleServer;
|
||||||
@@ -228,6 +228,7 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int routingUserRule(RulesItem rules, ref V2rayConfig v2rayConfig)
|
private static int routingUserRule(RulesItem rules, ref V2rayConfig v2rayConfig)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -372,7 +373,6 @@ namespace v2rayN.Handler
|
|||||||
serversItem.password = node.id;
|
serversItem.password = node.id;
|
||||||
serversItem.method = LazyConfig.Instance.GetShadowsocksSecuritys(node).Contains(node.security) ? node.security : "none";
|
serversItem.method = LazyConfig.Instance.GetShadowsocksSecuritys(node).Contains(node.security) ? node.security : "none";
|
||||||
|
|
||||||
|
|
||||||
serversItem.ota = false;
|
serversItem.ota = false;
|
||||||
serversItem.level = 1;
|
serversItem.level = 1;
|
||||||
|
|
||||||
@@ -456,22 +456,8 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
boundStreamSettings(node, "out", outbound.streamSettings);
|
boundStreamSettings(node, "out", outbound.streamSettings);
|
||||||
|
|
||||||
//if xtls
|
if (node.streamSecurity == Global.StreamSecurityReality
|
||||||
if (node.streamSecurity == Global.StreamSecurityX)
|
|| node.streamSecurity == Global.StreamSecurity)
|
||||||
{
|
|
||||||
if (Utils.IsNullOrEmpty(node.flow))
|
|
||||||
{
|
|
||||||
usersItem.flow = Global.xtlsFlows[1];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
usersItem.flow = node.flow.Replace("splice", "direct");
|
|
||||||
}
|
|
||||||
|
|
||||||
outbound.mux.enabled = false;
|
|
||||||
outbound.mux.concurrency = -1;
|
|
||||||
}
|
|
||||||
else if (node.streamSecurity == Global.StreamSecurity)
|
|
||||||
{
|
{
|
||||||
if (!Utils.IsNullOrEmpty(node.flow))
|
if (!Utils.IsNullOrEmpty(node.flow))
|
||||||
{
|
{
|
||||||
@@ -505,22 +491,6 @@ namespace v2rayN.Handler
|
|||||||
serversItem.ota = false;
|
serversItem.ota = false;
|
||||||
serversItem.level = 1;
|
serversItem.level = 1;
|
||||||
|
|
||||||
//if xtls
|
|
||||||
if (node.streamSecurity == Global.StreamSecurityX)
|
|
||||||
{
|
|
||||||
if (Utils.IsNullOrEmpty(node.flow))
|
|
||||||
{
|
|
||||||
serversItem.flow = Global.xtlsFlows[1];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
serversItem.flow = node.flow.Replace("splice", "direct");
|
|
||||||
}
|
|
||||||
|
|
||||||
outbound.mux.enabled = false;
|
|
||||||
outbound.mux.concurrency = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
outbound.mux.enabled = false;
|
outbound.mux.enabled = false;
|
||||||
outbound.mux.concurrency = -1;
|
outbound.mux.concurrency = -1;
|
||||||
|
|
||||||
@@ -581,26 +551,21 @@ namespace v2rayN.Handler
|
|||||||
streamSettings.tlsSettings = tlsSettings;
|
streamSettings.tlsSettings = tlsSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if xtls
|
//if Reality
|
||||||
if (node.streamSecurity == Global.StreamSecurityX)
|
if (node.streamSecurity == Global.StreamSecurityReality)
|
||||||
{
|
{
|
||||||
streamSettings.security = node.streamSecurity;
|
streamSettings.security = node.streamSecurity;
|
||||||
|
|
||||||
TlsSettings xtlsSettings = new()
|
TlsSettings realitySettings = new()
|
||||||
{
|
{
|
||||||
allowInsecure = Utils.ToBool(node.allowInsecure.IsNullOrEmpty() ? config.coreBasicItem.defAllowInsecure.ToString().ToLower() : node.allowInsecure),
|
fingerprint = node.fingerprint.IsNullOrEmpty() ? config.coreBasicItem.defFingerprint : node.fingerprint,
|
||||||
alpn = node.GetAlpn(),
|
serverName = sni,
|
||||||
fingerprint = node.fingerprint.IsNullOrEmpty() ? config.coreBasicItem.defFingerprint : node.fingerprint
|
publicKey = node.publicKey,
|
||||||
|
shortId = node.shortId,
|
||||||
|
spiderX = node.spiderX,
|
||||||
};
|
};
|
||||||
if (!string.IsNullOrWhiteSpace(sni))
|
|
||||||
{
|
streamSettings.realitySettings = realitySettings;
|
||||||
xtlsSettings.serverName = sni;
|
|
||||||
}
|
|
||||||
else if (!string.IsNullOrWhiteSpace(host))
|
|
||||||
{
|
|
||||||
xtlsSettings.serverName = Utils.String2List(host)[0];
|
|
||||||
}
|
|
||||||
streamSettings.xtlsSettings = xtlsSettings;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//streamSettings
|
//streamSettings
|
||||||
@@ -660,13 +625,6 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
streamSettings.wsSettings = wsSettings;
|
streamSettings.wsSettings = wsSettings;
|
||||||
|
|
||||||
//TlsSettings tlsSettings = new TlsSettings();
|
|
||||||
//tlsSettings.allowInsecure = config.allowInsecure();
|
|
||||||
//if (!string.IsNullOrWhiteSpace(host))
|
|
||||||
//{
|
|
||||||
// tlsSettings.serverName = host;
|
|
||||||
//}
|
|
||||||
//streamSettings.tlsSettings = tlsSettings;
|
|
||||||
break;
|
break;
|
||||||
//h2
|
//h2
|
||||||
case "h2":
|
case "h2":
|
||||||
@@ -680,9 +638,6 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
streamSettings.httpSettings = httpSettings;
|
streamSettings.httpSettings = httpSettings;
|
||||||
|
|
||||||
//TlsSettings tlsSettings2 = new TlsSettings();
|
|
||||||
//tlsSettings2.allowInsecure = config.allowInsecure();
|
|
||||||
//streamSettings.tlsSettings = tlsSettings2;
|
|
||||||
break;
|
break;
|
||||||
//quic
|
//quic
|
||||||
case "quic":
|
case "quic":
|
||||||
@@ -708,6 +663,7 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "grpc":
|
case "grpc":
|
||||||
GrpcSettings grpcSettings = new()
|
GrpcSettings grpcSettings = new()
|
||||||
{
|
{
|
||||||
@@ -718,9 +674,9 @@ namespace v2rayN.Handler
|
|||||||
permit_without_stream = config.grpcItem.permit_without_stream,
|
permit_without_stream = config.grpcItem.permit_without_stream,
|
||||||
initial_windows_size = config.grpcItem.initial_windows_size,
|
initial_windows_size = config.grpcItem.initial_windows_size,
|
||||||
};
|
};
|
||||||
|
|
||||||
streamSettings.grpcSettings = grpcSettings;
|
streamSettings.grpcSettings = grpcSettings;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
//tcp
|
//tcp
|
||||||
if (node.headerType == Global.TcpHeaderHttp)
|
if (node.headerType == Global.TcpHeaderHttp)
|
||||||
@@ -874,11 +830,11 @@ namespace v2rayN.Handler
|
|||||||
/// <param name="fileName"></param>
|
/// <param name="fileName"></param>
|
||||||
/// <param name="msg"></param>
|
/// <param name="msg"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private static int GenerateClientCustomConfig(ProfileItem node, string fileName, out string msg)
|
private static int GenerateClientCustomConfig(ProfileItem node, string? fileName, out string msg)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (node == null)
|
if (node == null || fileName is null)
|
||||||
{
|
{
|
||||||
msg = ResUI.CheckServerSettings;
|
msg = ResUI.CheckServerSettings;
|
||||||
return -1;
|
return -1;
|
||||||
@@ -920,6 +876,7 @@ namespace v2rayN.Handler
|
|||||||
case ECoreType.Xray:
|
case ECoreType.Xray:
|
||||||
case ECoreType.v2fly_v5:
|
case ECoreType.v2fly_v5:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ECoreType.clash:
|
case ECoreType.clash:
|
||||||
case ECoreType.clash_meta:
|
case ECoreType.clash_meta:
|
||||||
//remove the original
|
//remove the original
|
||||||
@@ -956,7 +913,8 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (node == null)
|
if (node == null
|
||||||
|
|| node.port <= 0)
|
||||||
{
|
{
|
||||||
msg = ResUI.CheckServerSettings;
|
msg = ResUI.CheckServerSettings;
|
||||||
return -1;
|
return -1;
|
||||||
@@ -1006,7 +964,7 @@ namespace v2rayN.Handler
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Generate client configuration
|
||||||
|
|
||||||
#region Generate server-side configuration
|
#region Generate server-side configuration
|
||||||
|
|
||||||
@@ -1081,7 +1039,6 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
inbound.protocol = Global.vmessProtocolLite;
|
inbound.protocol = Global.vmessProtocolLite;
|
||||||
usersItem.alterId = node.alterId;
|
usersItem.alterId = node.alterId;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (node.configType == EConfigType.VLESS)
|
else if (node.configType == EConfigType.VLESS)
|
||||||
{
|
{
|
||||||
@@ -1114,7 +1071,8 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
#endregion Generate server-side configuration
|
||||||
|
|
||||||
#region Import (export) client/server configuration
|
#region Import (export) client/server configuration
|
||||||
|
|
||||||
@@ -1385,11 +1343,10 @@ namespace v2rayN.Handler
|
|||||||
return GenerateServerConfig(node, fileName, out msg);
|
return GenerateServerConfig(node, fileName, out msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Import (export) client/server configuration
|
||||||
|
|
||||||
#region Gen speedtest config
|
#region Gen speedtest config
|
||||||
|
|
||||||
|
|
||||||
public static string GenerateClientSpeedtestConfigString(Config config, List<ServerTestItem> selecteds, out string msg)
|
public static string GenerateClientSpeedtestConfigString(Config config, List<ServerTestItem> selecteds, out string msg)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -1430,7 +1387,7 @@ namespace v2rayN.Handler
|
|||||||
Utils.SaveLog(ex.Message, ex);
|
Utils.SaveLog(ex.Message, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
log(configCopy, ref v2rayConfig, false);
|
log(configCopy, ref v2rayConfig, true);
|
||||||
//routing(config, ref v2rayConfig);
|
//routing(config, ref v2rayConfig);
|
||||||
//dns(configCopy, ref v2rayConfig);
|
//dns(configCopy, ref v2rayConfig);
|
||||||
|
|
||||||
@@ -1505,6 +1462,11 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (item.configType == EConfigType.VLESS
|
||||||
|
&& !Global.flows.Contains(item.flow))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
outbound(item, ref v2rayConfigCopy);
|
outbound(item, ref v2rayConfigCopy);
|
||||||
v2rayConfigCopy.outbounds[0].tag = Global.agentTag + inbound.port.ToString();
|
v2rayConfigCopy.outbounds[0].tag = Global.agentTag + inbound.port.ToString();
|
||||||
@@ -1531,7 +1493,6 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Gen speedtest config
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,13 +9,13 @@ namespace v2rayN.Handler
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Core process processing class
|
/// Core process processing class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class CoreHandler
|
internal class CoreHandler
|
||||||
{
|
{
|
||||||
private static string _coreCConfigRes = Global.coreConfigFileName;
|
private static string _coreCConfigRes = Global.coreConfigFileName;
|
||||||
private CoreInfo? _coreInfo;
|
private CoreInfo? _coreInfo;
|
||||||
private int _processId = 0;
|
private int _processId = 0;
|
||||||
private Process? _process;
|
private Process? _process;
|
||||||
Action<bool, string> _updateFunc;
|
private Action<bool, string> _updateFunc;
|
||||||
|
|
||||||
public CoreHandler(Action<bool, string> update)
|
public CoreHandler(Action<bool, string> update)
|
||||||
{
|
{
|
||||||
@@ -119,7 +119,6 @@ namespace v2rayN.Handler
|
|||||||
CoreStopPid(_processId);
|
CoreStopPid(_processId);
|
||||||
_processId = 0;
|
_processId = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -156,6 +155,7 @@ namespace v2rayN.Handler
|
|||||||
if (Utils.IsNullOrEmpty(fileName))
|
if (Utils.IsNullOrEmpty(fileName))
|
||||||
{
|
{
|
||||||
string msg = string.Format(ResUI.NotFoundCore, Utils.GetBinPath("", coreInfo.coreType), string.Join(", ", coreInfo.coreExes.ToArray()), coreInfo.coreUrl);
|
string msg = string.Format(ResUI.NotFoundCore, Utils.GetBinPath("", coreInfo.coreType), string.Join(", ", coreInfo.coreExes.ToArray()), coreInfo.coreUrl);
|
||||||
|
Utils.SaveLog(msg);
|
||||||
ShowMsg(false, msg);
|
ShowMsg(false, msg);
|
||||||
}
|
}
|
||||||
return fileName;
|
return fileName;
|
||||||
@@ -196,11 +196,20 @@ namespace v2rayN.Handler
|
|||||||
ShowMsg(false, msg);
|
ShowMsg(false, msg);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
p.ErrorDataReceived += (sender, e) =>
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(e.Data))
|
||||||
|
{
|
||||||
|
string msg = e.Data + Environment.NewLine;
|
||||||
|
ShowMsg(false, msg);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
p.Start();
|
p.Start();
|
||||||
if (displayLog)
|
if (displayLog)
|
||||||
{
|
{
|
||||||
p.BeginOutputReadLine();
|
p.BeginOutputReadLine();
|
||||||
|
p.BeginErrorReadLine();
|
||||||
}
|
}
|
||||||
_process = p;
|
_process = p;
|
||||||
|
|
||||||
@@ -213,6 +222,7 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
//Utils.SaveLog(Utils.ToJson(node));
|
||||||
Utils.SaveLog(ex.Message, ex);
|
Utils.SaveLog(ex.Message, ex);
|
||||||
string msg = ex.Message;
|
string msg = ex.Message;
|
||||||
ShowMsg(true, msg);
|
ShowMsg(true, msg);
|
||||||
@@ -253,8 +263,17 @@ namespace v2rayN.Handler
|
|||||||
ShowMsg(false, msg);
|
ShowMsg(false, msg);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
p.ErrorDataReceived += (sender, e) =>
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(e.Data))
|
||||||
|
{
|
||||||
|
string msg = e.Data + Environment.NewLine;
|
||||||
|
ShowMsg(false, msg);
|
||||||
|
}
|
||||||
|
};
|
||||||
p.Start();
|
p.Start();
|
||||||
p.BeginOutputReadLine();
|
p.BeginOutputReadLine();
|
||||||
|
p.BeginErrorReadLine();
|
||||||
|
|
||||||
p.StandardInput.Write(configStr);
|
p.StandardInput.Write(configStr);
|
||||||
p.StandardInput.Close();
|
p.StandardInput.Close();
|
||||||
|
|||||||
@@ -12,13 +12,12 @@ namespace v2rayN.Handler
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///Download
|
///Download
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class DownloadHandle
|
internal class DownloadHandle
|
||||||
{
|
{
|
||||||
public event EventHandler<ResultEventArgs>? UpdateCompleted;
|
public event EventHandler<ResultEventArgs>? UpdateCompleted;
|
||||||
|
|
||||||
public event ErrorEventHandler? Error;
|
public event ErrorEventHandler? Error;
|
||||||
|
|
||||||
|
|
||||||
public class ResultEventArgs : EventArgs
|
public class ResultEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
public bool Success;
|
public bool Success;
|
||||||
@@ -175,7 +174,6 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,7 +255,6 @@ namespace v2rayN.Handler
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int RunAvailabilityCheck(IWebProxy? webProxy)
|
public int RunAvailabilityCheck(IWebProxy? webProxy)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
180
v2rayN/v2rayN/Handler/HotkeyHandler.cs
Normal file
180
v2rayN/v2rayN/Handler/HotkeyHandler.cs
Normal file
@@ -0,0 +1,180 @@
|
|||||||
|
using System.ComponentModel;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Interop;
|
||||||
|
using v2rayN.Mode;
|
||||||
|
using v2rayN.Resx;
|
||||||
|
|
||||||
|
namespace v2rayN.Handler
|
||||||
|
{
|
||||||
|
public sealed class HotkeyHandler
|
||||||
|
{
|
||||||
|
private static readonly Lazy<HotkeyHandler> _instance = new(() => new());
|
||||||
|
public static HotkeyHandler Instance = _instance.Value;
|
||||||
|
|
||||||
|
private const int WmHotkey = 0x0312;
|
||||||
|
|
||||||
|
private Config _config
|
||||||
|
{
|
||||||
|
get => LazyConfig.Instance.GetConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Dictionary<int, List<EGlobalHotkey>> _hotkeyTriggerDic;
|
||||||
|
|
||||||
|
public bool IsPause { get; set; } = false;
|
||||||
|
|
||||||
|
public event Action<bool, string>? UpdateViewEvent;
|
||||||
|
|
||||||
|
public event Action<EGlobalHotkey>? HotkeyTriggerEvent;
|
||||||
|
|
||||||
|
public HotkeyHandler()
|
||||||
|
{
|
||||||
|
_hotkeyTriggerDic = new();
|
||||||
|
ComponentDispatcher.ThreadPreprocessMessage += OnThreadPreProcessMessage;
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Init()
|
||||||
|
{
|
||||||
|
_hotkeyTriggerDic.Clear();
|
||||||
|
if (_config.globalHotkeys == null) return;
|
||||||
|
foreach (var item in _config.globalHotkeys)
|
||||||
|
{
|
||||||
|
if (item.KeyCode != null && item.KeyCode != Key.None)
|
||||||
|
{
|
||||||
|
int key = KeyInterop.VirtualKeyFromKey((Key)item.KeyCode);
|
||||||
|
KeyModifiers modifiers = KeyModifiers.None;
|
||||||
|
if (item.Control) modifiers |= KeyModifiers.Ctrl;
|
||||||
|
if (item.Shift) modifiers |= KeyModifiers.Shift;
|
||||||
|
if (item.Alt) modifiers |= KeyModifiers.Alt;
|
||||||
|
key = (key << 16) | (int)modifiers;
|
||||||
|
if (!_hotkeyTriggerDic.ContainsKey(key))
|
||||||
|
{
|
||||||
|
_hotkeyTriggerDic.Add(key, new() { item.eGlobalHotkey });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!_hotkeyTriggerDic[key].Contains(item.eGlobalHotkey))
|
||||||
|
_hotkeyTriggerDic[key].Add(item.eGlobalHotkey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Load()
|
||||||
|
{
|
||||||
|
foreach (var _hotkeyCode in _hotkeyTriggerDic.Keys)
|
||||||
|
{
|
||||||
|
var hotkeyInfo = GetHotkeyInfo(_hotkeyCode);
|
||||||
|
bool isSuccess = false;
|
||||||
|
string msg;
|
||||||
|
|
||||||
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
isSuccess = RegisterHotKey(IntPtr.Zero, _hotkeyCode, hotkeyInfo.fsModifiers, hotkeyInfo.vKey);
|
||||||
|
});
|
||||||
|
foreach (var name in hotkeyInfo.Names)
|
||||||
|
{
|
||||||
|
if (isSuccess)
|
||||||
|
{
|
||||||
|
msg = string.Format(ResUI.RegisterGlobalHotkeySuccessfully, $"{name}({hotkeyInfo.hotkeyStr})");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var errInfo = new Win32Exception(Marshal.GetLastWin32Error()).Message;
|
||||||
|
msg = string.Format(ResUI.RegisterGlobalHotkeyFailed, $"{name}({hotkeyInfo.hotkeyStr})", errInfo);
|
||||||
|
}
|
||||||
|
UpdateViewEvent?.Invoke(false, msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReLoad()
|
||||||
|
{
|
||||||
|
foreach (var hotkey in _hotkeyTriggerDic.Keys)
|
||||||
|
{
|
||||||
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
UnregisterHotKey(IntPtr.Zero, hotkey);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Init();
|
||||||
|
Load();
|
||||||
|
}
|
||||||
|
|
||||||
|
private (int fsModifiers, int vKey, string hotkeyStr, List<string> Names) GetHotkeyInfo(int hotkeycode)
|
||||||
|
{
|
||||||
|
var _fsModifiers = hotkeycode & 0xffff;
|
||||||
|
var _vkey = (hotkeycode >> 16) & 0xffff;
|
||||||
|
var _hotkeyStr = new StringBuilder();
|
||||||
|
var _names = new List<string>();
|
||||||
|
|
||||||
|
var mdif = (KeyModifiers)_fsModifiers;
|
||||||
|
var key = KeyInterop.KeyFromVirtualKey(_vkey);
|
||||||
|
if ((mdif | KeyModifiers.Ctrl) == KeyModifiers.Ctrl) _hotkeyStr.Append($"{KeyModifiers.Ctrl}+");
|
||||||
|
if ((mdif | KeyModifiers.Alt) == KeyModifiers.Alt) _hotkeyStr.Append($"{KeyModifiers.Alt}+");
|
||||||
|
if ((mdif | KeyModifiers.Shift) == KeyModifiers.Shift) _hotkeyStr.Append($"{KeyModifiers.Shift}+");
|
||||||
|
_hotkeyStr.Append(key.ToString());
|
||||||
|
|
||||||
|
foreach (var name in _hotkeyTriggerDic[hotkeycode])
|
||||||
|
{
|
||||||
|
_names.Add(name.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return (_fsModifiers, _vkey, _hotkeyStr.ToString(), _names);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnThreadPreProcessMessage(ref MSG msg, ref bool handled)
|
||||||
|
{
|
||||||
|
if (msg.message != WmHotkey || !_hotkeyTriggerDic.ContainsKey((int)msg.lParam))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
handled = true;
|
||||||
|
var _hotKeyCode = (int)msg.lParam;
|
||||||
|
if (IsPause)
|
||||||
|
{
|
||||||
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
UIElement? element = Keyboard.FocusedElement as UIElement;
|
||||||
|
if (element != null)
|
||||||
|
{
|
||||||
|
var _keyEventArgs = new KeyEventArgs(Keyboard.PrimaryDevice,
|
||||||
|
PresentationSource.FromVisual(element), 0,
|
||||||
|
KeyInterop.KeyFromVirtualKey(GetHotkeyInfo(_hotKeyCode).vKey))
|
||||||
|
{
|
||||||
|
RoutedEvent = UIElement.KeyDownEvent
|
||||||
|
};
|
||||||
|
element.RaiseEvent(_keyEventArgs);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (var keyEvent in _hotkeyTriggerDic[(int)msg.lParam])
|
||||||
|
{
|
||||||
|
HotkeyTriggerEvent?.Invoke(keyEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[DllImport("user32.dll", SetLastError = true)]
|
||||||
|
private static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vlc);
|
||||||
|
|
||||||
|
[DllImport("user32.dll", SetLastError = true)]
|
||||||
|
private static extern bool UnregisterHotKey(IntPtr hWnd, int id);
|
||||||
|
|
||||||
|
[Flags]
|
||||||
|
private enum KeyModifiers
|
||||||
|
{
|
||||||
|
None = 0x0000,
|
||||||
|
Alt = 0x0001,
|
||||||
|
Ctrl = 0x0002,
|
||||||
|
Shift = 0x0004,
|
||||||
|
Win = 0x0008,
|
||||||
|
NoRepeat = 0x4000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,6 +26,7 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
_config = config;
|
_config = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Config GetConfig()
|
public Config GetConfig()
|
||||||
{
|
{
|
||||||
return _config;
|
return _config;
|
||||||
@@ -65,6 +66,7 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
return SqliteHelper.Instance.Table<SubItem>().ToList();
|
return SqliteHelper.Instance.Table<SubItem>().ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubItem GetSubItem(string subid)
|
public SubItem GetSubItem(string subid)
|
||||||
{
|
{
|
||||||
return SqliteHelper.Instance.Table<SubItem>().FirstOrDefault(t => t.id == subid);
|
return SqliteHelper.Instance.Table<SubItem>().FirstOrDefault(t => t.id == subid);
|
||||||
@@ -75,19 +77,18 @@ namespace v2rayN.Handler
|
|||||||
if (Utils.IsNullOrEmpty(subid))
|
if (Utils.IsNullOrEmpty(subid))
|
||||||
{
|
{
|
||||||
return SqliteHelper.Instance.Table<ProfileItem>().ToList();
|
return SqliteHelper.Instance.Table<ProfileItem>().ToList();
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return SqliteHelper.Instance.Table<ProfileItem>().Where(t => t.subid == subid).ToList();
|
return SqliteHelper.Instance.Table<ProfileItem>().Where(t => t.subid == subid).ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<string> ProfileItemIndexs(string subid)
|
public List<string> ProfileItemIndexs(string subid)
|
||||||
{
|
{
|
||||||
if (Utils.IsNullOrEmpty(subid))
|
if (Utils.IsNullOrEmpty(subid))
|
||||||
{
|
{
|
||||||
return SqliteHelper.Instance.Table<ProfileItem>().Select(t => t.indexId).ToList();
|
return SqliteHelper.Instance.Table<ProfileItem>().Select(t => t.indexId).ToList();
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -112,7 +113,7 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
filter = filter.Replace("'", "");
|
filter = filter.Replace("'", "");
|
||||||
}
|
}
|
||||||
sql += $" and a.remarks like '%{filter}%'";
|
sql += String.Format(" and (a.remarks like '%{0}%' or a.address like '%{0}%') ", filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
return SqliteHelper.Instance.Query<ProfileItemModel>(sql).ToList();
|
return SqliteHelper.Instance.Query<ProfileItemModel>(sql).ToList();
|
||||||
@@ -131,12 +132,13 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
return SqliteHelper.Instance.Table<RoutingItem>().Where(it => it.locked == false).OrderBy(t => t.sort).ToList();
|
return SqliteHelper.Instance.Table<RoutingItem>().Where(it => it.locked == false).OrderBy(t => t.sort).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public RoutingItem GetRoutingItem(string id)
|
public RoutingItem GetRoutingItem(string id)
|
||||||
{
|
{
|
||||||
return SqliteHelper.Instance.Table<RoutingItem>().FirstOrDefault(it => it.locked == false && it.id == id);
|
return SqliteHelper.Instance.Table<RoutingItem>().FirstOrDefault(it => it.locked == false && it.id == id);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Config
|
||||||
|
|
||||||
#region Core Type
|
#region Core Type
|
||||||
|
|
||||||
@@ -200,8 +202,9 @@ namespace v2rayN.Handler
|
|||||||
coreType = ECoreType.v2rayN,
|
coreType = ECoreType.v2rayN,
|
||||||
coreUrl = Global.NUrl,
|
coreUrl = Global.NUrl,
|
||||||
coreReleaseApiUrl = Global.NUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
coreReleaseApiUrl = Global.NUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
||||||
coreDownloadUrl32 = Global.NUrl + "/download/{0}/v2rayN.zip",
|
coreDownloadUrl32 = Global.NUrl + "/download/{0}/v2rayN-32.zip",
|
||||||
coreDownloadUrl64 = Global.NUrl + "/download/{0}/v2rayN.zip",
|
coreDownloadUrl64 = Global.NUrl + "/download/{0}/v2rayN.zip",
|
||||||
|
coreDownloadUrlArm64 = Global.NUrl + "/download/{0}/v2rayN-arm64.zip"
|
||||||
});
|
});
|
||||||
|
|
||||||
coreInfos.Add(new CoreInfo
|
coreInfos.Add(new CoreInfo
|
||||||
@@ -213,6 +216,7 @@ namespace v2rayN.Handler
|
|||||||
coreReleaseApiUrl = Global.v2flyCoreUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
coreReleaseApiUrl = Global.v2flyCoreUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
||||||
coreDownloadUrl32 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
|
coreDownloadUrl32 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
|
||||||
coreDownloadUrl64 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
|
coreDownloadUrl64 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
|
||||||
|
coreDownloadUrlArm64 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
|
||||||
match = "V2Ray",
|
match = "V2Ray",
|
||||||
versionArg = "-version",
|
versionArg = "-version",
|
||||||
redirectInfo = true,
|
redirectInfo = true,
|
||||||
@@ -227,6 +231,7 @@ namespace v2rayN.Handler
|
|||||||
coreReleaseApiUrl = Global.SagerNetCoreUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
coreReleaseApiUrl = Global.SagerNetCoreUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
||||||
coreDownloadUrl32 = Global.SagerNetCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
|
coreDownloadUrl32 = Global.SagerNetCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
|
||||||
coreDownloadUrl64 = Global.SagerNetCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
|
coreDownloadUrl64 = Global.SagerNetCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
|
||||||
|
coreDownloadUrlArm64 = Global.SagerNetCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
|
||||||
match = "V2Ray",
|
match = "V2Ray",
|
||||||
versionArg = "version",
|
versionArg = "version",
|
||||||
redirectInfo = true,
|
redirectInfo = true,
|
||||||
@@ -241,6 +246,7 @@ namespace v2rayN.Handler
|
|||||||
coreReleaseApiUrl = Global.v2flyCoreUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
coreReleaseApiUrl = Global.v2flyCoreUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
||||||
coreDownloadUrl32 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
|
coreDownloadUrl32 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
|
||||||
coreDownloadUrl64 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
|
coreDownloadUrl64 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
|
||||||
|
coreDownloadUrlArm64 = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip",
|
||||||
match = "V2Ray",
|
match = "V2Ray",
|
||||||
versionArg = "version",
|
versionArg = "version",
|
||||||
redirectInfo = true,
|
redirectInfo = true,
|
||||||
@@ -255,6 +261,7 @@ namespace v2rayN.Handler
|
|||||||
coreReleaseApiUrl = Global.xrayCoreUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
coreReleaseApiUrl = Global.xrayCoreUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
||||||
coreDownloadUrl32 = Global.xrayCoreUrl + "/download/{0}/Xray-windows-{1}.zip",
|
coreDownloadUrl32 = Global.xrayCoreUrl + "/download/{0}/Xray-windows-{1}.zip",
|
||||||
coreDownloadUrl64 = Global.xrayCoreUrl + "/download/{0}/Xray-windows-{1}.zip",
|
coreDownloadUrl64 = Global.xrayCoreUrl + "/download/{0}/Xray-windows-{1}.zip",
|
||||||
|
coreDownloadUrlArm64 = Global.xrayCoreUrl + "/download/{0}/Xray-windows-{1}.zip",
|
||||||
match = "Xray",
|
match = "Xray",
|
||||||
versionArg = "-version",
|
versionArg = "-version",
|
||||||
redirectInfo = true,
|
redirectInfo = true,
|
||||||
@@ -269,6 +276,7 @@ namespace v2rayN.Handler
|
|||||||
coreReleaseApiUrl = Global.clashCoreUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
coreReleaseApiUrl = Global.clashCoreUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
||||||
coreDownloadUrl32 = Global.clashCoreUrl + "/download/{0}/clash-windows-386-{0}.zip",
|
coreDownloadUrl32 = Global.clashCoreUrl + "/download/{0}/clash-windows-386-{0}.zip",
|
||||||
coreDownloadUrl64 = Global.clashCoreUrl + "/download/{0}/clash-windows-amd64-{0}.zip",
|
coreDownloadUrl64 = Global.clashCoreUrl + "/download/{0}/clash-windows-amd64-{0}.zip",
|
||||||
|
coreDownloadUrlArm64 = Global.clashCoreUrl + "/download/{0}/clash-windows-arm64-{0}.zip",
|
||||||
match = "v",
|
match = "v",
|
||||||
versionArg = "-v",
|
versionArg = "-v",
|
||||||
redirectInfo = true,
|
redirectInfo = true,
|
||||||
@@ -283,6 +291,7 @@ namespace v2rayN.Handler
|
|||||||
coreReleaseApiUrl = Global.clashMetaCoreUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
coreReleaseApiUrl = Global.clashMetaCoreUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
||||||
coreDownloadUrl32 = Global.clashMetaCoreUrl + "/download/{0}/Clash.Meta-windows-386-{0}.zip",
|
coreDownloadUrl32 = Global.clashMetaCoreUrl + "/download/{0}/Clash.Meta-windows-386-{0}.zip",
|
||||||
coreDownloadUrl64 = Global.clashMetaCoreUrl + "/download/{0}/Clash.Meta-windows-amd64-compatible-{0}.zip",
|
coreDownloadUrl64 = Global.clashMetaCoreUrl + "/download/{0}/Clash.Meta-windows-amd64-compatible-{0}.zip",
|
||||||
|
coreDownloadUrlArm64 = Global.clashMetaCoreUrl + "/download/{0}/Clash.Meta-windows-arm64-{0}.zip",
|
||||||
match = "v",
|
match = "v",
|
||||||
versionArg = "-v",
|
versionArg = "-v",
|
||||||
redirectInfo = true,
|
redirectInfo = true,
|
||||||
@@ -297,6 +306,7 @@ namespace v2rayN.Handler
|
|||||||
coreReleaseApiUrl = Global.hysteriaCoreUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
coreReleaseApiUrl = Global.hysteriaCoreUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
||||||
coreDownloadUrl32 = Global.hysteriaCoreUrl + "/download/{0}/hysteria-windows-386.exe",
|
coreDownloadUrl32 = Global.hysteriaCoreUrl + "/download/{0}/hysteria-windows-386.exe",
|
||||||
coreDownloadUrl64 = Global.hysteriaCoreUrl + "/download/{0}/hysteria-windows-amd64.exe",
|
coreDownloadUrl64 = Global.hysteriaCoreUrl + "/download/{0}/hysteria-windows-amd64.exe",
|
||||||
|
coreDownloadUrlArm64 = Global.hysteriaCoreUrl + "/download/{0}/hysteria-windows-arm64.exe",
|
||||||
redirectInfo = true,
|
redirectInfo = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -325,9 +335,15 @@ namespace v2rayN.Handler
|
|||||||
arguments = "run",
|
arguments = "run",
|
||||||
coreUrl = Global.singboxCoreUrl,
|
coreUrl = Global.singboxCoreUrl,
|
||||||
redirectInfo = true,
|
redirectInfo = true,
|
||||||
|
coreReleaseApiUrl = Global.singboxCoreUrl.Replace(Global.githubUrl, Global.githubApiUrl),
|
||||||
|
coreDownloadUrl32 = Global.singboxCoreUrl + "/download/{0}/sing-box-{1}-windows-386.zip",
|
||||||
|
coreDownloadUrl64 = Global.singboxCoreUrl + "/download/{0}/sing-box-{1}-windows-amd64.zip",
|
||||||
|
coreDownloadUrlArm64 = Global.singboxCoreUrl + "/download/{0}/sing-box-{1}-windows-arm64.zip",
|
||||||
|
match = "sing-box",
|
||||||
|
versionArg = "version",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Core Type
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,6 @@
|
|||||||
using NHotkey;
|
using Microsoft.Win32;
|
||||||
using NHotkey.Wpf;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows.Forms;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using v2rayN.Mode;
|
using v2rayN.Mode;
|
||||||
using v2rayN.Resx;
|
using v2rayN.Resx;
|
||||||
@@ -13,14 +10,6 @@ namespace v2rayN.Handler
|
|||||||
public sealed class MainFormHandler
|
public sealed class MainFormHandler
|
||||||
{
|
{
|
||||||
private static readonly Lazy<MainFormHandler> instance = new(() => new());
|
private static readonly Lazy<MainFormHandler> instance = new(() => new());
|
||||||
//Action<bool, string> _updateUI;
|
|
||||||
|
|
||||||
//private DownloadHandle downloadHandle2;
|
|
||||||
//private Config _config;
|
|
||||||
//private V2rayHandler _v2rayHandler;
|
|
||||||
//private List<int> _selecteds;
|
|
||||||
//private Thread _workThread;
|
|
||||||
//Action<int, string> _updateFunc;
|
|
||||||
public static MainFormHandler Instance => instance.Value;
|
public static MainFormHandler Instance => instance.Value;
|
||||||
|
|
||||||
public Icon GetNotifyIcon(Config config)
|
public Icon GetNotifyIcon(Config config)
|
||||||
@@ -66,10 +55,12 @@ namespace v2rayN.Handler
|
|||||||
case 0:
|
case 0:
|
||||||
index = 1;
|
index = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
case 3:
|
case 3:
|
||||||
index = 2;
|
index = 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
index = 3;
|
index = 3;
|
||||||
break;
|
break;
|
||||||
@@ -144,7 +135,7 @@ namespace v2rayN.Handler
|
|||||||
FilterIndex = 2,
|
FilterIndex = 2,
|
||||||
RestoreDirectory = true
|
RestoreDirectory = true
|
||||||
};
|
};
|
||||||
if (fileDialog.ShowDialog() != DialogResult.OK)
|
if (fileDialog.ShowDialog() != true)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -183,7 +174,7 @@ namespace v2rayN.Handler
|
|||||||
FilterIndex = 2,
|
FilterIndex = 2,
|
||||||
RestoreDirectory = true
|
RestoreDirectory = true
|
||||||
};
|
};
|
||||||
if (fileDialog.ShowDialog() != DialogResult.OK)
|
if (fileDialog.ShowDialog() != true)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -220,7 +211,7 @@ namespace v2rayN.Handler
|
|||||||
FilterIndex = 2,
|
FilterIndex = 2,
|
||||||
RestoreDirectory = true
|
RestoreDirectory = true
|
||||||
};
|
};
|
||||||
if (fileDialog.ShowDialog() != DialogResult.OK)
|
if (fileDialog.ShowDialog() != true)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -235,7 +226,6 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
UI.Show(ResUI.OperationSuccess);
|
UI.Show(ResUI.OperationSuccess);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -248,14 +238,14 @@ namespace v2rayN.Handler
|
|||||||
public bool RestoreGuiNConfig(ref Config config)
|
public bool RestoreGuiNConfig(ref Config config)
|
||||||
{
|
{
|
||||||
var fileContent = string.Empty;
|
var fileContent = string.Empty;
|
||||||
using (OpenFileDialog fileDialog = new())
|
OpenFileDialog fileDialog = new();
|
||||||
{
|
|
||||||
fileDialog.InitialDirectory = Utils.GetBackupPath("");
|
fileDialog.InitialDirectory = Utils.GetBackupPath("");
|
||||||
fileDialog.Filter = "guiNConfig|*.json|All|*.*";
|
fileDialog.Filter = "guiNConfig|*.json|All|*.*";
|
||||||
fileDialog.FilterIndex = 2;
|
fileDialog.FilterIndex = 2;
|
||||||
fileDialog.RestoreDirectory = true;
|
fileDialog.RestoreDirectory = true;
|
||||||
|
|
||||||
if (fileDialog.ShowDialog() == DialogResult.OK)
|
if (fileDialog.ShowDialog() == true)
|
||||||
{
|
{
|
||||||
fileContent = Utils.LoadResource(fileDialog.FileName);
|
fileContent = Utils.LoadResource(fileDialog.FileName);
|
||||||
}
|
}
|
||||||
@@ -263,7 +253,7 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (Utils.IsNullOrEmpty(fileContent))
|
if (Utils.IsNullOrEmpty(fileContent))
|
||||||
{
|
{
|
||||||
UI.ShowWarning(ResUI.OperationFailed);
|
UI.ShowWarning(ResUI.OperationFailed);
|
||||||
@@ -287,37 +277,52 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
public void UpdateTask(Config config, Action<bool, string> update)
|
public void UpdateTask(Config config, Action<bool, string> update)
|
||||||
{
|
{
|
||||||
Task.Run(() => UpdateTaskRun(config, update));
|
Task.Run(() => UpdateTaskRunSubscription(config, update));
|
||||||
|
Task.Run(() => UpdateTaskRunGeo(config, update));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateTaskRun(Config config, Action<bool, string> update)
|
private void UpdateTaskRunSubscription(Config config, Action<bool, string> update)
|
||||||
{
|
{
|
||||||
var autoUpdateSubTime = DateTime.Now;
|
|
||||||
var autoUpdateGeoTime = DateTime.Now;
|
|
||||||
|
|
||||||
Thread.Sleep(60000);
|
Thread.Sleep(60000);
|
||||||
Utils.SaveLog("UpdateTaskRun");
|
Utils.SaveLog("UpdateTaskRunSubscription");
|
||||||
|
|
||||||
var updateHandle = new UpdateHandle();
|
var updateHandle = new UpdateHandle();
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
var dtNow = DateTime.Now;
|
var updateTime = ((DateTimeOffset)DateTime.Now).ToUnixTimeSeconds();
|
||||||
|
var lstSubs = LazyConfig.Instance.SubItems()
|
||||||
|
.Where(t => t.autoUpdateInterval > 0)
|
||||||
|
.Where(t => updateTime - t.updateTime >= t.autoUpdateInterval * 60)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
if (config.guiItem.autoUpdateSubInterval > 0)
|
foreach (var item in lstSubs)
|
||||||
{
|
{
|
||||||
if ((dtNow - autoUpdateSubTime).Hours % config.guiItem.autoUpdateSubInterval == 0)
|
updateHandle.UpdateSubscriptionProcess(config, item.id, true, (bool success, string msg) =>
|
||||||
{
|
|
||||||
updateHandle.UpdateSubscriptionProcess(config, "", true, (bool success, string msg) =>
|
|
||||||
{
|
{
|
||||||
update(success, msg);
|
update(success, msg);
|
||||||
if (success)
|
if (success)
|
||||||
Utils.SaveLog("subscription" + msg);
|
Utils.SaveLog("subscription" + msg);
|
||||||
});
|
});
|
||||||
autoUpdateSubTime = dtNow;
|
item.updateTime = updateTime;
|
||||||
|
ConfigHandler.AddSubItem(ref config, item);
|
||||||
|
|
||||||
|
Thread.Sleep(5000);
|
||||||
}
|
}
|
||||||
Thread.Sleep(60000);
|
Thread.Sleep(60000);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateTaskRunGeo(Config config, Action<bool, string> update)
|
||||||
|
{
|
||||||
|
var autoUpdateGeoTime = DateTime.Now;
|
||||||
|
|
||||||
|
Thread.Sleep(1000 * 120);
|
||||||
|
Utils.SaveLog("UpdateTaskRunGeo");
|
||||||
|
|
||||||
|
var updateHandle = new UpdateHandle();
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
var dtNow = DateTime.Now;
|
||||||
if (config.guiItem.autoUpdateInterval > 0)
|
if (config.guiItem.autoUpdateInterval > 0)
|
||||||
{
|
{
|
||||||
if ((dtNow - autoUpdateGeoTime).Hours % config.guiItem.autoUpdateInterval == 0)
|
if ((dtNow - autoUpdateGeoTime).Hours % config.guiItem.autoUpdateInterval == 0)
|
||||||
@@ -343,49 +348,11 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegisterGlobalHotkey(Config config, EventHandler<HotkeyEventArgs> handler, Action<bool, string> update)
|
public void RegisterGlobalHotkey(Config config, Action<EGlobalHotkey> handler, Action<bool, string> update)
|
||||||
{
|
{
|
||||||
if (config.globalHotkeys == null)
|
HotkeyHandler.Instance.UpdateViewEvent += update;
|
||||||
{
|
HotkeyHandler.Instance.HotkeyTriggerEvent += handler;
|
||||||
return;
|
HotkeyHandler.Instance.Load();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var item in config.globalHotkeys)
|
|
||||||
{
|
|
||||||
if (item.KeyCode == null)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var modifiers = ModifierKeys.None;
|
|
||||||
if (item.Control)
|
|
||||||
{
|
|
||||||
modifiers |= ModifierKeys.Control;
|
|
||||||
}
|
|
||||||
if (item.Alt)
|
|
||||||
{
|
|
||||||
modifiers |= ModifierKeys.Alt;
|
|
||||||
}
|
|
||||||
if (item.Shift)
|
|
||||||
{
|
|
||||||
modifiers |= ModifierKeys.Shift;
|
|
||||||
}
|
|
||||||
|
|
||||||
var gesture = new KeyGesture(KeyInterop.KeyFromVirtualKey((int)item.KeyCode), modifiers);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
HotkeyManager.Current.AddOrReplace(((int)item.eGlobalHotkey).ToString(), gesture, handler);
|
|
||||||
var msg = string.Format(ResUI.RegisterGlobalHotkeySuccessfully, $"{item.eGlobalHotkey}");
|
|
||||||
update(false, msg);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
var msg = string.Format(ResUI.RegisterGlobalHotkeyFailed, $"{item.eGlobalHotkey}", ex.Message);
|
|
||||||
update(false, msg);
|
|
||||||
Utils.SaveLog(msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -18,16 +18,16 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
_snackbarMessageQueue?.Enqueue(content);
|
_snackbarMessageQueue?.Enqueue(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendMessage(string msg)
|
public void SendMessage(string msg)
|
||||||
{
|
{
|
||||||
MessageBus.Current.SendMessage(msg, "MsgView");
|
MessageBus.Current.SendMessage(msg, "MsgView");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendMessage(string msg, bool time)
|
public void SendMessage(string msg, bool time)
|
||||||
{
|
{
|
||||||
msg = $"{DateTime.Now} {msg}";
|
msg = $"{DateTime.Now} {msg}";
|
||||||
MessageBus.Current.SendMessage(msg, "MsgView");
|
MessageBus.Current.SendMessage(msg, "MsgView");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,7 @@ using v2rayN.Mode;
|
|||||||
|
|
||||||
namespace v2rayN.Handler
|
namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
class ProfileExHandler
|
internal class ProfileExHandler
|
||||||
{
|
{
|
||||||
private static readonly Lazy<ProfileExHandler> _instance = new(() => new());
|
private static readonly Lazy<ProfileExHandler> _instance = new(() => new());
|
||||||
private ConcurrentBag<ProfileExItem> _lstProfileEx;
|
private ConcurrentBag<ProfileExItem> _lstProfileEx;
|
||||||
@@ -132,6 +132,7 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
return profileEx.sort;
|
return profileEx.sort;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetMaxSort()
|
public int GetMaxSort()
|
||||||
{
|
{
|
||||||
if (_lstProfileEx.Count <= 0)
|
if (_lstProfileEx.Count <= 0)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using System.Runtime.InteropServices;
|
|||||||
|
|
||||||
namespace v2rayN.Handler
|
namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
class ProxySetting
|
internal class ProxySetting
|
||||||
{
|
{
|
||||||
public static bool UnsetProxy()
|
public static bool UnsetProxy()
|
||||||
{
|
{
|
||||||
@@ -62,7 +62,6 @@ namespace v2rayN.Handler
|
|||||||
list.dwOptionCount = options.Length;
|
list.dwOptionCount = options.Length;
|
||||||
list.dwOptionError = 0;
|
list.dwOptionError = 0;
|
||||||
|
|
||||||
|
|
||||||
int optSize = Marshal.SizeOf(typeof(InternetConnectionOption));
|
int optSize = Marshal.SizeOf(typeof(InternetConnectionOption));
|
||||||
// make a pointer out of all that ...
|
// make a pointer out of all that ...
|
||||||
IntPtr optionsPtr = Marshal.AllocCoTaskMem(optSize * options.Length);
|
IntPtr optionsPtr = Marshal.AllocCoTaskMem(optSize * options.Length);
|
||||||
@@ -106,8 +105,8 @@ namespace v2rayN.Handler
|
|||||||
return (returnvalue < 0);
|
return (returnvalue < 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#region WinInet structures
|
#region WinInet structures
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
||||||
public struct InternetPerConnOptionList
|
public struct InternetPerConnOptionList
|
||||||
{
|
{
|
||||||
@@ -115,6 +114,7 @@ namespace v2rayN.Handler
|
|||||||
public IntPtr szConnection; // connection name to set/query options
|
public IntPtr szConnection; // connection name to set/query options
|
||||||
public int dwOptionCount; // number of options to set/query
|
public int dwOptionCount; // number of options to set/query
|
||||||
public int dwOptionError; // on error, which option failed
|
public int dwOptionError; // on error, which option failed
|
||||||
|
|
||||||
//[MarshalAs(UnmanagedType.)]
|
//[MarshalAs(UnmanagedType.)]
|
||||||
public IntPtr options;
|
public IntPtr options;
|
||||||
};
|
};
|
||||||
@@ -122,9 +122,10 @@ namespace v2rayN.Handler
|
|||||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
||||||
public struct InternetConnectionOption
|
public struct InternetConnectionOption
|
||||||
{
|
{
|
||||||
static readonly int Size;
|
private static readonly int Size;
|
||||||
public PerConnOption m_Option;
|
public PerConnOption m_Option;
|
||||||
public InternetConnectionOptionValue m_Value;
|
public InternetConnectionOptionValue m_Value;
|
||||||
|
|
||||||
static InternetConnectionOption()
|
static InternetConnectionOption()
|
||||||
{
|
{
|
||||||
Size = Marshal.SizeOf(typeof(InternetConnectionOption));
|
Size = Marshal.SizeOf(typeof(InternetConnectionOption));
|
||||||
@@ -137,15 +138,19 @@ namespace v2rayN.Handler
|
|||||||
// Fields
|
// Fields
|
||||||
[FieldOffset(0)]
|
[FieldOffset(0)]
|
||||||
public System.Runtime.InteropServices.ComTypes.FILETIME m_FileTime;
|
public System.Runtime.InteropServices.ComTypes.FILETIME m_FileTime;
|
||||||
|
|
||||||
[FieldOffset(0)]
|
[FieldOffset(0)]
|
||||||
public int m_Int;
|
public int m_Int;
|
||||||
|
|
||||||
[FieldOffset(0)]
|
[FieldOffset(0)]
|
||||||
public IntPtr m_StringPtr;
|
public IntPtr m_StringPtr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
#endregion WinInet structures
|
||||||
|
|
||||||
#region WinInet enums
|
#region WinInet enums
|
||||||
|
|
||||||
//
|
//
|
||||||
// options manifests for Internet{Query|Set}Option
|
// options manifests for Internet{Query|Set}Option
|
||||||
//
|
//
|
||||||
@@ -163,7 +168,6 @@ namespace v2rayN.Handler
|
|||||||
INTERNET_PER_CONN_PROXY_SERVER = 2, // Sets or retrieves a string containing the proxy servers.
|
INTERNET_PER_CONN_PROXY_SERVER = 2, // Sets or retrieves a string containing the proxy servers.
|
||||||
INTERNET_PER_CONN_PROXY_BYPASS = 3, // Sets or retrieves a string containing the URLs that do not use the proxy server.
|
INTERNET_PER_CONN_PROXY_BYPASS = 3, // Sets or retrieves a string containing the URLs that do not use the proxy server.
|
||||||
INTERNET_PER_CONN_AUTOCONFIG_URL = 4//, // Sets or retrieves a string containing the URL to the automatic configuration script.
|
INTERNET_PER_CONN_AUTOCONFIG_URL = 4//, // Sets or retrieves a string containing the URL to the automatic configuration script.
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -177,7 +181,8 @@ namespace v2rayN.Handler
|
|||||||
PROXY_TYPE_AUTO_PROXY_URL = 0x00000004, // autoproxy URL
|
PROXY_TYPE_AUTO_PROXY_URL = 0x00000004, // autoproxy URL
|
||||||
PROXY_TYPE_AUTO_DETECT = 0x00000008 // use autoproxy detection
|
PROXY_TYPE_AUTO_DETECT = 0x00000008 // use autoproxy detection
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
#endregion WinInet enums
|
||||||
|
|
||||||
internal static class NativeMethods
|
internal static class NativeMethods
|
||||||
{
|
{
|
||||||
@@ -199,13 +204,13 @@ namespace v2rayN.Handler
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//获得代理的IP和端口
|
//获得代理的IP和端口
|
||||||
public static string? GetProxyProxyServer()
|
public static string? GetProxyProxyServer()
|
||||||
{
|
{
|
||||||
using RegistryKey? rk = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", true);
|
using RegistryKey? rk = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", true);
|
||||||
string ProxyServer = rk.GetValue("ProxyServer").ToString();
|
string ProxyServer = rk.GetValue("ProxyServer").ToString();
|
||||||
return ProxyServer;
|
return ProxyServer;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,5 @@ namespace v2rayN.Handler
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,9 +7,8 @@ using v2rayN.Resx;
|
|||||||
|
|
||||||
namespace v2rayN.Handler
|
namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
class ShareHandler
|
internal class ShareHandler
|
||||||
{
|
{
|
||||||
|
|
||||||
#region GetShareUrl
|
#region GetShareUrl
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -49,7 +48,7 @@ namespace v2rayN.Handler
|
|||||||
VmessQRCode vmessQRCode = new()
|
VmessQRCode vmessQRCode = new()
|
||||||
{
|
{
|
||||||
v = item.configVersion.ToString(),
|
v = item.configVersion.ToString(),
|
||||||
ps = item.remarks.TrimEx(), //备注也许很长 ;
|
ps = item.remarks.TrimEx(),
|
||||||
add = item.address,
|
add = item.address,
|
||||||
port = item.port.ToString(),
|
port = item.port.ToString(),
|
||||||
id = item.id,
|
id = item.id,
|
||||||
@@ -162,6 +161,7 @@ namespace v2rayN.Handler
|
|||||||
url = $"{Global.vlessProtocol}{url}{query}{remark}";
|
url = $"{Global.vlessProtocol}{url}{query}{remark}";
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetIpv6(string address)
|
private static string GetIpv6(string address)
|
||||||
{
|
{
|
||||||
return Utils.IsIpv6(address) ? $"[{address}]" : address;
|
return Utils.IsIpv6(address) ? $"[{address}]" : address;
|
||||||
@@ -197,6 +197,18 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
dicQuery.Add("fp", Utils.UrlEncode(item.fingerprint));
|
dicQuery.Add("fp", Utils.UrlEncode(item.fingerprint));
|
||||||
}
|
}
|
||||||
|
if (!Utils.IsNullOrEmpty(item.publicKey))
|
||||||
|
{
|
||||||
|
dicQuery.Add("pbk", Utils.UrlEncode(item.publicKey));
|
||||||
|
}
|
||||||
|
if (!Utils.IsNullOrEmpty(item.shortId))
|
||||||
|
{
|
||||||
|
dicQuery.Add("sid", Utils.UrlEncode(item.shortId));
|
||||||
|
}
|
||||||
|
if (!Utils.IsNullOrEmpty(item.spiderX))
|
||||||
|
{
|
||||||
|
dicQuery.Add("spx", Utils.UrlEncode(item.spiderX));
|
||||||
|
}
|
||||||
|
|
||||||
dicQuery.Add("type", !Utils.IsNullOrEmpty(item.network) ? item.network : "tcp");
|
dicQuery.Add("type", !Utils.IsNullOrEmpty(item.network) ? item.network : "tcp");
|
||||||
|
|
||||||
@@ -209,6 +221,7 @@ namespace v2rayN.Handler
|
|||||||
dicQuery.Add("host", Utils.UrlEncode(item.requestHost));
|
dicQuery.Add("host", Utils.UrlEncode(item.requestHost));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "kcp":
|
case "kcp":
|
||||||
dicQuery.Add("headerType", !Utils.IsNullOrEmpty(item.headerType) ? item.headerType : "none");
|
dicQuery.Add("headerType", !Utils.IsNullOrEmpty(item.headerType) ? item.headerType : "none");
|
||||||
if (!Utils.IsNullOrEmpty(item.path))
|
if (!Utils.IsNullOrEmpty(item.path))
|
||||||
@@ -246,6 +259,7 @@ namespace v2rayN.Handler
|
|||||||
dicQuery.Add("quicSecurity", Utils.UrlEncode(item.requestHost));
|
dicQuery.Add("quicSecurity", Utils.UrlEncode(item.requestHost));
|
||||||
dicQuery.Add("key", Utils.UrlEncode(item.path));
|
dicQuery.Add("key", Utils.UrlEncode(item.path));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "grpc":
|
case "grpc":
|
||||||
if (!Utils.IsNullOrEmpty(item.path))
|
if (!Utils.IsNullOrEmpty(item.path))
|
||||||
{
|
{
|
||||||
@@ -260,11 +274,10 @@ namespace v2rayN.Handler
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion GetShareUrl
|
||||||
|
|
||||||
#region ImportShareUrl
|
#region ImportShareUrl
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 从剪贴板导入URL
|
/// 从剪贴板导入URL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -297,7 +310,6 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
profileItem = ResolveVmess(result, out msg);
|
profileItem = ResolveVmess(result, out msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (result.StartsWith(Global.ssProtocol))
|
else if (result.StartsWith(Global.ssProtocol))
|
||||||
{
|
{
|
||||||
@@ -340,7 +352,6 @@ namespace v2rayN.Handler
|
|||||||
else if (result.StartsWith(Global.vlessProtocol))
|
else if (result.StartsWith(Global.vlessProtocol))
|
||||||
{
|
{
|
||||||
profileItem = ResolveStdVLESS(result);
|
profileItem = ResolveStdVLESS(result);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -475,6 +486,7 @@ namespace v2rayN.Handler
|
|||||||
case "tls":
|
case "tls":
|
||||||
// TODO tls config
|
// TODO tls config
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (!string.IsNullOrWhiteSpace(i.streamSecurity))
|
if (!string.IsNullOrWhiteSpace(i.streamSecurity))
|
||||||
return null;
|
return null;
|
||||||
@@ -490,6 +502,7 @@ namespace v2rayN.Handler
|
|||||||
// TODO http option
|
// TODO http option
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "kcp":
|
case "kcp":
|
||||||
i.headerType = q["type"] ?? "none";
|
i.headerType = q["type"] ?? "none";
|
||||||
// TODO kcp seed
|
// TODO kcp seed
|
||||||
@@ -624,7 +637,6 @@ namespace v2rayN.Handler
|
|||||||
return server;
|
return server;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static readonly Regex StdVmessUserInfo = new(
|
private static readonly Regex StdVmessUserInfo = new(
|
||||||
@"^(?<network>[a-z]+)(\+(?<streamSecurity>[a-z]+))?:(?<id>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$", RegexOptions.Compiled);
|
@"^(?<network>[a-z]+)(\+(?<streamSecurity>[a-z]+))?:(?<id>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$", RegexOptions.Compiled);
|
||||||
|
|
||||||
@@ -726,6 +738,7 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ProfileItem ResolveStdVLESS(string result)
|
private static ProfileItem ResolveStdVLESS(string result)
|
||||||
{
|
{
|
||||||
ProfileItem item = new()
|
ProfileItem item = new()
|
||||||
@@ -756,6 +769,10 @@ namespace v2rayN.Handler
|
|||||||
item.sni = query["sni"] ?? "";
|
item.sni = query["sni"] ?? "";
|
||||||
item.alpn = Utils.UrlDecode(query["alpn"] ?? "");
|
item.alpn = Utils.UrlDecode(query["alpn"] ?? "");
|
||||||
item.fingerprint = Utils.UrlDecode(query["fp"] ?? "");
|
item.fingerprint = Utils.UrlDecode(query["fp"] ?? "");
|
||||||
|
item.publicKey = Utils.UrlDecode(query["pbk"] ?? "");
|
||||||
|
item.shortId = Utils.UrlDecode(query["sid"] ?? "");
|
||||||
|
item.spiderX = Utils.UrlDecode(query["spx"] ?? "");
|
||||||
|
|
||||||
item.network = query["type"] ?? "tcp";
|
item.network = query["type"] ?? "tcp";
|
||||||
switch (item.network)
|
switch (item.network)
|
||||||
{
|
{
|
||||||
@@ -764,6 +781,7 @@ namespace v2rayN.Handler
|
|||||||
item.requestHost = Utils.UrlDecode(query["host"] ?? "");
|
item.requestHost = Utils.UrlDecode(query["host"] ?? "");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "kcp":
|
case "kcp":
|
||||||
item.headerType = query["headerType"] ?? "none";
|
item.headerType = query["headerType"] ?? "none";
|
||||||
item.path = Utils.UrlDecode(query["seed"] ?? "");
|
item.path = Utils.UrlDecode(query["seed"] ?? "");
|
||||||
@@ -786,16 +804,18 @@ namespace v2rayN.Handler
|
|||||||
item.requestHost = query["quicSecurity"] ?? "none";
|
item.requestHost = query["quicSecurity"] ?? "none";
|
||||||
item.path = Utils.UrlDecode(query["key"] ?? "");
|
item.path = Utils.UrlDecode(query["key"] ?? "");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "grpc":
|
case "grpc":
|
||||||
item.path = Utils.UrlDecode(query["serviceName"] ?? "");
|
item.path = Utils.UrlDecode(query["serviceName"] ?? "");
|
||||||
item.headerType = Utils.UrlDecode(query["mode"] ?? Global.GrpcgunMode);
|
item.headerType = Utils.UrlDecode(query["mode"] ?? Global.GrpcgunMode);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion ImportShareUrl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,13 +7,13 @@ using v2rayN.Resx;
|
|||||||
|
|
||||||
namespace v2rayN.Handler
|
namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
class SpeedtestHandler
|
internal class SpeedtestHandler
|
||||||
{
|
{
|
||||||
private Config _config;
|
private Config _config;
|
||||||
private CoreHandler _coreHandler;
|
private CoreHandler _coreHandler;
|
||||||
private List<ServerTestItem> _selecteds;
|
private List<ServerTestItem> _selecteds;
|
||||||
private ESpeedActionType _actionType;
|
private ESpeedActionType _actionType;
|
||||||
Action<string, string, string> _updateFunc;
|
private Action<string, string, string> _updateFunc;
|
||||||
|
|
||||||
public SpeedtestHandler(Config config)
|
public SpeedtestHandler(Config config)
|
||||||
{
|
{
|
||||||
@@ -57,12 +57,14 @@ namespace v2rayN.Handler
|
|||||||
UpdateFunc(it.indexId, ResUI.Speedtesting, "");
|
UpdateFunc(it.indexId, ResUI.Speedtesting, "");
|
||||||
ProfileExHandler.Instance.SetTestDelay(it.indexId, "0");
|
ProfileExHandler.Instance.SetTestDelay(it.indexId, "0");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ESpeedActionType.Speedtest:
|
case ESpeedActionType.Speedtest:
|
||||||
UpdateFunc(it.indexId, "", ResUI.Speedtesting);
|
UpdateFunc(it.indexId, "", ResUI.SpeedtestingWait);
|
||||||
ProfileExHandler.Instance.SetTestSpeed(it.indexId, "0");
|
ProfileExHandler.Instance.SetTestSpeed(it.indexId, "0");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ESpeedActionType.Mixedtest:
|
case ESpeedActionType.Mixedtest:
|
||||||
UpdateFunc(it.indexId, ResUI.Speedtesting, ResUI.Speedtesting);
|
UpdateFunc(it.indexId, ResUI.Speedtesting, ResUI.SpeedtestingWait);
|
||||||
ProfileExHandler.Instance.SetTestDelay(it.indexId, "0");
|
ProfileExHandler.Instance.SetTestDelay(it.indexId, "0");
|
||||||
ProfileExHandler.Instance.SetTestSpeed(it.indexId, "0");
|
ProfileExHandler.Instance.SetTestSpeed(it.indexId, "0");
|
||||||
break;
|
break;
|
||||||
@@ -74,15 +76,19 @@ namespace v2rayN.Handler
|
|||||||
case ESpeedActionType.Ping:
|
case ESpeedActionType.Ping:
|
||||||
Task.Run(RunPing);
|
Task.Run(RunPing);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ESpeedActionType.Tcping:
|
case ESpeedActionType.Tcping:
|
||||||
Task.Run(RunTcping);
|
Task.Run(RunTcping);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ESpeedActionType.Realping:
|
case ESpeedActionType.Realping:
|
||||||
Task.Run(RunRealPing);
|
Task.Run(RunRealPing);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ESpeedActionType.Speedtest:
|
case ESpeedActionType.Speedtest:
|
||||||
Task.Run(RunSpeedTestAsync);
|
Task.Run(RunSpeedTestAsync);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ESpeedActionType.Mixedtest:
|
case ESpeedActionType.Mixedtest:
|
||||||
Task.Run(RunMixedtestAsync);
|
Task.Run(RunMixedtestAsync);
|
||||||
break;
|
break;
|
||||||
@@ -113,7 +119,6 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void RunPing()
|
private void RunPing()
|
||||||
{
|
{
|
||||||
RunPingSub((ServerTestItem it) =>
|
RunPingSub((ServerTestItem it) =>
|
||||||
@@ -169,7 +174,6 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
WebProxy webProxy = new(Global.Loopback, it.port);
|
WebProxy webProxy = new(Global.Loopback, it.port);
|
||||||
string output = GetRealPingTime(downloadHandle, webProxy);
|
string output = GetRealPingTime(downloadHandle, webProxy);
|
||||||
|
|
||||||
@@ -236,13 +240,14 @@ namespace v2rayN.Handler
|
|||||||
// continue;
|
// continue;
|
||||||
//}
|
//}
|
||||||
ProfileExHandler.Instance.SetTestSpeed(it.indexId, "-1");
|
ProfileExHandler.Instance.SetTestSpeed(it.indexId, "-1");
|
||||||
|
UpdateFunc(it.indexId, "", ResUI.Speedtesting);
|
||||||
|
|
||||||
var item = LazyConfig.Instance.GetProfileItem(it.indexId);
|
var item = LazyConfig.Instance.GetProfileItem(it.indexId);
|
||||||
if (item is null) continue;
|
if (item is null) continue;
|
||||||
|
|
||||||
WebProxy webProxy = new(Global.Loopback, it.port);
|
WebProxy webProxy = new(Global.Loopback, it.port);
|
||||||
|
|
||||||
await downloadHandle.DownloadDataAsync(url, webProxy, timeout, async (bool success, string msg) =>
|
await downloadHandle.DownloadDataAsync(url, webProxy, timeout, (bool success, string msg) =>
|
||||||
{
|
{
|
||||||
decimal.TryParse(msg, out decimal dec);
|
decimal.TryParse(msg, out decimal dec);
|
||||||
if (dec > 0)
|
if (dec > 0)
|
||||||
@@ -286,13 +291,19 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (it.delay < 0)
|
||||||
|
{
|
||||||
|
UpdateFunc(it.indexId, "", ResUI.SpeedtestingSkip);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
ProfileExHandler.Instance.SetTestSpeed(it.indexId, "-1");
|
ProfileExHandler.Instance.SetTestSpeed(it.indexId, "-1");
|
||||||
|
UpdateFunc(it.indexId, "", ResUI.Speedtesting);
|
||||||
|
|
||||||
var item = LazyConfig.Instance.GetProfileItem(it.indexId);
|
var item = LazyConfig.Instance.GetProfileItem(it.indexId);
|
||||||
if (item is null) continue;
|
if (item is null) continue;
|
||||||
|
|
||||||
WebProxy webProxy = new(Global.Loopback, it.port);
|
WebProxy webProxy = new(Global.Loopback, it.port);
|
||||||
_ = downloadHandle.DownloadDataAsync(url, webProxy, timeout, async (bool success, string msg) =>
|
_ = downloadHandle.DownloadDataAsync(url, webProxy, timeout, (bool success, string msg) =>
|
||||||
{
|
{
|
||||||
decimal.TryParse(msg, out decimal dec);
|
decimal.TryParse(msg, out decimal dec);
|
||||||
if (dec > 0)
|
if (dec > 0)
|
||||||
@@ -363,7 +374,6 @@ namespace v2rayN.Handler
|
|||||||
return responseTime;
|
return responseTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ping
|
/// Ping
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Grpc.Core;
|
using Grpc.Core;
|
||||||
|
using Grpc.Net.Client;
|
||||||
using ProtosLib.Statistics;
|
using ProtosLib.Statistics;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
@@ -7,17 +8,17 @@ using v2rayN.Mode;
|
|||||||
|
|
||||||
namespace v2rayN.Handler
|
namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
class StatisticsHandler
|
internal class StatisticsHandler
|
||||||
{
|
{
|
||||||
private Mode.Config config_;
|
private Mode.Config config_;
|
||||||
private Channel channel_;
|
private GrpcChannel _channel;
|
||||||
private StatsService.StatsServiceClient client_;
|
private StatsService.StatsServiceClient _client;
|
||||||
private bool exitFlag_;
|
private bool _exitFlag;
|
||||||
private ServerStatItem? _serverStatItem;
|
private ServerStatItem? _serverStatItem;
|
||||||
private List<ServerStatItem> _lstServerStat;
|
private List<ServerStatItem> _lstServerStat;
|
||||||
public List<ServerStatItem> ServerStat => _lstServerStat;
|
public List<ServerStatItem> ServerStat => _lstServerStat;
|
||||||
|
|
||||||
Action<ServerSpeedItem> updateFunc_;
|
private Action<ServerSpeedItem> _updateFunc;
|
||||||
|
|
||||||
public bool Enable
|
public bool Enable
|
||||||
{
|
{
|
||||||
@@ -28,8 +29,8 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
config_ = config;
|
config_ = config;
|
||||||
Enable = config.guiItem.enableStatistics;
|
Enable = config.guiItem.enableStatistics;
|
||||||
updateFunc_ = update;
|
_updateFunc = update;
|
||||||
exitFlag_ = false;
|
_exitFlag = false;
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
GrpcInit();
|
GrpcInit();
|
||||||
@@ -39,13 +40,12 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
private void GrpcInit()
|
private void GrpcInit()
|
||||||
{
|
{
|
||||||
if (channel_ == null)
|
if (_channel == null)
|
||||||
{
|
{
|
||||||
Global.statePort = GetFreePort();
|
Global.statePort = GetFreePort();
|
||||||
|
|
||||||
channel_ = new Channel($"{Global.Loopback}:{Global.statePort}", ChannelCredentials.Insecure);
|
_channel = GrpcChannel.ForAddress($"{Global.httpProtocol}{Global.Loopback}:{Global.statePort}");
|
||||||
channel_.ConnectAsync();
|
_client = new StatsService.StatsServiceClient(_channel);
|
||||||
client_ = new StatsService.StatsServiceClient(channel_);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,8 +53,8 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
exitFlag_ = true;
|
_exitFlag = true;
|
||||||
channel_.ShutdownAsync();
|
//channel_.ShutdownAsync();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -62,18 +62,18 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Run()
|
public async void Run()
|
||||||
{
|
{
|
||||||
while (!exitFlag_)
|
while (!_exitFlag)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Enable && channel_.State == ChannelState.Ready)
|
if (Enable && _channel.State == ConnectivityState.Ready)
|
||||||
{
|
{
|
||||||
QueryStatsResponse? res = null;
|
QueryStatsResponse? res = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
res = client_.QueryStats(new QueryStatsRequest() { Pattern = "", Reset = true });
|
res = await _client.QueryStatsAsync(new QueryStatsRequest() { Pattern = "", Reset = true });
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -99,13 +99,13 @@ namespace v2rayN.Handler
|
|||||||
server.todayDown = _serverStatItem.todayDown;
|
server.todayDown = _serverStatItem.todayDown;
|
||||||
server.totalUp = _serverStatItem.totalUp;
|
server.totalUp = _serverStatItem.totalUp;
|
||||||
server.totalDown = _serverStatItem.totalDown;
|
server.totalDown = _serverStatItem.totalDown;
|
||||||
updateFunc_(server);
|
_updateFunc(server);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var sleep = config_.guiItem.statisticsFreshRate < 1 ? 1 : config_.guiItem.statisticsFreshRate;
|
var sleep = config_.guiItem.statisticsFreshRate < 1 ? 1 : config_.guiItem.statisticsFreshRate;
|
||||||
Thread.Sleep(1000 * sleep);
|
Thread.Sleep(1000 * sleep);
|
||||||
channel_.ConnectAsync();
|
await _channel.ConnectAsync();
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -134,6 +134,8 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
private void Init()
|
private void Init()
|
||||||
{
|
{
|
||||||
|
SqliteHelper.Instance.Execute($"delete from ServerStatItem where indexId not in ( select indexId from ProfileItem )");
|
||||||
|
|
||||||
long ticks = DateTime.Now.Date.Ticks;
|
long ticks = DateTime.Now.Date.Ticks;
|
||||||
SqliteHelper.Instance.Execute($"update ServerStatItem set todayUp = 0,todayDown=0,dateNow={ticks} where dateNow<>{ticks}");
|
SqliteHelper.Instance.Execute($"update ServerStatItem set todayUp = 0,todayDown=0,dateNow={ticks} where dateNow<>{ticks}");
|
||||||
|
|
||||||
@@ -180,7 +182,6 @@ namespace v2rayN.Handler
|
|||||||
server = new();
|
server = new();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach (Stat stat in source)
|
foreach (Stat stat in source)
|
||||||
{
|
{
|
||||||
string name = stat.Name;
|
string name = stat.Name;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace v2rayN.Handler
|
|||||||
// <pac-url>
|
// <pac-url>
|
||||||
private static SysproxyConfig? _userSettings = null;
|
private static SysproxyConfig? _userSettings = null;
|
||||||
|
|
||||||
enum RET_ERRORS : int
|
private enum RET_ERRORS : int
|
||||||
{
|
{
|
||||||
RET_NO_ERROR = 0,
|
RET_NO_ERROR = 0,
|
||||||
INVALID_FORMAT = 1,
|
INVALID_FORMAT = 1,
|
||||||
@@ -45,7 +45,6 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static bool UpdateSysProxy(Config config, bool forceDisable)
|
public static bool UpdateSysProxy(Config config, bool forceDisable)
|
||||||
{
|
{
|
||||||
var type = config.sysProxyType;
|
var type = config.sysProxyType;
|
||||||
@@ -120,7 +119,6 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void SetIEProxy(bool global, string strProxy, string strExceptions)
|
public static void SetIEProxy(bool global, string strProxy, string strExceptions)
|
||||||
{
|
{
|
||||||
string arguments = global
|
string arguments = global
|
||||||
@@ -209,7 +207,6 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
catch (System.ComponentModel.Win32Exception e)
|
catch (System.ComponentModel.Win32Exception e)
|
||||||
{
|
{
|
||||||
|
|
||||||
// log the arguments
|
// log the arguments
|
||||||
throw new Exception(process.StartInfo.Arguments);
|
throw new Exception(process.StartInfo.Arguments);
|
||||||
}
|
}
|
||||||
@@ -231,7 +228,5 @@ namespace v2rayN.Handler
|
|||||||
// _queryStr = stdout;
|
// _queryStr = stdout;
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -204,7 +204,6 @@ namespace v2rayN.Base
|
|||||||
configStr = configStr.Replace("$ruleProxyProcess$", "");
|
configStr = configStr.Replace("$ruleProxyProcess$", "");
|
||||||
configStr = configStr.Replace("$ruleFinally$", "");
|
configStr = configStr.Replace("$ruleFinally$", "");
|
||||||
|
|
||||||
|
|
||||||
File.WriteAllText(Utils.GetConfigPath(_tunConfigName), configStr);
|
File.WriteAllText(Utils.GetConfigPath(_tunConfigName), configStr);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
using Splat;
|
using DynamicData;
|
||||||
|
using Splat;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Windows.Forms;
|
using System.Windows;
|
||||||
using v2rayN.Base;
|
using v2rayN.Base;
|
||||||
using v2rayN.Mode;
|
using v2rayN.Mode;
|
||||||
using v2rayN.Resx;
|
using v2rayN.Resx;
|
||||||
|
|
||||||
namespace v2rayN.Handler
|
namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
class UpdateHandle
|
internal class UpdateHandle
|
||||||
{
|
{
|
||||||
Action<bool, string> _updateFunc;
|
private Action<bool, string> _updateFunc;
|
||||||
private Config _config;
|
private Config _config;
|
||||||
|
|
||||||
public event EventHandler<ResultEventArgs> AbsoluteCompleted;
|
public event EventHandler<ResultEventArgs> AbsoluteCompleted;
|
||||||
@@ -94,7 +96,6 @@ namespace v2rayN.Handler
|
|||||||
CheckUpdateAsync(ECoreType.v2rayN, preRelease);
|
CheckUpdateAsync(ECoreType.v2rayN, preRelease);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void CheckUpdateCore(ECoreType type, Config config, Action<bool, string> update, bool preRelease)
|
public void CheckUpdateCore(ECoreType type, Config config, Action<bool, string> update, bool preRelease)
|
||||||
{
|
{
|
||||||
_config = config;
|
_config = config;
|
||||||
@@ -146,7 +147,6 @@ namespace v2rayN.Handler
|
|||||||
CheckUpdateAsync(type, preRelease);
|
CheckUpdateAsync(type, preRelease);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void UpdateSubscriptionProcess(Config config, string subId, bool blProxy, Action<bool, string> update)
|
public void UpdateSubscriptionProcess(Config config, string subId, bool blProxy, Action<bool, string> update)
|
||||||
{
|
{
|
||||||
_config = config;
|
_config = config;
|
||||||
@@ -163,36 +163,22 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
//Turn off system proxy
|
|
||||||
//bool bSysProxyType = false;
|
|
||||||
//if (!blProxy && config.sysProxyType == ESysProxyType.ForcedChange)
|
|
||||||
//{
|
|
||||||
// bSysProxyType = true;
|
|
||||||
// config.sysProxyType = ESysProxyType.ForcedClear;
|
|
||||||
// SysProxyHandle.UpdateSysProxy(config, false);
|
|
||||||
// Thread.Sleep(3000);
|
|
||||||
//}
|
|
||||||
|
|
||||||
foreach (var item in subItem)
|
foreach (var item in subItem)
|
||||||
{
|
{
|
||||||
if (item.enabled == false)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!Utils.IsNullOrEmpty(subId) && item.id != subId)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
string id = item.id.TrimEx();
|
string id = item.id.TrimEx();
|
||||||
string url = item.url.TrimEx();
|
string url = item.url.TrimEx();
|
||||||
string userAgent = item.userAgent.TrimEx();
|
string userAgent = item.userAgent.TrimEx();
|
||||||
string hashCode = $"{item.remarks}->";
|
string hashCode = $"{item.remarks}->";
|
||||||
if (Utils.IsNullOrEmpty(id) || Utils.IsNullOrEmpty(url))
|
if (Utils.IsNullOrEmpty(id) || Utils.IsNullOrEmpty(url) || (!Utils.IsNullOrEmpty(subId) && item.id != subId))
|
||||||
{
|
{
|
||||||
//_updateFunc(false, $"{hashCode}{ResUI.MsgNoValidSubscription}");
|
//_updateFunc(false, $"{hashCode}{ResUI.MsgNoValidSubscription}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (item.enabled == false)
|
||||||
|
{
|
||||||
|
_updateFunc(false, $"{hashCode}{ResUI.MsgSkipSubscriptionUpdate}");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
var downloadHandle = new DownloadHandle();
|
var downloadHandle = new DownloadHandle();
|
||||||
downloadHandle.Error += (sender2, args) =>
|
downloadHandle.Error += (sender2, args) =>
|
||||||
@@ -200,16 +186,69 @@ namespace v2rayN.Handler
|
|||||||
_updateFunc(false, $"{hashCode}{args.GetException().Message}");
|
_updateFunc(false, $"{hashCode}{args.GetException().Message}");
|
||||||
};
|
};
|
||||||
|
|
||||||
//idn to idc
|
|
||||||
url = Utils.GetPunycode(url);
|
|
||||||
|
|
||||||
_updateFunc(false, $"{hashCode}{ResUI.MsgStartGettingSubscriptions}");
|
_updateFunc(false, $"{hashCode}{ResUI.MsgStartGettingSubscriptions}");
|
||||||
|
|
||||||
|
//one url
|
||||||
|
url = Utils.GetPunycode(url);
|
||||||
|
//convert
|
||||||
|
if (!Utils.IsNullOrEmpty(item.convertTarget))
|
||||||
|
{
|
||||||
|
var subConvertUrl = string.IsNullOrEmpty(config.constItem.subConvertUrl) ? Global.SubConvertUrls.FirstOrDefault() : config.constItem.subConvertUrl;
|
||||||
|
url = string.Format(subConvertUrl!, Utils.UrlEncode(url));
|
||||||
|
if (!url.Contains("target="))
|
||||||
|
{
|
||||||
|
url += string.Format("&target={0}", item.convertTarget);
|
||||||
|
}
|
||||||
|
if (!url.Contains("config="))
|
||||||
|
{
|
||||||
|
url += string.Format("&config={0}", Global.SubConvertConfig.FirstOrDefault());
|
||||||
|
}
|
||||||
|
}
|
||||||
var result = await downloadHandle.TryDownloadString(url, blProxy, userAgent);
|
var result = await downloadHandle.TryDownloadString(url, blProxy, userAgent);
|
||||||
if (blProxy && Utils.IsNullOrEmpty(result))
|
if (blProxy && Utils.IsNullOrEmpty(result))
|
||||||
{
|
{
|
||||||
result = await downloadHandle.TryDownloadString(url, false, userAgent);
|
result = await downloadHandle.TryDownloadString(url, false, userAgent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//more url
|
||||||
|
if (Utils.IsNullOrEmpty(item.convertTarget) && !Utils.IsNullOrEmpty(item.moreUrl.TrimEx()))
|
||||||
|
{
|
||||||
|
if (!Utils.IsNullOrEmpty(result) && Utils.IsBase64String(result))
|
||||||
|
{
|
||||||
|
result = Utils.Base64Decode(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
var lstUrl = new List<string>
|
||||||
|
{
|
||||||
|
item.moreUrl.TrimEx().Split(",")
|
||||||
|
};
|
||||||
|
foreach (var it in lstUrl)
|
||||||
|
{
|
||||||
|
var url2 = Utils.GetPunycode(it);
|
||||||
|
if (Utils.IsNullOrEmpty(url2))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var result2 = await downloadHandle.TryDownloadString(url2, blProxy, userAgent);
|
||||||
|
if (blProxy && Utils.IsNullOrEmpty(result2))
|
||||||
|
{
|
||||||
|
result2 = await downloadHandle.TryDownloadString(url2, false, userAgent);
|
||||||
|
}
|
||||||
|
if (!Utils.IsNullOrEmpty(result2))
|
||||||
|
{
|
||||||
|
if (Utils.IsBase64String(result2))
|
||||||
|
{
|
||||||
|
result += Utils.Base64Decode(result2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result += result2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Utils.IsNullOrEmpty(result))
|
if (Utils.IsNullOrEmpty(result))
|
||||||
{
|
{
|
||||||
_updateFunc(false, $"{hashCode}{ResUI.MsgSubscriptionDecodingFailed}");
|
_updateFunc(false, $"{hashCode}{ResUI.MsgSubscriptionDecodingFailed}");
|
||||||
@@ -235,18 +274,11 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
_updateFunc(false, "-------------------------------------------------------");
|
_updateFunc(false, "-------------------------------------------------------");
|
||||||
}
|
}
|
||||||
////restore system proxy
|
|
||||||
//if (bSysProxyType)
|
|
||||||
//{
|
|
||||||
// config.sysProxyType = ESysProxyType.ForcedChange;
|
|
||||||
// SysProxyHandle.UpdateSysProxy(config, false);
|
|
||||||
//}
|
|
||||||
_updateFunc(true, $"{ResUI.MsgUpdateSubscriptionEnd}");
|
|
||||||
|
|
||||||
|
_updateFunc(true, $"{ResUI.MsgUpdateSubscriptionEnd}");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void UpdateGeoFile(string geoName, Config config, Action<bool, string> update)
|
public void UpdateGeoFile(string geoName, Config config, Action<bool, string> update)
|
||||||
{
|
{
|
||||||
_config = config;
|
_config = config;
|
||||||
@@ -292,7 +324,6 @@ namespace v2rayN.Handler
|
|||||||
_updateFunc(false, args.GetException().Message);
|
_updateFunc(false, args.GetException().Message);
|
||||||
};
|
};
|
||||||
askToDownload(downloadHandle, url, false);
|
askToDownload(downloadHandle, url, false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RunAvailabilityCheck(Action<bool, string> update)
|
public void RunAvailabilityCheck(Action<bool, string> update)
|
||||||
@@ -339,7 +370,6 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
var coreInfo = LazyConfig.Instance.GetCoreInfo(type);
|
var coreInfo = LazyConfig.Instance.GetCoreInfo(type);
|
||||||
string filePath = string.Empty;
|
string filePath = string.Empty;
|
||||||
foreach (string name in coreInfo.coreExes)
|
foreach (string name in coreInfo.coreExes)
|
||||||
@@ -380,10 +410,15 @@ namespace v2rayN.Handler
|
|||||||
case ECoreType.v2fly_v5:
|
case ECoreType.v2fly_v5:
|
||||||
version = Regex.Match(echo, $"{coreInfo.match} ([0-9.]+) \\(").Groups[1].Value;
|
version = Regex.Match(echo, $"{coreInfo.match} ([0-9.]+) \\(").Groups[1].Value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ECoreType.clash:
|
case ECoreType.clash:
|
||||||
case ECoreType.clash_meta:
|
case ECoreType.clash_meta:
|
||||||
version = Regex.Match(echo, $"v[0-9.]+").Groups[0].Value;
|
version = Regex.Match(echo, $"v[0-9.]+").Groups[0].Value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ECoreType.sing_box:
|
||||||
|
version = Regex.Match(echo, $"([0-9.]+)").Groups[1].Value;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
@@ -394,6 +429,7 @@ namespace v2rayN.Handler
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void responseHandler(ECoreType type, string gitHubReleaseApi, bool preRelease)
|
private void responseHandler(ECoreType type, string gitHubReleaseApi, bool preRelease)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -422,7 +458,22 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
curVersion = "v" + getCoreVersion(type);
|
curVersion = "v" + getCoreVersion(type);
|
||||||
message = string.Format(ResUI.IsLatestCore, curVersion);
|
message = string.Format(ResUI.IsLatestCore, curVersion);
|
||||||
string osBit = Environment.Is64BitProcess ? "64" : "32";
|
string osBit = "64";
|
||||||
|
switch (RuntimeInformation.ProcessArchitecture)
|
||||||
|
{
|
||||||
|
case Architecture.Arm64:
|
||||||
|
osBit = "arm64-v8a";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Architecture.X86:
|
||||||
|
osBit = "32";
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
osBit = "64";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
url = string.Format(coreInfo.coreDownloadUrl64, version, osBit);
|
url = string.Format(coreInfo.coreDownloadUrl64, version, osBit);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -431,23 +482,64 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
curVersion = getCoreVersion(type);
|
curVersion = getCoreVersion(type);
|
||||||
message = string.Format(ResUI.IsLatestCore, curVersion);
|
message = string.Format(ResUI.IsLatestCore, curVersion);
|
||||||
if (Environment.Is64BitProcess)
|
switch (RuntimeInformation.ProcessArchitecture)
|
||||||
{
|
{
|
||||||
url = string.Format(coreInfo.coreDownloadUrl64, version);
|
case Architecture.Arm64:
|
||||||
|
url = coreInfo.coreDownloadUrlArm64;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Architecture.X86:
|
||||||
|
url = coreInfo.coreDownloadUrl32;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
url = coreInfo.coreDownloadUrl64;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
url = string.Format(url, version);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ECoreType.sing_box:
|
||||||
{
|
{
|
||||||
url = string.Format(coreInfo.coreDownloadUrl32, version);
|
curVersion = "v" + getCoreVersion(type);
|
||||||
|
message = string.Format(ResUI.IsLatestCore, curVersion);
|
||||||
|
switch (RuntimeInformation.ProcessArchitecture)
|
||||||
|
{
|
||||||
|
case Architecture.Arm64:
|
||||||
|
url = coreInfo.coreDownloadUrlArm64;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Architecture.X86:
|
||||||
|
url = coreInfo.coreDownloadUrl32;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
url = coreInfo.coreDownloadUrl64;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
url = string.Format(url, version, version.Replace("v", ""));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ECoreType.v2rayN:
|
case ECoreType.v2rayN:
|
||||||
{
|
{
|
||||||
curVersion = FileVersionInfo.GetVersionInfo(Utils.GetExePath()).FileVersion.ToString();
|
curVersion = FileVersionInfo.GetVersionInfo(Utils.GetExePath()).FileVersion.ToString();
|
||||||
message = string.Format(ResUI.IsLatestN, curVersion);
|
message = string.Format(ResUI.IsLatestN, curVersion);
|
||||||
|
switch (RuntimeInformation.ProcessArchitecture)
|
||||||
|
{
|
||||||
|
case Architecture.Arm64:
|
||||||
|
url = string.Format(coreInfo.coreDownloadUrlArm64, version);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Architecture.X86:
|
||||||
|
url = string.Format(coreInfo.coreDownloadUrl32, version);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
url = string.Format(coreInfo.coreDownloadUrl64, version);
|
url = string.Format(coreInfo.coreDownloadUrl64, version);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
throw new ArgumentException("Type");
|
throw new ArgumentException("Type");
|
||||||
}
|
}
|
||||||
@@ -483,7 +575,7 @@ namespace v2rayN.Handler
|
|||||||
bool blDownload = false;
|
bool blDownload = false;
|
||||||
if (blAsk)
|
if (blAsk)
|
||||||
{
|
{
|
||||||
if (UI.ShowYesNo(string.Format(ResUI.DownloadYesNo, url)) == DialogResult.Yes)
|
if (UI.ShowYesNo(string.Format(ResUI.DownloadYesNo, url)) == MessageBoxResult.Yes)
|
||||||
{
|
{
|
||||||
blDownload = true;
|
blDownload = true;
|
||||||
}
|
}
|
||||||
@@ -497,6 +589,7 @@ namespace v2rayN.Handler
|
|||||||
downloadHandle.DownloadFileAsync(url, true, 600);
|
downloadHandle.DownloadFileAsync(url, true, 600);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
#endregion private
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Text
|
public string Text
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
public string subIndexId { get; set; }
|
public string subIndexId { get; set; }
|
||||||
|
|
||||||
public string remoteDNS { get; set; }
|
public string remoteDNS { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Outbound Freedom domainStrategy
|
/// Outbound Freedom domainStrategy
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -21,7 +22,7 @@
|
|||||||
public string systemProxyExceptions { get; set; }
|
public string systemProxyExceptions { get; set; }
|
||||||
public string systemProxyAdvancedProtocol { get; set; }
|
public string systemProxyAdvancedProtocol { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion property
|
||||||
|
|
||||||
#region other entities
|
#region other entities
|
||||||
|
|
||||||
@@ -38,7 +39,6 @@
|
|||||||
public List<KeyEventItem> globalHotkeys { get; set; }
|
public List<KeyEventItem> globalHotkeys { get; set; }
|
||||||
public List<CoreTypeItem> coreTypeItem { get; set; }
|
public List<CoreTypeItem> coreTypeItem { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion other entities
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace v2rayN.Mode
|
namespace v2rayN.Mode
|
||||||
{
|
{
|
||||||
@@ -52,7 +52,6 @@ namespace v2rayN.Mode
|
|||||||
public string user { get; set; }
|
public string user { get; set; }
|
||||||
|
|
||||||
public string pass { get; set; }
|
public string pass { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
@@ -97,13 +96,15 @@ namespace v2rayN.Mode
|
|||||||
|
|
||||||
public int autoUpdateInterval { get; set; } = 10;
|
public int autoUpdateInterval { get; set; } = 10;
|
||||||
|
|
||||||
public int autoUpdateSubInterval { get; set; } = 10;
|
|
||||||
|
|
||||||
public bool checkPreReleaseUpdate { get; set; } = false;
|
public bool checkPreReleaseUpdate { get; set; } = false;
|
||||||
|
|
||||||
public bool enableSecurityProtocolTls13 { get; set; }
|
public bool enableSecurityProtocolTls13 { get; set; }
|
||||||
|
|
||||||
public int trayMenuServersLimit { get; set; } = 20;
|
public int trayMenuServersLimit { get; set; } = 20;
|
||||||
|
|
||||||
|
public bool enableHWA { get; set; } = false;
|
||||||
|
|
||||||
|
public bool enableLog { get; set; } = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
@@ -123,14 +124,15 @@ namespace v2rayN.Mode
|
|||||||
public bool doubleClick2Activate { get; set; }
|
public bool doubleClick2Activate { get; set; }
|
||||||
public bool autoHideStartup { get; set; } = true;
|
public bool autoHideStartup { get; set; } = true;
|
||||||
public string mainMsgFilter { get; set; }
|
public string mainMsgFilter { get; set; }
|
||||||
|
public bool showTrayTip { get; set; }
|
||||||
public List<ColumnItem> mainColumnItem { get; set; }
|
public List<ColumnItem> mainColumnItem { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ConstItem
|
public class ConstItem
|
||||||
{
|
{
|
||||||
public string defIEProxyExceptions { get; set; }
|
public string defIEProxyExceptions { get; set; }
|
||||||
|
public string subConvertUrl { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
@@ -144,8 +146,7 @@ namespace v2rayN.Mode
|
|||||||
|
|
||||||
public bool Shift { get; set; }
|
public bool Shift { get; set; }
|
||||||
|
|
||||||
public Keys? KeyCode { get; set; }
|
public Key? KeyCode { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
@@ -173,7 +174,6 @@ namespace v2rayN.Mode
|
|||||||
public List<string> proxyIP { get; set; }
|
public List<string> proxyIP { get; set; }
|
||||||
public List<string> proxyProcess { get; set; }
|
public List<string> proxyProcess { get; set; }
|
||||||
public string proxyDNS { get; set; }
|
public string proxyDNS { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
@@ -182,7 +182,6 @@ namespace v2rayN.Mode
|
|||||||
public int speedTestTimeout { get; set; }
|
public int speedTestTimeout { get; set; }
|
||||||
public string speedTestUrl { get; set; }
|
public string speedTestUrl { get; set; }
|
||||||
public string speedPingTestUrl { get; set; }
|
public string speedPingTestUrl { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
@@ -192,6 +191,7 @@ namespace v2rayN.Mode
|
|||||||
/// 域名解析策略
|
/// 域名解析策略
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string domainStrategy { get; set; }
|
public string domainStrategy { get; set; }
|
||||||
|
|
||||||
public string domainMatcher { get; set; }
|
public string domainMatcher { get; set; }
|
||||||
public string routingIndexId { get; set; }
|
public string routingIndexId { get; set; }
|
||||||
public bool enableRoutingAdvanced { get; set; }
|
public bool enableRoutingAdvanced { get; set; }
|
||||||
|
|||||||
@@ -97,14 +97,17 @@
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string domainMatcher
|
public string domainMatcher
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int routingIndex
|
public int routingIndex
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool enableRoutingAdvanced
|
public bool enableRoutingAdvanced
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
@@ -122,6 +125,7 @@
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string systemProxyAdvancedProtocol { get; set; }
|
public string systemProxyAdvancedProtocol { get; set; }
|
||||||
|
|
||||||
public int autoUpdateInterval { get; set; } = 0;
|
public int autoUpdateInterval { get; set; } = 0;
|
||||||
@@ -137,7 +141,7 @@
|
|||||||
|
|
||||||
public int trayMenuServersLimit { get; set; }
|
public int trayMenuServersLimit { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion property
|
||||||
|
|
||||||
#region other entities
|
#region other entities
|
||||||
|
|
||||||
@@ -172,6 +176,7 @@
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// UI
|
/// UI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -179,6 +184,7 @@
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<RoutingItemOld> routings
|
public List<RoutingItemOld> routings
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
@@ -194,14 +200,12 @@
|
|||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<CoreTypeItem> coreTypeItem
|
public List<CoreTypeItem> coreTypeItem
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion other entities
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
@@ -231,7 +235,6 @@
|
|||||||
groupId = string.Empty;
|
groupId = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public string indexId
|
public string indexId
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
@@ -265,6 +268,7 @@
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 远程服务器端口
|
/// 远程服务器端口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -272,6 +276,7 @@
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 远程服务器ID
|
/// 远程服务器ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -279,6 +284,7 @@
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 远程服务器额外ID
|
/// 远程服务器额外ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -286,6 +292,7 @@
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 本地安全策略
|
/// 本地安全策略
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -293,6 +300,7 @@
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// tcp,kcp,ws,h2,quic
|
/// tcp,kcp,ws,h2,quic
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -300,8 +308,9 @@
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 备注或别名
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string remarks
|
public string remarks
|
||||||
{
|
{
|
||||||
@@ -371,6 +380,7 @@
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// tls sni
|
/// tls sni
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -404,20 +414,24 @@
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string url
|
public string url
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<RulesItem> rules
|
public List<RulesItem> rules
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool enabled { get; set; } = true;
|
public bool enabled { get; set; } = true;
|
||||||
|
|
||||||
public bool locked
|
public bool locked
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string customIcon
|
public string customIcon
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
|
|||||||
@@ -17,10 +17,11 @@
|
|||||||
|
|
||||||
public string coreDownloadUrl64 { get; set; }
|
public string coreDownloadUrl64 { get; set; }
|
||||||
|
|
||||||
|
public string coreDownloadUrlArm64 { get; set; }
|
||||||
|
|
||||||
public string match { get; set; }
|
public string match { get; set; }
|
||||||
public string versionArg { get; set; }
|
public string versionArg { get; set; }
|
||||||
|
|
||||||
public bool redirectInfo { get; set; }
|
public bool redirectInfo { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
|
namespace v2rayN.Mode
|
||||||
namespace v2rayN.Mode
|
|
||||||
{
|
{
|
||||||
public enum EConfigType
|
public enum EConfigType
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
|
namespace v2rayN.Mode
|
||||||
namespace v2rayN.Mode
|
|
||||||
{
|
{
|
||||||
public enum ECoreType
|
public enum ECoreType
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
|
namespace v2rayN.Mode
|
||||||
namespace v2rayN.Mode
|
|
||||||
{
|
{
|
||||||
public enum EGlobalHotkey
|
public enum EGlobalHotkey
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
|
namespace v2rayN.Mode
|
||||||
namespace v2rayN.Mode
|
|
||||||
{
|
{
|
||||||
public enum EMove
|
public enum EMove
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
|
namespace v2rayN.Mode
|
||||||
namespace v2rayN.Mode
|
|
||||||
{
|
{
|
||||||
public enum EServerColName
|
public enum EServerColName
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
|
namespace v2rayN.Mode
|
||||||
namespace v2rayN.Mode
|
|
||||||
{
|
{
|
||||||
public enum ESpeedActionType
|
public enum ESpeedActionType
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
|
namespace v2rayN.Mode
|
||||||
namespace v2rayN.Mode
|
|
||||||
{
|
{
|
||||||
public enum ESysProxyType
|
public enum ESysProxyType
|
||||||
{
|
{
|
||||||
|
|||||||
8
v2rayN/v2rayN/Mode/EViewAction.cs
Normal file
8
v2rayN/v2rayN/Mode/EViewAction.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
namespace v2rayN.Mode
|
||||||
|
{
|
||||||
|
public enum EViewAction
|
||||||
|
{
|
||||||
|
AdjustMainLvColWidth,
|
||||||
|
ProfilesFocus
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ namespace v2rayN.Mode
|
|||||||
{
|
{
|
||||||
[PrimaryKey]
|
[PrimaryKey]
|
||||||
public string indexId { get; set; }
|
public string indexId { get; set; }
|
||||||
|
|
||||||
public int delay { get; set; }
|
public int delay { get; set; }
|
||||||
public decimal speed { get; set; }
|
public decimal speed { get; set; }
|
||||||
public int sort { get; set; }
|
public int sort { get; set; }
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ namespace v2rayN.Mode
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region function
|
#region function
|
||||||
|
|
||||||
public string GetSummary()
|
public string GetSummary()
|
||||||
{
|
{
|
||||||
string summary = string.Format("[{0}] ", (configType).ToString());
|
string summary = string.Format("[{0}] ", (configType).ToString());
|
||||||
@@ -54,6 +55,7 @@ namespace v2rayN.Mode
|
|||||||
case EConfigType.Trojan:
|
case EConfigType.Trojan:
|
||||||
summary += string.Format("{0}({1}:{2})", remarks, addr, port);
|
summary += string.Format("{0}({1}:{2})", remarks, addr, port);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
summary += string.Format("{0}", remarks);
|
summary += string.Format("{0}", remarks);
|
||||||
break;
|
break;
|
||||||
@@ -82,161 +84,112 @@ namespace v2rayN.Mode
|
|||||||
return network.TrimEx();
|
return network.TrimEx();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion function
|
||||||
|
|
||||||
[PrimaryKey]
|
[PrimaryKey]
|
||||||
public string indexId
|
public string indexId { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// config type(1=normal,2=custom)
|
/// config type(1=normal,2=custom)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public EConfigType configType
|
public EConfigType configType { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 版本(现在=2)
|
/// 版本(现在=2)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int configVersion
|
public int configVersion { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 远程服务器地址
|
/// 远程服务器地址
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string address
|
public string address { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 远程服务器端口
|
/// 远程服务器端口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int port
|
public int port { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 远程服务器ID
|
/// 远程服务器ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string id
|
public string id { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 远程服务器额外ID
|
/// 远程服务器额外ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int alterId
|
public int alterId { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 本地安全策略
|
/// 本地安全策略
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string security
|
public string security { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// tcp,kcp,ws,h2,quic
|
/// tcp,kcp,ws,h2,quic
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string network
|
public string network { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 备注或别名
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string remarks
|
public string remarks { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 伪装类型
|
/// 伪装类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string headerType
|
public string headerType { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 伪装的域名
|
/// 伪装的域名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string requestHost
|
public string requestHost { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ws h2 path
|
/// ws h2 path
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string path
|
public string path { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 传输层安全
|
/// 传输层安全
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string streamSecurity
|
public string streamSecurity { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否允许不安全连接(用于客户端)
|
/// 是否允许不安全连接(用于客户端)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string allowInsecure
|
public string allowInsecure { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// SubItem id
|
/// SubItem id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string subid
|
public string subid { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
public bool isSub { get; set; } = true;
|
public bool isSub { get; set; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// VLESS flow
|
/// VLESS flow
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string flow
|
public string flow { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// tls sni
|
/// tls sni
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string sni
|
public string sni { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// tls alpn
|
/// tls alpn
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string alpn { get; set; } = string.Empty;
|
public string alpn { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public ECoreType? coreType { get; set; }
|
||||||
|
|
||||||
public ECoreType? coreType
|
public int preSocksPort { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int preSocksPort
|
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string fingerprint { get; set; }
|
public string fingerprint { get; set; }
|
||||||
|
|
||||||
public bool displayLog { get; set; } = true;
|
public bool displayLog { get; set; } = true;
|
||||||
|
public string publicKey { get; set; }
|
||||||
|
public string shortId { get; set; }
|
||||||
|
public string spiderX { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,5 @@
|
|||||||
public string todayDown { get; set; }
|
public string todayDown { get; set; }
|
||||||
public string totalUp { get; set; }
|
public string totalUp { get; set; }
|
||||||
public string totalDown { get; set; }
|
public string totalDown { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,7 @@ namespace v2rayN.Mode
|
|||||||
{
|
{
|
||||||
[PrimaryKey]
|
[PrimaryKey]
|
||||||
public string id { get; set; }
|
public string id { get; set; }
|
||||||
|
|
||||||
public string remarks { get; set; }
|
public string remarks { get; set; }
|
||||||
public string url { get; set; }
|
public string url { get; set; }
|
||||||
public string ruleSet { get; set; }
|
public string ruleSet { get; set; }
|
||||||
@@ -16,6 +17,5 @@ namespace v2rayN.Mode
|
|||||||
public string customIcon { get; set; }
|
public string customIcon { get; set; }
|
||||||
public string domainStrategy { get; set; }
|
public string domainStrategy { get; set; }
|
||||||
public int sort { get; set; }
|
public int sort { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,5 @@
|
|||||||
public class RoutingItemModel : RoutingItem
|
public class RoutingItemModel : RoutingItem
|
||||||
{
|
{
|
||||||
public bool isActive { get; set; }
|
public bool isActive { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,5 @@
|
|||||||
public List<string> protocol { get; set; }
|
public List<string> protocol { get; set; }
|
||||||
|
|
||||||
public bool enabled { get; set; } = true;
|
public bool enabled { get; set; } = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,5 @@
|
|||||||
public string domains { get; set; }
|
public string domains { get; set; }
|
||||||
|
|
||||||
public string protocols { get; set; }
|
public string protocols { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,20 +1,23 @@
|
|||||||
namespace v2rayN.Mode
|
namespace v2rayN.Mode
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
class ServerSpeedItem : ServerStatItem
|
internal class ServerSpeedItem : ServerStatItem
|
||||||
{
|
{
|
||||||
public long proxyUp
|
public long proxyUp
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long proxyDown
|
public long proxyDown
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long directUp
|
public long directUp
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long directDown
|
public long directDown
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
|
|||||||
@@ -10,22 +10,27 @@ namespace v2rayN.Mode
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long totalUp
|
public long totalUp
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long totalDown
|
public long totalDown
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long todayUp
|
public long todayUp
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long todayDown
|
public long todayDown
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long dateNow
|
public long dateNow
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace v2rayN.Mode
|
namespace v2rayN.Mode
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
class ServerTestItem
|
internal class ServerTestItem
|
||||||
{
|
{
|
||||||
public string indexId { get; set; }
|
public string indexId { get; set; }
|
||||||
public string address { get; set; }
|
public string address { get; set; }
|
||||||
|
|||||||
@@ -15,5 +15,4 @@
|
|||||||
public string password { get; set; }
|
public string password { get; set; }
|
||||||
public string plugin { get; set; }
|
public string plugin { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,46 +6,26 @@ namespace v2rayN.Mode
|
|||||||
public class SubItem
|
public class SubItem
|
||||||
{
|
{
|
||||||
[PrimaryKey]
|
[PrimaryKey]
|
||||||
public string id
|
public string id { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
public string remarks { get; set; }
|
||||||
/// 备注
|
|
||||||
/// </summary>
|
|
||||||
public string remarks
|
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
public string url { get; set; }
|
||||||
/// url
|
|
||||||
/// </summary>
|
public string moreUrl { get; set; }
|
||||||
public string url
|
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// enable
|
|
||||||
/// </summary>
|
|
||||||
public bool enabled { get; set; } = true;
|
public bool enabled { get; set; } = true;
|
||||||
|
|
||||||
/// <summary>
|
public string userAgent { get; set; } = string.Empty;
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public string userAgent
|
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
} = string.Empty;
|
|
||||||
|
|
||||||
|
public int sort { get; set; }
|
||||||
|
|
||||||
public int sort
|
public string? filter { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
public string filter { get; set; }
|
|
||||||
|
|
||||||
|
public int autoUpdateInterval { get; set; }
|
||||||
|
|
||||||
|
public long updateTime { get; set; }
|
||||||
|
|
||||||
|
public string? convertTarget { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
|
namespace v2rayN.Mode
|
||||||
namespace v2rayN.Mode
|
|
||||||
{
|
{
|
||||||
class SysproxyConfig
|
internal class SysproxyConfig
|
||||||
{
|
{
|
||||||
public bool UserSettingsRecorded;
|
public bool UserSettingsRecorded;
|
||||||
public string Flags;
|
public string Flags;
|
||||||
|
|||||||
@@ -12,10 +12,12 @@ namespace v2rayN.Mode
|
|||||||
/// 日志配置
|
/// 日志配置
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Log log { get; set; }
|
public Log log { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 传入连接配置
|
/// 传入连接配置
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<Inbounds> inbounds { get; set; }
|
public List<Inbounds> inbounds { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 传出连接配置
|
/// 传出连接配置
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -36,13 +38,15 @@ namespace v2rayN.Mode
|
|||||||
/// DNS 配置
|
/// DNS 配置
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public object dns { get; set; }
|
public object dns { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 路由配置
|
/// 路由配置
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Routing routing { get; set; }
|
public Routing routing { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Stats { };
|
public class Stats
|
||||||
|
{ };
|
||||||
|
|
||||||
public class API
|
public class API
|
||||||
{
|
{
|
||||||
@@ -67,10 +71,12 @@ namespace v2rayN.Mode
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string access { get; set; }
|
public string access { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string error { get; set; }
|
public string error { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -80,22 +86,27 @@ namespace v2rayN.Mode
|
|||||||
public class Inbounds
|
public class Inbounds
|
||||||
{
|
{
|
||||||
public string tag { get; set; }
|
public string tag { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int port { get; set; }
|
public int port { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string listen { get; set; }
|
public string listen { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string protocol { get; set; }
|
public string protocol { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Sniffing sniffing { get; set; }
|
public Sniffing sniffing { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -105,7 +116,6 @@ namespace v2rayN.Mode
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public StreamSettings streamSettings { get; set; }
|
public StreamSettings streamSettings { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Inboundsettings
|
public class Inboundsettings
|
||||||
@@ -114,10 +124,12 @@ namespace v2rayN.Mode
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string auth { get; set; }
|
public string auth { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool udp { get; set; }
|
public bool udp { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -133,7 +145,6 @@ namespace v2rayN.Mode
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public List<UsersItem> clients { get; set; }
|
public List<UsersItem> clients { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// VLESS
|
/// VLESS
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -150,14 +161,17 @@ namespace v2rayN.Mode
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string id { get; set; }
|
public string id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int alterId { get; set; }
|
public int alterId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string email { get; set; }
|
public string email { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -173,6 +187,7 @@ namespace v2rayN.Mode
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string flow { get; set; }
|
public string flow { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Sniffing
|
public class Sniffing
|
||||||
{
|
{
|
||||||
public bool enabled { get; set; }
|
public bool enabled { get; set; }
|
||||||
@@ -186,18 +201,22 @@ namespace v2rayN.Mode
|
|||||||
/// 默认值agentout
|
/// 默认值agentout
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string tag { get; set; }
|
public string tag { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string protocol { get; set; }
|
public string protocol { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Outboundsettings settings { get; set; }
|
public Outboundsettings settings { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public StreamSettings streamSettings { get; set; }
|
public StreamSettings streamSettings { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -210,6 +229,7 @@ namespace v2rayN.Mode
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<VnextItem> vnext { get; set; }
|
public List<VnextItem> vnext { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -237,41 +257,50 @@ namespace v2rayN.Mode
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string address { get; set; }
|
public string address { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int port { get; set; }
|
public int port { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<UsersItem> users { get; set; }
|
public List<UsersItem> users { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ServersItem
|
public class ServersItem
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string email { get; set; }
|
public string email { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string address { get; set; }
|
public string address { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string method { get; set; }
|
public string method { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ota { get; set; }
|
public bool ota { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string password { get; set; }
|
public string password { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int port { get; set; }
|
public int port { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -294,17 +323,18 @@ namespace v2rayN.Mode
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string user { get; set; }
|
public string user { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string pass { get; set; }
|
public string pass { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int level { get; set; }
|
public int level { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class Mux
|
public class Mux
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -340,10 +370,12 @@ namespace v2rayN.Mode
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string domainStrategy { get; set; }
|
public string domainStrategy { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string domainMatcher { get; set; }
|
public string domainMatcher { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -356,6 +388,7 @@ namespace v2rayN.Mode
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string network { get; set; }
|
public string network { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -370,14 +403,17 @@ namespace v2rayN.Mode
|
|||||||
/// Tcp传输额外设置
|
/// Tcp传输额外设置
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public TcpSettings tcpSettings { get; set; }
|
public TcpSettings tcpSettings { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Kcp传输额外设置
|
/// Kcp传输额外设置
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public KcpSettings kcpSettings { get; set; }
|
public KcpSettings kcpSettings { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ws传输额外设置
|
/// ws传输额外设置
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public WsSettings wsSettings { get; set; }
|
public WsSettings wsSettings { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// h2传输额外设置
|
/// h2传输额外设置
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -389,14 +425,14 @@ namespace v2rayN.Mode
|
|||||||
public QuicSettings quicSettings { get; set; }
|
public QuicSettings quicSettings { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// VLESS xtls
|
/// VLESS only
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public TlsSettings xtlsSettings { get; set; }
|
public TlsSettings realitySettings { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// grpc
|
/// grpc
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public GrpcSettings grpcSettings { get; set; }
|
public GrpcSettings grpcSettings { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TlsSettings
|
public class TlsSettings
|
||||||
@@ -404,25 +440,24 @@ namespace v2rayN.Mode
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否允许不安全连接(用于客户端)
|
/// 是否允许不安全连接(用于客户端)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool allowInsecure { get; set; }
|
public bool? allowInsecure { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string serverName { get; set; }
|
public string? serverName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> alpn
|
public List<string>? alpn { get; set; }
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
public string? fingerprint { get; set; }
|
||||||
/// "chrome" | "firefox" | "safari" | "randomized"
|
|
||||||
/// </summary>
|
|
||||||
public string fingerprint { get; set; }
|
|
||||||
|
|
||||||
|
public bool? show { get; set; } = false;
|
||||||
|
public string? publicKey { get; set; }
|
||||||
|
public string? shortId { get; set; }
|
||||||
|
public string? spiderX { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TcpSettings
|
public class TcpSettings
|
||||||
@@ -439,10 +474,12 @@ namespace v2rayN.Mode
|
|||||||
/// 伪装
|
/// 伪装
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string type { get; set; }
|
public string type { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 结构复杂,直接存起来
|
/// 结构复杂,直接存起来
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public object request { get; set; }
|
public object request { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 结构复杂,直接存起来
|
/// 结构复杂,直接存起来
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -455,34 +492,42 @@ namespace v2rayN.Mode
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int mtu { get; set; }
|
public int mtu { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int tti { get; set; }
|
public int tti { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int uplinkCapacity { get; set; }
|
public int uplinkCapacity { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int downlinkCapacity { get; set; }
|
public int downlinkCapacity { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool congestion { get; set; }
|
public bool congestion { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int readBufferSize { get; set; }
|
public int readBufferSize { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int writeBufferSize { get; set; }
|
public int writeBufferSize { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Header header { get; set; }
|
public Header header { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -501,6 +546,7 @@ namespace v2rayN.Mode
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Headers headers { get; set; }
|
public Headers headers { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Headers
|
public class Headers
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -526,7 +572,6 @@ namespace v2rayN.Mode
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> host { get; set; }
|
public List<string> host { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class QuicSettings
|
public class QuicSettings
|
||||||
@@ -535,6 +580,7 @@ namespace v2rayN.Mode
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string security { get; set; }
|
public string security { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -562,6 +608,7 @@ namespace v2rayN.Mode
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string user { get; set; }
|
public string user { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -18,6 +18,4 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> Host { get; set; }
|
public List<string> Host { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,32 +4,38 @@
|
|||||||
/// https://github.com/2dust/v2rayN/wiki/
|
/// https://github.com/2dust/v2rayN/wiki/
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Serializable]
|
[Serializable]
|
||||||
class VmessQRCode
|
internal class VmessQRCode
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string v { get; set; } = string.Empty;
|
public string v { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ps { get; set; } = string.Empty;
|
public string ps { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string add { get; set; } = string.Empty;
|
public string add { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string port { get; set; } = string.Empty;
|
public string port { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string id { get; set; } = string.Empty;
|
public string id { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string aid { get; set; } = string.Empty;
|
public string aid { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -39,34 +45,40 @@
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string net { get; set; } = string.Empty;
|
public string net { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string type { get; set; } = string.Empty;
|
public string type { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string host { get; set; } = string.Empty;
|
public string host { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string path { get; set; } = string.Empty;
|
public string path { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// TLS
|
/// TLS
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string tls { get; set; } = string.Empty;
|
public string tls { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// TLS SNI
|
/// TLS SNI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string sni { get; set; } = string.Empty;
|
public string sni { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// TLS alpn
|
/// TLS alpn
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string alpn { get; set; } = string.Empty;
|
public string alpn { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// TLS fingerprint
|
/// TLS fingerprint
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string fp { get; set; } = string.Empty;
|
public string fp { get; set; } = string.Empty;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
252
v2rayN/v2rayN/Resx/ResUI.Designer.cs
generated
252
v2rayN/v2rayN/Resx/ResUI.Designer.cs
generated
@@ -367,11 +367,29 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Alias 的本地化字符串。
|
/// 查找类似 Automatic update interval(minutes) 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string LvAlias {
|
public static string LvAutoUpdateInterval {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("LvAlias", resourceCulture);
|
return ResourceManager.GetString("LvAutoUpdateInterval", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Convert target type 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string LvConvertTarget {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("LvConvertTarget", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Please leave blank if no conversion is required 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string LvConvertTargetTip {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("LvConvertTargetTip", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -420,6 +438,15 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 More urls, separated by commas;Subscription conversion will be invalid 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string LvMoreUrl {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("LvMoreUrl", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Port 的本地化字符串。
|
/// 查找类似 Port 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -474,15 +501,6 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Test Results 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string LvTestResults {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("LvTestResults", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Speed(M/s) 的本地化字符串。
|
/// 查找类似 Speed(M/s) 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -564,15 +582,6 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Medium 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string MediumFresh {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("MediumFresh", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Add a custom configuration server 的本地化字符串。
|
/// 查找类似 Add a custom configuration server 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -933,6 +942,15 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Reboot as administrator 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string menuRebootAsAdmin {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("menuRebootAsAdmin", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Reload 的本地化字符串。
|
/// 查找类似 Reload 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1042,7 +1060,7 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Rule Setting 的本地化字符串。
|
/// 查找类似 Rule Settings 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string menuRoutingRuleSetting {
|
public static string menuRoutingRuleSetting {
|
||||||
get {
|
get {
|
||||||
@@ -1123,7 +1141,7 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Setting 的本地化字符串。
|
/// 查找类似 Settings 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string menuSetting {
|
public static string menuSetting {
|
||||||
get {
|
get {
|
||||||
@@ -1213,7 +1231,7 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Subscription group Setting 的本地化字符串。
|
/// 查找类似 Subscription group Settings 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string menuSubSetting {
|
public static string menuSubSetting {
|
||||||
get {
|
get {
|
||||||
@@ -1384,7 +1402,7 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Please fill in the address (Url) 的本地化字符串。
|
/// 查找类似 Please fill in the Url 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string MsgNeedUrl {
|
public static string MsgNeedUrl {
|
||||||
get {
|
get {
|
||||||
@@ -1401,24 +1419,6 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 PAC update failed 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string MsgPACUpdateFailed {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("MsgPACUpdateFailed", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 PAC update succeeded 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string MsgPACUpdateSuccessfully {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("MsgPACUpdateSuccessfully", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Resolve {0} successfully 的本地化字符串。
|
/// 查找类似 Resolve {0} successfully 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1429,7 +1429,7 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Servers Filter 的本地化字符串。
|
/// 查找类似 Servers Filter, press Enter to execute 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string MsgServerTitle {
|
public static string MsgServerTitle {
|
||||||
get {
|
get {
|
||||||
@@ -1438,11 +1438,11 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Simplify PAC Success 的本地化字符串。
|
/// 查找类似 Updates are not enabled, skip this subscription 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string MsgSimplifyPAC {
|
public static string MsgSkipSubscriptionUpdate {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("MsgSimplifyPAC", resourceCulture);
|
return ResourceManager.GetString("MsgSkipSubscriptionUpdate", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1464,15 +1464,6 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Start updating PAC... 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string MsgStartUpdatingPAC {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("MsgStartUpdatingPAC", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Invalid subscription content 的本地化字符串。
|
/// 查找类似 Invalid subscription content 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1527,24 +1518,6 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 This feature relies on the Http global proxy, please set it correctly first. 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string NeedHttpGlobalProxy {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("NeedHttpGlobalProxy", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Normal use of this version requires .NET Framework 4.8 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string NetFrameworkRequirementsTip {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("NetFrameworkRequirementsTip", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Non-VMess or ss protocol 的本地化字符串。
|
/// 查找类似 Non-VMess or ss protocol 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1653,15 +1626,6 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Fast 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string QuickFresh {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("QuickFresh", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Global hotkey {0} registered failed, reason {1} 的本地化字符串。
|
/// 查找类似 Global hotkey {0} registered failed, reason {1} 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1744,20 +1708,11 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Slow 的本地化字符串。
|
/// 查找类似 {0}:{1}/s↑ | {2}/s↓ 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string SlowFresh {
|
public static string SpeedDisplayText {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("SlowFresh", resourceCulture);
|
return ResourceManager.GetString("SpeedDisplayText", resourceCulture);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Note: This feature relies on the Http global proxy. Please manually adjust the Http global proxy and active node after testing. 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string SpeedServerTips {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("SpeedServerTips", resourceCulture);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1789,11 +1744,11 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 PAC failed to start. Please run this program as Administrator. 的本地化字符串。
|
/// 查找类似 Waiting for testing 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string StartPacFailed {
|
public static string SpeedtestingWait {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("StartPacFailed", resourceCulture);
|
return ResourceManager.GetString("SpeedtestingWait", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2051,7 +2006,7 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 GlobalHotkey Setting 的本地化字符串。
|
/// 查找类似 GlobalHotkey Settings 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string TbGlobalHotkeySetting {
|
public static string TbGlobalHotkeySetting {
|
||||||
get {
|
get {
|
||||||
@@ -2167,6 +2122,15 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 PublicKey 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string TbPublicKey {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TbPublicKey", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Alias (remarks) 的本地化字符串。
|
/// 查找类似 Alias (remarks) 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -2320,24 +2284,6 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Automatic latency test interval (minutes) 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string TbSettingsAutoTest {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("TbSettingsAutoTest", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Automatic update interval of subscriptions (hours) 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string TbSettingsAutoUpdate {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("TbSettingsAutoUpdate", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Automatic update interval of and Geo (hours) 的本地化字符串。
|
/// 查找类似 Automatic update interval of and Geo (hours) 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -2500,6 +2446,15 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Enable hardware acceleration(Require restart) 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string TbSettingsEnableHWA {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TbSettingsEnableHWA", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Exception 的本地化字符串。
|
/// 查找类似 Exception 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -2545,15 +2500,6 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Enable IPv6 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string TbSettingsIpv6 {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("TbSettingsIpv6", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Keep older when deduplication 的本地化字符串。
|
/// 查找类似 Keep older when deduplication 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -2581,6 +2527,15 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Enable logging to file 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string TbSettingsLogEnabledToFile {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TbSettingsLogEnabledToFile", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Log Level 的本地化字符串。
|
/// 查找类似 Log Level 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -2617,15 +2572,6 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Pac listen port 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string TbSettingsPacListenPort {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("TbSettingsPacListenPort", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Auth pass 的本地化字符串。
|
/// 查找类似 Auth pass 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -2653,15 +2599,6 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 After modifying the following parameters, click Save to take effect 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string TbSettingsSaveTip {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("TbSettingsSaveTip", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Set Win10 UWP Loopback 的本地化字符串。
|
/// 查找类似 Set Win10 UWP Loopback 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -2896,6 +2833,15 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 ShortId 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string TbShortId {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TbShortId", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 SNI 的本地化字符串。
|
/// 查找类似 SNI 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -2905,6 +2851,15 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 SpiderX 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string TbSpiderX {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TbSpiderX", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 TLS 的本地化字符串。
|
/// 查找类似 TLS 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -2950,6 +2905,15 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Please turn off when there is an abnormal disconnection 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string TipDisplayLog {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TipDisplayLog", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 *Default value tcp 的本地化字符串。
|
/// 查找类似 *Default value tcp 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -195,9 +195,6 @@
|
|||||||
<data name="LvAddress" xml:space="preserve">
|
<data name="LvAddress" xml:space="preserve">
|
||||||
<value>آدرس</value>
|
<value>آدرس</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LvAlias" xml:space="preserve">
|
|
||||||
<value>Alias</value>
|
|
||||||
</data>
|
|
||||||
<data name="LvEncryptionMethod" xml:space="preserve">
|
<data name="LvEncryptionMethod" xml:space="preserve">
|
||||||
<value>امنیت</value>
|
<value>امنیت</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -210,9 +207,6 @@
|
|||||||
<data name="LvSubscription" xml:space="preserve">
|
<data name="LvSubscription" xml:space="preserve">
|
||||||
<value>گروه فرعی</value>
|
<value>گروه فرعی</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LvTestResults" xml:space="preserve">
|
|
||||||
<value>نتایج تست</value>
|
|
||||||
</data>
|
|
||||||
<data name="LvTodayDownloadDataAmount" xml:space="preserve">
|
<data name="LvTodayDownloadDataAmount" xml:space="preserve">
|
||||||
<value> ترافیک دانلود امروز</value>
|
<value> ترافیک دانلود امروز</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -228,9 +222,6 @@
|
|||||||
<data name="LvTransportProtocol" xml:space="preserve">
|
<data name="LvTransportProtocol" xml:space="preserve">
|
||||||
<value>جابجایی</value>
|
<value>جابجایی</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MediumFresh" xml:space="preserve">
|
|
||||||
<value>متوسط</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgClearSubscription" xml:space="preserve">
|
<data name="MsgClearSubscription" xml:space="preserve">
|
||||||
<value>محتوای اشتراک اصلی را پاک کنید</value>
|
<value>محتوای اشتراک اصلی را پاک کنید</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -246,27 +237,15 @@
|
|||||||
<data name="MsgNoValidSubscription" xml:space="preserve">
|
<data name="MsgNoValidSubscription" xml:space="preserve">
|
||||||
<value>هیچ اشتراک معتبری تنظیم نشده است</value>
|
<value>هیچ اشتراک معتبری تنظیم نشده است</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgPACUpdateFailed" xml:space="preserve">
|
|
||||||
<value>به روز رسانی PAC ناموفق بود</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgPACUpdateSuccessfully" xml:space="preserve">
|
|
||||||
<value>به روز رسانی PAC با موفقیت انجام شد</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgParsingSuccessfully" xml:space="preserve">
|
<data name="MsgParsingSuccessfully" xml:space="preserve">
|
||||||
<value>Resolve {0} successfully</value>
|
<value>Resolve {0} successfully</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgSimplifyPAC" xml:space="preserve">
|
|
||||||
<value>Simplify PAC Success</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgStartGettingSubscriptions" xml:space="preserve">
|
<data name="MsgStartGettingSubscriptions" xml:space="preserve">
|
||||||
<value>شروع به دریافت اشتراک شد</value>
|
<value>شروع به دریافت اشتراک شد</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgStartUpdating" xml:space="preserve">
|
<data name="MsgStartUpdating" xml:space="preserve">
|
||||||
<value>شروع بروزرسانی {0}...</value>
|
<value>شروع بروزرسانی {0}...</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgStartUpdatingPAC" xml:space="preserve">
|
|
||||||
<value>شروع بروزرسانی PAC...</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
|
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
|
||||||
<value>محتوای اشتراک نامعتبر است</value>
|
<value>محتوای اشتراک نامعتبر است</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -285,9 +264,6 @@
|
|||||||
<data name="MsgUpdateV2rayCoreSuccessfullyMore" xml:space="preserve">
|
<data name="MsgUpdateV2rayCoreSuccessfullyMore" xml:space="preserve">
|
||||||
<value>هسته با موفقیت بروزرسانی شد! راه اندازی مجدد سرویس...</value>
|
<value>هسته با موفقیت بروزرسانی شد! راه اندازی مجدد سرویس...</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NeedHttpGlobalProxy" xml:space="preserve">
|
|
||||||
<value> This feature relies on the Http global proxy, please set it correctly first.</value>
|
|
||||||
</data>
|
|
||||||
<data name="NonvmessOrssProtocol" xml:space="preserve">
|
<data name="NonvmessOrssProtocol" xml:space="preserve">
|
||||||
<value>Non-VMess or ss protocol</value>
|
<value>Non-VMess or ss protocol</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -315,9 +291,6 @@
|
|||||||
<data name="PleaseSelectServer" xml:space="preserve">
|
<data name="PleaseSelectServer" xml:space="preserve">
|
||||||
<value>لطفا ابتدا سرور را انتخاب کنید</value>
|
<value>لطفا ابتدا سرور را انتخاب کنید</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="QuickFresh" xml:space="preserve">
|
|
||||||
<value>سریع</value>
|
|
||||||
</data>
|
|
||||||
<data name="RemoveDuplicateServerResult" xml:space="preserve">
|
<data name="RemoveDuplicateServerResult" xml:space="preserve">
|
||||||
<value>Servers deduplication completed. Old: {0}, New: {1}.</value>
|
<value>Servers deduplication completed. Old: {0}, New: {1}.</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -330,15 +303,6 @@
|
|||||||
<data name="SaveServerConfigurationIn" xml:space="preserve">
|
<data name="SaveServerConfigurationIn" xml:space="preserve">
|
||||||
<value>The server configuration file is saved at: {0}</value>
|
<value>The server configuration file is saved at: {0}</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SlowFresh" xml:space="preserve">
|
|
||||||
<value>آهسته. تدریجی</value>
|
|
||||||
</data>
|
|
||||||
<data name="SpeedServerTips" xml:space="preserve">
|
|
||||||
<value>توجه: این ویژگی به پروکسی جهانی Http متکی است. لطفاً پس از آزمایش، پراکسی جهانی Http و گره فعال را به صورت دستی تنظیم کنید.</value>
|
|
||||||
</data>
|
|
||||||
<data name="StartPacFailed" xml:space="preserve">
|
|
||||||
<value>PAC شروع نشد. لطفا این برنامه را به عنوان Administrator اجرا کنید.</value>
|
|
||||||
</data>
|
|
||||||
<data name="StartService" xml:space="preserve">
|
<data name="StartService" xml:space="preserve">
|
||||||
<value>Start service ({0})...</value>
|
<value>Start service ({0})...</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -472,9 +436,6 @@
|
|||||||
<data name="MsgServerTitle" xml:space="preserve">
|
<data name="MsgServerTitle" xml:space="preserve">
|
||||||
<value>فیلتر سرورها</value>
|
<value>فیلتر سرورها</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NetFrameworkRequirementsTip" xml:space="preserve">
|
|
||||||
<value>استفاده معمولی از این نسخه به .NET Framework 4.8 نیاز دارد</value>
|
|
||||||
</data>
|
|
||||||
<data name="menuCheckUpdate" xml:space="preserve">
|
<data name="menuCheckUpdate" xml:space="preserve">
|
||||||
<value>بررسی بروزرسانی</value>
|
<value>بررسی بروزرسانی</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -763,12 +724,6 @@
|
|||||||
<data name="TbSettingsAutoHideStartup" xml:space="preserve">
|
<data name="TbSettingsAutoHideStartup" xml:space="preserve">
|
||||||
<value>Auto hide startup</value>
|
<value>Auto hide startup</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsAutoTest" xml:space="preserve">
|
|
||||||
<value>فاصله تست تأخیر خودکار (دقیقه)</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsAutoUpdate" xml:space="preserve">
|
|
||||||
<value>فاصله به روز رسانی خودکار اشتراک ها (ساعت)</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsAutoUpdateInterval" xml:space="preserve">
|
<data name="TbSettingsAutoUpdateInterval" xml:space="preserve">
|
||||||
<value>فاصله به روز رسانی خودکار و Geo (ساعت)</value>
|
<value>فاصله به روز رسانی خودکار و Geo (ساعت)</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -808,9 +763,6 @@
|
|||||||
<data name="TbSettingsIgnoreGeoUpdateCore" xml:space="preserve">
|
<data name="TbSettingsIgnoreGeoUpdateCore" xml:space="preserve">
|
||||||
<value>هنگام بهروزرسانی هسته، فایلهای Geo را نادیده بگیرید</value>
|
<value>هنگام بهروزرسانی هسته، فایلهای Geo را نادیده بگیرید</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsIpv6" xml:space="preserve">
|
|
||||||
<value>IPv6 را فعال کنید</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsKeepOlderDedupl" xml:space="preserve">
|
<data name="TbSettingsKeepOlderDedupl" xml:space="preserve">
|
||||||
<value>Keep older when deduplication</value>
|
<value>Keep older when deduplication</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -826,18 +778,12 @@
|
|||||||
<data name="TbSettingsN" xml:space="preserve">
|
<data name="TbSettingsN" xml:space="preserve">
|
||||||
<value>تنظیمات v2rayN</value>
|
<value>تنظیمات v2rayN</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsPacListenPort" xml:space="preserve">
|
|
||||||
<value>Pac پورت درحال شنود</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsPass" xml:space="preserve">
|
<data name="TbSettingsPass" xml:space="preserve">
|
||||||
<value>Auth pass</value>
|
<value>Auth pass</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsRemoteDNS" xml:space="preserve">
|
<data name="TbSettingsRemoteDNS" xml:space="preserve">
|
||||||
<value>سفارشی DNS (multiple, separated by commas (,))</value>
|
<value>سفارشی DNS (multiple, separated by commas (,))</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsSaveTip" xml:space="preserve">
|
|
||||||
<value>After modifying the following parameters, click Save to take effect</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsSetUWP" xml:space="preserve">
|
<data name="TbSettingsSetUWP" xml:space="preserve">
|
||||||
<value>Set Win10 UWP Loopback</value>
|
<value>Set Win10 UWP Loopback</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -1066,4 +1012,7 @@
|
|||||||
<data name="TbSettingsDefUserAgentTips" xml:space="preserve">
|
<data name="TbSettingsDefUserAgentTips" xml:space="preserve">
|
||||||
<value>This parameter is valid only for tcp/http and ws</value>
|
<value>This parameter is valid only for tcp/http and ws</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbSettingsEnableHWA" xml:space="preserve">
|
||||||
|
<value>فعالسازی شتابدهنده سختافزاری (نیاز به راهاندازی مجدد)</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -195,9 +195,6 @@
|
|||||||
<data name="LvAddress" xml:space="preserve">
|
<data name="LvAddress" xml:space="preserve">
|
||||||
<value>Address</value>
|
<value>Address</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LvAlias" xml:space="preserve">
|
|
||||||
<value>Alias</value>
|
|
||||||
</data>
|
|
||||||
<data name="LvEncryptionMethod" xml:space="preserve">
|
<data name="LvEncryptionMethod" xml:space="preserve">
|
||||||
<value>Security</value>
|
<value>Security</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -210,9 +207,6 @@
|
|||||||
<data name="LvSubscription" xml:space="preserve">
|
<data name="LvSubscription" xml:space="preserve">
|
||||||
<value>Subs group</value>
|
<value>Subs group</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LvTestResults" xml:space="preserve">
|
|
||||||
<value>Test Results</value>
|
|
||||||
</data>
|
|
||||||
<data name="LvTodayDownloadDataAmount" xml:space="preserve">
|
<data name="LvTodayDownloadDataAmount" xml:space="preserve">
|
||||||
<value>Download traffic today</value>
|
<value>Download traffic today</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -228,9 +222,6 @@
|
|||||||
<data name="LvTransportProtocol" xml:space="preserve">
|
<data name="LvTransportProtocol" xml:space="preserve">
|
||||||
<value>Transport</value>
|
<value>Transport</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MediumFresh" xml:space="preserve">
|
|
||||||
<value>Medium</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgClearSubscription" xml:space="preserve">
|
<data name="MsgClearSubscription" xml:space="preserve">
|
||||||
<value>Clear original subscription content</value>
|
<value>Clear original subscription content</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -246,27 +237,15 @@
|
|||||||
<data name="MsgNoValidSubscription" xml:space="preserve">
|
<data name="MsgNoValidSubscription" xml:space="preserve">
|
||||||
<value>No valid subscriptions set</value>
|
<value>No valid subscriptions set</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgPACUpdateFailed" xml:space="preserve">
|
|
||||||
<value>PAC update failed</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgPACUpdateSuccessfully" xml:space="preserve">
|
|
||||||
<value>PAC update succeeded</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgParsingSuccessfully" xml:space="preserve">
|
<data name="MsgParsingSuccessfully" xml:space="preserve">
|
||||||
<value>Resolve {0} successfully</value>
|
<value>Resolve {0} successfully</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgSimplifyPAC" xml:space="preserve">
|
|
||||||
<value>Simplify PAC Success</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgStartGettingSubscriptions" xml:space="preserve">
|
<data name="MsgStartGettingSubscriptions" xml:space="preserve">
|
||||||
<value>Start getting subscriptions</value>
|
<value>Start getting subscriptions</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgStartUpdating" xml:space="preserve">
|
<data name="MsgStartUpdating" xml:space="preserve">
|
||||||
<value>Start updating {0}...</value>
|
<value>Start updating {0}...</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgStartUpdatingPAC" xml:space="preserve">
|
|
||||||
<value>Start updating PAC...</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
|
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
|
||||||
<value>Invalid subscription content</value>
|
<value>Invalid subscription content</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -285,9 +264,6 @@
|
|||||||
<data name="MsgUpdateV2rayCoreSuccessfullyMore" xml:space="preserve">
|
<data name="MsgUpdateV2rayCoreSuccessfullyMore" xml:space="preserve">
|
||||||
<value>Update Core successfully! Restarting service...</value>
|
<value>Update Core successfully! Restarting service...</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NeedHttpGlobalProxy" xml:space="preserve">
|
|
||||||
<value> This feature relies on the Http global proxy, please set it correctly first.</value>
|
|
||||||
</data>
|
|
||||||
<data name="NonvmessOrssProtocol" xml:space="preserve">
|
<data name="NonvmessOrssProtocol" xml:space="preserve">
|
||||||
<value>Non-VMess or ss protocol</value>
|
<value>Non-VMess or ss protocol</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -315,9 +291,6 @@
|
|||||||
<data name="PleaseSelectServer" xml:space="preserve">
|
<data name="PleaseSelectServer" xml:space="preserve">
|
||||||
<value>Please select the server first</value>
|
<value>Please select the server first</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="QuickFresh" xml:space="preserve">
|
|
||||||
<value>Fast</value>
|
|
||||||
</data>
|
|
||||||
<data name="RemoveDuplicateServerResult" xml:space="preserve">
|
<data name="RemoveDuplicateServerResult" xml:space="preserve">
|
||||||
<value>Servers deduplication completed. Old: {0}, New: {1}.</value>
|
<value>Servers deduplication completed. Old: {0}, New: {1}.</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -330,15 +303,6 @@
|
|||||||
<data name="SaveServerConfigurationIn" xml:space="preserve">
|
<data name="SaveServerConfigurationIn" xml:space="preserve">
|
||||||
<value>The server configuration file is saved at: {0}</value>
|
<value>The server configuration file is saved at: {0}</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SlowFresh" xml:space="preserve">
|
|
||||||
<value>Slow</value>
|
|
||||||
</data>
|
|
||||||
<data name="SpeedServerTips" xml:space="preserve">
|
|
||||||
<value>Note: This feature relies on the Http global proxy. Please manually adjust the Http global proxy and active node after testing.</value>
|
|
||||||
</data>
|
|
||||||
<data name="StartPacFailed" xml:space="preserve">
|
|
||||||
<value>PAC failed to start. Please run this program as Administrator.</value>
|
|
||||||
</data>
|
|
||||||
<data name="StartService" xml:space="preserve">
|
<data name="StartService" xml:space="preserve">
|
||||||
<value>Start service ({0})...</value>
|
<value>Start service ({0})...</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -380,7 +344,7 @@
|
|||||||
<value>Count</value>
|
<value>Count</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgNeedUrl" xml:space="preserve">
|
<data name="MsgNeedUrl" xml:space="preserve">
|
||||||
<value>Please fill in the address (Url)</value>
|
<value>Please fill in the Url</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AddBatchRoutingRulesYesNo" xml:space="preserve">
|
<data name="AddBatchRoutingRulesYesNo" xml:space="preserve">
|
||||||
<value>Do you want to append rules? Choose yes to append, choose otherwise to replace</value>
|
<value>Do you want to append rules? Choose yes to append, choose otherwise to replace</value>
|
||||||
@@ -470,10 +434,7 @@
|
|||||||
<value>Local</value>
|
<value>Local</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgServerTitle" xml:space="preserve">
|
<data name="MsgServerTitle" xml:space="preserve">
|
||||||
<value>Servers Filter</value>
|
<value>Servers Filter, press Enter to execute</value>
|
||||||
</data>
|
|
||||||
<data name="NetFrameworkRequirementsTip" xml:space="preserve">
|
|
||||||
<value>Normal use of this version requires .NET Framework 4.8</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="menuCheckUpdate" xml:space="preserve">
|
<data name="menuCheckUpdate" xml:space="preserve">
|
||||||
<value>Check Update</value>
|
<value>Check Update</value>
|
||||||
@@ -506,7 +467,7 @@
|
|||||||
<value>Servers</value>
|
<value>Servers</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="menuSetting" xml:space="preserve">
|
<data name="menuSetting" xml:space="preserve">
|
||||||
<value>Setting</value>
|
<value>Settings</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="menuSubGroupUpdate" xml:space="preserve">
|
<data name="menuSubGroupUpdate" xml:space="preserve">
|
||||||
<value>Update current subscription without proxy</value>
|
<value>Update current subscription without proxy</value>
|
||||||
@@ -518,7 +479,7 @@
|
|||||||
<value>Subscription group</value>
|
<value>Subscription group</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="menuSubSetting" xml:space="preserve">
|
<data name="menuSubSetting" xml:space="preserve">
|
||||||
<value>Subscription group Setting</value>
|
<value>Subscription group Settings</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="menuSubUpdate" xml:space="preserve">
|
<data name="menuSubUpdate" xml:space="preserve">
|
||||||
<value>Update subscription without proxy</value>
|
<value>Update subscription without proxy</value>
|
||||||
@@ -763,12 +724,6 @@
|
|||||||
<data name="TbSettingsAutoHideStartup" xml:space="preserve">
|
<data name="TbSettingsAutoHideStartup" xml:space="preserve">
|
||||||
<value>Auto hide startup</value>
|
<value>Auto hide startup</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsAutoTest" xml:space="preserve">
|
|
||||||
<value>Automatic latency test interval (minutes)</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsAutoUpdate" xml:space="preserve">
|
|
||||||
<value>Automatic update interval of subscriptions (hours)</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsAutoUpdateInterval" xml:space="preserve">
|
<data name="TbSettingsAutoUpdateInterval" xml:space="preserve">
|
||||||
<value>Automatic update interval of and Geo (hours)</value>
|
<value>Automatic update interval of and Geo (hours)</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -808,9 +763,6 @@
|
|||||||
<data name="TbSettingsIgnoreGeoUpdateCore" xml:space="preserve">
|
<data name="TbSettingsIgnoreGeoUpdateCore" xml:space="preserve">
|
||||||
<value>Ignore Geo files when updating core</value>
|
<value>Ignore Geo files when updating core</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsIpv6" xml:space="preserve">
|
|
||||||
<value>Enable IPv6</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsKeepOlderDedupl" xml:space="preserve">
|
<data name="TbSettingsKeepOlderDedupl" xml:space="preserve">
|
||||||
<value>Keep older when deduplication</value>
|
<value>Keep older when deduplication</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -826,18 +778,12 @@
|
|||||||
<data name="TbSettingsN" xml:space="preserve">
|
<data name="TbSettingsN" xml:space="preserve">
|
||||||
<value>v2rayN settings</value>
|
<value>v2rayN settings</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsPacListenPort" xml:space="preserve">
|
|
||||||
<value>Pac listen port</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsPass" xml:space="preserve">
|
<data name="TbSettingsPass" xml:space="preserve">
|
||||||
<value>Auth pass</value>
|
<value>Auth pass</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsRemoteDNS" xml:space="preserve">
|
<data name="TbSettingsRemoteDNS" xml:space="preserve">
|
||||||
<value>Custom DNS (multiple, separated by commas (,))</value>
|
<value>Custom DNS (multiple, separated by commas (,))</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsSaveTip" xml:space="preserve">
|
|
||||||
<value>After modifying the following parameters, click Save to take effect</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsSetUWP" xml:space="preserve">
|
<data name="TbSettingsSetUWP" xml:space="preserve">
|
||||||
<value>Set Win10 UWP Loopback</value>
|
<value>Set Win10 UWP Loopback</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -881,7 +827,7 @@
|
|||||||
<value>Display GUI</value>
|
<value>Display GUI</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbGlobalHotkeySetting" xml:space="preserve">
|
<data name="TbGlobalHotkeySetting" xml:space="preserve">
|
||||||
<value>GlobalHotkey Setting</value>
|
<value>GlobalHotkey Settings</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbGlobalHotkeySettingTip" xml:space="preserve">
|
<data name="TbGlobalHotkeySettingTip" xml:space="preserve">
|
||||||
<value>Set directly by pressing the keyboard, Take effect after restart</value>
|
<value>Set directly by pressing the keyboard, Take effect after restart</value>
|
||||||
@@ -983,7 +929,7 @@
|
|||||||
<value>Import Rules From Sub Url</value>
|
<value>Import Rules From Sub Url</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="menuRoutingRuleSetting" xml:space="preserve">
|
<data name="menuRoutingRuleSetting" xml:space="preserve">
|
||||||
<value>Rule Setting</value>
|
<value>Rule Settings</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="menuRuleAdd" xml:space="preserve">
|
<data name="menuRuleAdd" xml:space="preserve">
|
||||||
<value>Rule Add</value>
|
<value>Rule Add</value>
|
||||||
@@ -1132,4 +1078,46 @@
|
|||||||
<data name="menuMoveTo" xml:space="preserve">
|
<data name="menuMoveTo" xml:space="preserve">
|
||||||
<value>Move up and down</value>
|
<value>Move up and down</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbPublicKey" xml:space="preserve">
|
||||||
|
<value>PublicKey</value>
|
||||||
|
</data>
|
||||||
|
<data name="TbShortId" xml:space="preserve">
|
||||||
|
<value>ShortId</value>
|
||||||
|
</data>
|
||||||
|
<data name="TbSpiderX" xml:space="preserve">
|
||||||
|
<value>SpiderX</value>
|
||||||
|
</data>
|
||||||
|
<data name="TbSettingsEnableHWA" xml:space="preserve">
|
||||||
|
<value>Enable hardware acceleration(Require restart)</value>
|
||||||
|
</data>
|
||||||
|
<data name="SpeedtestingWait" xml:space="preserve">
|
||||||
|
<value>Waiting for testing</value>
|
||||||
|
</data>
|
||||||
|
<data name="TipDisplayLog" xml:space="preserve">
|
||||||
|
<value>Please turn off when there is an abnormal disconnection</value>
|
||||||
|
</data>
|
||||||
|
<data name="MsgSkipSubscriptionUpdate" xml:space="preserve">
|
||||||
|
<value>Updates are not enabled, skip this subscription</value>
|
||||||
|
</data>
|
||||||
|
<data name="menuRebootAsAdmin" xml:space="preserve">
|
||||||
|
<value>Reboot as administrator</value>
|
||||||
|
</data>
|
||||||
|
<data name="LvMoreUrl" xml:space="preserve">
|
||||||
|
<value>More urls, separated by commas;Subscription conversion will be invalid</value>
|
||||||
|
</data>
|
||||||
|
<data name="SpeedDisplayText" xml:space="preserve">
|
||||||
|
<value>{0}:{1}/s↑ | {2}/s↓</value>
|
||||||
|
</data>
|
||||||
|
<data name="LvAutoUpdateInterval" xml:space="preserve">
|
||||||
|
<value>Automatic update interval(minutes)</value>
|
||||||
|
</data>
|
||||||
|
<data name="TbSettingsLogEnabledToFile" xml:space="preserve">
|
||||||
|
<value>Enable logging to file</value>
|
||||||
|
</data>
|
||||||
|
<data name="LvConvertTarget" xml:space="preserve">
|
||||||
|
<value>Convert target type</value>
|
||||||
|
</data>
|
||||||
|
<data name="LvConvertTargetTip" xml:space="preserve">
|
||||||
|
<value>Please leave blank if no conversion is required</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -195,9 +195,6 @@
|
|||||||
<data name="LvAddress" xml:space="preserve">
|
<data name="LvAddress" xml:space="preserve">
|
||||||
<value>Адрес</value>
|
<value>Адрес</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LvAlias" xml:space="preserve">
|
|
||||||
<value>Псевдоним</value>
|
|
||||||
</data>
|
|
||||||
<data name="LvEncryptionMethod" xml:space="preserve">
|
<data name="LvEncryptionMethod" xml:space="preserve">
|
||||||
<value>Безопасность</value>
|
<value>Безопасность</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -210,9 +207,6 @@
|
|||||||
<data name="LvSubscription" xml:space="preserve">
|
<data name="LvSubscription" xml:space="preserve">
|
||||||
<value>Группа подписки</value>
|
<value>Группа подписки</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LvTestResults" xml:space="preserve">
|
|
||||||
<value>Результаты тестирования</value>
|
|
||||||
</data>
|
|
||||||
<data name="LvTodayDownloadDataAmount" xml:space="preserve">
|
<data name="LvTodayDownloadDataAmount" xml:space="preserve">
|
||||||
<value>Загружено трафика сегодня</value>
|
<value>Загружено трафика сегодня</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -228,9 +222,6 @@
|
|||||||
<data name="LvTransportProtocol" xml:space="preserve">
|
<data name="LvTransportProtocol" xml:space="preserve">
|
||||||
<value>Протокол</value>
|
<value>Протокол</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MediumFresh" xml:space="preserve">
|
|
||||||
<value>Medium</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgClearSubscription" xml:space="preserve">
|
<data name="MsgClearSubscription" xml:space="preserve">
|
||||||
<value>Очистить контент оригинальной подписки</value>
|
<value>Очистить контент оригинальной подписки</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -246,27 +237,15 @@
|
|||||||
<data name="MsgNoValidSubscription" xml:space="preserve">
|
<data name="MsgNoValidSubscription" xml:space="preserve">
|
||||||
<value>Нет установлены подписки</value>
|
<value>Нет установлены подписки</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgPACUpdateFailed" xml:space="preserve">
|
|
||||||
<value>Ошибка обновления PAC</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgPACUpdateSuccessfully" xml:space="preserve">
|
|
||||||
<value>PAC успешно обновлен</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgParsingSuccessfully" xml:space="preserve">
|
<data name="MsgParsingSuccessfully" xml:space="preserve">
|
||||||
<value>Парсинг {0} прошел успешно</value>
|
<value>Парсинг {0} прошел успешно</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgSimplifyPAC" xml:space="preserve">
|
|
||||||
<value>Упрощение PAC прошло успешно</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgStartGettingSubscriptions" xml:space="preserve">
|
<data name="MsgStartGettingSubscriptions" xml:space="preserve">
|
||||||
<value>Начинаю получать подписки</value>
|
<value>Начинаю получать подписки</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgStartUpdating" xml:space="preserve">
|
<data name="MsgStartUpdating" xml:space="preserve">
|
||||||
<value>Начинаю обновление {0}...</value>
|
<value>Начинаю обновление {0}...</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgStartUpdatingPAC" xml:space="preserve">
|
|
||||||
<value>Начинаю обновление PAC...</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
|
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
|
||||||
<value>Некорректное содержимое подписки</value>
|
<value>Некорректное содержимое подписки</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -285,9 +264,6 @@
|
|||||||
<data name="MsgUpdateV2rayCoreSuccessfullyMore" xml:space="preserve">
|
<data name="MsgUpdateV2rayCoreSuccessfullyMore" xml:space="preserve">
|
||||||
<value>Успешное обновление ядра! Перезапуск службы...</value>
|
<value>Успешное обновление ядра! Перезапуск службы...</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NeedHttpGlobalProxy" xml:space="preserve">
|
|
||||||
<value>Эта функция зависит от глобального прокси-сервера HTTP, пожалуйста, сначала установите его правильно.</value>
|
|
||||||
</data>
|
|
||||||
<data name="NonvmessOrssProtocol" xml:space="preserve">
|
<data name="NonvmessOrssProtocol" xml:space="preserve">
|
||||||
<value>Не является протоколом Vmess или SS</value>
|
<value>Не является протоколом Vmess или SS</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -315,9 +291,6 @@
|
|||||||
<data name="PleaseSelectServer" xml:space="preserve">
|
<data name="PleaseSelectServer" xml:space="preserve">
|
||||||
<value>Сначала выберите сервер</value>
|
<value>Сначала выберите сервер</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="QuickFresh" xml:space="preserve">
|
|
||||||
<value>Быстрый</value>
|
|
||||||
</data>
|
|
||||||
<data name="RemoveDuplicateServerResult" xml:space="preserve">
|
<data name="RemoveDuplicateServerResult" xml:space="preserve">
|
||||||
<value>Удаление дублей завершено. Старая: {0}, Новая: {1}.</value>
|
<value>Удаление дублей завершено. Старая: {0}, Новая: {1}.</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -330,15 +303,6 @@
|
|||||||
<data name="SaveServerConfigurationIn" xml:space="preserve">
|
<data name="SaveServerConfigurationIn" xml:space="preserve">
|
||||||
<value>Файл конфигурации сервера сохранен по адресу: {0}</value>
|
<value>Файл конфигурации сервера сохранен по адресу: {0}</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SlowFresh" xml:space="preserve">
|
|
||||||
<value>Медленный</value>
|
|
||||||
</data>
|
|
||||||
<data name="SpeedServerTips" xml:space="preserve">
|
|
||||||
<value>Примечание. Эта функция зависит от глобального прокси-сервера HTTP. После тестирования вручную настройте глобальный прокси-сервер HTTP и активный узел.</value>
|
|
||||||
</data>
|
|
||||||
<data name="StartPacFailed" xml:space="preserve">
|
|
||||||
<value>PAC не удалось запустить. Пожалуйста, запустите эту программу от имени администратора.</value>
|
|
||||||
</data>
|
|
||||||
<data name="StartService" xml:space="preserve">
|
<data name="StartService" xml:space="preserve">
|
||||||
<value>Запуск сервиса ({0})...</value>
|
<value>Запуск сервиса ({0})...</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -472,9 +436,6 @@
|
|||||||
<data name="MsgServerTitle" xml:space="preserve">
|
<data name="MsgServerTitle" xml:space="preserve">
|
||||||
<value>Фильтр серверов</value>
|
<value>Фильтр серверов</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NetFrameworkRequirementsTip" xml:space="preserve">
|
|
||||||
<value>Для корректной работы требуется .NET Framework 4.8</value>
|
|
||||||
</data>
|
|
||||||
<data name="menuCheckUpdate" xml:space="preserve">
|
<data name="menuCheckUpdate" xml:space="preserve">
|
||||||
<value>Проверить обновления</value>
|
<value>Проверить обновления</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -763,12 +724,6 @@
|
|||||||
<data name="TbSettingsAutoHideStartup" xml:space="preserve">
|
<data name="TbSettingsAutoHideStartup" xml:space="preserve">
|
||||||
<value>Auto hide startup</value>
|
<value>Auto hide startup</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsAutoTest" xml:space="preserve">
|
|
||||||
<value>Интервал автоматической проверки задержки в минутах</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsAutoUpdate" xml:space="preserve">
|
|
||||||
<value>Интервал автоматического обновления подписок в часах</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsAutoUpdateInterval" xml:space="preserve">
|
<data name="TbSettingsAutoUpdateInterval" xml:space="preserve">
|
||||||
<value>Интервал автоматического обновления Geo в часах</value>
|
<value>Интервал автоматического обновления Geo в часах</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -808,9 +763,6 @@
|
|||||||
<data name="TbSettingsIgnoreGeoUpdateCore" xml:space="preserve">
|
<data name="TbSettingsIgnoreGeoUpdateCore" xml:space="preserve">
|
||||||
<value>Игнорировать файлы Geo при обновлении ядра</value>
|
<value>Игнорировать файлы Geo при обновлении ядра</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsIpv6" xml:space="preserve">
|
|
||||||
<value>Включить IPv6</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsKeepOlderDedupl" xml:space="preserve">
|
<data name="TbSettingsKeepOlderDedupl" xml:space="preserve">
|
||||||
<value>Сохранить старые при удалении дублей</value>
|
<value>Сохранить старые при удалении дублей</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -826,18 +778,12 @@
|
|||||||
<data name="TbSettingsN" xml:space="preserve">
|
<data name="TbSettingsN" xml:space="preserve">
|
||||||
<value>Настройки v2rayN</value>
|
<value>Настройки v2rayN</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsPacListenPort" xml:space="preserve">
|
|
||||||
<value>Порт PAC</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsPass" xml:space="preserve">
|
<data name="TbSettingsPass" xml:space="preserve">
|
||||||
<value>Пароль аутентификации</value>
|
<value>Пароль аутентификации</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsRemoteDNS" xml:space="preserve">
|
<data name="TbSettingsRemoteDNS" xml:space="preserve">
|
||||||
<value>Пользовательский DNS (если несколько делите с запятыми (,))</value>
|
<value>Пользовательский DNS (если несколько делите с запятыми (,))</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsSaveTip" xml:space="preserve">
|
|
||||||
<value>После изменения следующих параметров нажмите «Сохранить», чтобы изменения вступили в силу</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsSetUWP" xml:space="preserve">
|
<data name="TbSettingsSetUWP" xml:space="preserve">
|
||||||
<value>Set Win10 UWP Loopback</value>
|
<value>Set Win10 UWP Loopback</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -1108,4 +1054,7 @@
|
|||||||
<data name="TbSettingsFontSize" xml:space="preserve">
|
<data name="TbSettingsFontSize" xml:space="preserve">
|
||||||
<value>Размер шрифта</value>
|
<value>Размер шрифта</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbSettingsEnableHWA" xml:space="preserve">
|
||||||
|
<value>Включить аппаратное ускорение (требуется перезагрузка)</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -195,9 +195,6 @@
|
|||||||
<data name="LvAddress" xml:space="preserve">
|
<data name="LvAddress" xml:space="preserve">
|
||||||
<value>地址</value>
|
<value>地址</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LvAlias" xml:space="preserve">
|
|
||||||
<value>别名</value>
|
|
||||||
</data>
|
|
||||||
<data name="LvEncryptionMethod" xml:space="preserve">
|
<data name="LvEncryptionMethod" xml:space="preserve">
|
||||||
<value>加密方式</value>
|
<value>加密方式</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -210,9 +207,6 @@
|
|||||||
<data name="LvSubscription" xml:space="preserve">
|
<data name="LvSubscription" xml:space="preserve">
|
||||||
<value>订阅分组</value>
|
<value>订阅分组</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LvTestResults" xml:space="preserve">
|
|
||||||
<value>测试结果</value>
|
|
||||||
</data>
|
|
||||||
<data name="LvTodayDownloadDataAmount" xml:space="preserve">
|
<data name="LvTodayDownloadDataAmount" xml:space="preserve">
|
||||||
<value>今日下载</value>
|
<value>今日下载</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -228,9 +222,6 @@
|
|||||||
<data name="LvTransportProtocol" xml:space="preserve">
|
<data name="LvTransportProtocol" xml:space="preserve">
|
||||||
<value>传输协议</value>
|
<value>传输协议</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MediumFresh" xml:space="preserve">
|
|
||||||
<value>中等</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgClearSubscription" xml:space="preserve">
|
<data name="MsgClearSubscription" xml:space="preserve">
|
||||||
<value>清除原订阅内容</value>
|
<value>清除原订阅内容</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -246,27 +237,15 @@
|
|||||||
<data name="MsgNoValidSubscription" xml:space="preserve">
|
<data name="MsgNoValidSubscription" xml:space="preserve">
|
||||||
<value>未设置有效的订阅</value>
|
<value>未设置有效的订阅</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgPACUpdateFailed" xml:space="preserve">
|
|
||||||
<value>PAC更新失败</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgPACUpdateSuccessfully" xml:space="preserve">
|
|
||||||
<value>PAC更新成功</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgParsingSuccessfully" xml:space="preserve">
|
<data name="MsgParsingSuccessfully" xml:space="preserve">
|
||||||
<value>解析{0}成功</value>
|
<value>解析{0}成功</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgSimplifyPAC" xml:space="preserve">
|
|
||||||
<value>简化PAC成功</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgStartGettingSubscriptions" xml:space="preserve">
|
<data name="MsgStartGettingSubscriptions" xml:space="preserve">
|
||||||
<value>开始获取订阅内容</value>
|
<value>开始获取订阅内容</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgStartUpdating" xml:space="preserve">
|
<data name="MsgStartUpdating" xml:space="preserve">
|
||||||
<value>开始更新 {0}...</value>
|
<value>开始更新 {0}...</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgStartUpdatingPAC" xml:space="preserve">
|
|
||||||
<value>开始更新 PAC...</value>
|
|
||||||
</data>
|
|
||||||
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
|
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
|
||||||
<value>无效的订阅内容</value>
|
<value>无效的订阅内容</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -285,9 +264,6 @@
|
|||||||
<data name="MsgUpdateV2rayCoreSuccessfullyMore" xml:space="preserve">
|
<data name="MsgUpdateV2rayCoreSuccessfullyMore" xml:space="preserve">
|
||||||
<value>更新Core成功!正在重启服务...</value>
|
<value>更新Core成功!正在重启服务...</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NeedHttpGlobalProxy" xml:space="preserve">
|
|
||||||
<value>此功能依赖Http全局代理,请先设置正确。</value>
|
|
||||||
</data>
|
|
||||||
<data name="NonvmessOrssProtocol" xml:space="preserve">
|
<data name="NonvmessOrssProtocol" xml:space="preserve">
|
||||||
<value>非VMess或ss协议</value>
|
<value>非VMess或ss协议</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -304,7 +280,7 @@
|
|||||||
<value>操作失败,请检查重试</value>
|
<value>操作失败,请检查重试</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PleaseFillRemarks" xml:space="preserve">
|
<data name="PleaseFillRemarks" xml:space="preserve">
|
||||||
<value>请填写备注</value>
|
<value>请填写别名</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PleaseSelectEncryption" xml:space="preserve">
|
<data name="PleaseSelectEncryption" xml:space="preserve">
|
||||||
<value>请选择加密方式</value>
|
<value>请选择加密方式</value>
|
||||||
@@ -315,9 +291,6 @@
|
|||||||
<data name="PleaseSelectServer" xml:space="preserve">
|
<data name="PleaseSelectServer" xml:space="preserve">
|
||||||
<value>请先选择服务器</value>
|
<value>请先选择服务器</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="QuickFresh" xml:space="preserve">
|
|
||||||
<value>快</value>
|
|
||||||
</data>
|
|
||||||
<data name="RemoveDuplicateServerResult" xml:space="preserve">
|
<data name="RemoveDuplicateServerResult" xml:space="preserve">
|
||||||
<value>服务器去重完成。原数量: {0},现数量: {1}</value>
|
<value>服务器去重完成。原数量: {0},现数量: {1}</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -330,15 +303,6 @@
|
|||||||
<data name="SaveServerConfigurationIn" xml:space="preserve">
|
<data name="SaveServerConfigurationIn" xml:space="preserve">
|
||||||
<value>服务端配置文件保存在:{0}</value>
|
<value>服务端配置文件保存在:{0}</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SlowFresh" xml:space="preserve">
|
|
||||||
<value>慢</value>
|
|
||||||
</data>
|
|
||||||
<data name="SpeedServerTips" xml:space="preserve">
|
|
||||||
<value>注意:此功能依赖Http全局代理!测试完成后,请手工调整Http全局代理和活动节点。</value>
|
|
||||||
</data>
|
|
||||||
<data name="StartPacFailed" xml:space="preserve">
|
|
||||||
<value>PAC服务启动失败,请用管理员启动</value>
|
|
||||||
</data>
|
|
||||||
<data name="StartService" xml:space="preserve">
|
<data name="StartService" xml:space="preserve">
|
||||||
<value>启动服务({0})...</value>
|
<value>启动服务({0})...</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -380,7 +344,7 @@
|
|||||||
<value>数量</value>
|
<value>数量</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgNeedUrl" xml:space="preserve">
|
<data name="MsgNeedUrl" xml:space="preserve">
|
||||||
<value>请填写地址(Url)</value>
|
<value>请填写Url</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AddBatchRoutingRulesYesNo" xml:space="preserve">
|
<data name="AddBatchRoutingRulesYesNo" xml:space="preserve">
|
||||||
<value>是否追加规则?选择是则追加,选择否则替换</value>
|
<value>是否追加规则?选择是则追加,选择否则替换</value>
|
||||||
@@ -410,13 +374,13 @@
|
|||||||
<value>*grpc serviceName</value>
|
<value>*grpc serviceName</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TransportRequestHostTip1" xml:space="preserve">
|
<data name="TransportRequestHostTip1" xml:space="preserve">
|
||||||
<value>*http host中间逗号(,)隔开</value>
|
<value>*http host中间逗号(,)分隔</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TransportRequestHostTip2" xml:space="preserve">
|
<data name="TransportRequestHostTip2" xml:space="preserve">
|
||||||
<value>*ws host</value>
|
<value>*ws host</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TransportRequestHostTip3" xml:space="preserve">
|
<data name="TransportRequestHostTip3" xml:space="preserve">
|
||||||
<value>*h2 host中间逗号(,)隔开</value>
|
<value>*h2 host中间逗号(,)分隔</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TransportRequestHostTip4" xml:space="preserve">
|
<data name="TransportRequestHostTip4" xml:space="preserve">
|
||||||
<value>*QUIC 加密方式</value>
|
<value>*QUIC 加密方式</value>
|
||||||
@@ -470,10 +434,7 @@
|
|||||||
<value>本地</value>
|
<value>本地</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgServerTitle" xml:space="preserve">
|
<data name="MsgServerTitle" xml:space="preserve">
|
||||||
<value>服务器过滤器</value>
|
<value>服务器过滤器,按回车执行</value>
|
||||||
</data>
|
|
||||||
<data name="NetFrameworkRequirementsTip" xml:space="preserve">
|
|
||||||
<value>正常使用此版本需要.NET Framework 4.8,请更新后重启</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="menuCheckUpdate" xml:space="preserve">
|
<data name="menuCheckUpdate" xml:space="preserve">
|
||||||
<value>检查更新</value>
|
<value>检查更新</value>
|
||||||
@@ -710,7 +671,7 @@
|
|||||||
<value>SNI</value>
|
<value>SNI</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbStreamSecurity" xml:space="preserve">
|
<data name="TbStreamSecurity" xml:space="preserve">
|
||||||
<value>TLS</value>
|
<value>传输层安全(TLS)</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TipNetwork" xml:space="preserve">
|
<data name="TipNetwork" xml:space="preserve">
|
||||||
<value>*默认tcp,选错会无法连接</value>
|
<value>*默认tcp,选错会无法连接</value>
|
||||||
@@ -763,12 +724,6 @@
|
|||||||
<data name="TbSettingsAutoHideStartup" xml:space="preserve">
|
<data name="TbSettingsAutoHideStartup" xml:space="preserve">
|
||||||
<value>启动后隐藏窗口</value>
|
<value>启动后隐藏窗口</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsAutoTest" xml:space="preserve">
|
|
||||||
<value>自动延迟测试的间隔 (单位分钟)</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsAutoUpdate" xml:space="preserve">
|
|
||||||
<value>自动更新订阅的间隔(单位小时)</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsAutoUpdateInterval" xml:space="preserve">
|
<data name="TbSettingsAutoUpdateInterval" xml:space="preserve">
|
||||||
<value>自动更新Geo文件的间隔(单位小时)</value>
|
<value>自动更新Geo文件的间隔(单位小时)</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -808,14 +763,11 @@
|
|||||||
<data name="TbSettingsIgnoreGeoUpdateCore" xml:space="preserve">
|
<data name="TbSettingsIgnoreGeoUpdateCore" xml:space="preserve">
|
||||||
<value>更新Core时忽略Geo文件</value>
|
<value>更新Core时忽略Geo文件</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsIpv6" xml:space="preserve">
|
|
||||||
<value>启用IPv6</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsKeepOlderDedupl" xml:space="preserve">
|
<data name="TbSettingsKeepOlderDedupl" xml:space="preserve">
|
||||||
<value>去重时保留序号较小的项</value>
|
<value>去重时保留序号较小的项</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsLogEnabled" xml:space="preserve">
|
<data name="TbSettingsLogEnabled" xml:space="preserve">
|
||||||
<value>启用日志(默认关闭)</value>
|
<value>启用日志</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsLogLevel" xml:space="preserve">
|
<data name="TbSettingsLogLevel" xml:space="preserve">
|
||||||
<value>日志等级</value>
|
<value>日志等级</value>
|
||||||
@@ -826,17 +778,11 @@
|
|||||||
<data name="TbSettingsN" xml:space="preserve">
|
<data name="TbSettingsN" xml:space="preserve">
|
||||||
<value>v2rayN 设置</value>
|
<value>v2rayN 设置</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsPacListenPort" xml:space="preserve">
|
|
||||||
<value>Pac监听端口号</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsPass" xml:space="preserve">
|
<data name="TbSettingsPass" xml:space="preserve">
|
||||||
<value>认证密码</value>
|
<value>认证密码</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsRemoteDNS" xml:space="preserve">
|
<data name="TbSettingsRemoteDNS" xml:space="preserve">
|
||||||
<value>自定义DNS(可多个,用逗号(,)隔开)</value>
|
<value>自定义DNS(可多个,用逗号(,)分隔)</value>
|
||||||
</data>
|
|
||||||
<data name="TbSettingsSaveTip" xml:space="preserve">
|
|
||||||
<value>修改以下参数后,点击保存才生效</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsSetUWP" xml:space="preserve">
|
<data name="TbSettingsSetUWP" xml:space="preserve">
|
||||||
<value>解除Win10 UWP应用回环代理限制</value>
|
<value>解除Win10 UWP应用回环代理限制</value>
|
||||||
@@ -1132,4 +1078,43 @@
|
|||||||
<data name="menuMoveTo" xml:space="preserve">
|
<data name="menuMoveTo" xml:space="preserve">
|
||||||
<value>移至上下</value>
|
<value>移至上下</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbPublicKey" xml:space="preserve">
|
||||||
|
<value>PublicKey</value>
|
||||||
|
</data>
|
||||||
|
<data name="TbShortId" xml:space="preserve">
|
||||||
|
<value>ShortId</value>
|
||||||
|
</data>
|
||||||
|
<data name="TbSpiderX" xml:space="preserve">
|
||||||
|
<value>SpiderX</value>
|
||||||
|
</data>
|
||||||
|
<data name="TbSettingsEnableHWA" xml:space="preserve">
|
||||||
|
<value>启用硬件加速(需重启)</value>
|
||||||
|
</data>
|
||||||
|
<data name="SpeedtestingWait" xml:space="preserve">
|
||||||
|
<value>等待测试中...</value>
|
||||||
|
</data>
|
||||||
|
<data name="TipDisplayLog" xml:space="preserve">
|
||||||
|
<value>当有异常断流时请关闭</value>
|
||||||
|
</data>
|
||||||
|
<data name="MsgSkipSubscriptionUpdate" xml:space="preserve">
|
||||||
|
<value>未启用更新,跳过此订阅</value>
|
||||||
|
</data>
|
||||||
|
<data name="menuRebootAsAdmin" xml:space="preserve">
|
||||||
|
<value>以管理员身份重启</value>
|
||||||
|
</data>
|
||||||
|
<data name="LvMoreUrl" xml:space="preserve">
|
||||||
|
<value>更多地址(url),用逗号(,)分隔;订阅转换将失效</value>
|
||||||
|
</data>
|
||||||
|
<data name="LvAutoUpdateInterval" xml:space="preserve">
|
||||||
|
<value>自动更新间隔(分钟)</value>
|
||||||
|
</data>
|
||||||
|
<data name="TbSettingsLogEnabledToFile" xml:space="preserve">
|
||||||
|
<value>启用日志存到文件</value>
|
||||||
|
</data>
|
||||||
|
<data name="LvConvertTarget" xml:space="preserve">
|
||||||
|
<value>订阅转换目标类型</value>
|
||||||
|
</data>
|
||||||
|
<data name="LvConvertTargetTip" xml:space="preserve">
|
||||||
|
<value>不需要转换时请留空</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -53,6 +53,7 @@ namespace v2rayN.Tool
|
|||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool ZipExtractToFile(string fileName, string toPath, string ignoredName)
|
public static bool ZipExtractToFile(string fileName, string toPath, string ignoredName)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
|
||||||
namespace v2rayN
|
namespace v2rayN
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* See:
|
* See:
|
||||||
* http://stackoverflow.com/questions/6266820/working-example-of-createjobobject-setinformationjobobject-pinvoke-in-net
|
* http://stackoverflow.com/questions/6266820/working-example-of-createjobobject-setinformationjobobject-pinvoke-in-net
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class Job : IDisposable
|
public class Job : IDisposable
|
||||||
{
|
{
|
||||||
private IntPtr handle = IntPtr.Zero;
|
private IntPtr handle = IntPtr.Zero;
|
||||||
@@ -95,7 +95,7 @@ namespace v2rayN
|
|||||||
Dispose(false);
|
Dispose(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion IDisposable
|
||||||
|
|
||||||
#region Interop
|
#region Interop
|
||||||
|
|
||||||
@@ -112,13 +112,13 @@ namespace v2rayN
|
|||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
private static extern bool CloseHandle(IntPtr hObject);
|
private static extern bool CloseHandle(IntPtr hObject);
|
||||||
|
|
||||||
#endregion
|
#endregion Interop
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Helper classes
|
#region Helper classes
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
struct IO_COUNTERS
|
internal struct IO_COUNTERS
|
||||||
{
|
{
|
||||||
public UInt64 ReadOperationCount;
|
public UInt64 ReadOperationCount;
|
||||||
public UInt64 WriteOperationCount;
|
public UInt64 WriteOperationCount;
|
||||||
@@ -128,9 +128,8 @@ namespace v2rayN
|
|||||||
public UInt64 OtherTransferCount;
|
public UInt64 OtherTransferCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
struct JOBOBJECT_BASIC_LIMIT_INFORMATION
|
internal struct JOBOBJECT_BASIC_LIMIT_INFORMATION
|
||||||
{
|
{
|
||||||
public Int64 PerProcessUserTimeLimit;
|
public Int64 PerProcessUserTimeLimit;
|
||||||
public Int64 PerJobUserTimeLimit;
|
public Int64 PerJobUserTimeLimit;
|
||||||
@@ -152,7 +151,7 @@ namespace v2rayN
|
|||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
struct JOBOBJECT_EXTENDED_LIMIT_INFORMATION
|
internal struct JOBOBJECT_EXTENDED_LIMIT_INFORMATION
|
||||||
{
|
{
|
||||||
public JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation;
|
public JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation;
|
||||||
public IO_COUNTERS IoInfo;
|
public IO_COUNTERS IoInfo;
|
||||||
@@ -173,5 +172,5 @@ namespace v2rayN
|
|||||||
GroupInformation = 11
|
GroupInformation = 11
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Helper classes
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,14 @@ namespace v2rayN.Tool
|
|||||||
LogManager.Configuration = config;
|
LogManager.Configuration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void LoggingEnabled(bool enable)
|
||||||
|
{
|
||||||
|
if (!enable)
|
||||||
|
{
|
||||||
|
LogManager.SuspendLogging();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void ClearLogs()
|
public static void ClearLogs()
|
||||||
{
|
{
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
|
|||||||
@@ -9,12 +9,13 @@ namespace v2rayN.Tool
|
|||||||
{
|
{
|
||||||
return _OrderBy<T>(query, propertyName, false);
|
return _OrderBy<T>(query, propertyName, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IOrderedQueryable<T> OrderByDescending<T>(this IQueryable<T> query, string propertyName)
|
public static IOrderedQueryable<T> OrderByDescending<T>(this IQueryable<T> query, string propertyName)
|
||||||
{
|
{
|
||||||
return _OrderBy<T>(query, propertyName, true);
|
return _OrderBy<T>(query, propertyName, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static IOrderedQueryable<T> _OrderBy<T>(IQueryable<T> query, string propertyName, bool isDesc)
|
private static IOrderedQueryable<T> _OrderBy<T>(IQueryable<T> query, string propertyName, bool isDesc)
|
||||||
{
|
{
|
||||||
string methodname = (isDesc) ? "OrderByDescendingInternal" : "OrderByInternal";
|
string methodname = (isDesc) ? "OrderByDescendingInternal" : "OrderByInternal";
|
||||||
|
|
||||||
@@ -25,15 +26,18 @@ namespace v2rayN.Tool
|
|||||||
|
|
||||||
return (IOrderedQueryable<T>)method.Invoke(null, new object[] { query, memberProp });
|
return (IOrderedQueryable<T>)method.Invoke(null, new object[] { query, memberProp });
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IOrderedQueryable<T> OrderByInternal<T, TProp>(IQueryable<T> query, PropertyInfo memberProperty)
|
public static IOrderedQueryable<T> OrderByInternal<T, TProp>(IQueryable<T> query, PropertyInfo memberProperty)
|
||||||
{//public
|
{//public
|
||||||
return query.OrderBy(_GetLamba<T, TProp>(memberProperty));
|
return query.OrderBy(_GetLamba<T, TProp>(memberProperty));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IOrderedQueryable<T> OrderByDescendingInternal<T, TProp>(IQueryable<T> query, PropertyInfo memberProperty)
|
public static IOrderedQueryable<T> OrderByDescendingInternal<T, TProp>(IQueryable<T> query, PropertyInfo memberProperty)
|
||||||
{//public
|
{//public
|
||||||
return query.OrderByDescending(_GetLamba<T, TProp>(memberProperty));
|
return query.OrderByDescending(_GetLamba<T, TProp>(memberProperty));
|
||||||
}
|
}
|
||||||
static Expression<Func<T, TProp>> _GetLamba<T, TProp>(PropertyInfo memberProperty)
|
|
||||||
|
private static Expression<Func<T, TProp>> _GetLamba<T, TProp>(PropertyInfo memberProperty)
|
||||||
{
|
{
|
||||||
if (memberProperty.PropertyType != typeof(TProp)) throw new Exception();
|
if (memberProperty.PropertyType != typeof(TProp)) throw new Exception();
|
||||||
|
|
||||||
|
|||||||
@@ -1,45 +1,24 @@
|
|||||||
using System.Windows.Forms;
|
using System.Windows;
|
||||||
|
|
||||||
namespace v2rayN
|
namespace v2rayN
|
||||||
{
|
{
|
||||||
class UI
|
internal class UI
|
||||||
{
|
{
|
||||||
|
private static readonly string caption = "v2rayN";
|
||||||
|
|
||||||
public static void Show(string msg)
|
public static void Show(string msg)
|
||||||
{
|
{
|
||||||
MessageBox.Show(msg, "v2rayN", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show(msg, caption, MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ShowWarning(string msg)
|
public static void ShowWarning(string msg)
|
||||||
{
|
{
|
||||||
MessageBox.Show(msg, "v2rayN", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
MessageBox.Show(msg, caption, MessageBoxButton.OK, MessageBoxImage.Warning, MessageBoxResult.OK);
|
||||||
}
|
}
|
||||||
public static void ShowError(string msg)
|
|
||||||
|
public static MessageBoxResult ShowYesNo(string msg)
|
||||||
{
|
{
|
||||||
MessageBox.Show(msg, "v2rayN", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
return MessageBox.Show(msg, caption, MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DialogResult ShowYesNo(string msg)
|
|
||||||
{
|
|
||||||
return MessageBox.Show(msg, "v2rayN", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//public static string GetResourseString(string key)
|
|
||||||
//{
|
|
||||||
// CultureInfo cultureInfo = null;
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// string languageCode = this.LanguageCode;
|
|
||||||
// cultureInfo = new CultureInfo(languageCode);
|
|
||||||
// return Common.ResourceManager.GetString(key, cultureInfo);
|
|
||||||
// }
|
|
||||||
// catch (Exception)
|
|
||||||
// {
|
|
||||||
// //默认读取英文的多语言
|
|
||||||
// cultureInfo = new CultureInfo(MKey.kDefaultLanguageCode);
|
|
||||||
// return Common.ResourceManager.GetString(key, cultureInfo);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,7 @@ using System.Security.Principal;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Windows.Forms;
|
using System.Windows;
|
||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
@@ -31,9 +31,8 @@ using ZXing.Windows.Compatibility;
|
|||||||
|
|
||||||
namespace v2rayN
|
namespace v2rayN
|
||||||
{
|
{
|
||||||
class Utils
|
internal class Utils
|
||||||
{
|
{
|
||||||
|
|
||||||
#region 资源Json操作
|
#region 资源Json操作
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -60,7 +59,6 @@ namespace v2rayN
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 取得存储资源
|
/// 取得存储资源
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -178,7 +176,8 @@ namespace v2rayN
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
#endregion 资源Json操作
|
||||||
|
|
||||||
#region 转换函数
|
#region 转换函数
|
||||||
|
|
||||||
@@ -210,6 +209,7 @@ namespace v2rayN
|
|||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 逗号分隔的字符串,转List<string>
|
/// 逗号分隔的字符串,转List<string>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -282,6 +282,8 @@ namespace v2rayN
|
|||||||
.Replace(Environment.NewLine, "")
|
.Replace(Environment.NewLine, "")
|
||||||
.Replace("\n", "")
|
.Replace("\n", "")
|
||||||
.Replace("\r", "")
|
.Replace("\r", "")
|
||||||
|
.Replace('_', '/')
|
||||||
|
.Replace('-', '+')
|
||||||
.Replace(" ", "");
|
.Replace(" ", "");
|
||||||
|
|
||||||
if (plainText.Length % 4 > 0)
|
if (plainText.Length % 4 > 0)
|
||||||
@@ -312,10 +314,11 @@ namespace v2rayN
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
SaveLog(ex.Message, ex);
|
//SaveLog(ex.Message, ex);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool ToBool(object obj)
|
public static bool ToBool(object obj)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -324,7 +327,7 @@ namespace v2rayN
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
SaveLog(ex.Message, ex);
|
//SaveLog(ex.Message, ex);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -337,7 +340,7 @@ namespace v2rayN
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
SaveLog(ex.Message, ex);
|
//SaveLog(ex.Message, ex);
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -365,23 +368,22 @@ namespace v2rayN
|
|||||||
if (GBs > 0)
|
if (GBs > 0)
|
||||||
{
|
{
|
||||||
// multi GB
|
// multi GB
|
||||||
/*ulong TBs = GBs / factor;
|
long TBs = GBs / factor;
|
||||||
if (TBs > 0)
|
if (TBs > 0)
|
||||||
{
|
{
|
||||||
// 你是魔鬼吗? 用这么多流量
|
result = TBs + ((GBs % factor) / (factor + 0.0));
|
||||||
result = TBs + GBs % factor / (factor + 0.0);
|
|
||||||
unit = "TB";
|
unit = "TB";
|
||||||
return;
|
return;
|
||||||
}*/
|
}
|
||||||
result = GBs + MBs % factor / (factor + 0.0);
|
result = GBs + ((MBs % factor) / (factor + 0.0));
|
||||||
unit = "GB";
|
unit = "GB";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result = MBs + KBs % factor / (factor + 0.0);
|
result = MBs + ((KBs % factor) / (factor + 0.0));
|
||||||
unit = "MB";
|
unit = "MB";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result = KBs + amount % factor / (factor + 0.0);
|
result = KBs + ((amount % factor) / (factor + 0.0));
|
||||||
unit = "KB";
|
unit = "KB";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -403,6 +405,7 @@ namespace v2rayN
|
|||||||
return Uri.EscapeDataString(url);
|
return Uri.EscapeDataString(url);
|
||||||
//return HttpUtility.UrlEncode(url);
|
//return HttpUtility.UrlEncode(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string UrlDecode(string url)
|
public static string UrlDecode(string url)
|
||||||
{
|
{
|
||||||
return HttpUtility.UrlDecode(url);
|
return HttpUtility.UrlDecode(url);
|
||||||
@@ -419,6 +422,7 @@ namespace v2rayN
|
|||||||
}
|
}
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ImageSource IconToImageSource(Icon icon)
|
public static ImageSource IconToImageSource(Icon icon)
|
||||||
{
|
{
|
||||||
return Imaging.CreateBitmapSourceFromHIcon(
|
return Imaging.CreateBitmapSourceFromHIcon(
|
||||||
@@ -427,6 +431,11 @@ namespace v2rayN
|
|||||||
BitmapSizeOptions.FromEmptyOptions());
|
BitmapSizeOptions.FromEmptyOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// idn to idc
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="url"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public static string GetPunycode(string url)
|
public static string GetPunycode(string url)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(url))
|
if (string.IsNullOrWhiteSpace(url))
|
||||||
@@ -451,8 +460,13 @@ namespace v2rayN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
public static bool IsBase64String(string plainText)
|
||||||
|
{
|
||||||
|
var buffer = new Span<byte>(new byte[plainText.Length]);
|
||||||
|
return Convert.TryFromBase64String(plainText, buffer, out int _);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion 转换函数
|
||||||
|
|
||||||
#region 数据检查
|
#region 数据检查
|
||||||
|
|
||||||
@@ -521,7 +535,6 @@ namespace v2rayN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//模式字符串
|
//模式字符串
|
||||||
string pattern = @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$";
|
string pattern = @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$";
|
||||||
|
|
||||||
@@ -575,11 +588,10 @@ namespace v2rayN
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion 数据检查
|
||||||
|
|
||||||
#region 开机自动启动
|
#region 开机自动启动
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开机自动启动
|
/// 开机自动启动
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -665,12 +677,12 @@ namespace v2rayN
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string GetExePath()
|
public static string GetExePath()
|
||||||
{
|
{
|
||||||
return Application.ExecutablePath;
|
return Environment.ProcessPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string StartupPath()
|
public static string StartupPath()
|
||||||
{
|
{
|
||||||
return Application.StartupPath;
|
return AppDomain.CurrentDomain.BaseDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string? RegReadValue(string path, string name, string def)
|
public static string? RegReadValue(string path, string name, string def)
|
||||||
@@ -778,14 +790,14 @@ namespace v2rayN
|
|||||||
task.Settings.RunOnlyIfIdle = false;
|
task.Settings.RunOnlyIfIdle = false;
|
||||||
task.Settings.IdleSettings.StopOnIdleEnd = false;
|
task.Settings.IdleSettings.StopOnIdleEnd = false;
|
||||||
task.Settings.ExecutionTimeLimit = TimeSpan.Zero;
|
task.Settings.ExecutionTimeLimit = TimeSpan.Zero;
|
||||||
task.Triggers.Add(new LogonTrigger { UserId = logonUser, Delay = TimeSpan.FromMinutes(1) });
|
task.Triggers.Add(new LogonTrigger { UserId = logonUser, Delay = TimeSpan.FromSeconds(10) });
|
||||||
task.Principal.RunLevel = TaskRunLevel.Highest;
|
task.Principal.RunLevel = TaskRunLevel.Highest;
|
||||||
task.Actions.Add(new ExecAction(deamonFileName));
|
task.Actions.Add(new ExecAction(deamonFileName));
|
||||||
|
|
||||||
taskService.RootFolder.RegisterTaskDefinition(TaskName, task);
|
taskService.RootFolder.RegisterTaskDefinition(TaskName, task);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion 开机自动启动
|
||||||
|
|
||||||
#region 测速
|
#region 测速
|
||||||
|
|
||||||
@@ -850,7 +862,8 @@ namespace v2rayN
|
|||||||
}
|
}
|
||||||
return inUse;
|
return inUse;
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
#endregion 测速
|
||||||
|
|
||||||
#region 杂项
|
#region 杂项
|
||||||
|
|
||||||
@@ -907,13 +920,13 @@ namespace v2rayN
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string? GetClipboardData()
|
public static string? GetClipboardData()
|
||||||
{
|
{
|
||||||
string strData = string.Empty;
|
string? strData = string.Empty;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IDataObject data = Clipboard.GetDataObject();
|
IDataObject data = Clipboard.GetDataObject();
|
||||||
if (data.GetDataPresent(DataFormats.UnicodeText))
|
if (data.GetDataPresent(DataFormats.UnicodeText))
|
||||||
{
|
{
|
||||||
strData = data.GetData(DataFormats.UnicodeText).ToString();
|
strData = data.GetData(DataFormats.UnicodeText)?.ToString();
|
||||||
}
|
}
|
||||||
return strData;
|
return strData;
|
||||||
}
|
}
|
||||||
@@ -983,7 +996,6 @@ namespace v2rayN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static string GetDownloadFileName(string url)
|
public static string GetDownloadFileName(string url)
|
||||||
{
|
{
|
||||||
var fileName = Path.GetFileName(url);
|
var fileName = Path.GetFileName(url);
|
||||||
@@ -1010,6 +1022,7 @@ namespace v2rayN
|
|||||||
{
|
{
|
||||||
return Guid.TryParse(strSrc, out Guid g);
|
return Guid.TryParse(strSrc, out Guid g);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ProcessStart(string fileName)
|
public static void ProcessStart(string fileName)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -1031,7 +1044,8 @@ namespace v2rayN
|
|||||||
DwmSetWindowAttribute(hWnd, DWMWINDOWATTRIBUTE.DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1, ref attribute, attributeSize);
|
DwmSetWindowAttribute(hWnd, DWMWINDOWATTRIBUTE.DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1, ref attribute, attributeSize);
|
||||||
DwmSetWindowAttribute(hWnd, DWMWINDOWATTRIBUTE.DWMWA_USE_IMMERSIVE_DARK_MODE, ref attribute, attributeSize);
|
DwmSetWindowAttribute(hWnd, DWMWINDOWATTRIBUTE.DWMWA_USE_IMMERSIVE_DARK_MODE, ref attribute, attributeSize);
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
#endregion 杂项
|
||||||
|
|
||||||
#region TempPath
|
#region TempPath
|
||||||
|
|
||||||
@@ -1071,6 +1085,7 @@ namespace v2rayN
|
|||||||
}
|
}
|
||||||
return Path.Combine(_tempPath, filename);
|
return Path.Combine(_tempPath, filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetConfigPath(string filename = "")
|
public static string GetConfigPath(string filename = "")
|
||||||
{
|
{
|
||||||
string _tempPath = Path.Combine(StartupPath(), "guiConfigs");
|
string _tempPath = Path.Combine(StartupPath(), "guiConfigs");
|
||||||
@@ -1087,6 +1102,7 @@ namespace v2rayN
|
|||||||
return Path.Combine(_tempPath, filename);
|
return Path.Combine(_tempPath, filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetBinPath(string filename, ECoreType? coreType = null)
|
public static string GetBinPath(string filename, ECoreType? coreType = null)
|
||||||
{
|
{
|
||||||
string _tempPath = Path.Combine(StartupPath(), "bin");
|
string _tempPath = Path.Combine(StartupPath(), "bin");
|
||||||
@@ -1111,6 +1127,7 @@ namespace v2rayN
|
|||||||
return Path.Combine(_tempPath, filename);
|
return Path.Combine(_tempPath, filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetLogPath(string filename = "")
|
public static string GetLogPath(string filename = "")
|
||||||
{
|
{
|
||||||
string _tempPath = Path.Combine(StartupPath(), "guiLogs");
|
string _tempPath = Path.Combine(StartupPath(), "guiLogs");
|
||||||
@@ -1127,6 +1144,7 @@ namespace v2rayN
|
|||||||
return Path.Combine(_tempPath, filename);
|
return Path.Combine(_tempPath, filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetFontsPath(string filename = "")
|
public static string GetFontsPath(string filename = "")
|
||||||
{
|
{
|
||||||
string _tempPath = Path.Combine(StartupPath(), "guiFonts");
|
string _tempPath = Path.Combine(StartupPath(), "guiFonts");
|
||||||
@@ -1144,16 +1162,22 @@ namespace v2rayN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion TempPath
|
||||||
|
|
||||||
#region Log
|
#region Log
|
||||||
|
|
||||||
public static void SaveLog(string strContent)
|
public static void SaveLog(string strContent)
|
||||||
|
{
|
||||||
|
if (LogManager.IsLoggingEnabled())
|
||||||
{
|
{
|
||||||
var logger = LogManager.GetLogger("Log1");
|
var logger = LogManager.GetLogger("Log1");
|
||||||
logger.Info(strContent);
|
logger.Info(strContent);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void SaveLog(string strTitle, Exception ex)
|
public static void SaveLog(string strTitle, Exception ex)
|
||||||
|
{
|
||||||
|
if (LogManager.IsLoggingEnabled())
|
||||||
{
|
{
|
||||||
var logger = LogManager.GetLogger("Log2");
|
var logger = LogManager.GetLogger("Log2");
|
||||||
logger.Debug($"{strTitle},{ex.Message}");
|
logger.Debug($"{strTitle},{ex.Message}");
|
||||||
@@ -1163,27 +1187,25 @@ namespace v2rayN
|
|||||||
logger.Error(ex.InnerException);
|
logger.Error(ex.InnerException);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Log
|
||||||
|
|
||||||
|
|
||||||
#region scan screen
|
#region scan screen
|
||||||
|
|
||||||
public static string ScanScreen()
|
public static string ScanScreen(float dpiX, float dpiY)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foreach (Screen screen in Screen.AllScreens)
|
var left = (int)(SystemParameters.WorkArea.Left);
|
||||||
{
|
var top = (int)(SystemParameters.WorkArea.Top);
|
||||||
using Bitmap fullImage = new Bitmap(screen.Bounds.Width,
|
var width = (int)(SystemParameters.WorkArea.Width / dpiX);
|
||||||
screen.Bounds.Height);
|
var height = (int)(SystemParameters.WorkArea.Height / dpiY);
|
||||||
|
|
||||||
|
using Bitmap fullImage = new Bitmap(width, height);
|
||||||
using (Graphics g = Graphics.FromImage(fullImage))
|
using (Graphics g = Graphics.FromImage(fullImage))
|
||||||
{
|
{
|
||||||
g.CopyFromScreen(screen.Bounds.X,
|
g.CopyFromScreen(left, top, 0, 0, fullImage.Size, CopyPixelOperation.SourceCopy);
|
||||||
screen.Bounds.Y,
|
|
||||||
0, 0,
|
|
||||||
fullImage.Size,
|
|
||||||
CopyPixelOperation.SourceCopy);
|
|
||||||
}
|
}
|
||||||
int maxTry = 10;
|
int maxTry = 10;
|
||||||
for (int i = 0; i < maxTry; i++)
|
for (int i = 0; i < maxTry; i++)
|
||||||
@@ -1191,9 +1213,9 @@ namespace v2rayN
|
|||||||
int marginLeft = (int)((double)fullImage.Width * i / 2.5 / maxTry);
|
int marginLeft = (int)((double)fullImage.Width * i / 2.5 / maxTry);
|
||||||
int marginTop = (int)((double)fullImage.Height * i / 2.5 / maxTry);
|
int marginTop = (int)((double)fullImage.Height * i / 2.5 / maxTry);
|
||||||
Rectangle cropRect = new(marginLeft, marginTop, fullImage.Width - marginLeft * 2, fullImage.Height - marginTop * 2);
|
Rectangle cropRect = new(marginLeft, marginTop, fullImage.Width - marginLeft * 2, fullImage.Height - marginTop * 2);
|
||||||
Bitmap target = new(screen.Bounds.Width, screen.Bounds.Height);
|
Bitmap target = new(width, height);
|
||||||
|
|
||||||
double imageScale = (double)screen.Bounds.Width / (double)cropRect.Width;
|
double imageScale = (double)width / (double)cropRect.Width;
|
||||||
using (Graphics g = Graphics.FromImage(target))
|
using (Graphics g = Graphics.FromImage(target))
|
||||||
{
|
{
|
||||||
g.DrawImage(fullImage, new Rectangle(0, 0, target.Width, target.Height),
|
g.DrawImage(fullImage, new Rectangle(0, 0, target.Width, target.Height),
|
||||||
@@ -1212,7 +1234,6 @@ namespace v2rayN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
SaveLog(ex.Message, ex);
|
SaveLog(ex.Message, ex);
|
||||||
@@ -1220,12 +1241,18 @@ namespace v2rayN
|
|||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
public static Tuple<float, float> GetDpiXY(Window window)
|
||||||
|
{
|
||||||
|
IntPtr hWnd = new WindowInteropHelper(window).EnsureHandle();
|
||||||
|
Graphics g = Graphics.FromHwnd(hWnd);
|
||||||
|
|
||||||
|
return new(96 / g.DpiX, 96 / g.DpiY);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion scan screen
|
||||||
|
|
||||||
#region Windows API
|
#region Windows API
|
||||||
|
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum DWMWINDOWATTRIBUTE : uint
|
public enum DWMWINDOWATTRIBUTE : uint
|
||||||
{
|
{
|
||||||
@@ -1236,6 +1263,6 @@ namespace v2rayN
|
|||||||
[DllImport("dwmapi.dll")]
|
[DllImport("dwmapi.dll")]
|
||||||
public static extern int DwmSetWindowAttribute(IntPtr hwnd, DWMWINDOWATTRIBUTE attribute, ref int attributeValue, uint attributeSize);
|
public static extern int DwmSetWindowAttribute(IntPtr hwnd, DWMWINDOWATTRIBUTE attribute, ref int attributeValue, uint attributeSize);
|
||||||
|
|
||||||
#endregion
|
#endregion Windows API
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Microsoft.Win32;
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
using ReactiveUI.Fody.Helpers;
|
using ReactiveUI.Fody.Helpers;
|
||||||
using ReactiveUI.Validation.Helpers;
|
using ReactiveUI.Validation.Helpers;
|
||||||
@@ -5,7 +6,6 @@ using Splat;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reactive;
|
using System.Reactive;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Forms;
|
|
||||||
using v2rayN.Base;
|
using v2rayN.Base;
|
||||||
using v2rayN.Handler;
|
using v2rayN.Handler;
|
||||||
using v2rayN.Mode;
|
using v2rayN.Mode;
|
||||||
@@ -22,7 +22,6 @@ namespace v2rayN.ViewModels
|
|||||||
[Reactive]
|
[Reactive]
|
||||||
public ProfileItem SelectedSource { get; set; }
|
public ProfileItem SelectedSource { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> BrowseServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> BrowseServerCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> EditServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> EditServerCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> SaveServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> SaveServerCmd { get; }
|
||||||
@@ -111,7 +110,7 @@ namespace v2rayN.ViewModels
|
|||||||
Multiselect = false,
|
Multiselect = false,
|
||||||
Filter = "Config|*.json|YAML|*.yaml;*.yml|All|*.*"
|
Filter = "Config|*.json|YAML|*.yaml;*.yml|All|*.*"
|
||||||
};
|
};
|
||||||
if (fileDialog.ShowDialog() != DialogResult.OK)
|
if (fileDialog.ShowDialog() != true)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
||||||
|
|
||||||
|
|
||||||
public AddServerViewModel(ProfileItem profileItem, Window view)
|
public AddServerViewModel(ProfileItem profileItem, Window view)
|
||||||
{
|
{
|
||||||
_config = LazyConfig.Instance.GetConfig();
|
_config = LazyConfig.Instance.GetConfig();
|
||||||
@@ -118,6 +117,10 @@ namespace v2rayN.ViewModels
|
|||||||
item.allowInsecure = SelectedSource.allowInsecure;
|
item.allowInsecure = SelectedSource.allowInsecure;
|
||||||
item.fingerprint = SelectedSource.fingerprint;
|
item.fingerprint = SelectedSource.fingerprint;
|
||||||
item.alpn = SelectedSource.alpn;
|
item.alpn = SelectedSource.alpn;
|
||||||
|
|
||||||
|
item.publicKey = SelectedSource.publicKey;
|
||||||
|
item.shortId = SelectedSource.shortId;
|
||||||
|
item.spiderX = SelectedSource.spiderX;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
@@ -126,15 +129,19 @@ namespace v2rayN.ViewModels
|
|||||||
case EConfigType.VMess:
|
case EConfigType.VMess:
|
||||||
ret = ConfigHandler.AddServer(ref _config, item);
|
ret = ConfigHandler.AddServer(ref _config, item);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.Shadowsocks:
|
case EConfigType.Shadowsocks:
|
||||||
ret = ConfigHandler.AddShadowsocksServer(ref _config, item);
|
ret = ConfigHandler.AddShadowsocksServer(ref _config, item);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.Socks:
|
case EConfigType.Socks:
|
||||||
ret = ConfigHandler.AddSocksServer(ref _config, item);
|
ret = ConfigHandler.AddSocksServer(ref _config, item);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.VLESS:
|
case EConfigType.VLESS:
|
||||||
ret = ConfigHandler.AddVlessServer(ref _config, item);
|
ret = ConfigHandler.AddVlessServer(ref _config, item);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.Trojan:
|
case EConfigType.Trojan:
|
||||||
ret = ConfigHandler.AddTrojanServer(ref _config, item);
|
ret = ConfigHandler.AddTrojanServer(ref _config, item);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -3,17 +3,17 @@ using DynamicData.Binding;
|
|||||||
using MaterialDesignColors;
|
using MaterialDesignColors;
|
||||||
using MaterialDesignColors.ColorManipulation;
|
using MaterialDesignColors.ColorManipulation;
|
||||||
using MaterialDesignThemes.Wpf;
|
using MaterialDesignThemes.Wpf;
|
||||||
using NHotkey;
|
using Microsoft.Win32;
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
using ReactiveUI.Fody.Helpers;
|
using ReactiveUI.Fody.Helpers;
|
||||||
using Splat;
|
using Splat;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reactive;
|
using System.Reactive;
|
||||||
using System.Reactive.Linq;
|
using System.Reactive.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Forms;
|
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using v2rayN.Base;
|
using v2rayN.Base;
|
||||||
using v2rayN.Handler;
|
using v2rayN.Handler;
|
||||||
@@ -21,8 +21,6 @@ using v2rayN.Mode;
|
|||||||
using v2rayN.Resx;
|
using v2rayN.Resx;
|
||||||
using v2rayN.Tool;
|
using v2rayN.Tool;
|
||||||
using v2rayN.Views;
|
using v2rayN.Views;
|
||||||
using Application = System.Windows.Application;
|
|
||||||
|
|
||||||
|
|
||||||
namespace v2rayN.ViewModels
|
namespace v2rayN.ViewModels
|
||||||
{
|
{
|
||||||
@@ -39,9 +37,9 @@ namespace v2rayN.ViewModels
|
|||||||
private NoticeHandler? _noticeHandler;
|
private NoticeHandler? _noticeHandler;
|
||||||
private readonly PaletteHelper _paletteHelper = new();
|
private readonly PaletteHelper _paletteHelper = new();
|
||||||
private Dictionary<string, bool> _dicHeaderSort = new();
|
private Dictionary<string, bool> _dicHeaderSort = new();
|
||||||
private Action<string> _updateView;
|
private Action<EViewAction> _updateView;
|
||||||
|
|
||||||
#endregion
|
#endregion private prop
|
||||||
|
|
||||||
#region ObservableCollection
|
#region ObservableCollection
|
||||||
|
|
||||||
@@ -59,23 +57,34 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public ProfileItemModel SelectedProfile { get; set; }
|
public ProfileItemModel SelectedProfile { get; set; }
|
||||||
|
|
||||||
public IList<ProfileItemModel> SelectedProfiles { get; set; }
|
public IList<ProfileItemModel> SelectedProfiles { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public SubItem SelectedSub { get; set; }
|
public SubItem SelectedSub { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public SubItem SelectedMoveToGroup { get; set; }
|
public SubItem SelectedMoveToGroup { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public RoutingItem SelectedRouting { get; set; }
|
public RoutingItem SelectedRouting { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public ComboItem SelectedServer { get; set; }
|
public ComboItem SelectedServer { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string ServerFilter { get; set; }
|
public string ServerFilter { get; set; }
|
||||||
#endregion
|
|
||||||
|
[Reactive]
|
||||||
|
public bool BlServers { get; set; }
|
||||||
|
|
||||||
|
#endregion ObservableCollection
|
||||||
|
|
||||||
#region Menu
|
#region Menu
|
||||||
|
|
||||||
//servers
|
//servers
|
||||||
public ReactiveCommand<Unit, Unit> AddVmessServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> AddVmessServerCmd { get; }
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> AddVlessServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> AddVlessServerCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> AddShadowsocksServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> AddShadowsocksServerCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> AddSocksServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> AddSocksServerCmd { get; }
|
||||||
@@ -83,34 +92,42 @@ namespace v2rayN.ViewModels
|
|||||||
public ReactiveCommand<Unit, Unit> AddCustomServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> AddCustomServerCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> AddServerViaClipboardCmd { get; }
|
public ReactiveCommand<Unit, Unit> AddServerViaClipboardCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> AddServerViaScanCmd { get; }
|
public ReactiveCommand<Unit, Unit> AddServerViaScanCmd { get; }
|
||||||
|
|
||||||
//servers delete
|
//servers delete
|
||||||
public ReactiveCommand<Unit, Unit> EditServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> EditServerCmd { get; }
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> RemoveServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> RemoveServerCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> RemoveDuplicateServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> RemoveDuplicateServerCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> CopyServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> CopyServerCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> SetDefaultServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> SetDefaultServerCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> ShareServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> ShareServerCmd { get; }
|
||||||
|
|
||||||
//servers move
|
//servers move
|
||||||
public ReactiveCommand<Unit, Unit> MoveTopCmd { get; }
|
public ReactiveCommand<Unit, Unit> MoveTopCmd { get; }
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> MoveUpCmd { get; }
|
public ReactiveCommand<Unit, Unit> MoveUpCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> MoveDownCmd { get; }
|
public ReactiveCommand<Unit, Unit> MoveDownCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> MoveBottomCmd { get; }
|
public ReactiveCommand<Unit, Unit> MoveBottomCmd { get; }
|
||||||
|
|
||||||
//servers ping
|
//servers ping
|
||||||
public ReactiveCommand<Unit, Unit> MixedTestServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> MixedTestServerCmd { get; }
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> PingServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> PingServerCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> TcpingServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> TcpingServerCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> RealPingServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> RealPingServerCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> SpeedServerCmd { get; }
|
public ReactiveCommand<Unit, Unit> SpeedServerCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> SortServerResultCmd { get; }
|
public ReactiveCommand<Unit, Unit> SortServerResultCmd { get; }
|
||||||
|
|
||||||
//servers export
|
//servers export
|
||||||
public ReactiveCommand<Unit, Unit> Export2ClientConfigCmd { get; }
|
public ReactiveCommand<Unit, Unit> Export2ClientConfigCmd { get; }
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> Export2ServerConfigCmd { get; }
|
public ReactiveCommand<Unit, Unit> Export2ServerConfigCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> Export2ShareUrlCmd { get; }
|
public ReactiveCommand<Unit, Unit> Export2ShareUrlCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> Export2SubContentCmd { get; }
|
public ReactiveCommand<Unit, Unit> Export2SubContentCmd { get; }
|
||||||
|
|
||||||
//Subscription
|
//Subscription
|
||||||
public ReactiveCommand<Unit, Unit> SubSettingCmd { get; }
|
public ReactiveCommand<Unit, Unit> SubSettingCmd { get; }
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> AddSubCmd { get; }
|
public ReactiveCommand<Unit, Unit> AddSubCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> SubUpdateCmd { get; }
|
public ReactiveCommand<Unit, Unit> SubUpdateCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> SubUpdateViaProxyCmd { get; }
|
public ReactiveCommand<Unit, Unit> SubUpdateViaProxyCmd { get; }
|
||||||
@@ -119,42 +136,56 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
//Setting
|
//Setting
|
||||||
public ReactiveCommand<Unit, Unit> OptionSettingCmd { get; }
|
public ReactiveCommand<Unit, Unit> OptionSettingCmd { get; }
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> RoutingSettingCmd { get; }
|
public ReactiveCommand<Unit, Unit> RoutingSettingCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> GlobalHotkeySettingCmd { get; }
|
public ReactiveCommand<Unit, Unit> GlobalHotkeySettingCmd { get; }
|
||||||
|
public ReactiveCommand<Unit, Unit> RebootAsAdminCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> ClearServerStatisticsCmd { get; }
|
public ReactiveCommand<Unit, Unit> ClearServerStatisticsCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> ImportOldGuiConfigCmd { get; }
|
public ReactiveCommand<Unit, Unit> ImportOldGuiConfigCmd { get; }
|
||||||
|
|
||||||
//CheckUpdate
|
//CheckUpdate
|
||||||
public ReactiveCommand<Unit, Unit> CheckUpdateNCmd { get; }
|
public ReactiveCommand<Unit, Unit> CheckUpdateNCmd { get; }
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> CheckUpdateV2flyCoreCmd { get; }
|
public ReactiveCommand<Unit, Unit> CheckUpdateV2flyCoreCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> CheckUpdateSagerNetCoreCmd { get; }
|
public ReactiveCommand<Unit, Unit> CheckUpdateSagerNetCoreCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> CheckUpdateXrayCoreCmd { get; }
|
public ReactiveCommand<Unit, Unit> CheckUpdateXrayCoreCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> CheckUpdateClashCoreCmd { get; }
|
public ReactiveCommand<Unit, Unit> CheckUpdateClashCoreCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> CheckUpdateClashMetaCoreCmd { get; }
|
public ReactiveCommand<Unit, Unit> CheckUpdateClashMetaCoreCmd { get; }
|
||||||
|
public ReactiveCommand<Unit, Unit> CheckUpdateSingBoxCoreCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> CheckUpdateGeoCmd { get; }
|
public ReactiveCommand<Unit, Unit> CheckUpdateGeoCmd { get; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> ReloadCmd { get; }
|
public ReactiveCommand<Unit, Unit> ReloadCmd { get; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public bool BlReloadEnabled { get; set; }
|
public bool BlReloadEnabled { get; set; }
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> NotifyLeftClickCmd { get; }
|
public ReactiveCommand<Unit, Unit> NotifyLeftClickCmd { get; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public Icon NotifyIcon { get; set; }
|
public Icon NotifyIcon { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public ImageSource AppIcon { get; set; }
|
public ImageSource AppIcon { get; set; }
|
||||||
#endregion
|
|
||||||
|
[Reactive]
|
||||||
|
public bool BlShowTrayTip { get; set; }
|
||||||
|
|
||||||
|
#endregion Menu
|
||||||
|
|
||||||
#region System Proxy
|
#region System Proxy
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public bool BlSystemProxyClear { get; set; }
|
public bool BlSystemProxyClear { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public bool BlSystemProxySet { get; set; }
|
public bool BlSystemProxySet { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public bool BlSystemProxyNothing { get; set; }
|
public bool BlSystemProxyNothing { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public bool BlSystemProxyPac { get; set; }
|
public bool BlSystemProxyPac { get; set; }
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> SystemProxyClearCmd { get; }
|
public ReactiveCommand<Unit, Unit> SystemProxyClearCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> SystemProxySetCmd { get; }
|
public ReactiveCommand<Unit, Unit> SystemProxySetCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> SystemProxyNothingCmd { get; }
|
public ReactiveCommand<Unit, Unit> SystemProxyNothingCmd { get; }
|
||||||
@@ -162,45 +193,58 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public bool BlRouting { get; set; }
|
public bool BlRouting { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public int SystemProxySelected { get; set; }
|
public int SystemProxySelected { get; set; }
|
||||||
#endregion
|
|
||||||
|
#endregion System Proxy
|
||||||
|
|
||||||
#region UI
|
#region UI
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string InboundDisplay { get; set; }
|
public string InboundDisplay { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string InboundLanDisplay { get; set; }
|
public string InboundLanDisplay { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string RunningServerDisplay { get; set; }
|
public string RunningServerDisplay { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string RunningServerToolTipText { get; set; }
|
public string RunningServerToolTipText { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string RunningInfoDisplay { get; set; }
|
public string RunningInfoDisplay { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string SpeedProxyDisplay { get; set; }
|
public string SpeedProxyDisplay { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string SpeedDirectDisplay { get; set; }
|
public string SpeedDirectDisplay { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public bool EnableTun { get; set; }
|
public bool EnableTun { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public bool ColorModeDark { get; set; }
|
public bool ColorModeDark { get; set; }
|
||||||
|
|
||||||
private IObservableCollection<Swatch> _swatches = new ObservableCollectionExtended<Swatch>();
|
private IObservableCollection<Swatch> _swatches = new ObservableCollectionExtended<Swatch>();
|
||||||
public IObservableCollection<Swatch> Swatches => _swatches;
|
public IObservableCollection<Swatch> Swatches => _swatches;
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public Swatch SelectedSwatch { get; set; }
|
public Swatch SelectedSwatch { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public int CurrentFontSize { get; set; }
|
public int CurrentFontSize { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string CurrentLanguage { get; set; }
|
public string CurrentLanguage { get; set; }
|
||||||
#endregion
|
|
||||||
|
#endregion UI
|
||||||
|
|
||||||
#region Init
|
#region Init
|
||||||
|
|
||||||
public MainWindowViewModel(ISnackbarMessageQueue snackbarMessageQueue, Action<string> updateView)
|
public MainWindowViewModel(ISnackbarMessageQueue snackbarMessageQueue, Action<EViewAction> updateView)
|
||||||
{
|
{
|
||||||
_updateView = updateView;
|
_updateView = updateView;
|
||||||
ThreadPool.RegisterWaitForSingleObject(App.ProgramStarted, OnProgramStarted, null, -1, false);
|
ThreadPool.RegisterWaitForSingleObject(App.ProgramStarted, OnProgramStarted, null, -1, false);
|
||||||
@@ -388,7 +432,6 @@ namespace v2rayN.ViewModels
|
|||||||
Export2SubContent();
|
Export2SubContent();
|
||||||
}, canEditRemove);
|
}, canEditRemove);
|
||||||
|
|
||||||
|
|
||||||
//Subscription
|
//Subscription
|
||||||
SubSettingCmd = ReactiveCommand.Create(() =>
|
SubSettingCmd = ReactiveCommand.Create(() =>
|
||||||
{
|
{
|
||||||
@@ -431,6 +474,10 @@ namespace v2rayN.ViewModels
|
|||||||
_noticeHandler?.Enqueue(ResUI.OperationSuccess);
|
_noticeHandler?.Enqueue(ResUI.OperationSuccess);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
RebootAsAdminCmd = ReactiveCommand.Create(() =>
|
||||||
|
{
|
||||||
|
RebootAsAdmin();
|
||||||
|
});
|
||||||
ClearServerStatisticsCmd = ReactiveCommand.Create(() =>
|
ClearServerStatisticsCmd = ReactiveCommand.Create(() =>
|
||||||
{
|
{
|
||||||
_statistics?.ClearAllServerStatistics();
|
_statistics?.ClearAllServerStatistics();
|
||||||
@@ -466,6 +513,10 @@ namespace v2rayN.ViewModels
|
|||||||
{
|
{
|
||||||
CheckUpdateCore(ECoreType.clash_meta);
|
CheckUpdateCore(ECoreType.clash_meta);
|
||||||
});
|
});
|
||||||
|
CheckUpdateSingBoxCoreCmd = ReactiveCommand.Create(() =>
|
||||||
|
{
|
||||||
|
CheckUpdateCore(ECoreType.sing_box);
|
||||||
|
});
|
||||||
CheckUpdateGeoCmd = ReactiveCommand.Create(() =>
|
CheckUpdateGeoCmd = ReactiveCommand.Create(() =>
|
||||||
{
|
{
|
||||||
CheckUpdateGeo();
|
CheckUpdateGeo();
|
||||||
@@ -499,7 +550,6 @@ namespace v2rayN.ViewModels
|
|||||||
SetListenerType(ESysProxyType.Pac);
|
SetListenerType(ESysProxyType.Pac);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Global.ShowInTaskbar = true;
|
Global.ShowInTaskbar = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -520,6 +570,7 @@ namespace v2rayN.ViewModels
|
|||||||
Reload();
|
Reload();
|
||||||
ChangeSystemProxyStatus(_config.sysProxyType, true);
|
ChangeSystemProxyStatus(_config.sysProxyType, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnProgramStarted(object state, bool timeout)
|
private void OnProgramStarted(object state, bool timeout)
|
||||||
{
|
{
|
||||||
Application.Current.Dispatcher.Invoke((Action)(() =>
|
Application.Current.Dispatcher.Invoke((Action)(() =>
|
||||||
@@ -528,13 +579,15 @@ namespace v2rayN.ViewModels
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Init
|
||||||
|
|
||||||
#region Actions
|
#region Actions
|
||||||
|
|
||||||
private void UpdateHandler(bool notify, string msg)
|
private void UpdateHandler(bool notify, string msg)
|
||||||
{
|
{
|
||||||
_noticeHandler?.SendMessage(msg);
|
_noticeHandler?.SendMessage(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateTaskHandler(bool success, string msg)
|
private void UpdateTaskHandler(bool success, string msg)
|
||||||
{
|
{
|
||||||
_noticeHandler?.SendMessage(msg);
|
_noticeHandler?.SendMessage(msg);
|
||||||
@@ -548,10 +601,11 @@ namespace v2rayN.ViewModels
|
|||||||
}
|
}
|
||||||
if (_config.uiItem.enableAutoAdjustMainLvColWidth)
|
if (_config.uiItem.enableAutoAdjustMainLvColWidth)
|
||||||
{
|
{
|
||||||
_updateView("AdjustMainLvColWidth");
|
_updateView(EViewAction.AdjustMainLvColWidth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateStatisticsHandler(ServerSpeedItem update)
|
private void UpdateStatisticsHandler(ServerSpeedItem update)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -562,8 +616,9 @@ namespace v2rayN.ViewModels
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SpeedProxyDisplay = string.Format("{0}:{1}/s<><73> | {2}/s<><73>", Global.agentTag, Utils.HumanFy(update.proxyUp), Utils.HumanFy(update.proxyDown));
|
|
||||||
SpeedDirectDisplay = string.Format("{0}:{1}/s<><73> | {2}/s<><73>", Global.directTag, Utils.HumanFy(update.directUp), Utils.HumanFy(update.directDown));
|
SpeedProxyDisplay = string.Format(ResUI.SpeedDisplayText, Global.agentTag, Utils.HumanFy(update.proxyUp), Utils.HumanFy(update.proxyDown));
|
||||||
|
SpeedDirectDisplay = string.Format(ResUI.SpeedDisplayText, Global.directTag, Utils.HumanFy(update.directUp), Utils.HumanFy(update.directDown));
|
||||||
|
|
||||||
if (update.proxyUp + update.proxyDown > 0)
|
if (update.proxyUp + update.proxyDown > 0)
|
||||||
{
|
{
|
||||||
@@ -598,6 +653,7 @@ namespace v2rayN.ViewModels
|
|||||||
Utils.SaveLog(ex.Message, ex);
|
Utils.SaveLog(ex.Message, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateSpeedtestHandler(string indexId, string delay, string speed)
|
private void UpdateSpeedtestHandler(string indexId, string delay, string speed)
|
||||||
{
|
{
|
||||||
Application.Current.Dispatcher.Invoke((Action)(() =>
|
Application.Current.Dispatcher.Invoke((Action)(() =>
|
||||||
@@ -605,6 +661,7 @@ namespace v2rayN.ViewModels
|
|||||||
SetTestResult(indexId, delay, speed);
|
SetTestResult(indexId, delay, speed);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetTestResult(string indexId, string delay, string speed)
|
private void SetTestResult(string indexId, string delay, string speed)
|
||||||
{
|
{
|
||||||
if (Utils.IsNullOrEmpty(indexId))
|
if (Utils.IsNullOrEmpty(indexId))
|
||||||
@@ -630,28 +687,32 @@ namespace v2rayN.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnHotkeyHandler(object sender, HotkeyEventArgs e)
|
private void OnHotkeyHandler(EGlobalHotkey e)
|
||||||
{
|
{
|
||||||
switch (Utils.ToInt(e.Name))
|
switch (e)
|
||||||
{
|
{
|
||||||
case (int)EGlobalHotkey.ShowForm:
|
case EGlobalHotkey.ShowForm:
|
||||||
ShowHideWindow(null);
|
ShowHideWindow(null);
|
||||||
break;
|
break;
|
||||||
case (int)EGlobalHotkey.SystemProxyClear:
|
|
||||||
|
case EGlobalHotkey.SystemProxyClear:
|
||||||
SetListenerType(ESysProxyType.ForcedClear);
|
SetListenerType(ESysProxyType.ForcedClear);
|
||||||
break;
|
break;
|
||||||
case (int)EGlobalHotkey.SystemProxySet:
|
|
||||||
|
case EGlobalHotkey.SystemProxySet:
|
||||||
SetListenerType(ESysProxyType.ForcedChange);
|
SetListenerType(ESysProxyType.ForcedChange);
|
||||||
break;
|
break;
|
||||||
case (int)EGlobalHotkey.SystemProxyUnchanged:
|
|
||||||
|
case EGlobalHotkey.SystemProxyUnchanged:
|
||||||
SetListenerType(ESysProxyType.Unchanged);
|
SetListenerType(ESysProxyType.Unchanged);
|
||||||
break;
|
break;
|
||||||
case (int)EGlobalHotkey.SystemProxyPac:
|
|
||||||
|
case EGlobalHotkey.SystemProxyPac:
|
||||||
SetListenerType(ESysProxyType.Pac);
|
SetListenerType(ESysProxyType.Pac);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
e.Handled = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MyAppExit(bool blWindowsShutDown)
|
public void MyAppExit(bool blWindowsShutDown)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -687,7 +748,7 @@ namespace v2rayN.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Actions
|
||||||
|
|
||||||
#region Servers && Groups
|
#region Servers && Groups
|
||||||
|
|
||||||
@@ -702,7 +763,7 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
RefreshServers();
|
RefreshServers();
|
||||||
|
|
||||||
_updateView("ProfilesFocus");
|
_updateView(EViewAction.ProfilesFocus);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ServerFilterChanged(bool c)
|
private void ServerFilterChanged(bool c)
|
||||||
@@ -712,12 +773,16 @@ namespace v2rayN.ViewModels
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_serverFilter = ServerFilter;
|
_serverFilter = ServerFilter;
|
||||||
|
if (Utils.IsNullOrEmpty(_serverFilter))
|
||||||
|
{
|
||||||
RefreshServers();
|
RefreshServers();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void RefreshServers()
|
public void RefreshServers()
|
||||||
{
|
{
|
||||||
List<ProfileItemModel> lstModel = LazyConfig.Instance.ProfileItems(_subId, _serverFilter);
|
List<ProfileItemModel> lstModel = LazyConfig.Instance.ProfileItems(_subId, _serverFilter);
|
||||||
|
|
||||||
ConfigHandler.SetDefaultServer(_config, lstModel);
|
ConfigHandler.SetDefaultServer(_config, lstModel);
|
||||||
|
|
||||||
List<ServerStatItem> lstServerStat = new();
|
List<ServerStatItem> lstServerStat = new();
|
||||||
@@ -741,6 +806,7 @@ namespace v2rayN.ViewModels
|
|||||||
security = t.security,
|
security = t.security,
|
||||||
network = t.network,
|
network = t.network,
|
||||||
streamSecurity = t.streamSecurity,
|
streamSecurity = t.streamSecurity,
|
||||||
|
subid = t.subid,
|
||||||
subRemarks = t.subRemarks,
|
subRemarks = t.subRemarks,
|
||||||
isActive = t.indexId == _config.indexId,
|
isActive = t.indexId == _config.indexId,
|
||||||
sort = t33 == null ? 0 : t33.sort,
|
sort = t33 == null ? 0 : t33.sort,
|
||||||
@@ -781,6 +847,11 @@ namespace v2rayN.ViewModels
|
|||||||
RunningServerDisplay = $"{ResUI.menuServers}:{runningSummary}";
|
RunningServerDisplay = $"{ResUI.menuServers}:{runningSummary}";
|
||||||
RunningServerToolTipText = runningSummary;
|
RunningServerToolTipText = runningSummary;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RunningServerDisplay =
|
||||||
|
RunningServerToolTipText = ResUI.CheckServerSettings;
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -789,9 +860,11 @@ namespace v2rayN.ViewModels
|
|||||||
_servers.Clear();
|
_servers.Clear();
|
||||||
if (_lstProfile.Count > _config.guiItem.trayMenuServersLimit)
|
if (_lstProfile.Count > _config.guiItem.trayMenuServersLimit)
|
||||||
{
|
{
|
||||||
|
BlServers = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BlServers = true;
|
||||||
for (int k = 0; k < _lstProfile.Count; k++)
|
for (int k = 0; k < _lstProfile.Count; k++)
|
||||||
{
|
{
|
||||||
ProfileItem it = _lstProfile[k];
|
ProfileItem it = _lstProfile[k];
|
||||||
@@ -825,17 +898,22 @@ namespace v2rayN.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Servers && Groups
|
||||||
|
|
||||||
#region Add Servers
|
#region Add Servers
|
||||||
private int GetProfileItems(out List<ProfileItem> lstSelecteds)
|
|
||||||
|
private int GetProfileItems(out List<ProfileItem> lstSelecteds, bool latest)
|
||||||
{
|
{
|
||||||
lstSelecteds = new List<ProfileItem>();
|
lstSelecteds = new List<ProfileItem>();
|
||||||
if (SelectedProfiles == null || SelectedProfiles.Count <= 0)
|
if (SelectedProfiles == null || SelectedProfiles.Count <= 0)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
foreach (var profile in SelectedProfiles)
|
|
||||||
|
var orderProfiles = SelectedProfiles?.OrderBy(t => t.sort);
|
||||||
|
if (latest)
|
||||||
|
{
|
||||||
|
foreach (var profile in orderProfiles)
|
||||||
{
|
{
|
||||||
var item = LazyConfig.Instance.GetProfileItem(profile.indexId);
|
var item = LazyConfig.Instance.GetProfileItem(profile.indexId);
|
||||||
if (item is not null)
|
if (item is not null)
|
||||||
@@ -843,6 +921,12 @@ namespace v2rayN.ViewModels
|
|||||||
lstSelecteds.Add(item);
|
lstSelecteds.Add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lstSelecteds = Utils.FromJson<List<ProfileItem>>(Utils.ToJson(orderProfiles));
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -892,8 +976,8 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
public void AddServerViaClipboard()
|
public void AddServerViaClipboard()
|
||||||
{
|
{
|
||||||
string clipboardData = Utils.GetClipboardData();
|
var clipboardData = Utils.GetClipboardData();
|
||||||
int ret = ConfigHandler.AddBatchServers(ref _config, clipboardData, _subId, false);
|
int ret = ConfigHandler.AddBatchServers(ref _config, clipboardData!, _subId, false);
|
||||||
if (ret > 0)
|
if (ret > 0)
|
||||||
{
|
{
|
||||||
InitSubscriptionView();
|
InitSubscriptionView();
|
||||||
@@ -901,13 +985,15 @@ namespace v2rayN.ViewModels
|
|||||||
_noticeHandler?.Enqueue(string.Format(ResUI.SuccessfullyImportedServerViaClipboard, ret));
|
_noticeHandler?.Enqueue(string.Format(ResUI.SuccessfullyImportedServerViaClipboard, ret));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task ScanScreenTaskAsync()
|
public async Task ScanScreenTaskAsync()
|
||||||
{
|
{
|
||||||
ShowHideWindow(false);
|
ShowHideWindow(false);
|
||||||
|
|
||||||
|
var dpiXY = Utils.GetDpiXY(Application.Current.MainWindow);
|
||||||
string result = await Task.Run(() =>
|
string result = await Task.Run(() =>
|
||||||
{
|
{
|
||||||
return Utils.ScanScreen();
|
return Utils.ScanScreen(dpiXY.Item1, dpiXY.Item2);
|
||||||
});
|
});
|
||||||
|
|
||||||
ShowHideWindow(true);
|
ShowHideWindow(true);
|
||||||
@@ -927,14 +1013,15 @@ namespace v2rayN.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveServer()
|
public void RemoveServer()
|
||||||
{
|
{
|
||||||
if (GetProfileItems(out List<ProfileItem> lstSelecteds) < 0)
|
if (GetProfileItems(out List<ProfileItem> lstSelecteds, true) < 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UI.ShowYesNo(ResUI.RemoveServer) == DialogResult.No)
|
if (UI.ShowYesNo(ResUI.RemoveServer) == MessageBoxResult.No)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -952,15 +1039,15 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
private void RemoveDuplicateServer()
|
private void RemoveDuplicateServer()
|
||||||
{
|
{
|
||||||
int oldCount = _lstProfile.Count;
|
var tuple = ConfigHandler.DedupServerList(_config, _subId);
|
||||||
int newCount = ConfigHandler.DedupServerList(ref _config, ref _lstProfile);
|
|
||||||
RefreshServers();
|
RefreshServers();
|
||||||
Reload();
|
Reload();
|
||||||
_noticeHandler?.Enqueue(string.Format(ResUI.RemoveDuplicateServerResult, oldCount, newCount));
|
_noticeHandler?.Enqueue(string.Format(ResUI.RemoveDuplicateServerResult, tuple.Item1, tuple.Item2));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CopyServer()
|
private void CopyServer()
|
||||||
{
|
{
|
||||||
if (GetProfileItems(out List<ProfileItem> lstSelecteds) < 0)
|
if (GetProfileItems(out List<ProfileItem> lstSelecteds, false) < 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -979,6 +1066,7 @@ namespace v2rayN.ViewModels
|
|||||||
}
|
}
|
||||||
SetDefaultServer(SelectedProfile.indexId);
|
SetDefaultServer(SelectedProfile.indexId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetDefaultServer(string indexId)
|
private void SetDefaultServer(string indexId)
|
||||||
{
|
{
|
||||||
if (Utils.IsNullOrEmpty(indexId))
|
if (Utils.IsNullOrEmpty(indexId))
|
||||||
@@ -1002,6 +1090,7 @@ namespace v2rayN.ViewModels
|
|||||||
Reload();
|
Reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ServerSelectedChanged(bool c)
|
private void ServerSelectedChanged(bool c)
|
||||||
{
|
{
|
||||||
if (!c)
|
if (!c)
|
||||||
@@ -1019,7 +1108,6 @@ namespace v2rayN.ViewModels
|
|||||||
SetDefaultServer(SelectedServer.ID);
|
SetDefaultServer(SelectedServer.ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async void ShareServer()
|
public async void ShareServer()
|
||||||
{
|
{
|
||||||
var item = LazyConfig.Instance.GetProfileItem(SelectedProfile.indexId);
|
var item = LazyConfig.Instance.GetProfileItem(SelectedProfile.indexId);
|
||||||
@@ -1050,10 +1138,7 @@ namespace v2rayN.ViewModels
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_dicHeaderSort.ContainsKey(colName))
|
_dicHeaderSort.TryAdd(colName, true);
|
||||||
{
|
|
||||||
_dicHeaderSort.Add(colName, true);
|
|
||||||
}
|
|
||||||
_dicHeaderSort.TryGetValue(colName, out bool asc);
|
_dicHeaderSort.TryGetValue(colName, out bool asc);
|
||||||
if (ConfigHandler.SortServers(ref _config, _subId, colName, asc) != 0)
|
if (ConfigHandler.SortServers(ref _config, _subId, colName, asc) != 0)
|
||||||
{
|
{
|
||||||
@@ -1092,7 +1177,7 @@ namespace v2rayN.ViewModels
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetProfileItems(out List<ProfileItem> lstSelecteds) < 0)
|
if (GetProfileItems(out List<ProfileItem> lstSelecteds, true) < 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1143,7 +1228,7 @@ namespace v2rayN.ViewModels
|
|||||||
{
|
{
|
||||||
SelectedProfiles = _profileItems;
|
SelectedProfiles = _profileItems;
|
||||||
}
|
}
|
||||||
if (GetProfileItems(out List<ProfileItem> lstSelecteds) < 0)
|
if (GetProfileItems(out List<ProfileItem> lstSelecteds, false) < 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1175,7 +1260,7 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
public void Export2ShareUrl()
|
public void Export2ShareUrl()
|
||||||
{
|
{
|
||||||
if (GetProfileItems(out List<ProfileItem> lstSelecteds) < 0)
|
if (GetProfileItems(out List<ProfileItem> lstSelecteds, true) < 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1200,7 +1285,7 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
private void Export2SubContent()
|
private void Export2SubContent()
|
||||||
{
|
{
|
||||||
if (GetProfileItems(out List<ProfileItem> lstSelecteds) < 0)
|
if (GetProfileItems(out List<ProfileItem> lstSelecteds, true) < 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1223,7 +1308,7 @@ namespace v2rayN.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Add Servers
|
||||||
|
|
||||||
#region Subscription
|
#region Subscription
|
||||||
|
|
||||||
@@ -1235,6 +1320,7 @@ namespace v2rayN.ViewModels
|
|||||||
SubSelectedChanged(true);
|
SubSelectedChanged(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddSub()
|
private void AddSub()
|
||||||
{
|
{
|
||||||
SubItem item = new();
|
SubItem item = new();
|
||||||
@@ -1251,7 +1337,7 @@ namespace v2rayN.ViewModels
|
|||||||
(new UpdateHandle()).UpdateSubscriptionProcess(_config, subId, blProxy, UpdateTaskHandler);
|
(new UpdateHandle()).UpdateSubscriptionProcess(_config, subId, blProxy, UpdateTaskHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Subscription
|
||||||
|
|
||||||
#region Setting
|
#region Setting
|
||||||
|
|
||||||
@@ -1265,6 +1351,7 @@ namespace v2rayN.ViewModels
|
|||||||
TunModeSwitch();
|
TunModeSwitch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RoutingSetting()
|
private void RoutingSetting()
|
||||||
{
|
{
|
||||||
var ret = (new RoutingSettingWindow()).ShowDialog();
|
var ret = (new RoutingSettingWindow()).ShowDialog();
|
||||||
@@ -1277,6 +1364,24 @@ namespace v2rayN.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void RebootAsAdmin()
|
||||||
|
{
|
||||||
|
ProcessStartInfo startInfo = new()
|
||||||
|
{
|
||||||
|
UseShellExecute = true,
|
||||||
|
Arguments = Global.RebootAs,
|
||||||
|
WorkingDirectory = Utils.StartupPath(),
|
||||||
|
FileName = Utils.GetExePath(),
|
||||||
|
Verb = "runas",
|
||||||
|
};
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Process.Start(startInfo);
|
||||||
|
MyAppExit(false);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
|
||||||
private void ImportOldGuiConfig()
|
private void ImportOldGuiConfig()
|
||||||
{
|
{
|
||||||
OpenFileDialog fileDialog = new()
|
OpenFileDialog fileDialog = new()
|
||||||
@@ -1284,7 +1389,7 @@ namespace v2rayN.ViewModels
|
|||||||
Multiselect = false,
|
Multiselect = false,
|
||||||
Filter = "guiNConfig|*.json|All|*.*"
|
Filter = "guiNConfig|*.json|All|*.*"
|
||||||
};
|
};
|
||||||
if (fileDialog.ShowDialog() != DialogResult.OK)
|
if (fileDialog.ShowDialog() != true)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1309,7 +1414,7 @@ namespace v2rayN.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Setting
|
||||||
|
|
||||||
#region CheckUpdate
|
#region CheckUpdate
|
||||||
|
|
||||||
@@ -1322,7 +1427,7 @@ namespace v2rayN.ViewModels
|
|||||||
{
|
{
|
||||||
MyAppExit(false);
|
MyAppExit(false);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
(new UpdateHandle()).CheckUpdateGuiN(_config, _updateUI, _config.guiItem.checkPreReleaseUpdate);
|
(new UpdateHandle()).CheckUpdateGuiN(_config, _updateUI, _config.guiItem.checkPreReleaseUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1351,7 +1456,7 @@ namespace v2rayN.ViewModels
|
|||||||
File.Delete(fileName);
|
File.Delete(fileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
(new UpdateHandle()).CheckUpdateCore(type, _config, _updateUI, _config.guiItem.checkPreReleaseUpdate);
|
(new UpdateHandle()).CheckUpdateCore(type, _config, _updateUI, _config.guiItem.checkPreReleaseUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1365,7 +1470,7 @@ namespace v2rayN.ViewModels
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion CheckUpdate
|
||||||
|
|
||||||
#region v2ray job
|
#region v2ray job
|
||||||
|
|
||||||
@@ -1374,8 +1479,7 @@ namespace v2rayN.ViewModels
|
|||||||
_ = LoadV2ray();
|
_ = LoadV2ray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task LoadV2ray()
|
||||||
async Task LoadV2ray()
|
|
||||||
{
|
{
|
||||||
Application.Current.Dispatcher.Invoke((Action)(() =>
|
Application.Current.Dispatcher.Invoke((Action)(() =>
|
||||||
{
|
{
|
||||||
@@ -1412,7 +1516,7 @@ namespace v2rayN.ViewModels
|
|||||||
_coreHandler.CoreStop();
|
_coreHandler.CoreStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion v2ray job
|
||||||
|
|
||||||
#region System proxy and Routings
|
#region System proxy and Routings
|
||||||
|
|
||||||
@@ -1501,7 +1605,7 @@ namespace v2rayN.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoSystemProxySelected(bool c)
|
private void DoSystemProxySelected(bool c)
|
||||||
{
|
{
|
||||||
if (!c)
|
if (!c)
|
||||||
{
|
{
|
||||||
@@ -1514,7 +1618,7 @@ namespace v2rayN.ViewModels
|
|||||||
SetListenerType((ESysProxyType)SystemProxySelected);
|
SetListenerType((ESysProxyType)SystemProxySelected);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoEnableTun(bool c)
|
private void DoEnableTun(bool c)
|
||||||
{
|
{
|
||||||
if (_config.tunModeItem.enableTun != EnableTun)
|
if (_config.tunModeItem.enableTun != EnableTun)
|
||||||
{
|
{
|
||||||
@@ -1523,7 +1627,7 @@ namespace v2rayN.ViewModels
|
|||||||
TunModeSwitch();
|
TunModeSwitch();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TunModeSwitch()
|
private void TunModeSwitch()
|
||||||
{
|
{
|
||||||
if (EnableTun)
|
if (EnableTun)
|
||||||
{
|
{
|
||||||
@@ -1535,7 +1639,7 @@ namespace v2rayN.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion System proxy and Routings
|
||||||
|
|
||||||
#region UI
|
#region UI
|
||||||
|
|
||||||
@@ -1559,7 +1663,7 @@ namespace v2rayN.ViewModels
|
|||||||
//Application.Current.MainWindow.ShowInTaskbar = false;
|
//Application.Current.MainWindow.ShowInTaskbar = false;
|
||||||
//IntPtr windowHandle = new WindowInteropHelper(Application.Current.MainWindow).Handle;
|
//IntPtr windowHandle = new WindowInteropHelper(Application.Current.MainWindow).Handle;
|
||||||
//Utils.RegWriteValue(Global.MyRegPath, Utils.WindowHwndKey, Convert.ToString((long)windowHandle));
|
//Utils.RegWriteValue(Global.MyRegPath, Utils.WindowHwndKey, Convert.ToString((long)windowHandle));
|
||||||
};
|
}
|
||||||
Global.ShowInTaskbar = bl;
|
Global.ShowInTaskbar = bl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1578,6 +1682,7 @@ namespace v2rayN.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StorageUI()
|
private void StorageUI()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1592,6 +1697,7 @@ namespace v2rayN.ViewModels
|
|||||||
}
|
}
|
||||||
CurrentFontSize = _config.uiItem.currentFontSize;
|
CurrentFontSize = _config.uiItem.currentFontSize;
|
||||||
CurrentLanguage = _config.uiItem.currentLanguage;
|
CurrentLanguage = _config.uiItem.currentLanguage;
|
||||||
|
BlShowTrayTip = _config.uiItem.showTrayTip;
|
||||||
|
|
||||||
this.WhenAnyValue(
|
this.WhenAnyValue(
|
||||||
x => x.ColorModeDark,
|
x => x.ColorModeDark,
|
||||||
@@ -1703,6 +1809,7 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
Utils.SetDarkBorder(Application.Current.MainWindow, isDarkTheme);
|
Utils.SetDarkBorder(Application.Current.MainWindow, isDarkTheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ChangePrimaryColor(System.Windows.Media.Color color)
|
public void ChangePrimaryColor(System.Windows.Media.Color color)
|
||||||
{
|
{
|
||||||
var theme = _paletteHelper.GetTheme();
|
var theme = _paletteHelper.GetTheme();
|
||||||
@@ -1730,6 +1837,6 @@ namespace v2rayN.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion UI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,7 @@ namespace v2rayN.ViewModels
|
|||||||
private Window _view;
|
private Window _view;
|
||||||
|
|
||||||
#region Core
|
#region Core
|
||||||
|
|
||||||
[Reactive] public int localPort { get; set; }
|
[Reactive] public int localPort { get; set; }
|
||||||
[Reactive] public bool udpEnabled { get; set; }
|
[Reactive] public bool udpEnabled { get; set; }
|
||||||
[Reactive] public bool sniffingEnabled { get; set; }
|
[Reactive] public bool sniffingEnabled { get; set; }
|
||||||
@@ -30,14 +31,18 @@ namespace v2rayN.ViewModels
|
|||||||
[Reactive] public bool defAllowInsecure { get; set; }
|
[Reactive] public bool defAllowInsecure { get; set; }
|
||||||
[Reactive] public string defFingerprint { get; set; }
|
[Reactive] public string defFingerprint { get; set; }
|
||||||
[Reactive] public string defUserAgent { get; set; }
|
[Reactive] public string defUserAgent { get; set; }
|
||||||
#endregion
|
|
||||||
|
#endregion Core
|
||||||
|
|
||||||
#region Core DNS
|
#region Core DNS
|
||||||
|
|
||||||
[Reactive] public string domainStrategy4Freedom { get; set; }
|
[Reactive] public string domainStrategy4Freedom { get; set; }
|
||||||
[Reactive] public string remoteDNS { get; set; }
|
[Reactive] public string remoteDNS { get; set; }
|
||||||
#endregion
|
|
||||||
|
#endregion Core DNS
|
||||||
|
|
||||||
#region Core KCP
|
#region Core KCP
|
||||||
|
|
||||||
//[Reactive] public int Kcpmtu { get; set; }
|
//[Reactive] public int Kcpmtu { get; set; }
|
||||||
//[Reactive] public int Kcptti { get; set; }
|
//[Reactive] public int Kcptti { get; set; }
|
||||||
//[Reactive] public int KcpuplinkCapacity { get; set; }
|
//[Reactive] public int KcpuplinkCapacity { get; set; }
|
||||||
@@ -45,9 +50,11 @@ namespace v2rayN.ViewModels
|
|||||||
//[Reactive] public int KcpreadBufferSize { get; set; }
|
//[Reactive] public int KcpreadBufferSize { get; set; }
|
||||||
//[Reactive] public int KcpwriteBufferSize { get; set; }
|
//[Reactive] public int KcpwriteBufferSize { get; set; }
|
||||||
//[Reactive] public bool Kcpcongestion { get; set; }
|
//[Reactive] public bool Kcpcongestion { get; set; }
|
||||||
#endregion
|
|
||||||
|
#endregion Core KCP
|
||||||
|
|
||||||
#region UI
|
#region UI
|
||||||
|
|
||||||
[Reactive] public bool AutoRun { get; set; }
|
[Reactive] public bool AutoRun { get; set; }
|
||||||
[Reactive] public bool EnableStatistics { get; set; }
|
[Reactive] public bool EnableStatistics { get; set; }
|
||||||
[Reactive] public int StatisticsFreshRate { get; set; }
|
[Reactive] public int StatisticsFreshRate { get; set; }
|
||||||
@@ -60,20 +67,24 @@ namespace v2rayN.ViewModels
|
|||||||
[Reactive] public bool EnableDragDropSort { get; set; }
|
[Reactive] public bool EnableDragDropSort { get; set; }
|
||||||
[Reactive] public bool DoubleClick2Activate { get; set; }
|
[Reactive] public bool DoubleClick2Activate { get; set; }
|
||||||
[Reactive] public int autoUpdateInterval { get; set; }
|
[Reactive] public int autoUpdateInterval { get; set; }
|
||||||
[Reactive] public int autoUpdateSubInterval { get; set; }
|
|
||||||
[Reactive] public int trayMenuServersLimit { get; set; }
|
[Reactive] public int trayMenuServersLimit { get; set; }
|
||||||
[Reactive] public string currentFontFamily { get; set; }
|
[Reactive] public string currentFontFamily { get; set; }
|
||||||
[Reactive] public int SpeedTestTimeout { get; set; }
|
[Reactive] public int SpeedTestTimeout { get; set; }
|
||||||
[Reactive] public string SpeedTestUrl { get; set; }
|
[Reactive] public string SpeedTestUrl { get; set; }
|
||||||
|
[Reactive] public bool EnableHWA { get; set; }
|
||||||
|
[Reactive] public string SubConvertUrl { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion UI
|
||||||
|
|
||||||
#region System proxy
|
#region System proxy
|
||||||
|
|
||||||
[Reactive] public string systemProxyAdvancedProtocol { get; set; }
|
[Reactive] public string systemProxyAdvancedProtocol { get; set; }
|
||||||
[Reactive] public string systemProxyExceptions { get; set; }
|
[Reactive] public string systemProxyExceptions { get; set; }
|
||||||
#endregion
|
|
||||||
|
#endregion System proxy
|
||||||
|
|
||||||
#region Tun mode
|
#region Tun mode
|
||||||
|
|
||||||
[Reactive] public bool TunShowWindow { get; set; }
|
[Reactive] public bool TunShowWindow { get; set; }
|
||||||
[Reactive] public bool TunEnabledLog { get; set; }
|
[Reactive] public bool TunEnabledLog { get; set; }
|
||||||
[Reactive] public bool TunStrictRoute { get; set; }
|
[Reactive] public bool TunStrictRoute { get; set; }
|
||||||
@@ -88,9 +99,11 @@ namespace v2rayN.ViewModels
|
|||||||
[Reactive] public string TunProxyIP { get; set; }
|
[Reactive] public string TunProxyIP { get; set; }
|
||||||
[Reactive] public string TunProxyProcess { get; set; }
|
[Reactive] public string TunProxyProcess { get; set; }
|
||||||
[Reactive] public string TunProxyDNS { get; set; }
|
[Reactive] public string TunProxyDNS { get; set; }
|
||||||
#endregion
|
|
||||||
|
#endregion Tun mode
|
||||||
|
|
||||||
#region CoreType
|
#region CoreType
|
||||||
|
|
||||||
[Reactive] public string CoreType1 { get; set; }
|
[Reactive] public string CoreType1 { get; set; }
|
||||||
[Reactive] public string CoreType2 { get; set; }
|
[Reactive] public string CoreType2 { get; set; }
|
||||||
[Reactive] public string CoreType3 { get; set; }
|
[Reactive] public string CoreType3 { get; set; }
|
||||||
@@ -98,11 +111,10 @@ namespace v2rayN.ViewModels
|
|||||||
[Reactive] public string CoreType5 { get; set; }
|
[Reactive] public string CoreType5 { get; set; }
|
||||||
[Reactive] public string CoreType6 { get; set; }
|
[Reactive] public string CoreType6 { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion CoreType
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
||||||
|
|
||||||
|
|
||||||
public OptionSettingViewModel(Window view)
|
public OptionSettingViewModel(Window view)
|
||||||
{
|
{
|
||||||
_config = LazyConfig.Instance.GetConfig();
|
_config = LazyConfig.Instance.GetConfig();
|
||||||
@@ -110,6 +122,7 @@ namespace v2rayN.ViewModels
|
|||||||
_view = view;
|
_view = view;
|
||||||
|
|
||||||
#region Core
|
#region Core
|
||||||
|
|
||||||
var inbound = _config.inbound[0];
|
var inbound = _config.inbound[0];
|
||||||
localPort = inbound.localPort;
|
localPort = inbound.localPort;
|
||||||
udpEnabled = inbound.udpEnabled;
|
udpEnabled = inbound.udpEnabled;
|
||||||
@@ -125,14 +138,18 @@ namespace v2rayN.ViewModels
|
|||||||
defAllowInsecure = _config.coreBasicItem.defAllowInsecure;
|
defAllowInsecure = _config.coreBasicItem.defAllowInsecure;
|
||||||
defFingerprint = _config.coreBasicItem.defFingerprint;
|
defFingerprint = _config.coreBasicItem.defFingerprint;
|
||||||
defUserAgent = _config.coreBasicItem.defUserAgent;
|
defUserAgent = _config.coreBasicItem.defUserAgent;
|
||||||
#endregion
|
|
||||||
|
#endregion Core
|
||||||
|
|
||||||
#region Core DNS
|
#region Core DNS
|
||||||
|
|
||||||
domainStrategy4Freedom = _config.domainStrategy4Freedom;
|
domainStrategy4Freedom = _config.domainStrategy4Freedom;
|
||||||
remoteDNS = _config.remoteDNS;
|
remoteDNS = _config.remoteDNS;
|
||||||
#endregion
|
|
||||||
|
#endregion Core DNS
|
||||||
|
|
||||||
#region Core KCP
|
#region Core KCP
|
||||||
|
|
||||||
//Kcpmtu = _config.kcpItem.mtu;
|
//Kcpmtu = _config.kcpItem.mtu;
|
||||||
//Kcptti = _config.kcpItem.tti;
|
//Kcptti = _config.kcpItem.tti;
|
||||||
//KcpuplinkCapacity = _config.kcpItem.uplinkCapacity;
|
//KcpuplinkCapacity = _config.kcpItem.uplinkCapacity;
|
||||||
@@ -140,9 +157,11 @@ namespace v2rayN.ViewModels
|
|||||||
//KcpreadBufferSize = _config.kcpItem.readBufferSize;
|
//KcpreadBufferSize = _config.kcpItem.readBufferSize;
|
||||||
//KcpwriteBufferSize = _config.kcpItem.writeBufferSize;
|
//KcpwriteBufferSize = _config.kcpItem.writeBufferSize;
|
||||||
//Kcpcongestion = _config.kcpItem.congestion;
|
//Kcpcongestion = _config.kcpItem.congestion;
|
||||||
#endregion
|
|
||||||
|
#endregion Core KCP
|
||||||
|
|
||||||
#region UI
|
#region UI
|
||||||
|
|
||||||
AutoRun = _config.guiItem.autoRun;
|
AutoRun = _config.guiItem.autoRun;
|
||||||
EnableStatistics = _config.guiItem.enableStatistics;
|
EnableStatistics = _config.guiItem.enableStatistics;
|
||||||
StatisticsFreshRate = _config.guiItem.statisticsFreshRate;
|
StatisticsFreshRate = _config.guiItem.statisticsFreshRate;
|
||||||
@@ -155,18 +174,21 @@ namespace v2rayN.ViewModels
|
|||||||
EnableDragDropSort = _config.uiItem.enableDragDropSort;
|
EnableDragDropSort = _config.uiItem.enableDragDropSort;
|
||||||
DoubleClick2Activate = _config.uiItem.doubleClick2Activate;
|
DoubleClick2Activate = _config.uiItem.doubleClick2Activate;
|
||||||
autoUpdateInterval = _config.guiItem.autoUpdateInterval;
|
autoUpdateInterval = _config.guiItem.autoUpdateInterval;
|
||||||
autoUpdateSubInterval = _config.guiItem.autoUpdateSubInterval;
|
|
||||||
trayMenuServersLimit = _config.guiItem.trayMenuServersLimit;
|
trayMenuServersLimit = _config.guiItem.trayMenuServersLimit;
|
||||||
currentFontFamily = _config.uiItem.currentFontFamily;
|
currentFontFamily = _config.uiItem.currentFontFamily;
|
||||||
SpeedTestTimeout = _config.speedTestItem.speedTestTimeout;
|
SpeedTestTimeout = _config.speedTestItem.speedTestTimeout;
|
||||||
SpeedTestUrl = _config.speedTestItem.speedTestUrl;
|
SpeedTestUrl = _config.speedTestItem.speedTestUrl;
|
||||||
|
EnableHWA = _config.guiItem.enableHWA;
|
||||||
|
SubConvertUrl = _config.constItem.subConvertUrl;
|
||||||
|
|
||||||
#endregion
|
#endregion UI
|
||||||
|
|
||||||
#region System proxy
|
#region System proxy
|
||||||
|
|
||||||
systemProxyAdvancedProtocol = _config.systemProxyAdvancedProtocol;
|
systemProxyAdvancedProtocol = _config.systemProxyAdvancedProtocol;
|
||||||
systemProxyExceptions = _config.systemProxyExceptions;
|
systemProxyExceptions = _config.systemProxyExceptions;
|
||||||
#endregion
|
|
||||||
|
#endregion System proxy
|
||||||
|
|
||||||
#region Tun mode
|
#region Tun mode
|
||||||
|
|
||||||
@@ -187,7 +209,7 @@ namespace v2rayN.ViewModels
|
|||||||
x => x.TunBypassMode)
|
x => x.TunBypassMode)
|
||||||
.Subscribe(c => TunBypassMode2 = !TunBypassMode);
|
.Subscribe(c => TunBypassMode2 = !TunBypassMode);
|
||||||
|
|
||||||
#endregion
|
#endregion Tun mode
|
||||||
|
|
||||||
InitCoreType();
|
InitCoreType();
|
||||||
|
|
||||||
@@ -227,18 +249,23 @@ namespace v2rayN.ViewModels
|
|||||||
case 1:
|
case 1:
|
||||||
CoreType1 = type;
|
CoreType1 = type;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
CoreType2 = type;
|
CoreType2 = type;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
CoreType3 = type;
|
CoreType3 = type;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
CoreType4 = type;
|
CoreType4 = type;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
CoreType5 = type;
|
CoreType5 = type;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
CoreType6 = type;
|
CoreType6 = type;
|
||||||
break;
|
break;
|
||||||
@@ -246,7 +273,6 @@ namespace v2rayN.ViewModels
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void SaveSetting()
|
private void SaveSetting()
|
||||||
{
|
{
|
||||||
if (Utils.IsNullOrEmpty(localPort.ToString()) || !Utils.IsNumberic(localPort.ToString())
|
if (Utils.IsNullOrEmpty(localPort.ToString()) || !Utils.IsNumberic(localPort.ToString())
|
||||||
@@ -300,12 +326,10 @@ namespace v2rayN.ViewModels
|
|||||||
_config.coreBasicItem.defFingerprint = defFingerprint;
|
_config.coreBasicItem.defFingerprint = defFingerprint;
|
||||||
_config.coreBasicItem.defUserAgent = defUserAgent;
|
_config.coreBasicItem.defUserAgent = defUserAgent;
|
||||||
|
|
||||||
|
|
||||||
//DNS
|
//DNS
|
||||||
_config.remoteDNS = remoteDNS;
|
_config.remoteDNS = remoteDNS;
|
||||||
_config.domainStrategy4Freedom = domainStrategy4Freedom;
|
_config.domainStrategy4Freedom = domainStrategy4Freedom;
|
||||||
|
|
||||||
|
|
||||||
//Kcp
|
//Kcp
|
||||||
//_config.kcpItem.mtu = Kcpmtu;
|
//_config.kcpItem.mtu = Kcpmtu;
|
||||||
//_config.kcpItem.tti = Kcptti;
|
//_config.kcpItem.tti = Kcptti;
|
||||||
@@ -315,7 +339,6 @@ namespace v2rayN.ViewModels
|
|||||||
//_config.kcpItem.writeBufferSize = KcpwriteBufferSize;
|
//_config.kcpItem.writeBufferSize = KcpwriteBufferSize;
|
||||||
//_config.kcpItem.congestion = Kcpcongestion;
|
//_config.kcpItem.congestion = Kcpcongestion;
|
||||||
|
|
||||||
|
|
||||||
//UI
|
//UI
|
||||||
Utils.SetAutoRun(AutoRun);
|
Utils.SetAutoRun(AutoRun);
|
||||||
_config.guiItem.autoRun = AutoRun;
|
_config.guiItem.autoRun = AutoRun;
|
||||||
@@ -331,7 +354,6 @@ namespace v2rayN.ViewModels
|
|||||||
_config.guiItem.enableSecurityProtocolTls13 = EnableSecurityProtocolTls13;
|
_config.guiItem.enableSecurityProtocolTls13 = EnableSecurityProtocolTls13;
|
||||||
_config.uiItem.autoHideStartup = AutoHideStartup;
|
_config.uiItem.autoHideStartup = AutoHideStartup;
|
||||||
_config.guiItem.autoUpdateInterval = autoUpdateInterval;
|
_config.guiItem.autoUpdateInterval = autoUpdateInterval;
|
||||||
_config.guiItem.autoUpdateSubInterval = autoUpdateSubInterval;
|
|
||||||
_config.guiItem.checkPreReleaseUpdate = EnableCheckPreReleaseUpdate;
|
_config.guiItem.checkPreReleaseUpdate = EnableCheckPreReleaseUpdate;
|
||||||
_config.uiItem.enableDragDropSort = EnableDragDropSort;
|
_config.uiItem.enableDragDropSort = EnableDragDropSort;
|
||||||
_config.uiItem.doubleClick2Activate = DoubleClick2Activate;
|
_config.uiItem.doubleClick2Activate = DoubleClick2Activate;
|
||||||
@@ -339,6 +361,8 @@ namespace v2rayN.ViewModels
|
|||||||
_config.uiItem.currentFontFamily = currentFontFamily;
|
_config.uiItem.currentFontFamily = currentFontFamily;
|
||||||
_config.speedTestItem.speedTestTimeout = SpeedTestTimeout;
|
_config.speedTestItem.speedTestTimeout = SpeedTestTimeout;
|
||||||
_config.speedTestItem.speedTestUrl = SpeedTestUrl;
|
_config.speedTestItem.speedTestUrl = SpeedTestUrl;
|
||||||
|
_config.guiItem.enableHWA = EnableHWA;
|
||||||
|
_config.constItem.subConvertUrl = SubConvertUrl;
|
||||||
|
|
||||||
//systemProxy
|
//systemProxy
|
||||||
_config.systemProxyExceptions = systemProxyExceptions;
|
_config.systemProxyExceptions = systemProxyExceptions;
|
||||||
@@ -371,8 +395,8 @@ namespace v2rayN.ViewModels
|
|||||||
{
|
{
|
||||||
UI.ShowWarning(ResUI.OperationFailed);
|
UI.ShowWarning(ResUI.OperationFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int SaveCoreType()
|
private int SaveCoreType()
|
||||||
{
|
{
|
||||||
for (int k = 1; k <= _config.coreTypeItem.Count; k++)
|
for (int k = 1; k <= _config.coreTypeItem.Count; k++)
|
||||||
@@ -384,18 +408,23 @@ namespace v2rayN.ViewModels
|
|||||||
case 1:
|
case 1:
|
||||||
type = CoreType1;
|
type = CoreType1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
type = CoreType2;
|
type = CoreType2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
type = CoreType3;
|
type = CoreType3;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
type = CoreType4;
|
type = CoreType4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
type = CoreType5;
|
type = CoreType5;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
type = CoreType6;
|
type = CoreType6;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -31,10 +31,8 @@ namespace v2rayN.ViewModels
|
|||||||
[Reactive]
|
[Reactive]
|
||||||
public bool AutoSort { get; set; }
|
public bool AutoSort { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
||||||
|
|
||||||
|
|
||||||
public RoutingRuleDetailsViewModel(RulesItem rulesItem, Window view)
|
public RoutingRuleDetailsViewModel(RulesItem rulesItem, Window view)
|
||||||
{
|
{
|
||||||
_config = LazyConfig.Instance.GetConfig();
|
_config = LazyConfig.Instance.GetConfig();
|
||||||
@@ -63,6 +61,7 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
|
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveRules()
|
private void SaveRules()
|
||||||
{
|
{
|
||||||
if (AutoSort)
|
if (AutoSort)
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using DynamicData.Binding;
|
using DynamicData.Binding;
|
||||||
|
using Microsoft.Win32;
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
using ReactiveUI.Fody.Helpers;
|
using ReactiveUI.Fody.Helpers;
|
||||||
using Splat;
|
using Splat;
|
||||||
using System.Reactive;
|
using System.Reactive;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Forms;
|
|
||||||
using v2rayN.Base;
|
using v2rayN.Base;
|
||||||
using v2rayN.Handler;
|
using v2rayN.Handler;
|
||||||
using v2rayN.Mode;
|
using v2rayN.Mode;
|
||||||
@@ -26,8 +26,10 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
private IObservableCollection<RulesItemModel> _rulesItems = new ObservableCollectionExtended<RulesItemModel>();
|
private IObservableCollection<RulesItemModel> _rulesItems = new ObservableCollectionExtended<RulesItemModel>();
|
||||||
public IObservableCollection<RulesItemModel> RulesItems => _rulesItems;
|
public IObservableCollection<RulesItemModel> RulesItems => _rulesItems;
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public RulesItemModel SelectedSource { get; set; }
|
public RulesItemModel SelectedSource { get; set; }
|
||||||
|
|
||||||
public IList<RulesItemModel> SelectedSources { get; set; }
|
public IList<RulesItemModel> SelectedSources { get; set; }
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> RuleAddCmd { get; }
|
public ReactiveCommand<Unit, Unit> RuleAddCmd { get; }
|
||||||
@@ -43,7 +45,6 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
||||||
|
|
||||||
|
|
||||||
public RoutingRuleSettingViewModel(RoutingItem routingItem, Window view)
|
public RoutingRuleSettingViewModel(RoutingItem routingItem, Window view)
|
||||||
{
|
{
|
||||||
_config = LazyConfig.Instance.GetConfig();
|
_config = LazyConfig.Instance.GetConfig();
|
||||||
@@ -173,7 +174,7 @@ namespace v2rayN.ViewModels
|
|||||||
UI.Show(ResUI.PleaseSelectRules);
|
UI.Show(ResUI.PleaseSelectRules);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (UI.ShowYesNo(ResUI.RemoveRules) == DialogResult.No)
|
if (UI.ShowYesNo(ResUI.RemoveRules) == MessageBoxResult.No)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -188,6 +189,7 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
RefreshRulesItems();
|
RefreshRulesItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RuleExportSelected()
|
public void RuleExportSelected()
|
||||||
{
|
{
|
||||||
if (SelectedSource is null || SelectedSource.outboundTag.IsNullOrEmpty())
|
if (SelectedSource is null || SelectedSource.outboundTag.IsNullOrEmpty())
|
||||||
@@ -268,7 +270,7 @@ namespace v2rayN.ViewModels
|
|||||||
Multiselect = false,
|
Multiselect = false,
|
||||||
Filter = "Rules|*.json|All|*.*"
|
Filter = "Rules|*.json|All|*.*"
|
||||||
};
|
};
|
||||||
if (fileDialog.ShowDialog() != DialogResult.OK)
|
if (fileDialog.ShowDialog() != true)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -299,6 +301,7 @@ namespace v2rayN.ViewModels
|
|||||||
UI.Show(ResUI.OperationSuccess);
|
UI.Show(ResUI.OperationSuccess);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ImportRulesFromUrl()
|
private async Task ImportRulesFromUrl()
|
||||||
{
|
{
|
||||||
var url = SelectedRouting.url;
|
var url = SelectedRouting.url;
|
||||||
@@ -319,10 +322,11 @@ namespace v2rayN.ViewModels
|
|||||||
UI.Show(ResUI.OperationSuccess);
|
UI.Show(ResUI.OperationSuccess);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int AddBatchRoutingRules(RoutingItem routingItem, string clipboardData)
|
private int AddBatchRoutingRules(RoutingItem routingItem, string clipboardData)
|
||||||
{
|
{
|
||||||
bool blReplace = false;
|
bool blReplace = false;
|
||||||
if (UI.ShowYesNo(ResUI.AddBatchRoutingRulesYesNo) == DialogResult.No)
|
if (UI.ShowYesNo(ResUI.AddBatchRoutingRulesYesNo) == MessageBoxResult.No)
|
||||||
{
|
{
|
||||||
blReplace = true;
|
blReplace = true;
|
||||||
}
|
}
|
||||||
@@ -351,6 +355,6 @@ namespace v2rayN.ViewModels
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Import rules
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,6 @@ using ReactiveUI.Fody.Helpers;
|
|||||||
using Splat;
|
using Splat;
|
||||||
using System.Reactive;
|
using System.Reactive;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Forms;
|
|
||||||
using v2rayN.Base;
|
using v2rayN.Base;
|
||||||
using v2rayN.Handler;
|
using v2rayN.Handler;
|
||||||
using v2rayN.Mode;
|
using v2rayN.Mode;
|
||||||
@@ -21,34 +20,43 @@ namespace v2rayN.ViewModels
|
|||||||
private RoutingItem _lockedItem;
|
private RoutingItem _lockedItem;
|
||||||
private List<RulesItem> _lockedRules;
|
private List<RulesItem> _lockedRules;
|
||||||
|
|
||||||
|
|
||||||
#region Reactive
|
#region Reactive
|
||||||
|
|
||||||
private IObservableCollection<RoutingItemModel> _routingItems = new ObservableCollectionExtended<RoutingItemModel>();
|
private IObservableCollection<RoutingItemModel> _routingItems = new ObservableCollectionExtended<RoutingItemModel>();
|
||||||
public IObservableCollection<RoutingItemModel> RoutingItems => _routingItems;
|
public IObservableCollection<RoutingItemModel> RoutingItems => _routingItems;
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public RoutingItemModel SelectedSource { get; set; }
|
public RoutingItemModel SelectedSource { get; set; }
|
||||||
|
|
||||||
public IList<RoutingItemModel> SelectedSources { get; set; }
|
public IList<RoutingItemModel> SelectedSources { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public bool enableRoutingAdvanced { get; set; }
|
public bool enableRoutingAdvanced { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public bool enableRoutingBasic { get; set; }
|
public bool enableRoutingBasic { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string domainStrategy { get; set; }
|
public string domainStrategy { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string domainMatcher { get; set; }
|
public string domainMatcher { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string ProxyDomain { get; set; }
|
public string ProxyDomain { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string ProxyIP { get; set; }
|
public string ProxyIP { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string DirectDomain { get; set; }
|
public string DirectDomain { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string DirectIP { get; set; }
|
public string DirectIP { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string BlockDomain { get; set; }
|
public string BlockDomain { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string BlockIP { get; set; }
|
public string BlockIP { get; set; }
|
||||||
|
|
||||||
@@ -60,7 +68,8 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
||||||
public bool IsModified { get; set; }
|
public bool IsModified { get; set; }
|
||||||
#endregion
|
|
||||||
|
#endregion Reactive
|
||||||
|
|
||||||
public RoutingSettingViewModel(Window view)
|
public RoutingSettingViewModel(Window view)
|
||||||
{
|
{
|
||||||
@@ -118,6 +127,7 @@ namespace v2rayN.ViewModels
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region locked
|
#region locked
|
||||||
|
|
||||||
private void BindingLockedData()
|
private void BindingLockedData()
|
||||||
{
|
{
|
||||||
_lockedItem = ConfigHandler.GetLockedRoutingItem(ref _config);
|
_lockedItem = ConfigHandler.GetLockedRoutingItem(ref _config);
|
||||||
@@ -134,6 +144,7 @@ namespace v2rayN.ViewModels
|
|||||||
BlockIP = Utils.List2String(_lockedRules[2].ip, true);
|
BlockIP = Utils.List2String(_lockedRules[2].ip, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EndBindingLockedData()
|
private void EndBindingLockedData()
|
||||||
{
|
{
|
||||||
if (_lockedItem != null)
|
if (_lockedItem != null)
|
||||||
@@ -152,9 +163,11 @@ namespace v2rayN.ViewModels
|
|||||||
ConfigHandler.SaveRoutingItem(ref _config, _lockedItem);
|
ConfigHandler.SaveRoutingItem(ref _config, _lockedItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
#endregion locked
|
||||||
|
|
||||||
#region Refresh Save
|
#region Refresh Save
|
||||||
|
|
||||||
public void RefreshRoutingItems()
|
public void RefreshRoutingItems()
|
||||||
{
|
{
|
||||||
_routingItems.Clear();
|
_routingItems.Clear();
|
||||||
@@ -181,6 +194,7 @@ namespace v2rayN.ViewModels
|
|||||||
_routingItems.Add(it);
|
_routingItems.Add(it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveRouting()
|
private void SaveRouting()
|
||||||
{
|
{
|
||||||
_config.routingBasicItem.domainStrategy = domainStrategy;
|
_config.routingBasicItem.domainStrategy = domainStrategy;
|
||||||
@@ -200,7 +214,7 @@ namespace v2rayN.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Refresh Save
|
||||||
|
|
||||||
private void RoutingBasicImportRules()
|
private void RoutingBasicImportRules()
|
||||||
{
|
{
|
||||||
@@ -244,7 +258,7 @@ namespace v2rayN.ViewModels
|
|||||||
UI.Show(ResUI.PleaseSelectRules);
|
UI.Show(ResUI.PleaseSelectRules);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (UI.ShowYesNo(ResUI.RemoveRules) == DialogResult.No)
|
if (UI.ShowYesNo(ResUI.RemoveRules) == MessageBoxResult.No)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -276,6 +290,7 @@ namespace v2rayN.ViewModels
|
|||||||
IsModified = true;
|
IsModified = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RoutingAdvancedImportRules()
|
private void RoutingAdvancedImportRules()
|
||||||
{
|
{
|
||||||
if (ConfigHandler.InitBuiltinRouting(ref _config, true) == 0)
|
if (ConfigHandler.InitBuiltinRouting(ref _config, true) == 0)
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
|
||||||
|
|
||||||
|
|
||||||
public SubEditViewModel(SubItem subItem, Window view)
|
public SubEditViewModel(SubItem subItem, Window view)
|
||||||
{
|
{
|
||||||
_config = LazyConfig.Instance.GetConfig();
|
_config = LazyConfig.Instance.GetConfig();
|
||||||
@@ -44,6 +43,7 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
|
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveSub()
|
private void SaveSub()
|
||||||
{
|
{
|
||||||
string remarks = SelectedSource.remarks;
|
string remarks = SelectedSource.remarks;
|
||||||
@@ -62,10 +62,13 @@ namespace v2rayN.ViewModels
|
|||||||
{
|
{
|
||||||
item.remarks = SelectedSource.remarks;
|
item.remarks = SelectedSource.remarks;
|
||||||
item.url = SelectedSource.url;
|
item.url = SelectedSource.url;
|
||||||
|
item.moreUrl = SelectedSource.moreUrl;
|
||||||
item.enabled = SelectedSource.enabled;
|
item.enabled = SelectedSource.enabled;
|
||||||
|
item.autoUpdateInterval = SelectedSource.autoUpdateInterval;
|
||||||
item.userAgent = SelectedSource.userAgent;
|
item.userAgent = SelectedSource.userAgent;
|
||||||
item.sort = SelectedSource.sort;
|
item.sort = SelectedSource.sort;
|
||||||
item.filter = SelectedSource.filter;
|
item.filter = SelectedSource.filter;
|
||||||
|
item.convertTarget = SelectedSource.convertTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ConfigHandler.AddSubItem(ref _config, item) == 0)
|
if (ConfigHandler.AddSubItem(ref _config, item) == 0)
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ using ReactiveUI.Fody.Helpers;
|
|||||||
using Splat;
|
using Splat;
|
||||||
using System.Reactive;
|
using System.Reactive;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Forms;
|
|
||||||
using v2rayN.Base;
|
using v2rayN.Base;
|
||||||
using v2rayN.Handler;
|
using v2rayN.Handler;
|
||||||
using v2rayN.Mode;
|
using v2rayN.Mode;
|
||||||
@@ -22,9 +21,12 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
private IObservableCollection<SubItem> _subItems = new ObservableCollectionExtended<SubItem>();
|
private IObservableCollection<SubItem> _subItems = new ObservableCollectionExtended<SubItem>();
|
||||||
public IObservableCollection<SubItem> SubItems => _subItems;
|
public IObservableCollection<SubItem> SubItems => _subItems;
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public SubItem SelectedSource { get; set; }
|
public SubItem SelectedSource { get; set; }
|
||||||
|
|
||||||
|
public IList<SubItem> SelectedSources { get; set; }
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> SubAddCmd { get; }
|
public ReactiveCommand<Unit, Unit> SubAddCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> SubDeleteCmd { get; }
|
public ReactiveCommand<Unit, Unit> SubDeleteCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> SubEditCmd { get; }
|
public ReactiveCommand<Unit, Unit> SubEditCmd { get; }
|
||||||
@@ -91,17 +93,19 @@ namespace v2rayN.ViewModels
|
|||||||
RefreshSubItems();
|
RefreshSubItems();
|
||||||
IsModified = true;
|
IsModified = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DeleteSub()
|
private void DeleteSub()
|
||||||
{
|
{
|
||||||
if (UI.ShowYesNo(ResUI.RemoveServer) == DialogResult.No)
|
if (UI.ShowYesNo(ResUI.RemoveServer) == MessageBoxResult.No)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigHandler.DeleteSubItem(ref _config, SelectedSource?.id);
|
foreach (var it in SelectedSources)
|
||||||
|
{
|
||||||
|
ConfigHandler.DeleteSubItem(ref _config, it?.id);
|
||||||
|
}
|
||||||
RefreshSubItems();
|
RefreshSubItems();
|
||||||
_noticeHandler?.Enqueue(ResUI.OperationSuccess);
|
_noticeHandler?.Enqueue(ResUI.OperationSuccess);
|
||||||
IsModified = true;
|
IsModified = true;
|
||||||
@@ -122,6 +126,5 @@ namespace v2rayN.ViewModels
|
|||||||
|
|
||||||
await DialogHost.Show(dialog, "SubDialog");
|
await DialogHost.Show(dialog, "SubDialog");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -137,12 +137,18 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
Text="{x:Static resx:ResUI.TbDisplayLog}" />
|
Text="{x:Static resx:ResUI.TbDisplayLog}" />
|
||||||
<ToggleButton
|
<StackPanel
|
||||||
x:Name="togDisplayLog"
|
|
||||||
Grid.Row="4"
|
Grid.Row="4"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
HorizontalAlignment="Left" />
|
Orientation="Horizontal">
|
||||||
|
<ToggleButton x:Name="togDisplayLog" HorizontalAlignment="Left" />
|
||||||
|
<TextBlock
|
||||||
|
Margin="8,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TipDisplayLog}" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="5"
|
Grid.Row="5"
|
||||||
@@ -171,12 +177,11 @@
|
|||||||
Text="{x:Static resx:ResUI.TipPreSocksPort}"
|
Text="{x:Static resx:ResUI.TipPreSocksPort}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid
|
<Grid
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="16"
|
Margin="8"
|
||||||
HorizontalAlignment="Center">
|
HorizontalAlignment="Center">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="200" />
|
<ColumnDefinition Width="200" />
|
||||||
@@ -197,9 +202,6 @@
|
|||||||
IsCancel="true"
|
IsCancel="true"
|
||||||
Style="{StaticResource DefButton}" />
|
Style="{StaticResource DefButton}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</reactiveui:ReactiveWindow>
|
</reactiveui:ReactiveWindow>
|
||||||
@@ -34,15 +34,14 @@ namespace v2rayN.Views
|
|||||||
this.BindCommand(ViewModel, vm => vm.BrowseServerCmd, v => v.btnBrowse).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.BrowseServerCmd, v => v.btnBrowse).DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.EditServerCmd, v => v.btnEdit).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.EditServerCmd, v => v.btnEdit).DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.SaveServerCmd, v => v.btnSave).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.SaveServerCmd, v => v.btnSave).DisposeWith(disposables);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
txtRemarks.Focus();
|
txtRemarks.Focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnCancel_Click(object sender, System.Windows.RoutedEventArgs e)
|
private void btnCancel_Click(object sender, System.Windows.RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (ViewModel?.IsModified == true)
|
if (ViewModel?.IsModified == true)
|
||||||
@@ -54,8 +53,5 @@ namespace v2rayN.Views
|
|||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
xmlns:resx="clr-namespace:v2rayN.Resx"
|
xmlns:resx="clr-namespace:v2rayN.Resx"
|
||||||
xmlns:vms="clr-namespace:v2rayN.ViewModels"
|
xmlns:vms="clr-namespace:v2rayN.ViewModels"
|
||||||
Title="{x:Static resx:ResUI.menuServers}"
|
Title="{x:Static resx:ResUI.menuServers}"
|
||||||
Width="800"
|
Width="820"
|
||||||
Height="800"
|
Height="820"
|
||||||
x:TypeArguments="vms:AddServerViewModel"
|
x:TypeArguments="vms:AddServerViewModel"
|
||||||
Background="{DynamicResource MaterialDesignPaper}"
|
Background="{DynamicResource MaterialDesignPaper}"
|
||||||
FontFamily="{x:Static conv:MaterialDesignFonts.MyFont}"
|
FontFamily="{x:Static conv:MaterialDesignFonts.MyFont}"
|
||||||
@@ -193,7 +193,6 @@
|
|||||||
Width="200"
|
Width="200"
|
||||||
Margin="{StaticResource ServerItemMargin}"
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
Style="{StaticResource DefComboBox}" />
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid
|
<Grid
|
||||||
x:Name="gridSs"
|
x:Name="gridSs"
|
||||||
@@ -239,7 +238,6 @@
|
|||||||
Width="300"
|
Width="300"
|
||||||
Margin="{StaticResource ServerItemMargin}"
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
Style="{StaticResource DefComboBox}" />
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid
|
<Grid
|
||||||
x:Name="gridSocks"
|
x:Name="gridSocks"
|
||||||
@@ -285,7 +283,6 @@
|
|||||||
Width="400"
|
Width="400"
|
||||||
Margin="{StaticResource ServerItemMargin}"
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
Style="{StaticResource DefTextBox}" />
|
Style="{StaticResource DefTextBox}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid
|
<Grid
|
||||||
x:Name="gridVLESS"
|
x:Name="gridVLESS"
|
||||||
@@ -523,7 +520,6 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
Text="{x:Static resx:ResUI.TbPath}" />
|
Text="{x:Static resx:ResUI.TbPath}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Separator
|
<Separator
|
||||||
@@ -559,8 +555,10 @@
|
|||||||
Margin="{StaticResource ServerItemMargin}"
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
Style="{StaticResource DefComboBox}" />
|
Style="{StaticResource DefComboBox}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<Grid
|
||||||
<Grid x:Name="gridTlsMore" Grid.Row="7">
|
x:Name="gridTlsMore"
|
||||||
|
Grid.Row="7"
|
||||||
|
Visibility="Hidden">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
@@ -595,25 +593,10 @@
|
|||||||
Margin="{StaticResource ServerItemMargin}"
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
Text="{x:Static resx:ResUI.TbAllowInsecure}" />
|
|
||||||
<ComboBox
|
|
||||||
x:Name="cmbAllowInsecure"
|
|
||||||
Grid.Row="2"
|
|
||||||
Grid.Column="1"
|
|
||||||
Width="100"
|
|
||||||
Margin="{StaticResource ServerItemMargin}"
|
|
||||||
Style="{StaticResource DefComboBox}" />
|
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="3"
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="{StaticResource ServerItemMargin}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
|
||||||
Text="{x:Static resx:ResUI.TbFingerprint}" />
|
Text="{x:Static resx:ResUI.TbFingerprint}" />
|
||||||
<ComboBox
|
<ComboBox
|
||||||
x:Name="cmbFingerprint"
|
x:Name="cmbFingerprint"
|
||||||
Grid.Row="3"
|
Grid.Row="2"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="200"
|
Width="200"
|
||||||
Margin="{StaticResource ServerItemMargin}"
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
@@ -621,7 +604,7 @@
|
|||||||
Style="{StaticResource DefComboBox}" />
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="4"
|
Grid.Row="3"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="{StaticResource ServerItemMargin}"
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
@@ -629,13 +612,123 @@
|
|||||||
Text="{x:Static resx:ResUI.TbAlpn}" />
|
Text="{x:Static resx:ResUI.TbAlpn}" />
|
||||||
<ComboBox
|
<ComboBox
|
||||||
x:Name="cmbAlpn"
|
x:Name="cmbAlpn"
|
||||||
Grid.Row="4"
|
Grid.Row="3"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="200"
|
Width="200"
|
||||||
Margin="{StaticResource ServerItemMargin}"
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
Style="{StaticResource DefComboBox}" />
|
Style="{StaticResource DefComboBox}" />
|
||||||
</Grid>
|
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="4"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TbAllowInsecure}" />
|
||||||
|
<ComboBox
|
||||||
|
x:Name="cmbAllowInsecure"
|
||||||
|
Grid.Row="4"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="100"
|
||||||
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
</Grid>
|
||||||
|
<Grid
|
||||||
|
x:Name="gridRealityMore"
|
||||||
|
Grid.Row="7"
|
||||||
|
Visibility="Hidden">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="180" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TbSNI}" />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtSNI2"
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="400"
|
||||||
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Style="{StaticResource DefTextBox}" />
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TbFingerprint}" />
|
||||||
|
<ComboBox
|
||||||
|
x:Name="cmbFingerprint2"
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="200"
|
||||||
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
|
IsEditable="True"
|
||||||
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="2"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TbPublicKey}" />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtPublicKey"
|
||||||
|
Grid.Row="2"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="400"
|
||||||
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Style="{StaticResource DefTextBox}" />
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="3"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TbShortId}" />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtShortId"
|
||||||
|
Grid.Row="3"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="200"
|
||||||
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Style="{StaticResource DefTextBox}" />
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="4"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TbSpiderX}" />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtSpiderX"
|
||||||
|
Grid.Row="4"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="400"
|
||||||
|
Margin="{StaticResource ServerItemMargin}"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Style="{StaticResource DefTextBox}" />
|
||||||
|
</Grid>
|
||||||
<Separator
|
<Separator
|
||||||
Grid.Row="8"
|
Grid.Row="8"
|
||||||
Margin="0,2"
|
Margin="0,2"
|
||||||
@@ -643,7 +736,7 @@
|
|||||||
|
|
||||||
<Grid
|
<Grid
|
||||||
Grid.Row="9"
|
Grid.Row="9"
|
||||||
Margin="16"
|
Margin="8"
|
||||||
HorizontalAlignment="Center">
|
HorizontalAlignment="Center">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="200" />
|
<ColumnDefinition Width="200" />
|
||||||
@@ -666,7 +759,6 @@
|
|||||||
IsCancel="true"
|
IsCancel="true"
|
||||||
Style="{StaticResource DefButton}" />
|
Style="{StaticResource DefButton}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</reactiveui:ReactiveWindow>
|
</reactiveui:ReactiveWindow>
|
||||||
@@ -12,7 +12,6 @@ namespace v2rayN.Views
|
|||||||
{
|
{
|
||||||
public partial class AddServerWindow
|
public partial class AddServerWindow
|
||||||
{
|
{
|
||||||
|
|
||||||
public AddServerWindow(ProfileItem profileItem)
|
public AddServerWindow(ProfileItem profileItem)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@@ -23,10 +22,20 @@ namespace v2rayN.Views
|
|||||||
|
|
||||||
ViewModel = new AddServerViewModel(profileItem, this);
|
ViewModel = new AddServerViewModel(profileItem, this);
|
||||||
|
|
||||||
|
if (profileItem.configType == EConfigType.VLESS)
|
||||||
|
{
|
||||||
|
Global.coreTypes4VLESS.ForEach(it =>
|
||||||
|
{
|
||||||
|
cmbCoreType.Items.Add(it);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Global.coreTypes.ForEach(it =>
|
Global.coreTypes.ForEach(it =>
|
||||||
{
|
{
|
||||||
cmbCoreType.Items.Add(it);
|
cmbCoreType.Items.Add(it);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
cmbCoreType.Items.Add(string.Empty);
|
cmbCoreType.Items.Add(string.Empty);
|
||||||
|
|
||||||
cmbStreamSecurity.Items.Add(string.Empty);
|
cmbStreamSecurity.Items.Add(string.Empty);
|
||||||
@@ -39,6 +48,7 @@ namespace v2rayN.Views
|
|||||||
Global.fingerprints.ForEach(it =>
|
Global.fingerprints.ForEach(it =>
|
||||||
{
|
{
|
||||||
cmbFingerprint.Items.Add(it);
|
cmbFingerprint.Items.Add(it);
|
||||||
|
cmbFingerprint2.Items.Add(it);
|
||||||
});
|
});
|
||||||
Global.allowInsecures.ForEach(it =>
|
Global.allowInsecures.ForEach(it =>
|
||||||
{
|
{
|
||||||
@@ -62,6 +72,7 @@ namespace v2rayN.Views
|
|||||||
profileItem.security = Global.DefaultSecurity;
|
profileItem.security = Global.DefaultSecurity;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.Shadowsocks:
|
case EConfigType.Shadowsocks:
|
||||||
gridSs.Visibility = Visibility.Visible;
|
gridSs.Visibility = Visibility.Visible;
|
||||||
LazyConfig.Instance.GetShadowsocksSecuritys(profileItem).ForEach(it =>
|
LazyConfig.Instance.GetShadowsocksSecuritys(profileItem).ForEach(it =>
|
||||||
@@ -69,13 +80,15 @@ namespace v2rayN.Views
|
|||||||
cmbSecurity3.Items.Add(it);
|
cmbSecurity3.Items.Add(it);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.Socks:
|
case EConfigType.Socks:
|
||||||
gridSocks.Visibility = Visibility.Visible;
|
gridSocks.Visibility = Visibility.Visible;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.VLESS:
|
case EConfigType.VLESS:
|
||||||
gridVLESS.Visibility = Visibility.Visible;
|
gridVLESS.Visibility = Visibility.Visible;
|
||||||
cmbStreamSecurity.Items.Add(Global.StreamSecurityX);
|
cmbStreamSecurity.Items.Add(Global.StreamSecurityReality);
|
||||||
Global.xtlsFlows.ForEach(it =>
|
Global.flows.ForEach(it =>
|
||||||
{
|
{
|
||||||
cmbFlow5.Items.Add(it);
|
cmbFlow5.Items.Add(it);
|
||||||
});
|
});
|
||||||
@@ -84,10 +97,10 @@ namespace v2rayN.Views
|
|||||||
profileItem.security = Global.None;
|
profileItem.security = Global.None;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.Trojan:
|
case EConfigType.Trojan:
|
||||||
gridTrojan.Visibility = Visibility.Visible;
|
gridTrojan.Visibility = Visibility.Visible;
|
||||||
cmbStreamSecurity.Items.Add(Global.StreamSecurityX);
|
Global.flows.ForEach(it =>
|
||||||
Global.xtlsFlows.ForEach(it =>
|
|
||||||
{
|
{
|
||||||
cmbFlow6.Items.Add(it);
|
cmbFlow6.Items.Add(it);
|
||||||
});
|
});
|
||||||
@@ -110,19 +123,23 @@ namespace v2rayN.Views
|
|||||||
this.Bind(ViewModel, vm => vm.SelectedSource.alterId, v => v.txtAlterId.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.alterId, v => v.txtAlterId.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.security, v => v.cmbSecurity.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.security, v => v.cmbSecurity.Text).DisposeWith(disposables);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.Shadowsocks:
|
case EConfigType.Shadowsocks:
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.id, v => v.txtId3.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.id, v => v.txtId3.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.security, v => v.cmbSecurity3.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.security, v => v.cmbSecurity3.Text).DisposeWith(disposables);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.Socks:
|
case EConfigType.Socks:
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.id, v => v.txtId4.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.id, v => v.txtId4.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.security, v => v.txtSecurity4.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.security, v => v.txtSecurity4.Text).DisposeWith(disposables);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.VLESS:
|
case EConfigType.VLESS:
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.id, v => v.txtId5.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.id, v => v.txtId5.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.flow, v => v.cmbFlow5.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.flow, v => v.cmbFlow5.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.security, v => v.txtSecurity5.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.security, v => v.txtSecurity5.Text).DisposeWith(disposables);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.Trojan:
|
case EConfigType.Trojan:
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.id, v => v.txtId6.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.id, v => v.txtId6.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.flow, v => v.cmbFlow6.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.flow, v => v.cmbFlow6.Text).DisposeWith(disposables);
|
||||||
@@ -138,9 +155,14 @@ namespace v2rayN.Views
|
|||||||
this.Bind(ViewModel, vm => vm.SelectedSource.allowInsecure, v => v.cmbAllowInsecure.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.allowInsecure, v => v.cmbAllowInsecure.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.fingerprint, v => v.cmbFingerprint.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.fingerprint, v => v.cmbFingerprint.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.alpn, v => v.cmbAlpn.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.alpn, v => v.cmbAlpn.Text).DisposeWith(disposables);
|
||||||
|
//reality
|
||||||
|
this.Bind(ViewModel, vm => vm.SelectedSource.sni, v => v.txtSNI2.Text).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.SelectedSource.fingerprint, v => v.cmbFingerprint2.Text).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.SelectedSource.publicKey, v => v.txtPublicKey.Text).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.SelectedSource.shortId, v => v.txtShortId.Text).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.SelectedSource.spiderX, v => v.txtSpiderX.Text).DisposeWith(disposables);
|
||||||
|
|
||||||
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.Title = $"{profileItem.configType}";
|
this.Title = $"{profileItem.configType}";
|
||||||
@@ -156,18 +178,27 @@ namespace v2rayN.Views
|
|||||||
SetHeaderType();
|
SetHeaderType();
|
||||||
SetTips();
|
SetTips();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CmbStreamSecurity_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
private void CmbStreamSecurity_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
var security = cmbStreamSecurity.SelectedItem.ToString();
|
var security = cmbStreamSecurity.SelectedItem.ToString();
|
||||||
if (Utils.IsNullOrEmpty(security))
|
if (security == Global.StreamSecurityReality)
|
||||||
{
|
{
|
||||||
|
gridRealityMore.Visibility = Visibility.Visible;
|
||||||
gridTlsMore.Visibility = Visibility.Hidden;
|
gridTlsMore.Visibility = Visibility.Hidden;
|
||||||
}
|
}
|
||||||
|
else if (security == Global.StreamSecurity)
|
||||||
|
{
|
||||||
|
gridRealityMore.Visibility = Visibility.Hidden;
|
||||||
|
gridTlsMore.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gridTlsMore.Visibility = Visibility.Visible;
|
gridRealityMore.Visibility = Visibility.Hidden;
|
||||||
|
gridTlsMore.Visibility = Visibility.Hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnGUID_Click(object sender, RoutedEventArgs e)
|
private void btnGUID_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
txtId.Text =
|
txtId.Text =
|
||||||
@@ -228,23 +259,28 @@ namespace v2rayN.Views
|
|||||||
tipRequestHost.Text = ResUI.TransportRequestHostTip1;
|
tipRequestHost.Text = ResUI.TransportRequestHostTip1;
|
||||||
tipHeaderType.Text = ResUI.TransportHeaderTypeTip1;
|
tipHeaderType.Text = ResUI.TransportHeaderTypeTip1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "kcp":
|
case "kcp":
|
||||||
tipHeaderType.Text = ResUI.TransportHeaderTypeTip2;
|
tipHeaderType.Text = ResUI.TransportHeaderTypeTip2;
|
||||||
tipPath.Text = ResUI.TransportPathTip5;
|
tipPath.Text = ResUI.TransportPathTip5;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "ws":
|
case "ws":
|
||||||
tipRequestHost.Text = ResUI.TransportRequestHostTip2;
|
tipRequestHost.Text = ResUI.TransportRequestHostTip2;
|
||||||
tipPath.Text = ResUI.TransportPathTip1;
|
tipPath.Text = ResUI.TransportPathTip1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "h2":
|
case "h2":
|
||||||
tipRequestHost.Text = ResUI.TransportRequestHostTip3;
|
tipRequestHost.Text = ResUI.TransportRequestHostTip3;
|
||||||
tipPath.Text = ResUI.TransportPathTip2;
|
tipPath.Text = ResUI.TransportPathTip2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "quic":
|
case "quic":
|
||||||
tipRequestHost.Text = ResUI.TransportRequestHostTip4;
|
tipRequestHost.Text = ResUI.TransportRequestHostTip4;
|
||||||
tipPath.Text = ResUI.TransportPathTip3;
|
tipPath.Text = ResUI.TransportPathTip3;
|
||||||
tipHeaderType.Text = ResUI.TransportHeaderTypeTip3;
|
tipHeaderType.Text = ResUI.TransportHeaderTypeTip3;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "grpc":
|
case "grpc":
|
||||||
tipPath.Text = ResUI.TransportPathTip4;
|
tipPath.Text = ResUI.TransportPathTip4;
|
||||||
tipHeaderType.Text = ResUI.TransportHeaderTypeTip4;
|
tipHeaderType.Text = ResUI.TransportHeaderTypeTip4;
|
||||||
@@ -257,6 +293,5 @@ namespace v2rayN.Views
|
|||||||
{
|
{
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,7 +150,7 @@
|
|||||||
|
|
||||||
<Grid
|
<Grid
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Margin="16"
|
Margin="8"
|
||||||
HorizontalAlignment="Center">
|
HorizontalAlignment="Center">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="150" />
|
<ColumnDefinition Width="150" />
|
||||||
|
|||||||
@@ -1,47 +1,24 @@
|
|||||||
using System.Windows;
|
using System.Text;
|
||||||
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using v2rayN.Handler;
|
using v2rayN.Handler;
|
||||||
using v2rayN.Mode;
|
using v2rayN.Mode;
|
||||||
using v2rayN.Resx;
|
using v2rayN.Resx;
|
||||||
using Forms = System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace v2rayN.Views
|
namespace v2rayN.Views
|
||||||
{
|
{
|
||||||
public partial class GlobalHotkeySettingWindow
|
public partial class GlobalHotkeySettingWindow
|
||||||
{
|
{
|
||||||
private static Config _config;
|
private static Config _config = default!;
|
||||||
List<KeyEventItem> lstKey;
|
private Dictionary<object, KeyEventItem> _TextBoxKeyEventItem = default!;
|
||||||
|
|
||||||
public GlobalHotkeySettingWindow()
|
public GlobalHotkeySettingWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.Owner = Application.Current.MainWindow;
|
this.Owner = Application.Current.MainWindow;
|
||||||
_config = LazyConfig.Instance.GetConfig();
|
_config = LazyConfig.Instance.GetConfig();
|
||||||
|
_config.globalHotkeys ??= new List<KeyEventItem>();
|
||||||
if (_config.globalHotkeys == null)
|
|
||||||
{
|
|
||||||
_config.globalHotkeys = new List<KeyEventItem>();
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (EGlobalHotkey it in Enum.GetValues(typeof(EGlobalHotkey)))
|
|
||||||
{
|
|
||||||
if (_config.globalHotkeys.FindIndex(t => t.eGlobalHotkey == it) >= 0)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
_config.globalHotkeys.Add(new KeyEventItem()
|
|
||||||
{
|
|
||||||
eGlobalHotkey = it,
|
|
||||||
Alt = false,
|
|
||||||
Control = false,
|
|
||||||
Shift = false,
|
|
||||||
KeyCode = null
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
lstKey = Utils.DeepCopy(_config.globalHotkeys);
|
|
||||||
|
|
||||||
txtGlobalHotkey0.KeyDown += TxtGlobalHotkey_KeyDown;
|
txtGlobalHotkey0.KeyDown += TxtGlobalHotkey_KeyDown;
|
||||||
txtGlobalHotkey1.KeyDown += TxtGlobalHotkey_KeyDown;
|
txtGlobalHotkey1.KeyDown += TxtGlobalHotkey_KeyDown;
|
||||||
@@ -49,69 +26,84 @@ namespace v2rayN.Views
|
|||||||
txtGlobalHotkey3.KeyDown += TxtGlobalHotkey_KeyDown;
|
txtGlobalHotkey3.KeyDown += TxtGlobalHotkey_KeyDown;
|
||||||
txtGlobalHotkey4.KeyDown += TxtGlobalHotkey_KeyDown;
|
txtGlobalHotkey4.KeyDown += TxtGlobalHotkey_KeyDown;
|
||||||
|
|
||||||
BindingData(-1);
|
HotkeyHandler.Instance.IsPause = true;
|
||||||
|
this.Closing += (s, e) => HotkeyHandler.Instance.IsPause = false;
|
||||||
Utils.SetDarkBorder(this, _config.uiItem.colorModeDark);
|
Utils.SetDarkBorder(this, _config.uiItem.colorModeDark);
|
||||||
|
InitData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void InitData()
|
||||||
|
{
|
||||||
|
_TextBoxKeyEventItem = new()
|
||||||
|
{
|
||||||
|
{ txtGlobalHotkey0,GetKeyEventItemByEGlobalHotkey(_config.globalHotkeys,EGlobalHotkey.ShowForm) },
|
||||||
|
{ txtGlobalHotkey1,GetKeyEventItemByEGlobalHotkey(_config.globalHotkeys,EGlobalHotkey.SystemProxyClear) },
|
||||||
|
{ txtGlobalHotkey2,GetKeyEventItemByEGlobalHotkey(_config.globalHotkeys,EGlobalHotkey.SystemProxySet) },
|
||||||
|
{ txtGlobalHotkey3,GetKeyEventItemByEGlobalHotkey(_config.globalHotkeys,EGlobalHotkey.SystemProxyUnchanged)},
|
||||||
|
{ txtGlobalHotkey4,GetKeyEventItemByEGlobalHotkey(_config.globalHotkeys,EGlobalHotkey.SystemProxyPac)}
|
||||||
|
};
|
||||||
|
BindingData();
|
||||||
|
}
|
||||||
|
|
||||||
private void TxtGlobalHotkey_KeyDown(object sender, KeyEventArgs e)
|
private void TxtGlobalHotkey_KeyDown(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
var _ModifierKeys = new Key[] { Key.LeftCtrl, Key.RightCtrl, Key.LeftShift, Key.RightShift, Key.LeftAlt, Key.RightAlt };
|
var _ModifierKeys = new Key[] { Key.LeftCtrl, Key.RightCtrl, Key.LeftShift,
|
||||||
if (!_ModifierKeys.Contains(e.Key) && !_ModifierKeys.Contains(e.SystemKey))
|
Key.RightShift, Key.LeftAlt, Key.RightAlt, Key.LWin, Key.RWin};
|
||||||
{
|
_TextBoxKeyEventItem[sender].KeyCode = e.Key == Key.System ? (_ModifierKeys.Contains(e.SystemKey) ? Key.None : e.SystemKey) : (_ModifierKeys.Contains(e.Key) ? Key.None : e.Key);
|
||||||
var txt = ((TextBox)sender);
|
_TextBoxKeyEventItem[sender].Alt = (Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt;
|
||||||
var index = Utils.ToInt(txt.Name.Substring(txt.Name.Length - 1, 1));
|
_TextBoxKeyEventItem[sender].Control = (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control;
|
||||||
var formsKey = (Forms.Keys)KeyInterop.VirtualKeyFromKey(e.Key == Key.System ? e.SystemKey : e.Key);
|
_TextBoxKeyEventItem[sender].Shift = (Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift;
|
||||||
|
(sender as TextBox)!.Text = KeyEventItemToString(_TextBoxKeyEventItem[sender]);
|
||||||
lstKey[index].KeyCode = formsKey;
|
|
||||||
lstKey[index].Alt = (Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt;
|
|
||||||
lstKey[index].Control = (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control;
|
|
||||||
lstKey[index].Shift = (Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift;
|
|
||||||
|
|
||||||
BindingData(index);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BindingData(int index)
|
private KeyEventItem GetKeyEventItemByEGlobalHotkey(List<KeyEventItem> KELsit, EGlobalHotkey eg)
|
||||||
{
|
{
|
||||||
for (int k = 0; k < lstKey.Count; k++)
|
return Utils.DeepCopy(KELsit.Find((it) => it.eGlobalHotkey == eg) ?? new()
|
||||||
{
|
{
|
||||||
if (index >= 0 && index != k)
|
eGlobalHotkey = eg,
|
||||||
{
|
Control = false,
|
||||||
continue;
|
Alt = false,
|
||||||
}
|
Shift = false,
|
||||||
var item = lstKey[k];
|
KeyCode = null
|
||||||
var keys = string.Empty;
|
});
|
||||||
|
|
||||||
if (item.Control)
|
|
||||||
{
|
|
||||||
keys += $"{Forms.Keys.Control} + ";
|
|
||||||
}
|
|
||||||
if (item.Alt)
|
|
||||||
{
|
|
||||||
keys += $"{Forms.Keys.Alt} + ";
|
|
||||||
}
|
|
||||||
if (item.Shift)
|
|
||||||
{
|
|
||||||
keys += $"{Forms.Keys.Shift} + ";
|
|
||||||
}
|
|
||||||
if (item.KeyCode != null)
|
|
||||||
{
|
|
||||||
keys += $"{item.KeyCode}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SetText($"txtGlobalHotkey{k}", keys);
|
private string KeyEventItemToString(KeyEventItem item)
|
||||||
|
{
|
||||||
|
var res = new StringBuilder();
|
||||||
|
|
||||||
|
if (item.Control) res.Append($"{ModifierKeys.Control}+");
|
||||||
|
if (item.Shift) res.Append($"{ModifierKeys.Shift}+");
|
||||||
|
if (item.Alt) res.Append($"{ModifierKeys.Alt}+");
|
||||||
|
if (item.KeyCode != null && item.KeyCode != Key.None)
|
||||||
|
res.Append($"{item.KeyCode}");
|
||||||
|
|
||||||
|
return res.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BindingData()
|
||||||
|
{
|
||||||
|
foreach (var item in _TextBoxKeyEventItem)
|
||||||
|
{
|
||||||
|
if (item.Value.KeyCode != null && item.Value.KeyCode != Key.None)
|
||||||
|
{
|
||||||
|
(item.Key as TextBox)!.Text = KeyEventItemToString(item.Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
(item.Key as TextBox)!.Text = string.Empty;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnSave_Click(object sender, RoutedEventArgs e)
|
private void btnSave_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
_config.globalHotkeys = lstKey;
|
_config.globalHotkeys = _TextBoxKeyEventItem.Values.ToList();
|
||||||
|
|
||||||
if (ConfigHandler.SaveConfig(ref _config, false) == 0)
|
if (ConfigHandler.SaveConfig(ref _config, false) == 0)
|
||||||
{
|
{
|
||||||
|
HotkeyHandler.Instance.ReLoad();
|
||||||
this.DialogResult = true;
|
this.DialogResult = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -127,37 +119,14 @@ namespace v2rayN.Views
|
|||||||
|
|
||||||
private void btnReset_Click(object sender, RoutedEventArgs e)
|
private void btnReset_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
lstKey.Clear();
|
foreach (var k in _TextBoxKeyEventItem.Keys)
|
||||||
foreach (EGlobalHotkey it in Enum.GetValues(typeof(EGlobalHotkey)))
|
|
||||||
{
|
{
|
||||||
if (lstKey.FindIndex(t => t.eGlobalHotkey == it) >= 0)
|
_TextBoxKeyEventItem[k].Alt = false;
|
||||||
{
|
_TextBoxKeyEventItem[k].Control = false;
|
||||||
continue;
|
_TextBoxKeyEventItem[k].Shift = false;
|
||||||
}
|
_TextBoxKeyEventItem[k].KeyCode = Key.None;
|
||||||
|
|
||||||
lstKey.Add(new KeyEventItem()
|
|
||||||
{
|
|
||||||
eGlobalHotkey = it,
|
|
||||||
Alt = false,
|
|
||||||
Control = false,
|
|
||||||
Shift = false,
|
|
||||||
KeyCode = null
|
|
||||||
});
|
|
||||||
}
|
|
||||||
BindingData(-1);
|
|
||||||
}
|
|
||||||
private void SetText(string name, string txt)
|
|
||||||
{
|
|
||||||
foreach (UIElement element in gridText.Children)
|
|
||||||
{
|
|
||||||
if (element is TextBox box)
|
|
||||||
{
|
|
||||||
if (box.Name == name)
|
|
||||||
{
|
|
||||||
box.Text = txt;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
BindingData();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GlobalHotkeySettingWindow_KeyDown(object sender, KeyEventArgs e)
|
private void GlobalHotkeySettingWindow_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
|||||||
@@ -10,13 +10,13 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:reactiveui="http://reactiveui.net"
|
xmlns:reactiveui="http://reactiveui.net"
|
||||||
xmlns:resx="clr-namespace:v2rayN.Resx"
|
xmlns:resx="clr-namespace:v2rayN.Resx"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="clr-namespace:H.NotifyIcon;assembly=H.NotifyIcon.Wpf"
|
||||||
xmlns:vms="clr-namespace:v2rayN.ViewModels"
|
xmlns:vms="clr-namespace:v2rayN.ViewModels"
|
||||||
Title="v2rayN"
|
Title="v2rayN"
|
||||||
Width="900"
|
Width="900"
|
||||||
Height="700"
|
Height="700"
|
||||||
MinWidth="800"
|
MinWidth="900"
|
||||||
MinHeight="600"
|
MinHeight="700"
|
||||||
x:TypeArguments="vms:MainWindowViewModel"
|
x:TypeArguments="vms:MainWindowViewModel"
|
||||||
Background="{DynamicResource MaterialDesignPaper}"
|
Background="{DynamicResource MaterialDesignPaper}"
|
||||||
FontFamily="{x:Static conv:MaterialDesignFonts.MyFont}"
|
FontFamily="{x:Static conv:MaterialDesignFonts.MyFont}"
|
||||||
@@ -94,7 +94,6 @@
|
|||||||
x:Name="menuAddServerViaScan"
|
x:Name="menuAddServerViaScan"
|
||||||
Height="{StaticResource MenuItemHeight}"
|
Height="{StaticResource MenuItemHeight}"
|
||||||
Header="{x:Static resx:ResUI.menuAddServerViaScan}" />
|
Header="{x:Static resx:ResUI.menuAddServerViaScan}" />
|
||||||
|
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
<Separator />
|
<Separator />
|
||||||
@@ -157,6 +156,10 @@
|
|||||||
Height="{StaticResource MenuItemHeight}"
|
Height="{StaticResource MenuItemHeight}"
|
||||||
Header="{x:Static resx:ResUI.menuGlobalHotkeySetting}" />
|
Header="{x:Static resx:ResUI.menuGlobalHotkeySetting}" />
|
||||||
<Separator Margin="-40,5" />
|
<Separator Margin="-40,5" />
|
||||||
|
<MenuItem
|
||||||
|
x:Name="menuRebootAsAdmin"
|
||||||
|
Height="{StaticResource MenuItemHeight}"
|
||||||
|
Header="{x:Static resx:ResUI.menuRebootAsAdmin}" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
x:Name="menuSettingsSetUWP"
|
x:Name="menuSettingsSetUWP"
|
||||||
Height="{StaticResource MenuItemHeight}"
|
Height="{StaticResource MenuItemHeight}"
|
||||||
@@ -225,6 +228,11 @@
|
|||||||
Height="{StaticResource MenuItemHeight}"
|
Height="{StaticResource MenuItemHeight}"
|
||||||
Header="Clash.Meta Core" />
|
Header="Clash.Meta Core" />
|
||||||
<Separator Margin="-40,5" />
|
<Separator Margin="-40,5" />
|
||||||
|
<MenuItem
|
||||||
|
x:Name="menuCheckUpdateSingBoxCore"
|
||||||
|
Height="{StaticResource MenuItemHeight}"
|
||||||
|
Header="SingBox Core" />
|
||||||
|
<Separator Margin="-40,5" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
x:Name="menuCheckUpdateGeo"
|
x:Name="menuCheckUpdateGeo"
|
||||||
Height="{StaticResource MenuItemHeight}"
|
Height="{StaticResource MenuItemHeight}"
|
||||||
@@ -352,7 +360,6 @@
|
|||||||
Margin="8"
|
Margin="8"
|
||||||
materialDesign:HintAssist.Hint="Language"
|
materialDesign:HintAssist.Hint="Language"
|
||||||
Style="{StaticResource DefComboBox}" />
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</materialDesign:PopupBox>
|
</materialDesign:PopupBox>
|
||||||
@@ -378,6 +385,14 @@
|
|||||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}">
|
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}">
|
||||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Plus" />
|
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Plus" />
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
x:Name="btnAutofitColumnWidth"
|
||||||
|
Width="30"
|
||||||
|
Height="30"
|
||||||
|
Margin="4,0"
|
||||||
|
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}">
|
||||||
|
<materialDesign:PackIcon VerticalAlignment="Center" Kind="ArrowSplitVertical" />
|
||||||
|
</Button>
|
||||||
<TextBox
|
<TextBox
|
||||||
x:Name="txtServerFilter"
|
x:Name="txtServerFilter"
|
||||||
Width="200"
|
Width="200"
|
||||||
@@ -484,10 +499,10 @@
|
|||||||
CanUserSortColumns="False"
|
CanUserSortColumns="False"
|
||||||
EnableRowVirtualization="True"
|
EnableRowVirtualization="True"
|
||||||
Focusable="True"
|
Focusable="True"
|
||||||
FrozenColumnCount="1"
|
|
||||||
GridLinesVisibility="All"
|
GridLinesVisibility="All"
|
||||||
HeadersVisibility="All"
|
HeadersVisibility="All"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
|
RowHeaderWidth="40"
|
||||||
Style="{StaticResource DefDataGrid}">
|
Style="{StaticResource DefDataGrid}">
|
||||||
<DataGrid.InputBindings>
|
<DataGrid.InputBindings>
|
||||||
<KeyBinding Command="ApplicationCommands.NotACommand" Gesture="Ctrl+C" />
|
<KeyBinding Command="ApplicationCommands.NotACommand" Gesture="Ctrl+C" />
|
||||||
@@ -610,24 +625,22 @@
|
|||||||
<DataGrid.Resources>
|
<DataGrid.Resources>
|
||||||
<Style BasedOn="{StaticResource MaterialDesignDataGridRow}" TargetType="DataGridRow">
|
<Style BasedOn="{StaticResource MaterialDesignDataGridRow}" TargetType="DataGridRow">
|
||||||
<EventSetter Event="MouseDoubleClick" Handler="LstProfiles_MouseDoubleClick" />
|
<EventSetter Event="MouseDoubleClick" Handler="LstProfiles_MouseDoubleClick" />
|
||||||
|
|
||||||
</Style>
|
</Style>
|
||||||
<Style BasedOn="{StaticResource MaterialDesignDataGridColumnHeader}" TargetType="DataGridColumnHeader">
|
<Style BasedOn="{StaticResource MaterialDesignDataGridColumnHeader}" TargetType="DataGridColumnHeader">
|
||||||
<EventSetter Event="Click" Handler="LstProfiles_ColumnHeader_Click" />
|
<EventSetter Event="Click" Handler="LstProfiles_ColumnHeader_Click" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<Style BasedOn="{StaticResource MaterialDesignDataGridCell}" TargetType="DataGridCell">
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding isActive}" Value="True">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource PrimaryHueLightBrush}" />
|
||||||
|
<Setter Property="Foreground" Value="Black" />
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueLightBrush}" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
</DataGrid.Resources>
|
</DataGrid.Resources>
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTemplateColumn Width="50">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Border
|
|
||||||
Width="auto"
|
|
||||||
Height="auto"
|
|
||||||
Background="{DynamicResource PrimaryHueLightBrush}"
|
|
||||||
Visibility="{Binding Path=isActive, Converter={StaticResource BoolToVisConverter}}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
|
|
||||||
<base:MyDGTextColumn
|
<base:MyDGTextColumn
|
||||||
Width="80"
|
Width="80"
|
||||||
@@ -638,7 +651,7 @@
|
|||||||
Width="150"
|
Width="150"
|
||||||
Binding="{Binding remarks}"
|
Binding="{Binding remarks}"
|
||||||
ExName="remarks"
|
ExName="remarks"
|
||||||
Header="{x:Static resx:ResUI.LvAlias}" />
|
Header="{x:Static resx:ResUI.LvRemarks}" />
|
||||||
<base:MyDGTextColumn
|
<base:MyDGTextColumn
|
||||||
Width="120"
|
Width="120"
|
||||||
Binding="{Binding address}"
|
Binding="{Binding address}"
|
||||||
@@ -717,13 +730,11 @@
|
|||||||
Binding="{Binding totalDown}"
|
Binding="{Binding totalDown}"
|
||||||
ExName="totalDown"
|
ExName="totalDown"
|
||||||
Header="{x:Static resx:ResUI.LvTotalDownloadDataAmount}" />
|
Header="{x:Static resx:ResUI.LvTotalDownloadDataAmount}" />
|
||||||
|
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
<GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" />
|
<GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" />
|
||||||
<local:MsgView Grid.Row="2" />
|
<local:MsgView Grid.Row="2" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
<tb:TaskbarIcon
|
<tb:TaskbarIcon
|
||||||
x:Name="tbNotify"
|
x:Name="tbNotify"
|
||||||
@@ -779,7 +790,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</MenuItem.Header>
|
</MenuItem.Header>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<Separator />
|
<Separator x:Name="sepRoutings" />
|
||||||
<MenuItem x:Name="menuRoutings" Height="Auto">
|
<MenuItem x:Name="menuRoutings" Height="Auto">
|
||||||
<MenuItem.Header>
|
<MenuItem.Header>
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
@@ -831,9 +842,25 @@
|
|||||||
Header="{x:Static resx:ResUI.menuExit}" />
|
Header="{x:Static resx:ResUI.menuExit}" />
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</tb:TaskbarIcon.ContextMenu>
|
</tb:TaskbarIcon.ContextMenu>
|
||||||
|
<tb:TaskbarIcon.TrayToolTip>
|
||||||
|
<Border
|
||||||
|
x:Name="borTrayToolTip"
|
||||||
|
Width="Auto"
|
||||||
|
Height="Auto"
|
||||||
|
Background="{DynamicResource MaterialDesignLightBackground}"
|
||||||
|
BorderBrush="{DynamicResource MaterialDesignDarkBackground}"
|
||||||
|
BorderThickness="0"
|
||||||
|
CornerRadius="4">
|
||||||
|
<TextBlock
|
||||||
|
Margin="8"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="{DynamicResource MaterialDesignDarkBackground}"
|
||||||
|
Text="{Binding Mode=OneWay, Path=ToolTipText}" />
|
||||||
|
</Border>
|
||||||
|
</tb:TaskbarIcon.TrayToolTip>
|
||||||
</tb:TaskbarIcon>
|
</tb:TaskbarIcon>
|
||||||
<materialDesign:Snackbar x:Name="MainSnackbar" MessageQueue="{materialDesign:MessageQueue}" />
|
<materialDesign:Snackbar x:Name="MainSnackbar" MessageQueue="{materialDesign:MessageQueue}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</materialDesign:DialogHost>
|
</materialDesign:DialogHost>
|
||||||
</reactiveui:ReactiveWindow>
|
</reactiveui:ReactiveWindow>
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
using Splat;
|
using Splat;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Drawing;
|
|
||||||
using System.Reactive.Disposables;
|
using System.Reactive.Disposables;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
@@ -15,7 +14,6 @@ using v2rayN.Mode;
|
|||||||
using v2rayN.Resx;
|
using v2rayN.Resx;
|
||||||
using v2rayN.ViewModels;
|
using v2rayN.ViewModels;
|
||||||
using Point = System.Windows.Point;
|
using Point = System.Windows.Point;
|
||||||
using SystemInformation = System.Windows.Forms.SystemInformation;
|
|
||||||
|
|
||||||
namespace v2rayN.Views
|
namespace v2rayN.Views
|
||||||
{
|
{
|
||||||
@@ -31,6 +29,8 @@ namespace v2rayN.Views
|
|||||||
App.Current.SessionEnding += Current_SessionEnding;
|
App.Current.SessionEnding += Current_SessionEnding;
|
||||||
this.Closing += MainWindow_Closing;
|
this.Closing += MainWindow_Closing;
|
||||||
this.PreviewKeyDown += MainWindow_PreviewKeyDown;
|
this.PreviewKeyDown += MainWindow_PreviewKeyDown;
|
||||||
|
btnAutofitColumnWidth.Click += BtnAutofitColumnWidth_Click;
|
||||||
|
txtServerFilter.PreviewKeyDown += TxtServerFilter_PreviewKeyDown;
|
||||||
lstProfiles.PreviewKeyDown += LstProfiles_PreviewKeyDown;
|
lstProfiles.PreviewKeyDown += LstProfiles_PreviewKeyDown;
|
||||||
lstProfiles.SelectionChanged += lstProfiles_SelectionChanged;
|
lstProfiles.SelectionChanged += lstProfiles_SelectionChanged;
|
||||||
lstProfiles.LoadingRow += LstProfiles_LoadingRow;
|
lstProfiles.LoadingRow += LstProfiles_LoadingRow;
|
||||||
@@ -118,6 +118,7 @@ namespace v2rayN.Views
|
|||||||
this.BindCommand(ViewModel, vm => vm.OptionSettingCmd, v => v.menuOptionSetting).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.OptionSettingCmd, v => v.menuOptionSetting).DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.RoutingSettingCmd, v => v.menuRoutingSetting).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.RoutingSettingCmd, v => v.menuRoutingSetting).DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.GlobalHotkeySettingCmd, v => v.menuGlobalHotkeySetting).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.GlobalHotkeySettingCmd, v => v.menuGlobalHotkeySetting).DisposeWith(disposables);
|
||||||
|
this.BindCommand(ViewModel, vm => vm.RebootAsAdminCmd, v => v.menuRebootAsAdmin).DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.ClearServerStatisticsCmd, v => v.menuClearServerStatistics).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.ClearServerStatisticsCmd, v => v.menuClearServerStatistics).DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.ImportOldGuiConfigCmd, v => v.menuImportOldGuiConfig).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.ImportOldGuiConfigCmd, v => v.menuImportOldGuiConfig).DisposeWith(disposables);
|
||||||
|
|
||||||
@@ -128,6 +129,7 @@ namespace v2rayN.Views
|
|||||||
this.BindCommand(ViewModel, vm => vm.CheckUpdateXrayCoreCmd, v => v.menuCheckUpdateXrayCore).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.CheckUpdateXrayCoreCmd, v => v.menuCheckUpdateXrayCore).DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.CheckUpdateClashCoreCmd, v => v.menuCheckUpdateClashCore).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.CheckUpdateClashCoreCmd, v => v.menuCheckUpdateClashCore).DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.CheckUpdateClashMetaCoreCmd, v => v.menuCheckUpdateClashMetaCore).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.CheckUpdateClashMetaCoreCmd, v => v.menuCheckUpdateClashMetaCore).DisposeWith(disposables);
|
||||||
|
this.BindCommand(ViewModel, vm => vm.CheckUpdateSingBoxCoreCmd, v => v.menuCheckUpdateSingBoxCore).DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.CheckUpdateGeoCmd, v => v.menuCheckUpdateGeo).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.CheckUpdateGeoCmd, v => v.menuCheckUpdateGeo).DisposeWith(disposables);
|
||||||
|
|
||||||
this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables);
|
||||||
@@ -147,9 +149,11 @@ namespace v2rayN.Views
|
|||||||
this.OneWayBind(ViewModel, vm => vm.RoutingItems, v => v.cmbRoutings.ItemsSource).DisposeWith(disposables);
|
this.OneWayBind(ViewModel, vm => vm.RoutingItems, v => v.cmbRoutings.ItemsSource).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedRouting, v => v.cmbRoutings.SelectedItem).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedRouting, v => v.cmbRoutings.SelectedItem).DisposeWith(disposables);
|
||||||
this.OneWayBind(ViewModel, vm => vm.BlRouting, v => v.menuRoutings.Visibility).DisposeWith(disposables);
|
this.OneWayBind(ViewModel, vm => vm.BlRouting, v => v.menuRoutings.Visibility).DisposeWith(disposables);
|
||||||
|
this.OneWayBind(ViewModel, vm => vm.BlRouting, v => v.sepRoutings.Visibility).DisposeWith(disposables);
|
||||||
|
|
||||||
this.OneWayBind(ViewModel, vm => vm.Servers, v => v.cmbServers.ItemsSource).DisposeWith(disposables);
|
this.OneWayBind(ViewModel, vm => vm.Servers, v => v.cmbServers.ItemsSource).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedServer, v => v.cmbServers.SelectedItem).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedServer, v => v.cmbServers.SelectedItem).DisposeWith(disposables);
|
||||||
|
this.OneWayBind(ViewModel, vm => vm.BlServers, v => v.cmbServers.Visibility).DisposeWith(disposables);
|
||||||
|
|
||||||
//tray menu
|
//tray menu
|
||||||
this.BindCommand(ViewModel, vm => vm.AddServerViaClipboardCmd, v => v.menuAddServerViaClipboard2).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.AddServerViaClipboardCmd, v => v.menuAddServerViaClipboard2).DisposeWith(disposables);
|
||||||
@@ -161,6 +165,7 @@ namespace v2rayN.Views
|
|||||||
this.OneWayBind(ViewModel, vm => vm.RunningServerToolTipText, v => v.tbNotify.ToolTipText).DisposeWith(disposables);
|
this.OneWayBind(ViewModel, vm => vm.RunningServerToolTipText, v => v.tbNotify.ToolTipText).DisposeWith(disposables);
|
||||||
this.OneWayBind(ViewModel, vm => vm.NotifyLeftClickCmd, v => v.tbNotify.LeftClickCommand).DisposeWith(disposables);
|
this.OneWayBind(ViewModel, vm => vm.NotifyLeftClickCmd, v => v.tbNotify.LeftClickCommand).DisposeWith(disposables);
|
||||||
this.OneWayBind(ViewModel, vm => vm.AppIcon, v => v.Icon).DisposeWith(disposables);
|
this.OneWayBind(ViewModel, vm => vm.AppIcon, v => v.Icon).DisposeWith(disposables);
|
||||||
|
this.OneWayBind(ViewModel, vm => vm.BlShowTrayTip, v => v.borTrayToolTip.Visibility).DisposeWith(disposables);
|
||||||
|
|
||||||
//status bar
|
//status bar
|
||||||
this.OneWayBind(ViewModel, vm => vm.InboundDisplay, v => v.txtInboundDisplay.Text).DisposeWith(disposables);
|
this.OneWayBind(ViewModel, vm => vm.InboundDisplay, v => v.txtInboundDisplay.Text).DisposeWith(disposables);
|
||||||
@@ -192,27 +197,29 @@ namespace v2rayN.Views
|
|||||||
|
|
||||||
spEnableTun.Visibility = IsAdministrator ? Visibility.Visible : Visibility.Collapsed;
|
spEnableTun.Visibility = IsAdministrator ? Visibility.Visible : Visibility.Collapsed;
|
||||||
|
|
||||||
if (_config.uiItem.autoHideStartup)
|
//if (_config.uiItem.autoHideStartup)
|
||||||
|
//{
|
||||||
|
// WindowState = WindowState.Minimized;
|
||||||
|
//}
|
||||||
|
|
||||||
|
if (!_config.guiItem.enableHWA)
|
||||||
{
|
{
|
||||||
WindowState = WindowState.Minimized;
|
RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Event
|
#region Event
|
||||||
|
|
||||||
private void UpdateViewHandler(string action)
|
private void UpdateViewHandler(EViewAction action)
|
||||||
{
|
{
|
||||||
if (action == "AdjustMainLvColWidth")
|
if (action == EViewAction.AdjustMainLvColWidth)
|
||||||
{
|
{
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
foreach (var it in lstProfiles.Columns)
|
AutofitColumnWidth();
|
||||||
{
|
|
||||||
it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (action == "ProfilesFocus")
|
else if (action == EViewAction.ProfilesFocus)
|
||||||
{
|
{
|
||||||
lstProfiles.Focus();
|
lstProfiles.Focus();
|
||||||
}
|
}
|
||||||
@@ -242,6 +249,7 @@ namespace v2rayN.Views
|
|||||||
{
|
{
|
||||||
ViewModel.SelectedProfiles = lstProfiles.SelectedItems.Cast<ProfileItemModel>().ToList();
|
ViewModel.SelectedProfiles = lstProfiles.SelectedItems.Cast<ProfileItemModel>().ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LstProfiles_LoadingRow(object? sender, DataGridRowEventArgs e)
|
private void LstProfiles_LoadingRow(object? sender, DataGridRowEventArgs e)
|
||||||
{
|
{
|
||||||
//if (e.Row.GetIndex() == 0)
|
//if (e.Row.GetIndex() == 0)
|
||||||
@@ -272,16 +280,6 @@ namespace v2rayN.Views
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (colHeader.Column.GetType().Name != typeof(MyDGTextColumn).Name)
|
|
||||||
{
|
|
||||||
foreach (var it in lstProfiles.Columns)
|
|
||||||
{
|
|
||||||
//it.MinWidth = it.ActualWidth;
|
|
||||||
it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var colName = ((MyDGTextColumn)colHeader.Column).ExName;
|
var colName = ((MyDGTextColumn)colHeader.Column).ExName;
|
||||||
ViewModel?.SortServer(colName);
|
ViewModel?.SortServer(colName);
|
||||||
}
|
}
|
||||||
@@ -383,12 +381,12 @@ namespace v2rayN.Views
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void menuClose_Click(object sender, RoutedEventArgs e)
|
private void menuClose_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
StorageUI();
|
StorageUI();
|
||||||
ViewModel?.ShowHideWindow(false);
|
ViewModel?.ShowHideWindow(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void menuPromotion_Click(object sender, RoutedEventArgs e)
|
private void menuPromotion_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Utils.ProcessStart($"{Utils.Base64Decode(Global.PromotionUrl)}?t={DateTime.Now.Ticks}");
|
Utils.ProcessStart($"{Utils.Base64Decode(Global.PromotionUrl)}?t={DateTime.Now.Ticks}");
|
||||||
@@ -398,11 +396,34 @@ namespace v2rayN.Views
|
|||||||
{
|
{
|
||||||
ViewModel?.TestServerAvailability();
|
ViewModel?.TestServerAvailability();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void menuSettingsSetUWP_Click(object sender, RoutedEventArgs e)
|
private void menuSettingsSetUWP_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Utils.ProcessStart(Utils.GetBinPath("EnableLoopback.exe"));
|
Utils.ProcessStart(Utils.GetBinPath("EnableLoopback.exe"));
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
private void BtnAutofitColumnWidth_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
AutofitColumnWidth();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AutofitColumnWidth()
|
||||||
|
{
|
||||||
|
foreach (var it in lstProfiles.Columns)
|
||||||
|
{
|
||||||
|
it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TxtServerFilter_PreviewKeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key is Key.Enter or Key.Return)
|
||||||
|
{
|
||||||
|
ViewModel?.RefreshServers();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Event
|
||||||
|
|
||||||
#region UI
|
#region UI
|
||||||
|
|
||||||
@@ -414,16 +435,10 @@ namespace v2rayN.Views
|
|||||||
Height = _config.uiItem.mainHeight;
|
Height = _config.uiItem.mainHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
IntPtr hWnd = new WindowInteropHelper(this).EnsureHandle();
|
var maxWidth = SystemParameters.WorkArea.Width;
|
||||||
Graphics g = Graphics.FromHwnd(hWnd);
|
var maxHeight = SystemParameters.WorkArea.Height;
|
||||||
if (Width > SystemInformation.WorkingArea.Width * 96 / g.DpiX)
|
if (Width > maxWidth) Width = maxWidth;
|
||||||
{
|
if (Height > maxHeight) Height = maxHeight;
|
||||||
Width = SystemInformation.WorkingArea.Width * 96 / g.DpiX;
|
|
||||||
}
|
|
||||||
if (Height > SystemInformation.WorkingArea.Height * 96 / g.DpiY)
|
|
||||||
{
|
|
||||||
Height = SystemInformation.WorkingArea.Height * 96 / g.DpiY;
|
|
||||||
}
|
|
||||||
if (_config.uiItem.mainGirdHeight1 > 0 && _config.uiItem.mainGirdHeight2 > 0)
|
if (_config.uiItem.mainGirdHeight1 > 0 && _config.uiItem.mainGirdHeight2 > 0)
|
||||||
{
|
{
|
||||||
gridMain.RowDefinitions[0].Height = new GridLength(_config.uiItem.mainGirdHeight1, GridUnitType.Star);
|
gridMain.RowDefinitions[0].Height = new GridLength(_config.uiItem.mainGirdHeight1, GridUnitType.Star);
|
||||||
@@ -438,9 +453,16 @@ namespace v2rayN.Views
|
|||||||
{
|
{
|
||||||
var item2 = (MyDGTextColumn)lstProfiles.Columns[k];
|
var item2 = (MyDGTextColumn)lstProfiles.Columns[k];
|
||||||
if (item2.ExName == item.Name)
|
if (item2.ExName == item.Name)
|
||||||
|
{
|
||||||
|
if (item.Width < 0)
|
||||||
|
{
|
||||||
|
item2.Visibility = Visibility.Hidden;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
item2.Width = item.Width;
|
item2.Width = item.Width;
|
||||||
item2.DisplayIndex = i + 1;
|
item2.DisplayIndex = i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -453,19 +475,20 @@ namespace v2rayN.Views
|
|||||||
colTotalDown.Visibility = Visibility.Hidden;
|
colTotalDown.Visibility = Visibility.Hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StorageUI()
|
private void StorageUI()
|
||||||
{
|
{
|
||||||
_config.uiItem.mainWidth = this.Width;
|
_config.uiItem.mainWidth = this.Width;
|
||||||
_config.uiItem.mainHeight = this.Height;
|
_config.uiItem.mainHeight = this.Height;
|
||||||
|
|
||||||
List<ColumnItem> lvColumnItem = new();
|
List<ColumnItem> lvColumnItem = new();
|
||||||
for (int k = 1; k < lstProfiles.Columns.Count; k++)
|
for (int k = 0; k < lstProfiles.Columns.Count; k++)
|
||||||
{
|
{
|
||||||
var item2 = (MyDGTextColumn)lstProfiles.Columns[k];
|
var item2 = (MyDGTextColumn)lstProfiles.Columns[k];
|
||||||
lvColumnItem.Add(new()
|
lvColumnItem.Add(new()
|
||||||
{
|
{
|
||||||
Name = item2.ExName,
|
Name = item2.ExName,
|
||||||
Width = Convert.ToInt32(item2.ActualWidth),
|
Width = item2.Visibility == Visibility.Visible ? Convert.ToInt32(item2.ActualWidth) : 0,
|
||||||
Index = item2.DisplayIndex
|
Index = item2.DisplayIndex
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -489,6 +512,7 @@ namespace v2rayN.Views
|
|||||||
menuHelp.Items.Add(item);
|
menuHelp.Items.Add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MenuItem_Click(object sender, RoutedEventArgs e)
|
private void MenuItem_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is MenuItem item)
|
if (sender is MenuItem item)
|
||||||
@@ -497,8 +521,8 @@ namespace v2rayN.Views
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion UI
|
||||||
|
|
||||||
#endregion
|
|
||||||
#region Drag and Drop
|
#region Drag and Drop
|
||||||
|
|
||||||
private Point startPoint = new();
|
private Point startPoint = new();
|
||||||
@@ -525,12 +549,12 @@ namespace v2rayN.Views
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void LstProfiles_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
private void LstProfiles_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
// Get current mouse position
|
// Get current mouse position
|
||||||
startPoint = e.GetPosition(null);
|
startPoint = e.GetPosition(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LstProfiles_MouseMove(object sender, MouseEventArgs e)
|
private void LstProfiles_MouseMove(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
// Get the current mouse position
|
// Get the current mouse position
|
||||||
@@ -589,8 +613,6 @@ namespace v2rayN.Views
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Drag and Drop
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,6 +48,7 @@
|
|||||||
FontSize="{DynamicResource StdFontSizeMsg}"
|
FontSize="{DynamicResource StdFontSizeMsg}"
|
||||||
HorizontalScrollBarVisibility="Auto"
|
HorizontalScrollBarVisibility="Auto"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
|
IsReadOnlyCaretVisible="True"
|
||||||
TextAlignment="Left"
|
TextAlignment="Left"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
VerticalScrollBarVisibility="Visible">
|
VerticalScrollBarVisibility="Visible">
|
||||||
@@ -73,11 +74,8 @@
|
|||||||
Height="{StaticResource MenuItemHeight}"
|
Height="{StaticResource MenuItemHeight}"
|
||||||
Click="menuMsgViewClear_Click"
|
Click="menuMsgViewClear_Click"
|
||||||
Header="{x:Static resx:ResUI.menuMsgViewClear}" />
|
Header="{x:Static resx:ResUI.menuMsgViewClear}" />
|
||||||
|
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</TextBox.ContextMenu>
|
</TextBox.ContextMenu>
|
||||||
</TextBox>
|
</TextBox>
|
||||||
|
|
||||||
|
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -30,7 +30,7 @@ namespace v2rayN.Views
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DelegateAppendText(string msg)
|
private void DelegateAppendText(string msg)
|
||||||
{
|
{
|
||||||
Dispatcher.BeginInvoke(AppendText, DispatcherPriority.Send, msg);
|
Dispatcher.BeginInvoke(AppendText, DispatcherPriority.Send, msg);
|
||||||
}
|
}
|
||||||
@@ -109,10 +109,10 @@ namespace v2rayN.Views
|
|||||||
{
|
{
|
||||||
ClearMsg();
|
ClearMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cmbMsgFilter_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
|
private void cmbMsgFilter_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
|
||||||
{
|
{
|
||||||
_config.uiItem.mainMsgFilter = cmbMsgFilter.Text.TrimEx();
|
_config.uiItem.mainMsgFilter = cmbMsgFilter.Text.TrimEx();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
TextOptions.TextRenderingMode="Auto"
|
TextOptions.TextRenderingMode="Auto"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<DockPanel Margin="16">
|
<DockPanel Margin="8">
|
||||||
<Grid HorizontalAlignment="Center" DockPanel.Dock="Bottom">
|
<Grid HorizontalAlignment="Center" DockPanel.Dock="Bottom">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="200" />
|
<ColumnDefinition Width="200" />
|
||||||
@@ -216,7 +216,7 @@
|
|||||||
Margin="{StaticResource SettingItemMargin}"
|
Margin="{StaticResource SettingItemMargin}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
Text="{x:Static resx:ResUI.TbSettingsLogEnabled}" />
|
Text="{x:Static resx:ResUI.TbSettingsLogEnabledToFile}" />
|
||||||
<ToggleButton
|
<ToggleButton
|
||||||
x:Name="toglogEnabled"
|
x:Name="toglogEnabled"
|
||||||
Grid.Row="9"
|
Grid.Row="9"
|
||||||
@@ -335,7 +335,6 @@
|
|||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
VerticalScrollBarVisibility="Auto" />
|
VerticalScrollBarVisibility="Auto" />
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
<!--<TabItem Header="{x:Static resx:ResUI.TbSettingsCoreKcp}">
|
<!--<TabItem Header="{x:Static resx:ResUI.TbSettingsCoreKcp}">
|
||||||
@@ -455,7 +454,6 @@
|
|||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="{StaticResource SettingItemMargin}"
|
Margin="{StaticResource SettingItemMargin}"
|
||||||
HorizontalAlignment="Left" />
|
HorizontalAlignment="Left" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>-->
|
</TabItem>-->
|
||||||
|
|
||||||
@@ -481,6 +479,8 @@
|
|||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
@@ -667,22 +667,6 @@
|
|||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Style="{StaticResource DefTextBox}" />
|
Style="{StaticResource DefTextBox}" />
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="13"
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="{StaticResource SettingItemMargin}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
|
||||||
Text="{x:Static resx:ResUI.TbSettingsAutoUpdate}" />
|
|
||||||
<TextBox
|
|
||||||
x:Name="txtautoUpdateSubInterval"
|
|
||||||
Grid.Row="13"
|
|
||||||
Grid.Column="1"
|
|
||||||
Width="200"
|
|
||||||
Margin="{StaticResource SettingItemMargin}"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Style="{StaticResource DefTextBox}" />
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="14"
|
Grid.Row="14"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
@@ -752,6 +736,37 @@
|
|||||||
Width="300"
|
Width="300"
|
||||||
Margin="{StaticResource SettingItemMargin}"
|
Margin="{StaticResource SettingItemMargin}"
|
||||||
Style="{StaticResource DefComboBox}" />
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="18"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="{StaticResource SettingItemMargin}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TbSettingsEnableHWA}" />
|
||||||
|
<ToggleButton
|
||||||
|
x:Name="togEnableHWA"
|
||||||
|
Grid.Row="18"
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="{StaticResource SettingItemMargin}"
|
||||||
|
HorizontalAlignment="Left" />
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="19"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="{StaticResource SettingItemMargin}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TbSettingsSubConvert}" />
|
||||||
|
<ComboBox
|
||||||
|
x:Name="cmbSubConvertUrl"
|
||||||
|
Grid.Row="19"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="300"
|
||||||
|
Margin="{StaticResource SettingItemMargin}"
|
||||||
|
materialDesign:HintAssist.Hint="Convert Url"
|
||||||
|
IsEditable="True"
|
||||||
|
Style="{StaticResource DefComboBox}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -772,7 +787,6 @@
|
|||||||
Margin="{StaticResource SettingItemMargin}"
|
Margin="{StaticResource SettingItemMargin}"
|
||||||
materialDesign:HintAssist.Hint="Protocol"
|
materialDesign:HintAssist.Hint="Protocol"
|
||||||
Style="{StaticResource DefComboBox}" />
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
@@ -940,7 +954,6 @@
|
|||||||
Text="{x:Static resx:ResUI.TbSettingsTunModeBypassModeTip}" />
|
Text="{x:Static resx:ResUI.TbSettingsTunModeBypassModeTip}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
<Grid
|
<Grid
|
||||||
x:Name="gridTunModeDirect"
|
x:Name="gridTunModeDirect"
|
||||||
Width="800"
|
Width="800"
|
||||||
@@ -1038,7 +1051,6 @@
|
|||||||
VerticalScrollBarVisibility="Auto" />
|
VerticalScrollBarVisibility="Auto" />
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using ReactiveUI;
|
using Microsoft.Win32;
|
||||||
|
using ReactiveUI;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reactive.Disposables;
|
using System.Reactive.Disposables;
|
||||||
@@ -72,6 +73,10 @@ namespace v2rayN.Views
|
|||||||
{
|
{
|
||||||
cmbSpeedTestUrl.Items.Add(it);
|
cmbSpeedTestUrl.Items.Add(it);
|
||||||
});
|
});
|
||||||
|
Global.SubConvertUrls.ForEach(it =>
|
||||||
|
{
|
||||||
|
cmbSubConvertUrl.Items.Add(it);
|
||||||
|
});
|
||||||
|
|
||||||
//fill fonts
|
//fill fonts
|
||||||
try
|
try
|
||||||
@@ -133,11 +138,9 @@ namespace v2rayN.Views
|
|||||||
this.Bind(ViewModel, vm => vm.defFingerprint, v => v.cmbdefFingerprint.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.defFingerprint, v => v.cmbdefFingerprint.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.defUserAgent, v => v.cmbdefUserAgent.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.defUserAgent, v => v.cmbdefUserAgent.Text).DisposeWith(disposables);
|
||||||
|
|
||||||
|
|
||||||
this.Bind(ViewModel, vm => vm.domainStrategy4Freedom, v => v.cmbdomainStrategy4Freedom.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.domainStrategy4Freedom, v => v.cmbdomainStrategy4Freedom.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.remoteDNS, v => v.txtremoteDNS.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.remoteDNS, v => v.txtremoteDNS.Text).DisposeWith(disposables);
|
||||||
|
|
||||||
|
|
||||||
//this.Bind(ViewModel, vm => vm.Kcpmtu, v => v.txtKcpmtu.Text).DisposeWith(disposables);
|
//this.Bind(ViewModel, vm => vm.Kcpmtu, v => v.txtKcpmtu.Text).DisposeWith(disposables);
|
||||||
//this.Bind(ViewModel, vm => vm.Kcptti, v => v.txtKcptti.Text).DisposeWith(disposables);
|
//this.Bind(ViewModel, vm => vm.Kcptti, v => v.txtKcptti.Text).DisposeWith(disposables);
|
||||||
//this.Bind(ViewModel, vm => vm.KcpuplinkCapacity, v => v.txtKcpuplinkCapacity.Text).DisposeWith(disposables);
|
//this.Bind(ViewModel, vm => vm.KcpuplinkCapacity, v => v.txtKcpuplinkCapacity.Text).DisposeWith(disposables);
|
||||||
@@ -146,7 +149,6 @@ namespace v2rayN.Views
|
|||||||
//this.Bind(ViewModel, vm => vm.KcpwriteBufferSize, v => v.txtKcpwriteBufferSize.Text).DisposeWith(disposables);
|
//this.Bind(ViewModel, vm => vm.KcpwriteBufferSize, v => v.txtKcpwriteBufferSize.Text).DisposeWith(disposables);
|
||||||
//this.Bind(ViewModel, vm => vm.Kcpcongestion, v => v.togKcpcongestion.IsChecked).DisposeWith(disposables);
|
//this.Bind(ViewModel, vm => vm.Kcpcongestion, v => v.togKcpcongestion.IsChecked).DisposeWith(disposables);
|
||||||
|
|
||||||
|
|
||||||
this.Bind(ViewModel, vm => vm.AutoRun, v => v.togAutoRun.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.AutoRun, v => v.togAutoRun.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.EnableStatistics, v => v.togEnableStatistics.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.EnableStatistics, v => v.togEnableStatistics.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.StatisticsFreshRate, v => v.cmbStatisticsFreshRate.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.StatisticsFreshRate, v => v.cmbStatisticsFreshRate.Text).DisposeWith(disposables);
|
||||||
@@ -159,17 +161,16 @@ namespace v2rayN.Views
|
|||||||
this.Bind(ViewModel, vm => vm.EnableDragDropSort, v => v.togEnableDragDropSort.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.EnableDragDropSort, v => v.togEnableDragDropSort.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.DoubleClick2Activate, v => v.togDoubleClick2Activate.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.DoubleClick2Activate, v => v.togDoubleClick2Activate.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.autoUpdateInterval, v => v.txtautoUpdateInterval.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.autoUpdateInterval, v => v.txtautoUpdateInterval.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.autoUpdateSubInterval, v => v.txtautoUpdateSubInterval.Text).DisposeWith(disposables);
|
|
||||||
this.Bind(ViewModel, vm => vm.trayMenuServersLimit, v => v.txttrayMenuServersLimit.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.trayMenuServersLimit, v => v.txttrayMenuServersLimit.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.currentFontFamily, v => v.cmbcurrentFontFamily.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.currentFontFamily, v => v.cmbcurrentFontFamily.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SpeedTestTimeout, v => v.cmbSpeedTestTimeout.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SpeedTestTimeout, v => v.cmbSpeedTestTimeout.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SpeedTestUrl, v => v.cmbSpeedTestUrl.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SpeedTestUrl, v => v.cmbSpeedTestUrl.Text).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.EnableHWA, v => v.togEnableHWA.IsChecked).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.SubConvertUrl, v => v.cmbSubConvertUrl.Text).DisposeWith(disposables);
|
||||||
|
|
||||||
this.Bind(ViewModel, vm => vm.systemProxyAdvancedProtocol, v => v.cmbsystemProxyAdvancedProtocol.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.systemProxyAdvancedProtocol, v => v.cmbsystemProxyAdvancedProtocol.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.systemProxyExceptions, v => v.txtsystemProxyExceptions.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.systemProxyExceptions, v => v.txtsystemProxyExceptions.Text).DisposeWith(disposables);
|
||||||
|
|
||||||
|
|
||||||
this.Bind(ViewModel, vm => vm.TunShowWindow, v => v.togShowWindow.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.TunShowWindow, v => v.togShowWindow.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.TunEnabledLog, v => v.togEnabledLog.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.TunEnabledLog, v => v.togEnabledLog.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.TunStrictRoute, v => v.togStrictRoute.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.TunStrictRoute, v => v.togStrictRoute.IsChecked).DisposeWith(disposables);
|
||||||
@@ -186,7 +187,6 @@ namespace v2rayN.Views
|
|||||||
this.Bind(ViewModel, vm => vm.TunProxyProcess, v => v.txtProxyProcess.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.TunProxyProcess, v => v.txtProxyProcess.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.TunProxyDNS, v => v.txtProxyDNS.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.TunProxyDNS, v => v.txtProxyDNS.Text).DisposeWith(disposables);
|
||||||
|
|
||||||
|
|
||||||
this.Bind(ViewModel, vm => vm.CoreType1, v => v.cmbCoreType1.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.CoreType1, v => v.cmbCoreType1.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.CoreType2, v => v.cmbCoreType2.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.CoreType2, v => v.cmbCoreType2.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.CoreType3, v => v.cmbCoreType3.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.CoreType3, v => v.cmbCoreType3.Text).DisposeWith(disposables);
|
||||||
@@ -195,9 +195,9 @@ namespace v2rayN.Views
|
|||||||
this.Bind(ViewModel, vm => vm.CoreType6, v => v.cmbCoreType6.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.CoreType6, v => v.cmbCoreType6.Text).DisposeWith(disposables);
|
||||||
|
|
||||||
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void linkDnsObjectDoc_Click(object sender, RoutedEventArgs e)
|
private void linkDnsObjectDoc_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Utils.ProcessStart("https://www.v2fly.org/config/dns.html#dnsobject");
|
Utils.ProcessStart("https://www.v2fly.org/config/dns.html#dnsobject");
|
||||||
@@ -207,9 +207,10 @@ namespace v2rayN.Views
|
|||||||
{
|
{
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnBrowse_Click(object sender, System.Windows.RoutedEventArgs e)
|
private void btnBrowse_Click(object sender, System.Windows.RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
|
var openFileDialog1 = new OpenFileDialog();
|
||||||
openFileDialog1.Filter = "tunConfig|*.json|All|*.*";
|
openFileDialog1.Filter = "tunConfig|*.json|All|*.*";
|
||||||
openFileDialog1.ShowDialog();
|
openFileDialog1.ShowDialog();
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,5 @@
|
|||||||
IsCancel="True"
|
IsCancel="True"
|
||||||
IsDefault="True"
|
IsDefault="True"
|
||||||
Style="{StaticResource MaterialDesignFlatButton}" />
|
Style="{StaticResource MaterialDesignFlatButton}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -134,7 +134,7 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid
|
<Grid
|
||||||
Margin="16"
|
Margin="8"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
DockPanel.Dock="Bottom">
|
DockPanel.Dock="Bottom">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ namespace v2rayN.Views
|
|||||||
this.Bind(ViewModel, vm => vm.AutoSort, v => v.chkAutoSort.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.AutoSort, v => v.chkAutoSort.IsChecked).DisposeWith(disposables);
|
||||||
|
|
||||||
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,10 +59,12 @@ namespace v2rayN.Views
|
|||||||
{
|
{
|
||||||
cmbOutboundTag.Focus();
|
cmbOutboundTag.Focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ClbProtocol_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
private void ClbProtocol_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
ViewModel.ProtocolItems = clbProtocol.SelectedItems.Cast<string>().ToList();
|
ViewModel.ProtocolItems = clbProtocol.SelectedItems.Cast<string>().ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ClbInboundTag_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
private void ClbInboundTag_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
ViewModel.InboundTagItems = clbInboundTag.SelectedItems.Cast<string>().ToList();
|
ViewModel.InboundTagItems = clbInboundTag.SelectedItems.Cast<string>().ToList();
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
</ToolBarTray>
|
</ToolBarTray>
|
||||||
|
|
||||||
<Grid
|
<Grid
|
||||||
Margin="16"
|
Margin="8"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
DockPanel.Dock="Bottom">
|
DockPanel.Dock="Bottom">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@@ -207,7 +207,6 @@
|
|||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
AcceptsReturn="True"
|
AcceptsReturn="True"
|
||||||
Style="{StaticResource DefTextBox}" />
|
Style="{StaticResource DefTextBox}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<TabControl x:Name="tabAdvanced">
|
<TabControl x:Name="tabAdvanced">
|
||||||
@@ -291,11 +290,9 @@
|
|||||||
Width="80"
|
Width="80"
|
||||||
Binding="{Binding enabled}"
|
Binding="{Binding enabled}"
|
||||||
Header="enabled" />
|
Header="enabled" />
|
||||||
|
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|
||||||
</reactiveui:ReactiveWindow>
|
</reactiveui:ReactiveWindow>
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using ReactiveUI;
|
using Microsoft.Win32;
|
||||||
|
using ReactiveUI;
|
||||||
using System.Reactive.Disposables;
|
using System.Reactive.Disposables;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
@@ -50,9 +51,9 @@ namespace v2rayN.Views
|
|||||||
this.BindCommand(ViewModel, vm => vm.MoveBottomCmd, v => v.menuMoveBottom).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.MoveBottomCmd, v => v.menuMoveBottom).DisposeWith(disposables);
|
||||||
|
|
||||||
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
txtRemarks.Focus();
|
txtRemarks.Focus();
|
||||||
@@ -101,6 +102,7 @@ namespace v2rayN.Views
|
|||||||
{
|
{
|
||||||
ViewModel?.RuleEdit(false);
|
ViewModel?.RuleEdit(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void menuRuleSelectAll_Click(object sender, System.Windows.RoutedEventArgs e)
|
private void menuRuleSelectAll_Click(object sender, System.Windows.RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
lstRules.SelectAll();
|
lstRules.SelectAll();
|
||||||
@@ -108,7 +110,7 @@ namespace v2rayN.Views
|
|||||||
|
|
||||||
private void btnBrowse_Click(object sender, System.Windows.RoutedEventArgs e)
|
private void btnBrowse_Click(object sender, System.Windows.RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
|
var openFileDialog1 = new OpenFileDialog();
|
||||||
openFileDialog1.Filter = "PNG|*.png";
|
openFileDialog1.Filter = "PNG|*.png";
|
||||||
openFileDialog1.ShowDialog();
|
openFileDialog1.ShowDialog();
|
||||||
|
|
||||||
|
|||||||
@@ -109,12 +109,11 @@
|
|||||||
Width="80"
|
Width="80"
|
||||||
Margin="8,0,0,0"
|
Margin="8,0,0,0"
|
||||||
Style="{StaticResource DefComboBox}" />
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
</ToolBarTray>
|
</ToolBarTray>
|
||||||
|
|
||||||
<Grid
|
<Grid
|
||||||
Margin="16"
|
Margin="8"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
DockPanel.Dock="Bottom">
|
DockPanel.Dock="Bottom">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@@ -187,22 +186,22 @@
|
|||||||
Header="{x:Static resx:ResUI.menuRoutingAdvancedImportRules}" />
|
Header="{x:Static resx:ResUI.menuRoutingAdvancedImportRules}" />
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</DataGrid.ContextMenu>
|
</DataGrid.ContextMenu>
|
||||||
|
<DataGrid.Resources>
|
||||||
|
<Style BasedOn="{StaticResource MaterialDesignDataGridCell}" TargetType="DataGridCell">
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding isActive}" Value="True">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource PrimaryHueLightBrush}" />
|
||||||
|
<Setter Property="Foreground" Value="Black" />
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueLightBrush}" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</DataGrid.Resources>
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTemplateColumn Width="50">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Border
|
|
||||||
Width="auto"
|
|
||||||
Height="auto"
|
|
||||||
Background="{DynamicResource PrimaryHueLightBrush}"
|
|
||||||
Visibility="{Binding Path=isActive, Converter={StaticResource BoolToVisConverter}}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="200"
|
Width="200"
|
||||||
Binding="{Binding remarks}"
|
Binding="{Binding remarks}"
|
||||||
Header="{x:Static resx:ResUI.LvAlias}" />
|
Header="{x:Static resx:ResUI.LvRemarks}" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="60"
|
Width="60"
|
||||||
Binding="{Binding ruleNum}"
|
Binding="{Binding ruleNum}"
|
||||||
@@ -326,5 +325,4 @@
|
|||||||
</TabControl>
|
</TabControl>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|
||||||
</reactiveui:ReactiveWindow>
|
</reactiveui:ReactiveWindow>
|
||||||
@@ -29,7 +29,6 @@ namespace v2rayN.Views
|
|||||||
cmbdomainMatcher.Items.Add(it);
|
cmbdomainMatcher.Items.Add(it);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
this.WhenActivated(disposables =>
|
this.WhenActivated(disposables =>
|
||||||
{
|
{
|
||||||
this.OneWayBind(ViewModel, vm => vm.RoutingItems, v => v.lstRoutings.ItemsSource).DisposeWith(disposables);
|
this.OneWayBind(ViewModel, vm => vm.RoutingItems, v => v.lstRoutings.ItemsSource).DisposeWith(disposables);
|
||||||
@@ -60,7 +59,6 @@ namespace v2rayN.Views
|
|||||||
this.BindCommand(ViewModel, vm => vm.RoutingAdvancedImportRulesCmd, v => v.menuRoutingAdvancedImportRules2).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.RoutingAdvancedImportRulesCmd, v => v.menuRoutingAdvancedImportRules2).DisposeWith(disposables);
|
||||||
|
|
||||||
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,10 +85,12 @@ namespace v2rayN.Views
|
|||||||
{
|
{
|
||||||
lstRoutings.SelectAll();
|
lstRoutings.SelectAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void lstRoutings_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
private void lstRoutings_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
ViewModel.SelectedSources = lstRoutings.SelectedItems.Cast<RoutingItemModel>().ToList();
|
ViewModel.SelectedSources = lstRoutings.SelectedItems.Cast<RoutingItemModel>().ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LstRoutings_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
private void LstRoutings_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
ViewModel?.RoutingAdvancedEdit(false);
|
ViewModel?.RoutingAdvancedEdit(false);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
xmlns:vms="clr-namespace:v2rayN.ViewModels"
|
xmlns:vms="clr-namespace:v2rayN.ViewModels"
|
||||||
Title="{x:Static resx:ResUI.menuSubSetting}"
|
Title="{x:Static resx:ResUI.menuSubSetting}"
|
||||||
Width="700"
|
Width="700"
|
||||||
Height="550"
|
Height="600"
|
||||||
x:TypeArguments="vms:SubEditViewModel"
|
x:TypeArguments="vms:SubEditViewModel"
|
||||||
Background="{DynamicResource MaterialDesignPaper}"
|
Background="{DynamicResource MaterialDesignPaper}"
|
||||||
FontFamily="{x:Static conv:MaterialDesignFonts.MyFont}"
|
FontFamily="{x:Static conv:MaterialDesignFonts.MyFont}"
|
||||||
@@ -23,6 +23,14 @@
|
|||||||
TextOptions.TextRenderingMode="Auto"
|
TextOptions.TextRenderingMode="Auto"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
<Window.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Popupbox.xaml" />
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</Window.Resources>
|
||||||
|
|
||||||
<ScrollViewer
|
<ScrollViewer
|
||||||
materialDesign:ScrollViewerAssist.IsAutoHideEnabled="True"
|
materialDesign:ScrollViewerAssist.IsAutoHideEnabled="True"
|
||||||
HorizontalScrollBarVisibility="Auto"
|
HorizontalScrollBarVisibility="Auto"
|
||||||
@@ -41,10 +49,13 @@
|
|||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
@@ -92,6 +103,31 @@
|
|||||||
Style="{StaticResource MyOutlinedTextBox}"
|
Style="{StaticResource MyOutlinedTextBox}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
|
<materialDesign:PopupBox
|
||||||
|
Grid.Row="2"
|
||||||
|
Grid.Column="2"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
StaysOpen="True"
|
||||||
|
Style="{StaticResource MaterialDesignToolForegroundPopupBox}">
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock
|
||||||
|
Margin="4"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.LvMoreUrl}" />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtMoreUrl"
|
||||||
|
Width="400"
|
||||||
|
Margin="4"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.SubUrlTips}"
|
||||||
|
AcceptsReturn="True"
|
||||||
|
MinLines="4"
|
||||||
|
Style="{StaticResource MyOutlinedTextBox}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</StackPanel>
|
||||||
|
</materialDesign:PopupBox>
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="3"
|
Grid.Row="3"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
@@ -111,10 +147,28 @@
|
|||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.LvAutoUpdateInterval}" />
|
||||||
|
<TextBox
|
||||||
|
x:Name="txtAutoUpdateInterval"
|
||||||
|
Grid.Row="4"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="400"
|
||||||
|
Margin="4"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.SubUrlTips}"
|
||||||
|
AcceptsReturn="True"
|
||||||
|
Style="{StaticResource MyOutlinedTextBox}" />
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="5"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="4"
|
||||||
|
VerticalAlignment="Center"
|
||||||
Text="{x:Static resx:ResUI.LvUserAgent}" />
|
Text="{x:Static resx:ResUI.LvUserAgent}" />
|
||||||
<TextBox
|
<TextBox
|
||||||
x:Name="txtUserAgent"
|
x:Name="txtUserAgent"
|
||||||
Grid.Row="4"
|
Grid.Row="5"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="400"
|
Width="400"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
@@ -125,7 +179,7 @@
|
|||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="5"
|
Grid.Row="6"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
@@ -133,7 +187,7 @@
|
|||||||
Text="{x:Static resx:ResUI.LvFilter}" />
|
Text="{x:Static resx:ResUI.LvFilter}" />
|
||||||
<TextBox
|
<TextBox
|
||||||
x:Name="txtFilter"
|
x:Name="txtFilter"
|
||||||
Grid.Row="5"
|
Grid.Row="6"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="400"
|
Width="400"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
@@ -142,8 +196,27 @@
|
|||||||
AcceptsReturn="True"
|
AcceptsReturn="True"
|
||||||
Style="{StaticResource MyOutlinedTextBox}" />
|
Style="{StaticResource MyOutlinedTextBox}" />
|
||||||
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="6"
|
Grid.Row="7"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="4"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.LvConvertTarget}" />
|
||||||
|
<ComboBox
|
||||||
|
x:Name="cmbConvertTarget"
|
||||||
|
Grid.Row="7"
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="4"
|
||||||
|
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.LvConvertTargetTip}"
|
||||||
|
FontSize="{DynamicResource StdFontSize}"
|
||||||
|
MaxDropDownHeight="1000"
|
||||||
|
Style="{StaticResource MaterialDesignOutlinedComboBox}" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="8"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
@@ -151,18 +224,17 @@
|
|||||||
Text="{x:Static resx:ResUI.LvSort}" />
|
Text="{x:Static resx:ResUI.LvSort}" />
|
||||||
<TextBox
|
<TextBox
|
||||||
x:Name="txtSort"
|
x:Name="txtSort"
|
||||||
Grid.Row="6"
|
Grid.Row="8"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="400"
|
Width="400"
|
||||||
Margin="4"
|
Margin="4"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
AcceptsReturn="True"
|
AcceptsReturn="True"
|
||||||
Style="{StaticResource MyOutlinedTextBox}" />
|
Style="{StaticResource MyOutlinedTextBox}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid
|
<Grid
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="16"
|
Margin="8"
|
||||||
HorizontalAlignment="Center">
|
HorizontalAlignment="Center">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="200" />
|
<ColumnDefinition Width="200" />
|
||||||
|
|||||||
@@ -16,19 +16,27 @@ namespace v2rayN.Views
|
|||||||
|
|
||||||
ViewModel = new SubEditViewModel(subItem, this);
|
ViewModel = new SubEditViewModel(subItem, this);
|
||||||
|
|
||||||
|
Global.SubConvertTargets.ForEach(it =>
|
||||||
|
{
|
||||||
|
cmbConvertTarget.Items.Add(it);
|
||||||
|
});
|
||||||
|
|
||||||
this.WhenActivated(disposables =>
|
this.WhenActivated(disposables =>
|
||||||
{
|
{
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.remarks, v => v.txtRemarks.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.remarks, v => v.txtRemarks.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.url, v => v.txtUrl.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.url, v => v.txtUrl.Text).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.SelectedSource.moreUrl, v => v.txtMoreUrl.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.enabled, v => v.togEnable.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.enabled, v => v.togEnable.IsChecked).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.SelectedSource.autoUpdateInterval, v => v.txtAutoUpdateInterval.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.userAgent, v => v.txtUserAgent.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.userAgent, v => v.txtUserAgent.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.sort, v => v.txtSort.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.sort, v => v.txtSort.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.filter, v => v.txtFilter.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.filter, v => v.txtFilter.Text).DisposeWith(disposables);
|
||||||
|
this.Bind(ViewModel, vm => vm.SelectedSource.convertTarget, v => v.cmbConvertTarget.Text).DisposeWith(disposables);
|
||||||
|
|
||||||
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
txtRemarks.Focus();
|
txtRemarks.Focus();
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user