Compare commits

...

9 Commits
6.0 ... 6.1

Author SHA1 Message Date
2dust
9b4bf455b4 up 6.1 2023-01-02 11:13:26 +08:00
2dust
ddd3739ed9 Fix the problem of using core 2023-01-02 11:02:31 +08:00
2dust
1c95c5861c Fix startup issues 2023-01-02 11:01:43 +08:00
2dust
fd6fa1c622 fix fa-Ir 2023-01-02 10:07:10 +08:00
2dust
6809a77a41 Merge pull request #2918 from DanielBlackBeard/master
add persian(farsi) language
2023-01-02 10:00:14 +08:00
2dust
7a913ee38f Merge pull request #2911 from FrzMtrsprt/more_dark_border
Dark border for every window
2023-01-02 09:50:24 +08:00
Persian Prince
cca330829a Update ResUI.fa-Ir.resx 2023-01-01 19:44:27 +03:30
Persian Prince
e2f5c76d91 add persian(farsi) language 2023-01-01 19:25:02 +03:30
FrzMtrsprt
26bf7c149c Dark border for every window 2023-01-01 21:18:10 +08:00
16 changed files with 1124 additions and 30 deletions

View File

@@ -98,7 +98,7 @@
public static readonly List<string> fingerprints = new List<string> { "chrome", "firefox", "safari", "randomized", "" }; public static readonly List<string> fingerprints = new List<string> { "chrome", "firefox", "safari", "randomized", "" };
public static readonly List<string> allowInsecures = new List<string> { "true", "false", "" }; public static readonly List<string> allowInsecures = new List<string> { "true", "false", "" };
public static readonly List<string> domainStrategy4Freedoms = new List<string> { "AsIs", "UseIP", "UseIPv4", "UseIPv6", "" }; public static readonly List<string> domainStrategy4Freedoms = new List<string> { "AsIs", "UseIP", "UseIPv4", "UseIPv6", "" };
public static readonly List<string> Languages = new List<string> { "zh-Hans", "en" }; public static readonly List<string> Languages = new List<string> { "zh-Hans", "en" ,"fa-Ir" };
public static readonly List<string> alpns = new List<string> { "h2", "http/1.1", "h2,http/1.1", "" }; public static readonly List<string> alpns = new List<string> { "h2", "http/1.1", "h2,http/1.1", "" };
public static readonly List<string> LogLevel = new List<string> { "debug", "info", "warning", "error", "none" }; public static readonly List<string> LogLevel = new List<string> { "debug", "info", "warning", "error", "none" };
public static readonly List<string> InboundTags = new List<string> { "socks", "http", "socks2", "http2" }; public static readonly List<string> InboundTags = new List<string> { "socks", "http", "socks2", "http2" };

View File

