Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b4bf455b4 | ||
|
|
ddd3739ed9 | ||
|
|
1c95c5861c | ||
|
|
fd6fa1c622 | ||
|
|
6809a77a41 | ||
|
|
7a913ee38f | ||
|
|
cca330829a | ||
|
|
e2f5c76d91 | ||
|
|
26bf7c149c |
@@ -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" };
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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; }
|
||||||
|
|
||||||
|
|||||||
1063
v2rayN/v2rayN/Resx/ResUI.fa-Ir.resx
Normal file
1063
v2rayN/v2rayN/Resx/ResUI.fa-Ir.resx
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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>
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ namespace v2rayN.ViewModels
|
|||||||
SaveServer();
|
SaveServer();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveServer()
|
private void SaveServer()
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ namespace v2rayN.ViewModels
|
|||||||
SaveServer();
|
SaveServer();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveServer()
|
private void SaveServer()
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ namespace v2rayN.ViewModels
|
|||||||
SaveRules();
|
SaveRules();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
|
||||||
}
|
}
|
||||||
private void SaveRules()
|
private void SaveRules()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -115,6 +115,8 @@ namespace v2rayN.ViewModels
|
|||||||
{
|
{
|
||||||
SaveRouting();
|
SaveRouting();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RefreshRulesItems()
|
public void RefreshRulesItems()
|
||||||
|
|||||||
@@ -113,6 +113,8 @@ namespace v2rayN.ViewModels
|
|||||||
{
|
{
|
||||||
SaveRouting();
|
SaveRouting();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region locked
|
#region locked
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ namespace v2rayN.ViewModels
|
|||||||
{
|
{
|
||||||
SaveSub();
|
SaveSub();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Utils.SetDarkBorder(view, _config.uiItem.colorModeDark);
|
||||||
}
|
}
|
||||||
private void SaveSub()
|
private void SaveSub()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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 =>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user