Compare commits
76 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c2da0a225 | ||
|
|
528400579a | ||
|
|
521ce1a487 | ||
|
|
34c6c953ac | ||
|
|
40fbbc7c58 | ||
|
|
534c329970 | ||
|
|
328d728257 | ||
|
|
fae6d42758 | ||
|
|
27693f6d23 | ||
|
|
89c4bab5b9 | ||
|
|
9d2ff04838 | ||
|
|
cf00243107 | ||
|
|
e8019ba7a5 | ||
|
|
4f30e3f0e3 | ||
|
|
047d08470f | ||
|
|
9643695389 | ||
|
|
5cabec86e7 | ||
|
|
f2d0e37255 | ||
|
|
9560851a3f | ||
|
|
4aeec1caa1 | ||
|
|
ae45b1ef44 | ||
|
|
aad1b087c9 | ||
|
|
b69c581fa1 | ||
|
|
9eb4d90cd6 | ||
|
|
958567c2c5 | ||
|
|
f1fc4583ed | ||
|
|
f7bfd5f766 | ||
|
|
aadc3c216a | ||
|
|
6fd2499daf | ||
|
|
f0405f1c5d | ||
|
|
1914cb3994 | ||
|
|
ab38fb572d | ||
|
|
46d7128a6e | ||
|
|
0821884ff3 | ||
|
|
62233281ef | ||
|
|
39504502af | ||
|
|
f97530a671 | ||
|
|
0fe7d5e598 | ||
|
|
527362dc9f | ||
|
|
1023426c8d | ||
|
|
4458fd7541 | ||
|
|
f0b03f59ff | ||
|
|
d5b17b3cfb | ||
|
|
9664d1d77f | ||
|
|
d329646a52 | ||
|
|
8eafe72bb0 | ||
|
|
c38a0bde65 | ||
|
|
eef5d3cc16 | ||
|
|
59ada594a5 | ||
|
|
5ec1d18143 | ||
|
|
fd1e1bb6bf | ||
|
|
5d545d8a85 | ||
|
|
e38bc45527 | ||
|
|
1b11425acd | ||
|
|
1e67850a80 | ||
|
|
975f89456f | ||
|
|
e267b4b379 | ||
|
|
2fd21690a5 | ||
|
|
b176ad03aa | ||
|
|
152c4802d0 | ||
|
|
8adbc57f23 | ||
|
|
d263a78db8 | ||
|
|
b94a065c06 | ||
|
|
bc957fea71 | ||
|
|
566f056149 | ||
|
|
abe484b0df | ||
|
|
982c865245 | ||
|
|
07d2a27b5f | ||
|
|
e4c65deda8 | ||
|
|
4930646e05 | ||
|
|
01dd1ff56f | ||
|
|
9433213fe5 | ||
|
|
82dea829f1 | ||
|
|
dafc83aa53 | ||
|
|
7ab1cd6612 | ||
|
|
d0e3b3ffbd |
@@ -2,7 +2,6 @@
|
||||
using System.IO;
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PacLib;
|
||||
@@ -50,7 +49,7 @@ public class PacHandler
|
||||
_tcpListener = TcpListener.Create(_pacPort);
|
||||
_isRunning = true;
|
||||
_tcpListener.Start();
|
||||
Task.Factory.StartNew(() =>
|
||||
Task.Factory.StartNew(async () =>
|
||||
{
|
||||
while (_isRunning)
|
||||
{
|
||||
@@ -58,25 +57,25 @@ public class PacHandler
|
||||
{
|
||||
if (!_tcpListener.Pending())
|
||||
{
|
||||
Thread.Sleep(10);
|
||||
await Task.Delay(10);
|
||||
continue;
|
||||
}
|
||||
|
||||
var client = _tcpListener.AcceptTcpClient();
|
||||
Task.Run(() =>
|
||||
{
|
||||
var stream = client.GetStream();
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine("HTTP/1.0 200 OK");
|
||||
sb.AppendLine("Content-type:application/x-ns-proxy-autoconfig");
|
||||
sb.AppendLine("Connection:close");
|
||||
sb.AppendLine("Content-Length:" + Encoding.UTF8.GetByteCount(_pacText));
|
||||
sb.AppendLine();
|
||||
sb.Append(_pacText);
|
||||
var content = Encoding.UTF8.GetBytes(sb.ToString());
|
||||
stream.Write(content, 0, content.Length);
|
||||
stream.Flush();
|
||||
});
|
||||
await Task.Run(() =>
|
||||
{
|
||||
var stream = client.GetStream();
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine("HTTP/1.0 200 OK");
|
||||
sb.AppendLine("Content-type:application/x-ns-proxy-autoconfig");
|
||||
sb.AppendLine("Connection:close");
|
||||
sb.AppendLine("Content-Length:" + Encoding.UTF8.GetByteCount(_pacText));
|
||||
sb.AppendLine();
|
||||
sb.Append(_pacText);
|
||||
var content = Encoding.UTF8.GetBytes(sb.ToString());
|
||||
stream.Write(content, 0, content.Length);
|
||||
stream.Flush();
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -5982,7 +5982,8 @@ var rules = [
|
||||
"zyzc9.com",
|
||||
"zzcartoon.com",
|
||||
"zzcloud.me",
|
||||
"zzux.com"
|
||||
"zzux.com",
|
||||
"chat.openai.com"
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Google.Protobuf" Version="3.23.0" />
|
||||
<PackageReference Include="Grpc.Net.Client" Version="2.53.0" />
|
||||
<PackageReference Include="Google.Protobuf" Version="3.23.3" />
|
||||
<PackageReference Include="Grpc.Net.Client" Version="2.54.0" />
|
||||
<PackageReference Include="Grpc.Tools" Version="2.54.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<Application
|
||||
x:Class="v2rayN.App"
|
||||
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:conv="clr-namespace:v2rayN.Converters"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
ShutdownMode="OnExplicitShutdown"
|
||||
StartupUri="Views/MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
@@ -21,7 +21,7 @@
|
||||
<system:Double x:Key="StdFontSize2">14</system:Double>
|
||||
<system:Double x:Key="StdFontSizeMsg">11</system:Double>
|
||||
|
||||
<conv:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
|
||||
<conv:InverseBooleanConverter x:Key="InverseBooleanConverter" />
|
||||
<Thickness
|
||||
x:Key="ServerItemMargin"
|
||||
Bottom="4"
|
||||
|
||||
@@ -70,5 +70,15 @@ namespace v2rayN.Base
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
public static string UpperFirstChar(this string value)
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
return char.ToUpper(value[0]) + value.Substring(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ namespace v2rayN.Converters
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if(targetType != typeof(bool))
|
||||
if (targetType != typeof(bool))
|
||||
{
|
||||
throw new InvalidOperationException("The target must be a boolean");
|
||||
}
|
||||
@@ -21,4 +21,4 @@ namespace v2rayN.Converters
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@
|
||||
public const string geoUrl = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/{0}.dat";
|
||||
public const string singboxGeoUrl = "https://github.com/soffchen/sing-{0}/releases/latest/download/{0}.db";
|
||||
public const string SpeedPingTestUrl = @"https://www.google.com/generate_204";
|
||||
public const string juicityCoreUrl = "https://github.com/juicity/juicity/releases";
|
||||
public const string CustomRoutingListUrl = @"https://raw.githubusercontent.com/2dust/v2rayCustomRoutingList/master/";
|
||||
|
||||
public const string PromotionUrl = @"aHR0cHM6Ly85LjIzNDQ1Ni54eXovYWJjLmh0bWw=";
|
||||
@@ -149,7 +150,7 @@
|
||||
|
||||
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> Languages = new() { "zh-Hans", "en", "fa-Ir", "ru" };
|
||||
public static readonly List<string> Languages = new() { "zh-Hans", "zh-Hant", "en", "fa-Ir", "ru" };
|
||||
public static readonly List<string> alpns = new() { "h2", "http/1.1", "h2,http/1.1", "" };
|
||||
public static readonly List<string> LogLevel = new() { "debug", "info", "warning", "error", "none" };
|
||||
public static readonly List<string> InboundTags = new() { "socks", "http", "socks2", "http2" };
|
||||
@@ -170,4 +171,4 @@
|
||||
|
||||
#endregion global variable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,6 @@ namespace v2rayN.Handler
|
||||
config.guiItem = new()
|
||||
{
|
||||
enableStatistics = false,
|
||||
statisticsFreshRate = 1,
|
||||
};
|
||||
}
|
||||
if (config.uiItem == null)
|
||||
@@ -185,11 +184,6 @@ namespace v2rayN.Handler
|
||||
config.speedTestItem.speedPingTestUrl = Global.SpeedPingTestUrl;
|
||||
}
|
||||
|
||||
if (config.guiItem.statisticsFreshRate is > 100 or < 1)
|
||||
{
|
||||
config.guiItem.statisticsFreshRate = 1;
|
||||
}
|
||||
|
||||
if (config.mux4Sbox == null)
|
||||
{
|
||||
config.mux4Sbox = new()
|
||||
@@ -331,7 +325,6 @@ namespace v2rayN.Handler
|
||||
config.guiItem = new()
|
||||
{
|
||||
enableStatistics = configOld.enableStatistics,
|
||||
statisticsFreshRate = configOld.statisticsFreshRate,
|
||||
keepOlderDedupl = configOld.keepOlderDedupl,
|
||||
ignoreGeoUpdateCore = configOld.ignoreGeoUpdateCore,
|
||||
autoUpdateInterval = configOld.autoUpdateInterval,
|
||||
@@ -376,6 +369,10 @@ namespace v2rayN.Handler
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (profileItem.id.IsNullOrEmpty())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
AddServerCommon(ref config, profileItem, toFile);
|
||||
|
||||
@@ -597,7 +594,7 @@ namespace v2rayN.Handler
|
||||
profileItem.configType = EConfigType.Custom;
|
||||
if (Utils.IsNullOrEmpty(profileItem.remarks))
|
||||
{
|
||||
profileItem.remarks = $"import custom@{DateTime.Now.ToShortDateString()}";
|
||||
profileItem.remarks = $"import custom@{DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")}";
|
||||
}
|
||||
|
||||
AddServerCommon(ref config, profileItem, true);
|
||||
@@ -643,6 +640,10 @@ namespace v2rayN.Handler
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (profileItem.id.IsNullOrEmpty())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
AddServerCommon(ref config, profileItem, toFile);
|
||||
|
||||
@@ -682,6 +683,10 @@ namespace v2rayN.Handler
|
||||
{
|
||||
profileItem.streamSecurity = Global.StreamSecurity;
|
||||
}
|
||||
if (profileItem.id.IsNullOrEmpty())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
AddServerCommon(ref config, profileItem, toFile);
|
||||
|
||||
@@ -807,6 +812,10 @@ namespace v2rayN.Handler
|
||||
{
|
||||
profileItem.flow = Global.flows.First();
|
||||
}
|
||||
if (profileItem.id.IsNullOrEmpty())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
AddServerCommon(ref config, profileItem, toFile);
|
||||
|
||||
@@ -858,10 +867,18 @@ namespace v2rayN.Handler
|
||||
profileItem.network = Global.DefaultNetwork;
|
||||
}
|
||||
|
||||
var maxSort = -1;
|
||||
if (Utils.IsNullOrEmpty(profileItem.indexId))
|
||||
{
|
||||
profileItem.indexId = Utils.GetGUID(false);
|
||||
var maxSort = ProfileExHandler.Instance.GetMaxSort();
|
||||
maxSort = ProfileExHandler.Instance.GetMaxSort();
|
||||
}
|
||||
if (!toFile && maxSort < 0)
|
||||
{
|
||||
maxSort = ProfileExHandler.Instance.GetMaxSort();
|
||||
}
|
||||
if (maxSort > 0)
|
||||
{
|
||||
ProfileExHandler.Instance.SetSort(profileItem.indexId, maxSort + 1);
|
||||
}
|
||||
|
||||
@@ -1026,7 +1043,7 @@ namespace v2rayN.Handler
|
||||
addStatus = AddVlessServer(ref config, profileItem, false);
|
||||
}
|
||||
|
||||
if (addStatus == 0 && profileItem.port > 0)
|
||||
if (addStatus == 0)
|
||||
{
|
||||
countServers++;
|
||||
lstAdd.Add(profileItem);
|
||||
|
||||
@@ -107,29 +107,18 @@ namespace v2rayN.Handler
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_config.tunModeItem.enableTun)
|
||||
singboxConfig.inbounds.Clear();
|
||||
|
||||
if (!_config.tunModeItem.enableTun || (_config.tunModeItem.enableTun && _config.tunModeItem.enableExInbound))
|
||||
{
|
||||
singboxConfig.inbounds.Clear();
|
||||
|
||||
if (_config.tunModeItem.mtu <= 0)
|
||||
var inbound = new Inbound4Sbox()
|
||||
{
|
||||
_config.tunModeItem.mtu = Convert.ToInt32(Global.TunMtus[0]);
|
||||
}
|
||||
if (Utils.IsNullOrEmpty(_config.tunModeItem.stack))
|
||||
{
|
||||
_config.tunModeItem.stack = Global.TunStacks[0];
|
||||
}
|
||||
type = Global.InboundSocks,
|
||||
tag = Global.InboundSocks,
|
||||
listen = Global.Loopback,
|
||||
};
|
||||
singboxConfig.inbounds.Add(inbound);
|
||||
|
||||
var tunInbound = Utils.FromJson<Inbound4Sbox>(Utils.GetEmbedText(Global.TunSingboxInboundFileName));
|
||||
tunInbound.mtu = _config.tunModeItem.mtu;
|
||||
tunInbound.strict_route = _config.tunModeItem.strictRoute;
|
||||
tunInbound.stack = _config.tunModeItem.stack;
|
||||
|
||||
singboxConfig.inbounds.Add(tunInbound);
|
||||
}
|
||||
else
|
||||
{
|
||||
var inbound = singboxConfig.inbounds[0];
|
||||
inbound.listen_port = LazyConfig.Instance.GetLocalPort(Global.InboundSocks);
|
||||
inbound.sniff = _config.inbound[0].sniffingEnabled;
|
||||
inbound.sniff_override_destination = _config.inbound[0].routeOnly ? false : _config.inbound[0].sniffingEnabled;
|
||||
@@ -174,6 +163,25 @@ namespace v2rayN.Handler
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_config.tunModeItem.enableTun)
|
||||
{
|
||||
if (_config.tunModeItem.mtu <= 0)
|
||||
{
|
||||
_config.tunModeItem.mtu = Convert.ToInt32(Global.TunMtus[0]);
|
||||
}
|
||||
if (Utils.IsNullOrEmpty(_config.tunModeItem.stack))
|
||||
{
|
||||
_config.tunModeItem.stack = Global.TunStacks[0];
|
||||
}
|
||||
|
||||
var tunInbound = Utils.FromJson<Inbound4Sbox>(Utils.GetEmbedText(Global.TunSingboxInboundFileName));
|
||||
tunInbound.mtu = _config.tunModeItem.mtu;
|
||||
tunInbound.strict_route = _config.tunModeItem.strictRoute;
|
||||
tunInbound.stack = _config.tunModeItem.stack;
|
||||
|
||||
singboxConfig.inbounds.Add(tunInbound);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -255,7 +263,6 @@ namespace v2rayN.Handler
|
||||
outbound.type = Global.vlessProtocolLite;
|
||||
|
||||
outbound.uuid = node.id;
|
||||
outbound.flow = node.flow;
|
||||
|
||||
outbound.packet_encoding = "xudp";
|
||||
|
||||
@@ -263,6 +270,10 @@ namespace v2rayN.Handler
|
||||
{
|
||||
outboundMux(node, outbound);
|
||||
}
|
||||
else
|
||||
{
|
||||
outbound.flow = node.flow;
|
||||
}
|
||||
}
|
||||
else if (node.configType == EConfigType.Trojan)
|
||||
{
|
||||
@@ -288,19 +299,19 @@ namespace v2rayN.Handler
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_config.coreBasicItem.muxEnabled)
|
||||
{
|
||||
var mux = new Multiplex4Sbox()
|
||||
{
|
||||
enabled = true,
|
||||
protocol = _config.mux4Sbox.protocol,
|
||||
max_connections = _config.mux4Sbox.max_connections,
|
||||
min_streams = _config.mux4Sbox.min_streams,
|
||||
max_streams = _config.mux4Sbox.max_streams,
|
||||
padding = _config.mux4Sbox.padding
|
||||
};
|
||||
outbound.multiplex = mux;
|
||||
}
|
||||
//if (_config.coreBasicItem.muxEnabled)
|
||||
//{
|
||||
// var mux = new Multiplex4Sbox()
|
||||
// {
|
||||
// enabled = true,
|
||||
// protocol = _config.mux4Sbox.protocol,
|
||||
// max_connections = _config.mux4Sbox.max_connections,
|
||||
// min_streams = _config.mux4Sbox.min_streams,
|
||||
// max_streams = _config.mux4Sbox.max_streams,
|
||||
// padding = _config.mux4Sbox.padding
|
||||
// };
|
||||
// outbound.multiplex = mux;
|
||||
//}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -315,10 +326,19 @@ namespace v2rayN.Handler
|
||||
{
|
||||
if (node.streamSecurity == Global.StreamSecurityReality || node.streamSecurity == Global.StreamSecurity)
|
||||
{
|
||||
var server_name = string.Empty;
|
||||
if (!string.IsNullOrWhiteSpace(node.sni))
|
||||
{
|
||||
server_name = node.sni;
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(node.requestHost))
|
||||
{
|
||||
server_name = Utils.String2List(node.requestHost)[0];
|
||||
}
|
||||
var tls = new Tls4Sbox()
|
||||
{
|
||||
enabled = true,
|
||||
server_name = node.sni,
|
||||
server_name = server_name,
|
||||
insecure = Utils.ToBool(node.allowInsecure.IsNullOrEmpty() ? _config.coreBasicItem.defAllowInsecure.ToString().ToLower() : node.allowInsecure),
|
||||
alpn = node.GetAlpn(),
|
||||
};
|
||||
@@ -666,24 +686,21 @@ namespace v2rayN.Handler
|
||||
return 0;
|
||||
}
|
||||
//Add the dns of the remote server domain
|
||||
if (Utils.IsDomain(node.address))
|
||||
if (dns4Sbox.rules is null)
|
||||
{
|
||||
if (dns4Sbox.rules is null)
|
||||
{
|
||||
dns4Sbox.rules = new();
|
||||
}
|
||||
dns4Sbox.servers.Add(new()
|
||||
{
|
||||
tag = "local_local",
|
||||
address = "223.5.5.5",
|
||||
detour = "direct"
|
||||
});
|
||||
dns4Sbox.rules.Add(new()
|
||||
{
|
||||
server = "local_local",
|
||||
domain = new List<string>() { node.address }
|
||||
});
|
||||
dns4Sbox.rules = new();
|
||||
}
|
||||
dns4Sbox.servers.Add(new()
|
||||
{
|
||||
tag = "local_local",
|
||||
address = "223.5.5.5",
|
||||
detour = "direct"
|
||||
});
|
||||
dns4Sbox.rules.Add(new()
|
||||
{
|
||||
server = "local_local",
|
||||
outbound = "any"
|
||||
});
|
||||
|
||||
singboxConfig.dns = dns4Sbox;
|
||||
}
|
||||
|
||||
@@ -423,7 +423,6 @@ namespace v2rayN.Handler
|
||||
usersItem = vnextItem.users[0];
|
||||
}
|
||||
usersItem.id = node.id;
|
||||
usersItem.flow = string.Empty;
|
||||
usersItem.email = Global.userEMail;
|
||||
usersItem.encryption = node.security;
|
||||
|
||||
@@ -462,7 +461,6 @@ namespace v2rayN.Handler
|
||||
serversItem.address = node.address;
|
||||
serversItem.port = node.port;
|
||||
serversItem.password = node.id;
|
||||
serversItem.flow = string.Empty;
|
||||
|
||||
serversItem.ota = false;
|
||||
serversItem.level = 1;
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace v2rayN.Handler
|
||||
|
||||
private void CoreStart(ProfileItem node)
|
||||
{
|
||||
ShowMsg(false, string.Format(ResUI.StartService, DateTime.Now.ToString()));
|
||||
ShowMsg(false, string.Format(ResUI.StartService, DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")));
|
||||
|
||||
ECoreType coreType;
|
||||
if (node.configType != EConfigType.Custom && _config.tunModeItem.enableTun)
|
||||
@@ -201,7 +201,7 @@ namespace v2rayN.Handler
|
||||
|
||||
private int CoreStartViaString(string configStr)
|
||||
{
|
||||
ShowMsg(false, string.Format(ResUI.StartService, DateTime.Now.ToString()));
|
||||
ShowMsg(false, string.Format(ResUI.StartService, DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")));
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -113,9 +113,9 @@ namespace v2rayN.Handler
|
||||
|
||||
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}+");
|
||||
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])
|
||||
|
||||
@@ -353,8 +353,16 @@ namespace v2rayN.Handler
|
||||
match = "sing-box",
|
||||
versionArg = "version",
|
||||
});
|
||||
|
||||
coreInfos.Add(new CoreInfo
|
||||
{
|
||||
coreType = ECoreType.juicity,
|
||||
coreExes = new List<string> { "juicity-client", "juicity" },
|
||||
arguments = "run -c config.json",
|
||||
coreUrl = Global.juicityCoreUrl
|
||||
});
|
||||
}
|
||||
|
||||
#endregion Core Type
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,9 +160,9 @@ namespace v2rayN.Handler
|
||||
Task.Run(() => UpdateTaskRunGeo(config, update));
|
||||
}
|
||||
|
||||
private void UpdateTaskRunSubscription(Config config, Action<bool, string> update)
|
||||
private async Task UpdateTaskRunSubscription(Config config, Action<bool, string> update)
|
||||
{
|
||||
Thread.Sleep(60000);
|
||||
await Task.Delay(60000);
|
||||
Utils.SaveLog("UpdateTaskRunSubscription");
|
||||
|
||||
var updateHandle = new UpdateHandle();
|
||||
@@ -185,17 +185,17 @@ namespace v2rayN.Handler
|
||||
item.updateTime = updateTime;
|
||||
ConfigHandler.AddSubItem(ref config, item);
|
||||
|
||||
Thread.Sleep(5000);
|
||||
await Task.Delay(5000);
|
||||
}
|
||||
Thread.Sleep(60000);
|
||||
await Task.Delay(60000);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateTaskRunGeo(Config config, Action<bool, string> update)
|
||||
private async Task UpdateTaskRunGeo(Config config, Action<bool, string> update)
|
||||
{
|
||||
var autoUpdateGeoTime = DateTime.Now;
|
||||
|
||||
Thread.Sleep(1000 * 120);
|
||||
await Task.Delay(1000 * 120);
|
||||
Utils.SaveLog("UpdateTaskRunGeo");
|
||||
|
||||
var updateHandle = new UpdateHandle();
|
||||
@@ -214,7 +214,7 @@ namespace v2rayN.Handler
|
||||
}
|
||||
}
|
||||
|
||||
Thread.Sleep(1000 * 3600);
|
||||
await Task.Delay(1000 * 3600);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace v2rayN.Handler
|
||||
|
||||
public void SendMessage(string msg, bool time)
|
||||
{
|
||||
msg = $"{DateTime.Now} {msg}";
|
||||
msg = $"{DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")} {msg}";
|
||||
MessageBus.Current.SendMessage(msg, "MsgView");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace v2rayN.Handler
|
||||
|
||||
_lstProfileEx = new(SqliteHelper.Instance.Table<ProfileExItem>());
|
||||
|
||||
Task.Run(() =>
|
||||
Task.Run(async () =>
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
@@ -38,7 +38,7 @@ namespace v2rayN.Handler
|
||||
SqliteHelper.Instance.Replace(item);
|
||||
}
|
||||
}
|
||||
Thread.Sleep(1000 * 60);
|
||||
await Task.Delay(1000 * 60);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -629,7 +629,7 @@ namespace v2rayN.Handler
|
||||
server.security = details.Groups["method"].Value;
|
||||
server.id = details.Groups["password"].Value;
|
||||
server.address = details.Groups["hostname"].Value;
|
||||
server.port = int.Parse(details.Groups["port"].Value);
|
||||
server.port = Utils.ToInt(details.Groups["port"].Value);
|
||||
return server;
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace v2rayN.Handler
|
||||
}
|
||||
}
|
||||
|
||||
private void RunPingSub(Action<ServerTestItem> updateFun)
|
||||
private async Task RunPingSubAsync(Action<ServerTestItem> updateFun)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -111,7 +111,7 @@ namespace v2rayN.Handler
|
||||
}
|
||||
}
|
||||
|
||||
Thread.Sleep(10);
|
||||
await Task.Delay(10);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -119,21 +119,21 @@ namespace v2rayN.Handler
|
||||
}
|
||||
}
|
||||
|
||||
private void RunPing()
|
||||
private async void RunPing()
|
||||
{
|
||||
RunPingSub((ServerTestItem it) =>
|
||||
{
|
||||
long time = Ping(it.address);
|
||||
var output = FormatOut(time, Global.DelayUnit);
|
||||
await RunPingSubAsync((ServerTestItem it) =>
|
||||
{
|
||||
long time = Ping(it.address);
|
||||
var output = FormatOut(time, Global.DelayUnit);
|
||||
|
||||
ProfileExHandler.Instance.SetTestDelay(it.indexId, output);
|
||||
UpdateFunc(it.indexId, output);
|
||||
});
|
||||
ProfileExHandler.Instance.SetTestDelay(it.indexId, output);
|
||||
UpdateFunc(it.indexId, output);
|
||||
});
|
||||
}
|
||||
|
||||
private void RunTcping()
|
||||
private async void RunTcping()
|
||||
{
|
||||
RunPingSub((ServerTestItem it) =>
|
||||
await RunPingSubAsync((ServerTestItem it) =>
|
||||
{
|
||||
int time = GetTcpingTime(it.address, it.port);
|
||||
var output = FormatOut(time, Global.DelayUnit);
|
||||
@@ -158,7 +158,7 @@ namespace v2rayN.Handler
|
||||
}
|
||||
|
||||
DownloadHandle downloadHandle = new DownloadHandle();
|
||||
//Thread.Sleep(5000);
|
||||
|
||||
List<Task> tasks = new();
|
||||
foreach (var it in _selecteds)
|
||||
{
|
||||
@@ -187,7 +187,6 @@ namespace v2rayN.Handler
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
}
|
||||
}));
|
||||
//Thread.Sleep(100);
|
||||
}
|
||||
Task.WaitAll(tasks.ToArray());
|
||||
}
|
||||
@@ -312,10 +311,10 @@ namespace v2rayN.Handler
|
||||
}
|
||||
UpdateFunc(it.indexId, "", msg);
|
||||
});
|
||||
Thread.Sleep(2000);
|
||||
await Task.Delay(2000);
|
||||
}
|
||||
|
||||
Thread.Sleep((timeout + 2) * 1000);
|
||||
await Task.Delay((timeout + 2) * 1000);
|
||||
|
||||
if (pid > 0)
|
||||
{
|
||||
@@ -329,7 +328,7 @@ namespace v2rayN.Handler
|
||||
{
|
||||
await RunRealPing();
|
||||
|
||||
Thread.Sleep(1000);
|
||||
await Task.Delay(1000);
|
||||
|
||||
await RunSpeedTestMulti();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace v2rayN.Handler
|
||||
|
||||
private async void Init()
|
||||
{
|
||||
Thread.Sleep(5000);
|
||||
await Task.Delay(5000);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -71,6 +71,7 @@ namespace v2rayN.Handler
|
||||
webSocket.Abort();
|
||||
webSocket = null;
|
||||
Init();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (webSocket.State != WebSocketState.Open)
|
||||
@@ -102,7 +103,7 @@ namespace v2rayN.Handler
|
||||
}
|
||||
finally
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
await Task.Delay(1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,8 +61,7 @@ namespace v2rayN.Handler
|
||||
_updateFunc(server);
|
||||
}
|
||||
}
|
||||
var sleep = _config.guiItem.statisticsFreshRate < 1 ? 1 : _config.guiItem.statisticsFreshRate;
|
||||
Thread.Sleep(1000 * sleep);
|
||||
await Task.Delay(1000);
|
||||
await _channel.ConnectAsync();
|
||||
}
|
||||
catch
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace v2rayN.Handler
|
||||
_updateFunc = update;
|
||||
|
||||
_updateFunc(false, ResUI.MsgUpdateSubscriptionStart);
|
||||
var subItem = LazyConfig.Instance.SubItems();
|
||||
var subItem = LazyConfig.Instance.SubItems().OrderBy(t => t.sort).ToList();
|
||||
|
||||
if (subItem == null || subItem.Count <= 0)
|
||||
{
|
||||
@@ -175,6 +175,10 @@ namespace v2rayN.Handler
|
||||
//_updateFunc(false, $"{hashCode}{ResUI.MsgNoValidSubscription}");
|
||||
continue;
|
||||
}
|
||||
if (!url.StartsWith(Global.httpsProtocol) && !url.StartsWith(Global.httpProtocol))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (item.enabled == false)
|
||||
{
|
||||
_updateFunc(false, $"{hashCode}{ResUI.MsgSkipSubscriptionUpdate}");
|
||||
@@ -462,7 +466,7 @@ namespace v2rayN.Handler
|
||||
url = coreInfo.coreDownloadUrl64;
|
||||
break;
|
||||
}
|
||||
url = string.Format(url, version);
|
||||
url = string.Format(url, version.ToVersionString("v"));
|
||||
break;
|
||||
}
|
||||
case ECoreType.sing_box:
|
||||
@@ -510,7 +514,7 @@ namespace v2rayN.Handler
|
||||
throw new ArgumentException("Type");
|
||||
}
|
||||
|
||||
if (curVersion >= version)
|
||||
if (curVersion >= version && version != new SemanticVersion(0, 0, 0))
|
||||
{
|
||||
AbsoluteCompleted?.Invoke(this, new ResultEventArgs(false, message));
|
||||
return;
|
||||
@@ -609,6 +613,7 @@ namespace v2rayN.Handler
|
||||
try
|
||||
{
|
||||
if (needStop) coreHandler?.CoreStop();
|
||||
Task.Delay(1000);
|
||||
string fileName = Utils.GetTempPath(Utils.GetDownloadFileName(url));
|
||||
if (File.Exists(fileName))
|
||||
{
|
||||
|
||||
@@ -88,8 +88,6 @@ namespace v2rayN.Mode
|
||||
|
||||
public bool enableStatistics { get; set; }
|
||||
|
||||
public int statisticsFreshRate { get; set; }
|
||||
|
||||
public bool keepOlderDedupl { get; set; }
|
||||
|
||||
public bool ignoreGeoUpdateCore { get; set; } = true;
|
||||
@@ -162,9 +160,10 @@ namespace v2rayN.Mode
|
||||
public class TunModeItem
|
||||
{
|
||||
public bool enableTun { get; set; }
|
||||
public bool strictRoute { get; set; }
|
||||
public bool strictRoute { get; set; } = true;
|
||||
public string stack { get; set; }
|
||||
public int mtu { get; set; }
|
||||
public bool enableExInbound { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
naiveproxy = 22,
|
||||
tuic = 23,
|
||||
sing_box = 24,
|
||||
juicity = 25,
|
||||
v2rayN = 99
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,13 @@
|
||||
{
|
||||
public List<Server4Sbox> servers { get; set; }
|
||||
public List<Rule4Sbox> rules { get; set; }
|
||||
public string? final { get; set; }
|
||||
public string? strategy { get; set; }
|
||||
public bool? disable_cache { get; set; }
|
||||
public bool? disable_expire { get; set; }
|
||||
public bool? independent_cache { get; set; }
|
||||
public bool? reverse_mapping { get; set; }
|
||||
public Fakeip4Sbox? fakeip { get; set; }
|
||||
}
|
||||
|
||||
public class Route4Sbox
|
||||
@@ -195,4 +202,11 @@
|
||||
public List<string>? outbounds { get; set; }
|
||||
public List<string>? users { get; set; }
|
||||
}
|
||||
|
||||
public class Fakeip4Sbox
|
||||
{
|
||||
public bool enabled { get; set; }
|
||||
public string inet4_range { get; set; }
|
||||
public string inet6_range { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -185,7 +185,7 @@ namespace v2rayN.Mode
|
||||
/// <summary>
|
||||
/// VLESS
|
||||
/// </summary>
|
||||
public string flow { get; set; }
|
||||
public string? flow { get; set; }
|
||||
}
|
||||
|
||||
public class Sniffing4Ray
|
||||
|
||||
9
v2rayN/v2rayN/Resx/ResUI.Designer.cs
generated
9
v2rayN/v2rayN/Resx/ResUI.Designer.cs
generated
@@ -2752,15 +2752,6 @@ namespace v2rayN.Resx {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Statistics freshrate (second) 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string TbSettingsStatisticsFreshRate {
|
||||
get {
|
||||
return ResourceManager.GetString("TbSettingsStatisticsFreshRate", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Subscription conversion Url 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -793,9 +793,6 @@
|
||||
<data name="TbSettingsStatistics" xml:space="preserve">
|
||||
<value>فعال کردن آمار (نیاز به راه اندازی مجدد)</value>
|
||||
</data>
|
||||
<data name="TbSettingsStatisticsFreshRate" xml:space="preserve">
|
||||
<value>نرخ تازه سازی آمار (ثانیه)</value>
|
||||
</data>
|
||||
<data name="TbSettingsSubConvert" xml:space="preserve">
|
||||
<value>Subscription conversion Url</value>
|
||||
</data>
|
||||
|
||||
@@ -796,9 +796,6 @@
|
||||
<data name="TbSettingsStatistics" xml:space="preserve">
|
||||
<value>Enable Statistics (Require restart)</value>
|
||||
</data>
|
||||
<data name="TbSettingsStatisticsFreshRate" xml:space="preserve">
|
||||
<value>Statistics freshrate (second)</value>
|
||||
</data>
|
||||
<data name="TbSettingsSubConvert" xml:space="preserve">
|
||||
<value>Subscription conversion Url</value>
|
||||
</data>
|
||||
|
||||
@@ -317,7 +317,7 @@
|
||||
<value>Сканирование URL-адреса импорта успешна.</value>
|
||||
</data>
|
||||
<data name="TestMeOutput" xml:space="preserve">
|
||||
<value>Пинг текущей службы: {0} мс</value>
|
||||
<value>Задержка текущего сервера: {0} мс</value>
|
||||
</data>
|
||||
<data name="OperationSuccess" xml:space="preserve">
|
||||
<value>Операция успешна</value>
|
||||
@@ -335,7 +335,7 @@
|
||||
<value>Примечания</value>
|
||||
</data>
|
||||
<data name="LvUrl" xml:space="preserve">
|
||||
<value>Url(Необязательно)</value>
|
||||
<value>URL (необязательно)</value>
|
||||
</data>
|
||||
<data name="LvCount" xml:space="preserve">
|
||||
<value>Количество</value>
|
||||
@@ -506,7 +506,7 @@
|
||||
<value>Тёмный режим</value>
|
||||
</data>
|
||||
<data name="TbSettingsFollowSystemTheme" xml:space="preserve">
|
||||
<value>следить за системной темой</value>
|
||||
<value>Следить за системной темой</value>
|
||||
</data>
|
||||
<data name="TbSettingsLanguage" xml:space="preserve">
|
||||
<value>Язык (требуется перезапуск)</value>
|
||||
@@ -533,19 +533,19 @@
|
||||
<value>Очистить всю статистику</value>
|
||||
</data>
|
||||
<data name="menuPingServer" xml:space="preserve">
|
||||
<value>Проверить пинг серверов (Ctrl+P)</value>
|
||||
<value>Тест на задержку сервера (Ctrl+P)</value>
|
||||
</data>
|
||||
<data name="menuRealPingServer" xml:space="preserve">
|
||||
<value>Тест на реальную задержку серверов (Ctrl+R)</value>
|
||||
<value>Тест на реальную задержку сервера (Ctrl+R)</value>
|
||||
</data>
|
||||
<data name="menuSortServerResult" xml:space="preserve">
|
||||
<value>Сортировать по результату теста</value>
|
||||
</data>
|
||||
<data name="menuSpeedServer" xml:space="preserve">
|
||||
<value>Проверить скорость загрузки серверов (Ctrl+T)</value>
|
||||
<value>Тест на скорость загрузки сервера (Ctrl+T)</value>
|
||||
</data>
|
||||
<data name="menuTcpingServer" xml:space="preserve">
|
||||
<value>Тестировать сервера с tcping (Ctrl+O)</value>
|
||||
<value>Тест задержки с tcping (Ctrl+O)</value>
|
||||
</data>
|
||||
<data name="menuTestMe" xml:space="preserve">
|
||||
<value>Проверить текущий статус службы</value>
|
||||
@@ -644,7 +644,7 @@
|
||||
<value>Тип камуфляжа</value>
|
||||
</data>
|
||||
<data name="TbId" xml:space="preserve">
|
||||
<value>UUID(id)</value>
|
||||
<value>UUID (id)</value>
|
||||
</data>
|
||||
<data name="TbNetwork" xml:space="preserve">
|
||||
<value>Транспортный протокол сети</value>
|
||||
@@ -656,7 +656,7 @@
|
||||
<value>Порт</value>
|
||||
</data>
|
||||
<data name="TbRemarks" xml:space="preserve">
|
||||
<value>Псевдоним (примечания)</value>
|
||||
<value>Примечание</value>
|
||||
</data>
|
||||
<data name="TbRequestHost" xml:space="preserve">
|
||||
<value>Маскирующий домен (хост)</value>
|
||||
@@ -719,16 +719,22 @@
|
||||
<value>Разрешить подключения из локальной сети</value>
|
||||
</data>
|
||||
<data name="TbSettingsAutoHideStartup" xml:space="preserve">
|
||||
<value>Auto hide startup</value>
|
||||
<value>Автоскрытие при автозапуске</value>
|
||||
</data>
|
||||
<data name="TbSettingsAutoUpdateInterval" xml:space="preserve">
|
||||
<value>Интервал автоматического обновления Geo в часах</value>
|
||||
</data>
|
||||
<data name="LvAutoUpdateInterval" xml:space="preserve">
|
||||
<value>Интервал автоматического обновления в минутах</value>
|
||||
</data>
|
||||
<data name="TbSettingsCore" xml:space="preserve">
|
||||
<value>Ядро: базовые настройки</value>
|
||||
</data>
|
||||
<data name="TbSettingsCoreDns" xml:space="preserve">
|
||||
<value>V2ray DNS settings</value>
|
||||
<value>Настройки DNS V2ray</value>
|
||||
</data>
|
||||
<data name="TbSettingsCoreDnsSingbox" xml:space="preserve">
|
||||
<value>Настройки DNS sing-box</value>
|
||||
</data>
|
||||
<data name="TbSettingsCoreKcp" xml:space="preserve">
|
||||
<value>Ядро: настройки KCP</value>
|
||||
@@ -796,9 +802,6 @@
|
||||
<data name="TbSettingsStatistics" xml:space="preserve">
|
||||
<value>Включить статистику (требуется перезагрузка)</value>
|
||||
</data>
|
||||
<data name="TbSettingsStatisticsFreshRate" xml:space="preserve">
|
||||
<value>Частота обновления статистики в секундах</value>
|
||||
</data>
|
||||
<data name="TbSettingsSubConvert" xml:space="preserve">
|
||||
<value>URL-адрес конверсии подписки</value>
|
||||
</data>
|
||||
@@ -809,7 +812,7 @@
|
||||
<value>Включить протокол безопасности TLS v1.3 (обновление подписки)</value>
|
||||
</data>
|
||||
<data name="TbSettingsTrayMenuServersLimit" xml:space="preserve">
|
||||
<value>Tray right-click menu servers display limit</value>
|
||||
<value>Лимит серверов в меню трея</value>
|
||||
</data>
|
||||
<data name="TbSettingsUdpEnabled" xml:space="preserve">
|
||||
<value>Включить UDP</value>
|
||||
@@ -953,7 +956,7 @@
|
||||
<value>Поддержка DnsObject</value>
|
||||
</data>
|
||||
<data name="SubUrlTips" xml:space="preserve">
|
||||
<value>Group please leave blank here</value>
|
||||
<value>Необязательное поле</value>
|
||||
</data>
|
||||
<data name="TipChangeRouting" xml:space="preserve">
|
||||
<value>Настройки маршрутизации изменены</value>
|
||||
@@ -965,7 +968,7 @@
|
||||
<value>Только маршрут</value>
|
||||
</data>
|
||||
<data name="menuMixedTestServer" xml:space="preserve">
|
||||
<value>Тест задержки и скорости (Ctrl+E)</value>
|
||||
<value>Тест задержки и скорости всех серверов (Ctrl+E)</value>
|
||||
</data>
|
||||
<data name="LvTestDelay" xml:space="preserve">
|
||||
<value>Задержка (ms)</value>
|
||||
@@ -986,7 +989,7 @@
|
||||
<value>Импортировать старый конфиг guiNConfig</value>
|
||||
</data>
|
||||
<data name="TbEnableTunAs" xml:space="preserve">
|
||||
<value>Включить интерфейс</value>
|
||||
<value>Режим VPN</value>
|
||||
</data>
|
||||
<data name="TbSettingsNewPort4LAN" xml:space="preserve">
|
||||
<value>Новый порт для локальной сети</value>
|
||||
@@ -1054,4 +1057,19 @@
|
||||
<data name="TbSettingsEnableHWA" xml:space="preserve">
|
||||
<value>Включить аппаратное ускорение (требуется перезагрузка)</value>
|
||||
</data>
|
||||
</root>
|
||||
<data name="menuRebootAsAdmin" xml:space="preserve">
|
||||
<value>Перезагрузить как администратор</value>
|
||||
</data>
|
||||
<data name="menuDNSSetting" xml:space="preserve">
|
||||
<value>Настройки DNS</value>
|
||||
</data>
|
||||
<data name="TbSettingsLogEnabledToFile" xml:space="preserve">
|
||||
<value>Включить логгирование в файл</value>
|
||||
</data>
|
||||
<data name="TbSettingsSpeedTestTimeout" xml:space="preserve">
|
||||
<value>Таймаут одиночного спидтеста</value>
|
||||
</data>
|
||||
<data name="TbSettingsSpeedTestUrl" xml:space="preserve">
|
||||
<value>URL спидтеста</value>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
@@ -796,9 +796,6 @@
|
||||
<data name="TbSettingsStatistics" xml:space="preserve">
|
||||
<value>启用统计(实时网速显示,需重启)</value>
|
||||
</data>
|
||||
<data name="TbSettingsStatisticsFreshRate" xml:space="preserve">
|
||||
<value>统计刷新频率(单位秒)</value>
|
||||
</data>
|
||||
<data name="TbSettingsSubConvert" xml:space="preserve">
|
||||
<value>订阅转换网址(可选)</value>
|
||||
</data>
|
||||
|
||||
1138
v2rayN/v2rayN/Resx/ResUI.zh-Hant.resx
Normal file
1138
v2rayN/v2rayN/Resx/ResUI.zh-Hant.resx
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"type":"tun",
|
||||
"tag":"tun-in",
|
||||
"interface_name":"singbox_tun",
|
||||
"inet4_address":"172.19.0.1/30",
|
||||
"mtu":9000,
|
||||
"auto_route":true,
|
||||
"strict_route":false,
|
||||
"stack":"system",
|
||||
"sniff":true
|
||||
"type": "tun",
|
||||
"tag": "tun-in",
|
||||
"interface_name": "singbox_tun",
|
||||
"inet4_address": "172.19.0.1/30",
|
||||
"inet6_address": "fdfe:dcba:9876::1/126",
|
||||
"mtu": 9000,
|
||||
"auto_route": true,
|
||||
"strict_route": false,
|
||||
"stack": "system",
|
||||
"sniff": true
|
||||
}
|
||||
@@ -45,7 +45,7 @@ namespace v2rayN.Tool
|
||||
this.major = 0;
|
||||
this.minor = 0;
|
||||
this.patch = 0;
|
||||
this.version = "0.0.0";
|
||||
//this.version = "0.0.0";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,12 +87,20 @@ namespace v2rayN.Tool
|
||||
}
|
||||
}
|
||||
|
||||
public static bool operator ==(SemanticVersion v1, SemanticVersion v2) { return v1.Equals(v2); }
|
||||
public static bool operator !=(SemanticVersion v1, SemanticVersion v2) { return !v1.Equals(v2); }
|
||||
public static bool operator >=(SemanticVersion v1, SemanticVersion v2) { return v1.GreaterEquals(v2); }
|
||||
public static bool operator <=(SemanticVersion v1, SemanticVersion v2) { return v1.LessEquals(v2); }
|
||||
public static bool operator ==(SemanticVersion v1, SemanticVersion v2)
|
||||
{ return v1.Equals(v2); }
|
||||
|
||||
public static bool operator !=(SemanticVersion v1, SemanticVersion v2)
|
||||
{ return !v1.Equals(v2); }
|
||||
|
||||
public static bool operator >=(SemanticVersion v1, SemanticVersion v2)
|
||||
{ return v1.GreaterEquals(v2); }
|
||||
|
||||
public static bool operator <=(SemanticVersion v1, SemanticVersion v2)
|
||||
{ return v1.LessEquals(v2); }
|
||||
|
||||
#region Private
|
||||
|
||||
private bool GreaterEquals(SemanticVersion other)
|
||||
{
|
||||
if (this.major < other.major)
|
||||
@@ -168,6 +176,7 @@ namespace v2rayN.Tool
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -167,8 +167,8 @@ namespace v2rayN.ViewModels
|
||||
[Reactive]
|
||||
public ImageSource AppIcon { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool BlShowTrayTip { get; set; }
|
||||
//[Reactive]
|
||||
//public bool BlShowTrayTip { get; set; }
|
||||
|
||||
#endregion Menu
|
||||
|
||||
@@ -210,8 +210,8 @@ namespace v2rayN.ViewModels
|
||||
[Reactive]
|
||||
public string RunningServerDisplay { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string RunningServerToolTipText { get; set; }
|
||||
//[Reactive]
|
||||
//public string RunningServerToolTipText { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string RunningInfoDisplay { get; set; }
|
||||
@@ -849,12 +849,12 @@ namespace v2rayN.ViewModels
|
||||
{
|
||||
var runningSummary = running.GetSummary();
|
||||
RunningServerDisplay = $"{ResUI.menuServers}:{runningSummary}";
|
||||
RunningServerToolTipText = runningSummary;
|
||||
//RunningServerToolTipText = runningSummary;
|
||||
}
|
||||
else
|
||||
{
|
||||
RunningServerDisplay =
|
||||
RunningServerToolTipText = ResUI.CheckServerSettings;
|
||||
RunningServerDisplay = ResUI.CheckServerSettings;
|
||||
//RunningServerToolTipText = ResUI.CheckServerSettings;
|
||||
}
|
||||
}));
|
||||
}
|
||||
@@ -1528,8 +1528,8 @@ namespace v2rayN.ViewModels
|
||||
|
||||
private void ChangeSystemProxyStatus(ESysProxyType type, bool blChange)
|
||||
{
|
||||
SysProxyHandle.UpdateSysProxy(_config, false);
|
||||
_noticeHandler?.SendMessage(ResUI.TipChangeSystemProxy, true);
|
||||
SysProxyHandle.UpdateSysProxy(_config, _config.tunModeItem.enableTun ? true : false);
|
||||
_noticeHandler?.SendMessage(ResUI.TipChangeSystemProxy + _config.sysProxyType.ToString(), true);
|
||||
|
||||
Application.Current.Dispatcher.Invoke((Action)(() =>
|
||||
{
|
||||
@@ -1686,7 +1686,7 @@ namespace v2rayN.ViewModels
|
||||
}
|
||||
CurrentFontSize = _config.uiItem.currentFontSize;
|
||||
CurrentLanguage = _config.uiItem.currentLanguage;
|
||||
BlShowTrayTip = _config.uiItem.showTrayTip;
|
||||
//BlShowTrayTip = _config.uiItem.showTrayTip;
|
||||
|
||||
this.WhenAnyValue(
|
||||
x => x.ColorModeDark,
|
||||
|
||||
@@ -51,7 +51,6 @@ namespace v2rayN.ViewModels
|
||||
|
||||
[Reactive] public bool AutoRun { get; set; }
|
||||
[Reactive] public bool EnableStatistics { get; set; }
|
||||
[Reactive] public int StatisticsFreshRate { get; set; }
|
||||
[Reactive] public bool KeepOlderDedupl { get; set; }
|
||||
[Reactive] public bool IgnoreGeoUpdateCore { get; set; }
|
||||
[Reactive] public bool EnableAutoAdjustMainLvColWidth { get; set; }
|
||||
@@ -141,7 +140,6 @@ namespace v2rayN.ViewModels
|
||||
|
||||
AutoRun = _config.guiItem.autoRun;
|
||||
EnableStatistics = _config.guiItem.enableStatistics;
|
||||
StatisticsFreshRate = _config.guiItem.statisticsFreshRate;
|
||||
KeepOlderDedupl = _config.guiItem.keepOlderDedupl;
|
||||
IgnoreGeoUpdateCore = _config.guiItem.ignoreGeoUpdateCore;
|
||||
EnableAutoAdjustMainLvColWidth = _config.uiItem.enableAutoAdjustMainLvColWidth;
|
||||
@@ -291,11 +289,6 @@ namespace v2rayN.ViewModels
|
||||
Utils.SetAutoRun(AutoRun);
|
||||
_config.guiItem.autoRun = AutoRun;
|
||||
_config.guiItem.enableStatistics = EnableStatistics;
|
||||
_config.guiItem.statisticsFreshRate = StatisticsFreshRate;
|
||||
if (_config.guiItem.statisticsFreshRate > 100 || _config.guiItem.statisticsFreshRate < 1)
|
||||
{
|
||||
_config.guiItem.statisticsFreshRate = 1;
|
||||
}
|
||||
_config.guiItem.keepOlderDedupl = KeepOlderDedupl;
|
||||
_config.guiItem.ignoreGeoUpdateCore = IgnoreGeoUpdateCore;
|
||||
_config.uiItem.enableAutoAdjustMainLvColWidth = EnableAutoAdjustMainLvColWidth;
|
||||
|
||||
@@ -87,18 +87,15 @@ namespace v2rayN.ViewModels
|
||||
SelectedSource.protocol = ProtocolItems?.ToList();
|
||||
SelectedSource.inboundTag = InboundTagItems?.ToList();
|
||||
|
||||
bool hasRule =
|
||||
SelectedSource.domain != null
|
||||
&& SelectedSource.domain.Count > 0
|
||||
|| SelectedSource.ip != null
|
||||
&& SelectedSource.ip.Count > 0
|
||||
|| SelectedSource.protocol != null
|
||||
&& SelectedSource.protocol.Count > 0
|
||||
bool hasRule = SelectedSource.domain?.Count > 0
|
||||
|| SelectedSource.ip?.Count > 0
|
||||
|| SelectedSource.protocol?.Count > 0
|
||||
|| SelectedSource.process?.Count > 0
|
||||
|| !Utils.IsNullOrEmpty(SelectedSource.port);
|
||||
|
||||
if (!hasRule)
|
||||
{
|
||||
UI.ShowWarning(string.Format(ResUI.RoutingRuleDetailRequiredTips, "Port/Protocol/Domain/IP"));
|
||||
UI.ShowWarning(string.Format(ResUI.RoutingRuleDetailRequiredTips, "Port/Protocol/Domain/IP/Process"));
|
||||
return;
|
||||
}
|
||||
//_noticeHandler?.Enqueue(ResUI.OperationSuccess);
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace v2rayN.ViewModels
|
||||
private void SaveSub()
|
||||
{
|
||||
string remarks = SelectedSource.remarks;
|
||||
if (Utils.IsNullOrEmpty(remarks))
|
||||
if (string.IsNullOrEmpty(remarks))
|
||||
{
|
||||
UI.Show(ResUI.PleaseFillRemarks);
|
||||
return;
|
||||
|
||||
@@ -11,6 +11,17 @@ namespace v2rayN.Views
|
||||
public AddServer2Window(ProfileItem profileItem)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||
if (this.Width > SystemParameters.WorkArea.Width)
|
||||
{
|
||||
this.Width = SystemParameters.WorkArea.Width;
|
||||
}
|
||||
if (this.Height > SystemParameters.WorkArea.Height)
|
||||
{
|
||||
this.Height = SystemParameters.WorkArea.Height;
|
||||
}
|
||||
|
||||
this.Owner = Application.Current.MainWindow;
|
||||
this.Loaded += Window_Loaded;
|
||||
ViewModel = new AddServer2ViewModel(profileItem, this);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
x:TypeArguments="vms:AddServerViewModel"
|
||||
Background="{DynamicResource MaterialDesignPaper}"
|
||||
FontFamily="{x:Static conv:MaterialDesignFonts.MyFont}"
|
||||
ResizeMode="NoResize"
|
||||
ResizeMode="CanResize"
|
||||
ShowInTaskbar="False"
|
||||
TextElement.FontFamily="{x:Static conv:MaterialDesignFonts.MyFont}"
|
||||
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
|
||||
|
||||
@@ -15,6 +15,17 @@ namespace v2rayN.Views
|
||||
public AddServerWindow(ProfileItem profileItem)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||
if (this.Width > SystemParameters.WorkArea.Width)
|
||||
{
|
||||
this.Width = SystemParameters.WorkArea.Width;
|
||||
}
|
||||
if (this.Height > SystemParameters.WorkArea.Height)
|
||||
{
|
||||
this.Height = SystemParameters.WorkArea.Height;
|
||||
}
|
||||
|
||||
this.Owner = Application.Current.MainWindow;
|
||||
this.Loaded += Window_Loaded;
|
||||
cmbNetwork.SelectionChanged += CmbNetwork_SelectionChanged;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:conv="clr-namespace:v2rayN.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:resx="clr-namespace:v2rayN.Resx"
|
||||
@@ -84,13 +85,15 @@
|
||||
Cursor="Hand"
|
||||
Style="{StaticResource DefButton}" />
|
||||
</StackPanel>
|
||||
|
||||
<TextBox
|
||||
x:Name="txtnormalDNS"
|
||||
Margin="{StaticResource SettingItemMargin}"
|
||||
VerticalAlignment="Stretch"
|
||||
materialDesign:HintAssist.Hint="Http/Socks"
|
||||
AcceptsReturn="True"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource DefTextBox}"
|
||||
Style="{StaticResource MaterialDesignOutlinedTextBox}"
|
||||
TextWrapping="Wrap"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
</DockPanel>
|
||||
@@ -122,35 +125,29 @@
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<GroupBox
|
||||
<TextBox
|
||||
x:Name="txtnormalDNS2"
|
||||
Grid.Column="0"
|
||||
Header=""
|
||||
Style="{StaticResource MyGroupBox}">
|
||||
<TextBox
|
||||
x:Name="txtnormalDNS2"
|
||||
Margin="{StaticResource SettingItemMargin}"
|
||||
VerticalAlignment="Stretch"
|
||||
AcceptsReturn="True"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource DefTextBox}"
|
||||
TextWrapping="Wrap"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
</GroupBox>
|
||||
VerticalAlignment="Stretch"
|
||||
materialDesign:HintAssist.Hint="Http/Socks"
|
||||
AcceptsReturn="True"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource MaterialDesignOutlinedTextBox}"
|
||||
TextWrapping="Wrap"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
|
||||
<GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" />
|
||||
<GroupBox
|
||||
|
||||
<TextBox
|
||||
x:Name="txttunDNS2"
|
||||
Grid.Column="2"
|
||||
Header="{x:Static resx:ResUI.TbSettingsTunMode}"
|
||||
Style="{StaticResource MyGroupBox}">
|
||||
<TextBox
|
||||
x:Name="txttunDNS2"
|
||||
Margin="{StaticResource SettingItemMargin}"
|
||||
VerticalAlignment="Stretch"
|
||||
AcceptsReturn="True"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource DefTextBox}"
|
||||
TextWrapping="Wrap"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
</GroupBox>
|
||||
VerticalAlignment="Stretch"
|
||||
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.TbSettingsTunMode}"
|
||||
AcceptsReturn="True"
|
||||
BorderThickness="1"
|
||||
Style="{StaticResource MaterialDesignOutlinedTextBox}"
|
||||
TextWrapping="Wrap"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
</TabItem>
|
||||
|
||||
@@ -14,6 +14,17 @@ namespace v2rayN.Views
|
||||
public DNSSettingWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||
if (this.Width > SystemParameters.WorkArea.Width)
|
||||
{
|
||||
this.Width = SystemParameters.WorkArea.Width;
|
||||
}
|
||||
if (this.Height > SystemParameters.WorkArea.Height)
|
||||
{
|
||||
this.Height = SystemParameters.WorkArea.Height;
|
||||
}
|
||||
|
||||
this.Owner = Application.Current.MainWindow;
|
||||
_config = LazyConfig.Instance.GetConfig();
|
||||
|
||||
@@ -44,7 +55,7 @@ namespace v2rayN.Views
|
||||
|
||||
private void linkDnsSingboxObjectDoc_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Utils.ProcessStart("http://sing-box.sagernet.org/zh/configuration/dns/");
|
||||
Utils.ProcessStart("https://sing-box.sagernet.org/zh/configuration/dns/");
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -16,6 +16,17 @@ namespace v2rayN.Views
|
||||
public GlobalHotkeySettingWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||
if (this.Width > SystemParameters.WorkArea.Width)
|
||||
{
|
||||
this.Width = SystemParameters.WorkArea.Width;
|
||||
}
|
||||
if (this.Height > SystemParameters.WorkArea.Height)
|
||||
{
|
||||
this.Height = SystemParameters.WorkArea.Height;
|
||||
}
|
||||
|
||||
this.Owner = Application.Current.MainWindow;
|
||||
_config = LazyConfig.Instance.GetConfig();
|
||||
_config.globalHotkeys ??= new List<KeyEventItem>();
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
Title="v2rayN"
|
||||
Width="900"
|
||||
Height="700"
|
||||
MinWidth="900"
|
||||
MinHeight="700"
|
||||
x:TypeArguments="vms:MainWindowViewModel"
|
||||
Background="{DynamicResource MaterialDesignPaper}"
|
||||
FontFamily="{x:Static conv:MaterialDesignFonts.MyFont}"
|
||||
@@ -209,7 +207,7 @@
|
||||
<MenuItem
|
||||
x:Name="menuCheckUpdateN"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="v2rayN" />
|
||||
Header="V2rayN" />
|
||||
<MenuItem
|
||||
x:Name="menuCheckUpdateV2flyCore"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
@@ -235,7 +233,7 @@
|
||||
<MenuItem
|
||||
x:Name="menuCheckUpdateSingBoxCore"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="sing-box Core" />
|
||||
Header="Sing-box Core" />
|
||||
<Separator Margin="-40,5" />
|
||||
<MenuItem
|
||||
x:Name="menuCheckUpdateGeo"
|
||||
@@ -301,7 +299,7 @@
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -321,15 +319,15 @@
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Margin="8"
|
||||
IsEnabled="{Binding ElementName=followSystemTheme, Path=IsChecked, Converter={StaticResource InverseBooleanConverter}}"/>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbSettingsFollowSystemTheme}" />
|
||||
<ToggleButton
|
||||
IsEnabled="{Binding ElementName=followSystemTheme, Path=IsChecked, Converter={StaticResource InverseBooleanConverter}}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbSettingsFollowSystemTheme}" />
|
||||
<ToggleButton
|
||||
x:Name="followSystemTheme"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
@@ -388,7 +386,7 @@
|
||||
x:Name="lstGroup"
|
||||
FontSize="{DynamicResource StdFontSize}"
|
||||
ItemContainerStyle="{StaticResource MyChipListBoxItem}"
|
||||
Style="{StaticResource MaterialDesignChoiceChipPrimaryOutlineListBox}">
|
||||
Style="{StaticResource MaterialDesignChoiceChipPrimaryOutlineListBox}" MaxHeight="120">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding remarks}" />
|
||||
@@ -574,7 +572,7 @@
|
||||
<MenuItem
|
||||
x:Name="menuSpeedServer"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="{x:Static resx:ResUI.menuSpeedServer}"/>
|
||||
Header="{x:Static resx:ResUI.menuSpeedServer}" />
|
||||
<MenuItem
|
||||
x:Name="menuSortServerResult"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
@@ -856,23 +854,6 @@
|
||||
Header="{x:Static resx:ResUI.menuExit}" />
|
||||
</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>
|
||||
<materialDesign:Snackbar x:Name="MainSnackbar" MessageQueue="{materialDesign:MessageQueue}" />
|
||||
</Grid>
|
||||
|
||||
@@ -25,6 +25,19 @@ namespace v2rayN.Views
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||
if (this.Width > SystemParameters.WorkArea.Width)
|
||||
{
|
||||
this.Width = SystemParameters.WorkArea.Width;
|
||||
}
|
||||
if (this.Height > SystemParameters.WorkArea.Height)
|
||||
{
|
||||
this.Height = SystemParameters.WorkArea.Height;
|
||||
}
|
||||
|
||||
lstGroup.MaxHeight = Math.Floor(SystemParameters.WorkArea.Height * 0.20 / 40) * 40;
|
||||
|
||||
_config = LazyConfig.Instance.GetConfig();
|
||||
|
||||
App.Current.SessionEnding += Current_SessionEnding;
|
||||
@@ -163,10 +176,10 @@ namespace v2rayN.Views
|
||||
this.BindCommand(ViewModel, vm => vm.SubUpdateViaProxyCmd, v => v.menuSubUpdateViaProxy2).DisposeWith(disposables);
|
||||
|
||||
this.OneWayBind(ViewModel, vm => vm.NotifyIcon, v => v.tbNotify.Icon).DisposeWith(disposables);
|
||||
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.AppIcon, v => v.Icon).DisposeWith(disposables);
|
||||
this.OneWayBind(ViewModel, vm => vm.BlShowTrayTip, v => v.borTrayToolTip.Visibility).DisposeWith(disposables);
|
||||
//this.OneWayBind(ViewModel, vm => vm.BlShowTrayTip, v => v.borTrayToolTip.Visibility).DisposeWith(disposables);
|
||||
|
||||
//status bar
|
||||
this.OneWayBind(ViewModel, vm => vm.InboundDisplay, v => v.txtInboundDisplay.Text).DisposeWith(disposables);
|
||||
@@ -519,10 +532,14 @@ namespace v2rayN.Views
|
||||
var coreInfos = LazyConfig.Instance.GetCoreInfos();
|
||||
foreach (var it in coreInfos)
|
||||
{
|
||||
if (it.coreType == ECoreType.v2fly)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var item = new MenuItem()
|
||||
{
|
||||
Tag = it.coreUrl.Replace(@"/releases", ""),
|
||||
Header = string.Format(Resx.ResUI.menuWebsiteItem, it.coreType.ToString().Replace("_", " "))
|
||||
Header = string.Format(Resx.ResUI.menuWebsiteItem, it.coreType.ToString().Replace("_", " ")).UpperFirstChar()
|
||||
};
|
||||
item.Click += MenuItem_Click;
|
||||
menuHelp.Items.Add(item);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<reactiveui:ReactiveWindow
|
||||
x:Class="v2rayN.Views.OptionSettingWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:conv="clr-namespace:v2rayN.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:conv="clr-namespace:v2rayN.Converters"
|
||||
xmlns:resx="clr-namespace:v2rayN.Resx"
|
||||
xmlns:vms="clr-namespace:v2rayN.ViewModels"
|
||||
Title="{x:Static resx:ResUI.menuSetting}"
|
||||
@@ -498,21 +498,6 @@
|
||||
Margin="{StaticResource SettingItemMargin}"
|
||||
HorizontalAlignment="Left" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource SettingItemMargin}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbSettingsStatisticsFreshRate}" />
|
||||
<ComboBox
|
||||
x:Name="cmbStatisticsFreshRate"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Width="200"
|
||||
Margin="{StaticResource SettingItemMargin}"
|
||||
Style="{StaticResource DefComboBox}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="4"
|
||||
Grid.Column="0"
|
||||
|
||||
@@ -18,6 +18,17 @@ namespace v2rayN.Views
|
||||
public OptionSettingWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||
if (this.Width > SystemParameters.WorkArea.Width)
|
||||
{
|
||||
this.Width = SystemParameters.WorkArea.Width;
|
||||
}
|
||||
if (this.Height > SystemParameters.WorkArea.Height)
|
||||
{
|
||||
this.Height = SystemParameters.WorkArea.Height;
|
||||
}
|
||||
|
||||
this.Owner = Application.Current.MainWindow;
|
||||
_config = LazyConfig.Instance.GetConfig();
|
||||
|
||||
@@ -44,10 +55,6 @@ namespace v2rayN.Views
|
||||
cmbmux4SboxProtocol.Items.Add(it);
|
||||
});
|
||||
|
||||
for (int i = 1; i <= 10; i++)
|
||||
{
|
||||
cmbStatisticsFreshRate.Items.Add(i);
|
||||
}
|
||||
Global.TunMtus.ForEach(it =>
|
||||
{
|
||||
cmbMtu.Items.Add(it);
|
||||
@@ -150,7 +157,6 @@ namespace v2rayN.Views
|
||||
|
||||
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.StatisticsFreshRate, v => v.cmbStatisticsFreshRate.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.KeepOlderDedupl, v => v.togKeepOlderDedupl.IsChecked).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.IgnoreGeoUpdateCore, v => v.togIgnoreGeoUpdateCore.IsChecked).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.EnableAutoAdjustMainLvColWidth, v => v.togEnableAutoAdjustMainLvColWidth.IsChecked).DisposeWith(disposables);
|
||||
|
||||
@@ -12,6 +12,17 @@ namespace v2rayN.Views
|
||||
public RoutingRuleDetailsWindow(RulesItem rulesItem)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||
if (this.Width > SystemParameters.WorkArea.Width)
|
||||
{
|
||||
this.Width = SystemParameters.WorkArea.Width;
|
||||
}
|
||||
if (this.Height > SystemParameters.WorkArea.Height)
|
||||
{
|
||||
this.Height = SystemParameters.WorkArea.Height;
|
||||
}
|
||||
|
||||
this.Owner = Application.Current.MainWindow;
|
||||
this.Loaded += Window_Loaded;
|
||||
clbProtocol.SelectionChanged += ClbProtocol_SelectionChanged;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
xmlns:resx="clr-namespace:v2rayN.Resx"
|
||||
xmlns:vms="clr-namespace:v2rayN.ViewModels"
|
||||
Title="{x:Static resx:ResUI.menuRoutingRuleSetting}"
|
||||
Width="900"
|
||||
Width="960"
|
||||
Height="700"
|
||||
x:TypeArguments="vms:RoutingRuleSettingViewModel"
|
||||
Background="{DynamicResource MaterialDesignPaper}"
|
||||
@@ -280,7 +280,7 @@
|
||||
Binding="{Binding outboundTag}"
|
||||
Header="outboundTag" />
|
||||
<DataGridTextColumn
|
||||
Width="100"
|
||||
Width="80"
|
||||
Binding="{Binding port}"
|
||||
Header="port" />
|
||||
<DataGridTextColumn
|
||||
@@ -288,15 +288,15 @@
|
||||
Binding="{Binding protocols}"
|
||||
Header="protocol" />
|
||||
<DataGridTextColumn
|
||||
Width="120"
|
||||
Width="110"
|
||||
Binding="{Binding inboundTags}"
|
||||
Header="inboundTag" />
|
||||
<DataGridTextColumn
|
||||
Width="150"
|
||||
Width="220"
|
||||
Binding="{Binding domains}"
|
||||
Header="domain" />
|
||||
<DataGridTextColumn
|
||||
Width="150"
|
||||
Width="220"
|
||||
Binding="{Binding ips}"
|
||||
Header="ip" />
|
||||
<DataGridTextColumn
|
||||
|
||||
@@ -13,6 +13,17 @@ namespace v2rayN.Views
|
||||
public RoutingRuleSettingWindow(RoutingItem routingItem)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||
if (this.Width > SystemParameters.WorkArea.Width)
|
||||
{
|
||||
this.Width = SystemParameters.WorkArea.Width;
|
||||
}
|
||||
if (this.Height > SystemParameters.WorkArea.Height)
|
||||
{
|
||||
this.Height = SystemParameters.WorkArea.Height;
|
||||
}
|
||||
|
||||
this.Owner = Application.Current.MainWindow;
|
||||
this.Loaded += Window_Loaded;
|
||||
this.PreviewKeyDown += RoutingRuleSettingWindow_PreviewKeyDown;
|
||||
|
||||
@@ -12,6 +12,17 @@ namespace v2rayN.Views
|
||||
public RoutingSettingWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||
if (this.Width > SystemParameters.WorkArea.Width)
|
||||
{
|
||||
this.Width = SystemParameters.WorkArea.Width;
|
||||
}
|
||||
if (this.Height > SystemParameters.WorkArea.Height)
|
||||
{
|
||||
this.Height = SystemParameters.WorkArea.Height;
|
||||
}
|
||||
|
||||
this.Owner = Application.Current.MainWindow;
|
||||
this.Closing += RoutingSettingWindow_Closing;
|
||||
this.PreviewKeyDown += RoutingSettingWindow_PreviewKeyDown;
|
||||
|
||||
@@ -11,6 +11,17 @@ namespace v2rayN.Views
|
||||
public SubEditWindow(SubItem subItem)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||
if (this.Width > SystemParameters.WorkArea.Width)
|
||||
{
|
||||
this.Width = SystemParameters.WorkArea.Width;
|
||||
}
|
||||
if (this.Height > SystemParameters.WorkArea.Height)
|
||||
{
|
||||
this.Height = SystemParameters.WorkArea.Height;
|
||||
}
|
||||
|
||||
this.Owner = Application.Current.MainWindow;
|
||||
this.Loaded += Window_Loaded;
|
||||
|
||||
|
||||
@@ -13,6 +13,17 @@ namespace v2rayN.Views
|
||||
public SubSettingWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||
if (this.Width > SystemParameters.WorkArea.Width)
|
||||
{
|
||||
this.Width = SystemParameters.WorkArea.Width;
|
||||
}
|
||||
if (this.Height > SystemParameters.WorkArea.Height)
|
||||
{
|
||||
this.Height = SystemParameters.WorkArea.Height;
|
||||
}
|
||||
|
||||
this.Owner = Application.Current.MainWindow;
|
||||
|
||||
ViewModel = new SubSettingViewModel(this);
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<ApplicationIcon>v2rayN.ico</ApplicationIcon>
|
||||
<Copyright>Copyright © 2017-2023 (GPLv3)</Copyright>
|
||||
<FileVersion>6.24</FileVersion>
|
||||
<FileVersion>6.29</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Downloader" Version="3.0.4" />
|
||||
<PackageReference Include="Downloader" Version="3.0.6" />
|
||||
<PackageReference Include="MaterialDesignThemes" Version="4.9.0" />
|
||||
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.0.108" />
|
||||
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.0.118" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="QRCoder.Xaml" Version="1.4.3" />
|
||||
<PackageReference Include="sqlite-net-pcl" Version="1.8.116" />
|
||||
@@ -25,8 +25,8 @@
|
||||
<PackageReference Include="ReactiveUI.Fody" Version="18.4.1" />
|
||||
<PackageReference Include="ReactiveUI.Validation" Version="3.0.22" />
|
||||
<PackageReference Include="ReactiveUI.WPF" Version="18.4.1" />
|
||||
<PackageReference Include="Splat.NLog" Version="14.6.8" />
|
||||
<PackageReference Include="System.Reactive" Version="5.0.0" />
|
||||
<PackageReference Include="Splat.NLog" Version="14.7.1" />
|
||||
<PackageReference Include="System.Reactive" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -108,6 +108,9 @@
|
||||
<EmbeddedResource Update="Resx\ResUI.zh-Hans.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Resx\ResUI.zh-Hant.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Resx\ResUI.fa-Ir.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
</EmbeddedResource>
|
||||
|
||||
@@ -92,9 +92,9 @@ namespace v2rayUpgrade
|
||||
File.Move(Application.ExecutablePath, thisAppOldFile);
|
||||
}
|
||||
|
||||
string entryOuputPath = GetPath(fullName);
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(entryOuputPath)!);
|
||||
entry.ExtractToFile(entryOuputPath, true);
|
||||
string entryOutputPath = GetPath(fullName);
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(entryOutputPath)!);
|
||||
entry.ExtractToFile(entryOutputPath, true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -145,4 +145,4 @@ namespace v2rayUpgrade
|
||||
return Path.Combine(startupPath, fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user