@@ -11,9 +11,9 @@ namespace v2rayN.Handler
/// </summary> /// </summary>
class CoreHandler 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; Action<bool, string> _updateFunc;
@@ -38,7 +38,7 @@ namespace v2rayN.Handler
ShowMsg(false, ResUI.CheckServerSettings); ShowMsg(false, ResUI.CheckServerSettings);
return; return;
} }
string fileName = Utils.GetConfigPath(coreCConfigRes); string fileName = Utils.GetConfigPath(_coreCConfigRes);
if (CoreConfigHandler.GenerateClientConfig(node, fileName, out string msg, out string content) != 0) if (CoreConfigHandler.GenerateClientConfig(node, fileName, out string msg, out string content) != 0)
{ {
ShowMsg(false, msg); ShowMsg(false, msg);
@@ -62,7 +62,7 @@ namespace v2rayN.Handler
}; };
if (CoreConfigHandler.GenerateClientConfig(itemSocks, null, out string msg2, out string configStr) == 0) if (CoreConfigHandler.GenerateClientConfig(itemSocks, null, out string msg2, out string configStr) == 0)
{ {
processId = CoreStartViaString(configStr); _processId = CoreStartViaString(configStr);
} }
} }
} }
@@ -96,17 +96,17 @@ namespace v2rayN.Handler
} }
else else
{ {
if (coreInfo == null || coreInfo.coreExes == null) if (_coreInfo == null || _coreInfo.coreExes == null)
{ {
return; return;
} }
foreach (string vName in coreInfo.coreExes) foreach (string vName in _coreInfo.coreExes)
{ {
Process[] existing = Process.GetProcessesByName(vName); Process[] existing = Process.GetProcessesByName(vName);
foreach (Process p in existing) foreach (Process p in existing)
{ {
string path = p.MainModule.FileName; string path = p.MainModule.FileName;
if (path == $"{Utils.GetBinPath(vName, coreInfo.coreType)}.exe") if (path == $"{Utils.GetBinPath(vName, _coreInfo.coreType)}.exe")
{ {
KillProcess(p); KillProcess(p);
} }
@@ -114,10 +114,10 @@ namespace v2rayN.Handler
} }
} }
if (processId > 0) if (_processId > 0)
{ {
CoreStopPid(processId); CoreStopPid(_processId);
processId = 0; _processId = 0;
} }
} }
@@ -140,10 +140,10 @@ namespace v2rayN.Handler
} }
} }
private string CoreFindexe(List<string> lstCoreTemp) private string CoreFindexe(CoreInfo coreInfo)
{ {
string fileName = string.Empty; string fileName = string.Empty;
foreach (string name in lstCoreTemp) foreach (string name in coreInfo.coreExes)
{ {
string vName = $"{name}.exe"; string vName = $"{name}.exe";
vName = Utils.GetBinPath(vName, coreInfo.coreType); vName = Utils.GetBinPath(vName, coreInfo.coreType);
@@ -155,7 +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(", ", lstCoreTemp.ToArray()), coreInfo.coreUrl); string msg = string.Format(ResUI.NotFoundCore, Utils.GetBinPath("", coreInfo.coreType), string.Join(", ", coreInfo.coreExes.ToArray()), coreInfo.coreUrl);
ShowMsg(false, msg); ShowMsg(false, msg);
} }
return fileName; return fileName;
@@ -167,7 +167,7 @@ namespace v2rayN.Handler
try try
{ {
string fileName = CoreFindexe(coreInfo.coreExes); string fileName = CoreFindexe(_coreInfo);
if (fileName == "") return; if (fileName == "") return;
Process p = new Process Process p = new Process
@@ -175,7 +175,7 @@ namespace v2rayN.Handler
StartInfo = new ProcessStartInfo StartInfo = new ProcessStartInfo
{ {
FileName = fileName, FileName = fileName,
Arguments = coreInfo.arguments, Arguments = _coreInfo.arguments,
WorkingDirectory = Utils.GetConfigPath(), WorkingDirectory = Utils.GetConfigPath(),
UseShellExecute = false, UseShellExecute = false,
RedirectStandardOutput = node.displayLog, RedirectStandardOutput = node.displayLog,
@@ -224,7 +224,8 @@ namespace v2rayN.Handler
try try
{ {
string fileName = CoreFindexe(new List<string> { "xray", "wxray", "wv2ray", "v2ray" }); var coreInfo = LazyConfig.Instance.GetCoreInfo(ECoreType.Xray);
string fileName = CoreFindexe(coreInfo);
if (fileName == "") return -1; if (fileName == "") return -1;
Process p = new Process Process p = new Process
@@ -305,9 +306,9 @@ namespace v2rayN.Handler
} }
var coreType = LazyConfig.Instance.GetCoreType(node, node.configType); var coreType = LazyConfig.Instance.GetCoreType(node, node.configType);
coreInfo = LazyConfig.Instance.GetCoreInfo(coreType); _coreInfo = LazyConfig.Instance.GetCoreInfo(coreType);
if (coreInfo == null) if (_coreInfo == null)
{ {
return -1; return -1;
} }

View File

@@ -45,6 +45,8 @@
get; set; get; set;
} }
public bool autoRun { get; set; }
/// <summary> /// <summary>
/// 启用实时网速和流量统计 /// 启用实时网速和流量统计
/// </summary> /// </summary>
@@ -124,9 +126,9 @@
} }
public string systemProxyAdvancedProtocol { get; set; } public string systemProxyAdvancedProtocol { get; set; }
public int autoUpdateInterval { get; set; } = 0; public int autoUpdateInterval { get; set; } = 10;
public int autoUpdateSubInterval { get; set; } = 0; public int autoUpdateSubInterval { get; set; } = 10;
public bool checkPreReleaseUpdate { get; set; } = false; public bool checkPreReleaseUpdate { get; set; } = false;
@@ -135,7 +137,7 @@
get; set; get; set;
} }
public int trayMenuServersLimit { get; set; } public int trayMenuServersLimit { get; set; } = 20;
public bool autoHideStartup { get; set; } public bool autoHideStartup { get; set; }

File diff suppressed because it is too large Load Diff

View File

@@ -597,13 +597,21 @@ namespace v2rayN
{ {
try try
{ {
string exePath = GetExePath(); var autoRunName = $"{Global.AutoRunName}_{GetMD5(StartupPath())}";
RegWriteValue(Global.AutoRunRegPath, Global.AutoRunName, run ? $"\"{exePath}\"" : "");
//delete first
RegWriteValue(Global.AutoRunRegPath, autoRunName, "");
if (run)
{
string exePath = $"\"{GetExePath()}\"";
RegWriteValue(Global.AutoRunRegPath, autoRunName, exePath);
}
} }
catch (Exception ex) catch (Exception ex)
{ {
SaveLog(ex.Message, ex); SaveLog(ex.Message, ex);
} }
} }
/// <summary> /// <summary>

View File

@@ -58,6 +58,7 @@ namespace v2rayN.ViewModels
SaveServer(); SaveServer();
}); });
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
} }
private void SaveServer() private void SaveServer()

View File

@@ -46,6 +46,7 @@ namespace v2rayN.ViewModels
SaveServer(); SaveServer();
}); });
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
} }
private void SaveServer() private void SaveServer()

View File

@@ -125,7 +125,7 @@ namespace v2rayN.ViewModels
#endregion #endregion
#region UI #region UI
AutoRun = Utils.IsAutoRun(); AutoRun = _config.autoRun;
EnableStatistics = _config.enableStatistics; EnableStatistics = _config.enableStatistics;
StatisticsFreshRate = _config.statisticsFreshRate; StatisticsFreshRate = _config.statisticsFreshRate;
KeepOlderDedupl = _config.keepOlderDedupl; KeepOlderDedupl = _config.keepOlderDedupl;
@@ -161,6 +161,8 @@ namespace v2rayN.ViewModels
{ {
SaveSetting(); SaveSetting();
}); });
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
} }
private void InitCoreType() private void InitCoreType()
@@ -280,6 +282,7 @@ namespace v2rayN.ViewModels
//UI //UI
Utils.SetAutoRun(AutoRun); Utils.SetAutoRun(AutoRun);
_config.autoRun = AutoRun;
_config.enableStatistics = EnableStatistics; _config.enableStatistics = EnableStatistics;
_config.statisticsFreshRate = StatisticsFreshRate; _config.statisticsFreshRate = StatisticsFreshRate;
if (_config.statisticsFreshRate > 100 || _config.statisticsFreshRate < 1) if (_config.statisticsFreshRate > 100 || _config.statisticsFreshRate < 1)

View File

@@ -61,6 +61,7 @@ namespace v2rayN.ViewModels
SaveRules(); SaveRules();
}); });
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
} }
private void SaveRules() private void SaveRules()
{ {

View File

@@ -115,6 +115,8 @@ namespace v2rayN.ViewModels
{ {
SaveRouting(); SaveRouting();
}); });
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
} }
public void RefreshRulesItems() public void RefreshRulesItems()

View File

@@ -113,6 +113,8 @@ namespace v2rayN.ViewModels
{ {
SaveRouting(); SaveRouting();
}); });
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
} }
#region locked #region locked

View File

@@ -41,6 +41,8 @@ namespace v2rayN.ViewModels
{ {
SaveSub(); SaveSub();
}); });
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
} }
private void SaveSub() private void SaveSub()
{ {

View File

@@ -5,6 +5,7 @@ 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.Forms; using System.Windows.Forms;
using v2rayN.Base; using v2rayN.Base;
using v2rayN.Handler; using v2rayN.Handler;
@@ -30,7 +31,7 @@ namespace v2rayN.ViewModels
public ReactiveCommand<Unit, Unit> SubShareCmd { get; } public ReactiveCommand<Unit, Unit> SubShareCmd { get; }
public bool IsModified { get; set; } public bool IsModified { get; set; }
public SubSettingViewModel() public SubSettingViewModel(Window view)
{ {
_config = LazyConfig.Instance.GetConfig(); _config = LazyConfig.Instance.GetConfig();
_noticeHandler = Locator.Current.GetService<NoticeHandler>(); _noticeHandler = Locator.Current.GetService<NoticeHandler>();
@@ -59,6 +60,8 @@ namespace v2rayN.ViewModels
{ {
SubShare(); SubShare();
}, canEditRemove); }, canEditRemove);
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
} }
public void RefreshSubItems() public void RefreshSubItems()

View File

@@ -49,6 +49,8 @@ namespace v2rayN.Views
txtGlobalHotkey4.KeyDown += TxtGlobalHotkey_KeyDown; txtGlobalHotkey4.KeyDown += TxtGlobalHotkey_KeyDown;
BindingData(-1); BindingData(-1);
Utils.SetDarkBorder(this, _config.uiItem.colorModeDark);
} }

View File

@@ -11,7 +11,7 @@ namespace v2rayN.Views
{ {
InitializeComponent(); InitializeComponent();
ViewModel = new SubSettingViewModel(); ViewModel = new SubSettingViewModel(this);
lstSubscription.MouseDoubleClick += LstSubscription_MouseDoubleClick; lstSubscription.MouseDoubleClick += LstSubscription_MouseDoubleClick;
this.WhenActivated(disposables => this.WhenActivated(disposables =>

View File

@@ -9,7 +9,7 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<ApplicationIcon>v2rayN.ico</ApplicationIcon> <ApplicationIcon>v2rayN.ico</ApplicationIcon>
<Copyright>Copyright © 2017-2023 (GPLv3)</Copyright> <Copyright>Copyright © 2017-2023 (GPLv3)</Copyright>
<FileVersion>6.0</FileVersion> <FileVersion>6.1</FileVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@@ -96,6 +96,9 @@
<EmbeddedResource Update="Resx\ResUI.zh-Hans.resx"> <EmbeddedResource Update="Resx\ResUI.zh-Hans.resx">
<Generator>PublicResXFileCodeGenerator</Generator> <Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Resx\ResUI.fa-Ir.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource>
</ItemGroup> </ItemGroup>
</Project> </Project>