Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab08660c20 | ||
|
|
daf271ee0d | ||
|
|
f949c9f4f0 | ||
|
|
a609eb4bcf | ||
|
|
fd9b6d0ff0 | ||
|
|
cb074528f4 | ||
|
|
5cadf59e10 | ||
|
|
86229bf73b | ||
|
|
cf04c64fee | ||
|
|
f8517a316b | ||
|
|
8bcbd34c27 | ||
|
|
3e35882fee | ||
|
|
cf204fac39 | ||
|
|
dfc22258dd | ||
|
|
b7ac195bfc | ||
|
|
45c74cfe59 | ||
|
|
fe15fde594 | ||
|
|
ec312055be | ||
|
|
b08a0212ff | ||
|
|
3f1688f8b7 | ||
|
|
912f682359 | ||
|
|
1a84090cc7 |
4
.github/issue_template.md
vendored
4
.github/issue_template.md
vendored
@@ -1,4 +1,4 @@
|
|||||||
在提出问题前请先自行排除服务器端问题,同时也请通过搜索确认是否有人提出过相同问题。
|
在提出问题前请先自行排除服务器端问题和升级到最新客户端,同时也请通过搜索确认是否有人提出过相同问题。
|
||||||
|
|
||||||
### 预期行为
|
### 预期行为
|
||||||
描述你认为应该发生什么
|
描述你认为应该发生什么
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
```
|
```
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 环境信息
|
### 环境信息(客户端请升级至最新正式版)
|
||||||
|
|
||||||
### 额外信息(可选)
|
### 额外信息(可选)
|
||||||
|
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -13,3 +13,7 @@
|
|||||||
.vs/ProjectSettings.json
|
.vs/ProjectSettings.json
|
||||||
.vs/slnx.sqlite
|
.vs/slnx.sqlite
|
||||||
.vs/VSWorkspaceState.json
|
.vs/VSWorkspaceState.json
|
||||||
|
/v2rayN/v2rayUpgrade/bin/Debug
|
||||||
|
/v2rayN/v2rayUpgrade/obj/Debug
|
||||||
|
/v2rayN/v2rayUpgrade/bin/Release
|
||||||
|
/v2rayN/v2rayUpgrade/obj/Release
|
||||||
@@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.28010.2050
|
|||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "v2rayN", "v2rayN\v2rayN.csproj", "{0A9785E6-D256-4B73-9757-4EF59955FD1E}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "v2rayN", "v2rayN\v2rayN.csproj", "{0A9785E6-D256-4B73-9757-4EF59955FD1E}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "v2rayUpgrade", "v2rayUpgrade\v2rayUpgrade.csproj", "{F82BE52A-155C-492C-9E0A-1E917EC62C78}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -20,6 +22,14 @@ Global
|
|||||||
{0A9785E6-D256-4B73-9757-4EF59955FD1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{0A9785E6-D256-4B73-9757-4EF59955FD1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{0A9785E6-D256-4B73-9757-4EF59955FD1E}.Release|Any CPU.Build.0 = Release|Any CPU
|
{0A9785E6-D256-4B73-9757-4EF59955FD1E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{0A9785E6-D256-4B73-9757-4EF59955FD1E}.Release|x86.ActiveCfg = Release|Any CPU
|
{0A9785E6-D256-4B73-9757-4EF59955FD1E}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{F82BE52A-155C-492C-9E0A-1E917EC62C78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{F82BE52A-155C-492C-9E0A-1E917EC62C78}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{F82BE52A-155C-492C-9E0A-1E917EC62C78}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{F82BE52A-155C-492C-9E0A-1E917EC62C78}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{F82BE52A-155C-492C-9E0A-1E917EC62C78}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{F82BE52A-155C-492C-9E0A-1E917EC62C78}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{F82BE52A-155C-492C-9E0A-1E917EC62C78}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{F82BE52A-155C-492C-9E0A-1E917EC62C78}.Release|x86.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
31
v2rayN/v2rayN/Forms/MainForm.Designer.cs
generated
31
v2rayN/v2rayN/Forms/MainForm.Designer.cs
generated
@@ -60,12 +60,12 @@
|
|||||||
this.menuExport2ServerConfig = new System.Windows.Forms.ToolStripMenuItem();
|
this.menuExport2ServerConfig = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.menuExport2ShareUrl = new System.Windows.Forms.ToolStripMenuItem();
|
this.menuExport2ShareUrl = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.menuExport2SubContent = new System.Windows.Forms.ToolStripMenuItem();
|
this.menuExport2SubContent = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.qrCodeControl = new v2rayN.Forms.QRCodeControl();
|
|
||||||
this.tsbServer = new System.Windows.Forms.ToolStripDropDownButton();
|
this.tsbServer = new System.Windows.Forms.ToolStripDropDownButton();
|
||||||
|
this.qrCodeControl = new v2rayN.Forms.QRCodeControl();
|
||||||
this.notifyMain = new System.Windows.Forms.NotifyIcon(this.components);
|
this.notifyMain = new System.Windows.Forms.NotifyIcon(this.components);
|
||||||
this.cmsMain = new System.Windows.Forms.ContextMenuStrip(this.components);
|
this.cmsMain = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||||
this.menuSysAgentEnabled = new System.Windows.Forms.ToolStripMenuItem();
|
|
||||||
this.menuSysAgentMode = new System.Windows.Forms.ToolStripMenuItem();
|
this.menuSysAgentMode = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.menuNotEnabledHttp = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.menuGlobal = new System.Windows.Forms.ToolStripMenuItem();
|
this.menuGlobal = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.menuGlobalPAC = new System.Windows.Forms.ToolStripMenuItem();
|
this.menuGlobalPAC = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.menuKeep = new System.Windows.Forms.ToolStripMenuItem();
|
this.menuKeep = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
@@ -159,6 +159,7 @@
|
|||||||
this.lvServers.UseCompatibleStateImageBehavior = false;
|
this.lvServers.UseCompatibleStateImageBehavior = false;
|
||||||
this.lvServers.View = System.Windows.Forms.View.Details;
|
this.lvServers.View = System.Windows.Forms.View.Details;
|
||||||
this.lvServers.SelectedIndexChanged += new System.EventHandler(this.lvServers_SelectedIndexChanged);
|
this.lvServers.SelectedIndexChanged += new System.EventHandler(this.lvServers_SelectedIndexChanged);
|
||||||
|
this.lvServers.Click += new System.EventHandler(this.lvServers_Click);
|
||||||
this.lvServers.DoubleClick += new System.EventHandler(this.lvServers_DoubleClick);
|
this.lvServers.DoubleClick += new System.EventHandler(this.lvServers_DoubleClick);
|
||||||
this.lvServers.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvServers_KeyDown);
|
this.lvServers.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvServers_KeyDown);
|
||||||
//
|
//
|
||||||
@@ -355,11 +356,6 @@
|
|||||||
resources.ApplyResources(this.menuExport2SubContent, "menuExport2SubContent");
|
resources.ApplyResources(this.menuExport2SubContent, "menuExport2SubContent");
|
||||||
this.menuExport2SubContent.Click += new System.EventHandler(this.menuExport2SubContent_Click);
|
this.menuExport2SubContent.Click += new System.EventHandler(this.menuExport2SubContent_Click);
|
||||||
//
|
//
|
||||||
// qrCodeControl
|
|
||||||
//
|
|
||||||
resources.ApplyResources(this.qrCodeControl, "qrCodeControl");
|
|
||||||
this.qrCodeControl.Name = "qrCodeControl";
|
|
||||||
//
|
|
||||||
// tsbServer
|
// tsbServer
|
||||||
//
|
//
|
||||||
this.tsbServer.DropDown = this.cmsLv;
|
this.tsbServer.DropDown = this.cmsLv;
|
||||||
@@ -367,6 +363,11 @@
|
|||||||
resources.ApplyResources(this.tsbServer, "tsbServer");
|
resources.ApplyResources(this.tsbServer, "tsbServer");
|
||||||
this.tsbServer.Name = "tsbServer";
|
this.tsbServer.Name = "tsbServer";
|
||||||
//
|
//
|
||||||
|
// qrCodeControl
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.qrCodeControl, "qrCodeControl");
|
||||||
|
this.qrCodeControl.Name = "qrCodeControl";
|
||||||
|
//
|
||||||
// notifyMain
|
// notifyMain
|
||||||
//
|
//
|
||||||
this.notifyMain.ContextMenuStrip = this.cmsMain;
|
this.notifyMain.ContextMenuStrip = this.cmsMain;
|
||||||
@@ -378,7 +379,6 @@
|
|||||||
this.cmsMain.ImageScalingSize = new System.Drawing.Size(20, 20);
|
this.cmsMain.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||||
resources.ApplyResources(this.cmsMain, "cmsMain");
|
resources.ApplyResources(this.cmsMain, "cmsMain");
|
||||||
this.cmsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.cmsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.menuSysAgentEnabled,
|
|
||||||
this.menuSysAgentMode,
|
this.menuSysAgentMode,
|
||||||
this.menuServers,
|
this.menuServers,
|
||||||
this.menuAddServers2,
|
this.menuAddServers2,
|
||||||
@@ -391,15 +391,10 @@
|
|||||||
this.cmsMain.ShowCheckMargin = true;
|
this.cmsMain.ShowCheckMargin = true;
|
||||||
this.cmsMain.ShowImageMargin = false;
|
this.cmsMain.ShowImageMargin = false;
|
||||||
//
|
//
|
||||||
// menuSysAgentEnabled
|
|
||||||
//
|
|
||||||
this.menuSysAgentEnabled.Name = "menuSysAgentEnabled";
|
|
||||||
resources.ApplyResources(this.menuSysAgentEnabled, "menuSysAgentEnabled");
|
|
||||||
this.menuSysAgentEnabled.Click += new System.EventHandler(this.menuSysAgentEnabled_Click);
|
|
||||||
//
|
|
||||||
// menuSysAgentMode
|
// menuSysAgentMode
|
||||||
//
|
//
|
||||||
this.menuSysAgentMode.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.menuSysAgentMode.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.menuNotEnabledHttp,
|
||||||
this.menuGlobal,
|
this.menuGlobal,
|
||||||
this.menuGlobalPAC,
|
this.menuGlobalPAC,
|
||||||
this.menuKeep,
|
this.menuKeep,
|
||||||
@@ -407,6 +402,12 @@
|
|||||||
this.menuSysAgentMode.Name = "menuSysAgentMode";
|
this.menuSysAgentMode.Name = "menuSysAgentMode";
|
||||||
resources.ApplyResources(this.menuSysAgentMode, "menuSysAgentMode");
|
resources.ApplyResources(this.menuSysAgentMode, "menuSysAgentMode");
|
||||||
//
|
//
|
||||||
|
// menuNotEnabledHttp
|
||||||
|
//
|
||||||
|
this.menuNotEnabledHttp.Name = "menuNotEnabledHttp";
|
||||||
|
resources.ApplyResources(this.menuNotEnabledHttp, "menuNotEnabledHttp");
|
||||||
|
this.menuNotEnabledHttp.Click += new System.EventHandler(this.menuNotEnabledHttp_Click);
|
||||||
|
//
|
||||||
// menuGlobal
|
// menuGlobal
|
||||||
//
|
//
|
||||||
this.menuGlobal.Name = "menuGlobal";
|
this.menuGlobal.Name = "menuGlobal";
|
||||||
@@ -818,7 +819,6 @@
|
|||||||
private System.Windows.Forms.ToolStripMenuItem menuGlobal;
|
private System.Windows.Forms.ToolStripMenuItem menuGlobal;
|
||||||
private System.Windows.Forms.ToolStripMenuItem menuGlobalPAC;
|
private System.Windows.Forms.ToolStripMenuItem menuGlobalPAC;
|
||||||
private System.Windows.Forms.ToolStripMenuItem menuKeep;
|
private System.Windows.Forms.ToolStripMenuItem menuKeep;
|
||||||
private System.Windows.Forms.ToolStripMenuItem menuSysAgentEnabled;
|
|
||||||
private System.Windows.Forms.ToolStripMenuItem menuCopyPACUrl;
|
private System.Windows.Forms.ToolStripMenuItem menuCopyPACUrl;
|
||||||
private System.Windows.Forms.ToolStripMenuItem menuAddCustomServer;
|
private System.Windows.Forms.ToolStripMenuItem menuAddCustomServer;
|
||||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||||
@@ -868,6 +868,7 @@
|
|||||||
private System.Windows.Forms.ToolStripMenuItem menuRemoveDuplicateServer;
|
private System.Windows.Forms.ToolStripMenuItem menuRemoveDuplicateServer;
|
||||||
private System.Windows.Forms.ToolStripMenuItem menuTcpingServer;
|
private System.Windows.Forms.ToolStripMenuItem menuTcpingServer;
|
||||||
private System.Windows.Forms.ToolStripMenuItem menuRealPingServer;
|
private System.Windows.Forms.ToolStripMenuItem menuRealPingServer;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem menuNotEnabledHttp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,14 +9,16 @@ using v2rayN.Handler;
|
|||||||
using v2rayN.HttpProxyHandler;
|
using v2rayN.HttpProxyHandler;
|
||||||
using v2rayN.Mode;
|
using v2rayN.Mode;
|
||||||
using v2rayN.Base;
|
using v2rayN.Base;
|
||||||
|
using v2rayN.Tool;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using v2rayN.Properties;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace v2rayN.Forms
|
namespace v2rayN.Forms
|
||||||
{
|
{
|
||||||
public partial class MainForm : BaseForm
|
public partial class MainForm : BaseForm
|
||||||
{
|
{
|
||||||
private V2rayHandler v2rayHandler;
|
private V2rayHandler v2rayHandler;
|
||||||
private PACListHandle pacListHandle;
|
|
||||||
private DownloadHandle downloadHandle;
|
|
||||||
private List<int> lvSelecteds = new List<int>();
|
private List<int> lvSelecteds = new List<int>();
|
||||||
private StatisticsHandler statistics = null;
|
private StatisticsHandler statistics = null;
|
||||||
|
|
||||||
@@ -29,13 +31,12 @@ namespace v2rayN.Forms
|
|||||||
this.WindowState = FormWindowState.Minimized;
|
this.WindowState = FormWindowState.Minimized;
|
||||||
HideForm();
|
HideForm();
|
||||||
this.Text = Utils.GetVersion();
|
this.Text = Utils.GetVersion();
|
||||||
|
Global.processJob = new Job();
|
||||||
|
|
||||||
Application.ApplicationExit += (sender, args) =>
|
Application.ApplicationExit += (sender, args) =>
|
||||||
{
|
{
|
||||||
Utils.ClearTempPath();
|
|
||||||
|
|
||||||
v2rayHandler.V2rayStop();
|
v2rayHandler.V2rayStop();
|
||||||
HttpProxyHandle.Update(config, true);
|
|
||||||
HttpProxyHandle.CloseHttpAgent(config);
|
HttpProxyHandle.CloseHttpAgent(config);
|
||||||
PACServerHandle.Stop();
|
PACServerHandle.Stop();
|
||||||
|
|
||||||
@@ -197,7 +198,7 @@ namespace v2rayN.Forms
|
|||||||
ListViewItem lvItem = null;
|
ListViewItem lvItem = null;
|
||||||
if (statistics != null && statistics.Enable)
|
if (statistics != null && statistics.Enable)
|
||||||
{
|
{
|
||||||
var index = statistics.Statistic.FindIndex(item_ => item_.address == item.address);
|
var index = statistics.Statistic.FindIndex(item_ => item_.itemId == item.getItemId());
|
||||||
if (index != -1)
|
if (index != -1)
|
||||||
{
|
{
|
||||||
totalUp = Utils.HumanFy(statistics.Statistic[index].totalUp);
|
totalUp = Utils.HumanFy(statistics.Statistic[index].totalUp);
|
||||||
@@ -268,6 +269,7 @@ namespace v2rayN.Forms
|
|||||||
{
|
{
|
||||||
menuServers.DropDownItems.Clear();
|
menuServers.DropDownItems.Clear();
|
||||||
|
|
||||||
|
List<ToolStripMenuItem> lst = new List<ToolStripMenuItem>();
|
||||||
for (int k = 0; k < config.vmess.Count; k++)
|
for (int k = 0; k < config.vmess.Count; k++)
|
||||||
{
|
{
|
||||||
VmessItem item = config.vmess[k];
|
VmessItem item = config.vmess[k];
|
||||||
@@ -280,8 +282,9 @@ namespace v2rayN.Forms
|
|||||||
ts.Checked = true;
|
ts.Checked = true;
|
||||||
}
|
}
|
||||||
ts.Click += new EventHandler(ts_Click);
|
ts.Click += new EventHandler(ts_Click);
|
||||||
menuServers.DropDownItems.Add(ts);
|
lst.Add(ts);
|
||||||
}
|
}
|
||||||
|
menuServers.DropDownItems.AddRange(lst.ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ts_Click(object sender, EventArgs e)
|
private void ts_Click(object sender, EventArgs e)
|
||||||
@@ -314,7 +317,7 @@ namespace v2rayN.Forms
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
qrCodeControl.showQRCode(index, config);
|
//qrCodeControl.showQRCode(index, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DisplayToolStatus()
|
private void DisplayToolStatus()
|
||||||
@@ -325,7 +328,7 @@ namespace v2rayN.Forms
|
|||||||
|
|
||||||
toolSslSocksPort.Text = $"{Global.Loopback}:{config.inbound[0].localPort}";
|
toolSslSocksPort.Text = $"{Global.Loopback}:{config.inbound[0].localPort}";
|
||||||
|
|
||||||
if (config.sysAgentEnabled)
|
if (config.listenerType != 0)
|
||||||
{
|
{
|
||||||
toolSslHttpPort.Text = $"{Global.Loopback}:{Global.httpPort}";
|
toolSslHttpPort.Text = $"{Global.Loopback}:{Global.httpPort}";
|
||||||
if (config.listenerType == 2 || config.listenerType == 4)
|
if (config.listenerType == 2 || config.listenerType == 4)
|
||||||
@@ -340,8 +343,8 @@ namespace v2rayN.Forms
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
notifyMain.Icon = GetNotifyIcon();
|
|
||||||
|
|
||||||
|
notifyMain.Icon = MainFormHandler.Instance.GetNotifyIcon(config, this.Icon);
|
||||||
}
|
}
|
||||||
private void ssMain_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
|
private void ssMain_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
|
||||||
{
|
{
|
||||||
@@ -351,45 +354,6 @@ namespace v2rayN.Forms
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Icon GetNotifyIcon()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var color = ColorTranslator.FromHtml("#3399CC");
|
|
||||||
var index = config.sysAgentEnabled ? config.listenerType : 0;
|
|
||||||
if (index > 0)
|
|
||||||
{
|
|
||||||
color = (new Color[] { Color.Red, Color.Purple, Color.DarkGreen, Color.Orange })[index - 1];
|
|
||||||
//color = ColorTranslator.FromHtml(new string[] { "#CC0066", "#CC6600", "#99CC99", "#666699" }[index - 1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
var width = 128;
|
|
||||||
var height = 128;
|
|
||||||
|
|
||||||
var bitmap = new Bitmap(width, height);
|
|
||||||
var graphics = Graphics.FromImage(bitmap);
|
|
||||||
var drawBrush = new SolidBrush(color);
|
|
||||||
|
|
||||||
graphics.FillEllipse(drawBrush, new Rectangle(0, 0, width, height));
|
|
||||||
var zoom = 16;
|
|
||||||
graphics.DrawImage(new Bitmap(Properties.Resources.notify, width - zoom, width - zoom), zoom / 2, zoom / 2);
|
|
||||||
|
|
||||||
bitmap.Save(Utils.GetPath("temp_icon.ico"), System.Drawing.Imaging.ImageFormat.Icon);
|
|
||||||
|
|
||||||
Icon createdIcon = Icon.FromHandle(bitmap.GetHicon());
|
|
||||||
|
|
||||||
drawBrush.Dispose();
|
|
||||||
graphics.Dispose();
|
|
||||||
bitmap.Dispose();
|
|
||||||
|
|
||||||
return createdIcon;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Utils.SaveLog(ex.Message, ex);
|
|
||||||
return this.Icon;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region v2ray 操作
|
#region v2ray 操作
|
||||||
@@ -406,9 +370,9 @@ namespace v2rayN.Forms
|
|||||||
v2rayHandler.LoadV2ray(config);
|
v2rayHandler.LoadV2ray(config);
|
||||||
Global.reloadV2ray = false;
|
Global.reloadV2ray = false;
|
||||||
ConfigHandler.SaveConfig(ref config, false);
|
ConfigHandler.SaveConfig(ref config, false);
|
||||||
|
statistics?.SaveToFile();
|
||||||
|
|
||||||
ChangeSysAgent(config.sysAgentEnabled);
|
ChangePACButtonStatus(config.listenerType);
|
||||||
DisplayToolStatus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -417,8 +381,9 @@ namespace v2rayN.Forms
|
|||||||
private void CloseV2ray()
|
private void CloseV2ray()
|
||||||
{
|
{
|
||||||
ConfigHandler.SaveConfig(ref config, false);
|
ConfigHandler.SaveConfig(ref config, false);
|
||||||
|
statistics?.SaveToFile();
|
||||||
|
|
||||||
ChangeSysAgent(false);
|
ChangePACButtonStatus(0);
|
||||||
|
|
||||||
v2rayHandler.V2rayStop();
|
v2rayHandler.V2rayStop();
|
||||||
}
|
}
|
||||||
@@ -427,6 +392,26 @@ namespace v2rayN.Forms
|
|||||||
|
|
||||||
#region 功能按钮
|
#region 功能按钮
|
||||||
|
|
||||||
|
private void lvServers_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
int index = -1;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (lvServers.SelectedIndices.Count > 0)
|
||||||
|
{
|
||||||
|
index = lvServers.SelectedIndices[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
qrCodeControl.showQRCode(index, config);
|
||||||
|
}
|
||||||
|
|
||||||
private void lvServers_DoubleClick(object sender, EventArgs e)
|
private void lvServers_DoubleClick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
int index = GetLvSelectedIndex();
|
int index = GetLvSelectedIndex();
|
||||||
@@ -635,79 +620,13 @@ namespace v2rayN.Forms
|
|||||||
private void menuExport2ClientConfig_Click(object sender, EventArgs e)
|
private void menuExport2ClientConfig_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
int index = GetLvSelectedIndex();
|
int index = GetLvSelectedIndex();
|
||||||
if (index < 0)
|
MainFormHandler.Instance.Export2ClientConfig(index, config);
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (config.vmess[index].configType != (int)EConfigType.Vmess)
|
|
||||||
{
|
|
||||||
UI.Show(UIRes.I18N("NonVmessService"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SaveFileDialog fileDialog = new SaveFileDialog();
|
|
||||||
fileDialog.Filter = "Config|*.json";
|
|
||||||
fileDialog.FilterIndex = 2;
|
|
||||||
fileDialog.RestoreDirectory = true;
|
|
||||||
if (fileDialog.ShowDialog() != DialogResult.OK)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
string fileName = fileDialog.FileName;
|
|
||||||
if (Utils.IsNullOrEmpty(fileName))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Config configCopy = Utils.DeepCopy<Config>(config);
|
|
||||||
configCopy.index = index;
|
|
||||||
string msg;
|
|
||||||
if (V2rayConfigHandler.Export2ClientConfig(configCopy, fileName, out msg) != 0)
|
|
||||||
{
|
|
||||||
UI.Show(msg);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
UI.Show(string.Format(UIRes.I18N("SaveClientConfigurationIn"), fileName));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void menuExport2ServerConfig_Click(object sender, EventArgs e)
|
private void menuExport2ServerConfig_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
int index = GetLvSelectedIndex();
|
int index = GetLvSelectedIndex();
|
||||||
if (index < 0)
|
MainFormHandler.Instance.Export2ServerConfig(index, config);
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (config.vmess[index].configType != (int)EConfigType.Vmess)
|
|
||||||
{
|
|
||||||
UI.Show(UIRes.I18N("NonVmessService"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SaveFileDialog fileDialog = new SaveFileDialog();
|
|
||||||
fileDialog.Filter = "Config|*.json";
|
|
||||||
fileDialog.FilterIndex = 2;
|
|
||||||
fileDialog.RestoreDirectory = true;
|
|
||||||
if (fileDialog.ShowDialog() != DialogResult.OK)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
string fileName = fileDialog.FileName;
|
|
||||||
if (Utils.IsNullOrEmpty(fileName))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Config configCopy = Utils.DeepCopy<Config>(config);
|
|
||||||
configCopy.index = index;
|
|
||||||
string msg;
|
|
||||||
if (V2rayConfigHandler.Export2ServerConfig(configCopy, fileName, out msg) != 0)
|
|
||||||
{
|
|
||||||
UI.Show(msg);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
UI.Show(string.Format(UIRes.I18N("SaveServerConfigurationIn"), fileName));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void menuExport2ShareUrl_Click(object sender, EventArgs e)
|
private void menuExport2ShareUrl_Click(object sender, EventArgs e)
|
||||||
@@ -962,14 +881,14 @@ namespace v2rayN.Forms
|
|||||||
/// <param name="msg"></param>
|
/// <param name="msg"></param>
|
||||||
private void ShowMsg(string msg)
|
private void ShowMsg(string msg)
|
||||||
{
|
{
|
||||||
if (txtMsgBox.Lines.Length > 500)
|
if (txtMsgBox.Lines.Length > 999)
|
||||||
{
|
{
|
||||||
ClearMsg();
|
ClearMsg();
|
||||||
}
|
}
|
||||||
this.txtMsgBox.AppendText(msg);
|
this.txtMsgBox.AppendText(msg);
|
||||||
if (!msg.EndsWith("\r\n"))
|
if (!msg.EndsWith(Environment.NewLine))
|
||||||
{
|
{
|
||||||
this.txtMsgBox.AppendText("\r\n");
|
this.txtMsgBox.AppendText(Environment.NewLine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1020,6 +939,7 @@ namespace v2rayN.Forms
|
|||||||
this.Activate();
|
this.Activate();
|
||||||
//this.notifyIcon1.Visible = false;
|
//this.notifyIcon1.Visible = false;
|
||||||
this.ShowInTaskbar = true;
|
this.ShowInTaskbar = true;
|
||||||
|
this.txtMsgBox.ScrollToCaret();
|
||||||
|
|
||||||
SetVisibleCore(true);
|
SetVisibleCore(true);
|
||||||
}
|
}
|
||||||
@@ -1063,51 +983,34 @@ namespace v2rayN.Forms
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateStatisticsHandler(ulong totalUp, ulong totalDown, ulong up, ulong down, List<Mode.ServerStatistics> statistics)
|
private void UpdateStatisticsHandler(ulong up, ulong down, List<ServerStatItem> statistics)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
up /= (ulong)(config.statisticsFreshRate / 1000f);
|
up /= (ulong)(config.statisticsFreshRate / 1000f);
|
||||||
down /= (ulong)(config.statisticsFreshRate / 1000f);
|
down /= (ulong)(config.statisticsFreshRate / 1000f);
|
||||||
toolSslServerSpeed.Text = string.Format(
|
toolSslServerSpeed.Text = string.Format("{0}/s↑ | {1}/s↓", Utils.HumanFy(up), Utils.HumanFy(down));
|
||||||
"{0}/s↑ | {1}/s↓",
|
|
||||||
Utils.HumanFy(up),
|
|
||||||
Utils.HumanFy(down)
|
|
||||||
);
|
|
||||||
|
|
||||||
List<string[]> datas = new List<string[]>();
|
List<string[]> datas = new List<string[]>();
|
||||||
for (int i = 0; i < config.vmess.Count; i++)
|
for (int i = 0; i < config.vmess.Count; i++)
|
||||||
{
|
{
|
||||||
string totalUp_ = string.Empty,
|
var index = statistics.FindIndex(item_ => item_.itemId == config.vmess[i].getItemId());
|
||||||
totalDown_ = string.Empty,
|
|
||||||
todayUp_ = string.Empty,
|
|
||||||
todayDown_ = string.Empty;
|
|
||||||
var index = statistics.FindIndex(item_ => Utils.IsIdenticalServer(item_, new ServerStatistics(config.vmess[i].remarks, config.vmess[i].address, config.vmess[i].port, config.vmess[i].path, config.vmess[i].requestHost, 0, 0, 0, 0)));
|
|
||||||
if (index != -1)
|
if (index != -1)
|
||||||
{
|
{
|
||||||
totalUp_ = Utils.HumanFy(statistics[index].totalUp);
|
lvServers.Invoke((MethodInvoker)delegate
|
||||||
totalDown_ = Utils.HumanFy(statistics[index].totalDown);
|
{
|
||||||
todayUp_ = Utils.HumanFy(statistics[index].todayUp);
|
lvServers.SuspendLayout();
|
||||||
todayDown_ = Utils.HumanFy(statistics[index].todayDown);
|
|
||||||
}
|
|
||||||
|
|
||||||
datas.Add(new string[] { totalUp_, totalDown_, todayUp_, todayDown_ });
|
var indexStart = 9;
|
||||||
|
lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].totalUp);
|
||||||
|
lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].totalDown);
|
||||||
|
lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].todayUp);
|
||||||
|
lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].todayDown);
|
||||||
|
|
||||||
|
lvServers.ResumeLayout();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lvServers.Invoke((MethodInvoker)delegate
|
|
||||||
{
|
|
||||||
lvServers.SuspendLayout();
|
|
||||||
for (int i = 0; i < datas.Count; i++)
|
|
||||||
{
|
|
||||||
var indexStart = 9;
|
|
||||||
lvServers.Items[i].SubItems[indexStart++].Text = datas[i][0];
|
|
||||||
lvServers.Items[i].SubItems[indexStart++].Text = datas[i][1];
|
|
||||||
lvServers.Items[i].SubItems[indexStart++].Text = datas[i][2];
|
|
||||||
lvServers.Items[i].SubItems[indexStart++].Text = datas[i][3];
|
|
||||||
}
|
|
||||||
lvServers.ResumeLayout();
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -1171,97 +1074,58 @@ namespace v2rayN.Forms
|
|||||||
Utils.SetClipboardData(HttpProxyHandle.GetPacUrl());
|
Utils.SetClipboardData(HttpProxyHandle.GetPacUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void menuSysAgentEnabled_Click(object sender, EventArgs e)
|
private void menuNotEnabledHttp_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
bool isChecked = !config.sysAgentEnabled;
|
SetListenerType(0);
|
||||||
config.sysAgentEnabled = isChecked;
|
|
||||||
ChangeSysAgent(isChecked);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void menuGlobal_Click(object sender, EventArgs e)
|
private void menuGlobal_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
config.listenerType = 1;
|
SetListenerType(1);
|
||||||
ChangePACButtonStatus(config.listenerType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void menuGlobalPAC_Click(object sender, EventArgs e)
|
private void menuGlobalPAC_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
config.listenerType = 2;
|
SetListenerType(2);
|
||||||
ChangePACButtonStatus(config.listenerType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void menuKeep_Click(object sender, EventArgs e)
|
private void menuKeep_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
config.listenerType = 3;
|
SetListenerType(3);
|
||||||
ChangePACButtonStatus(config.listenerType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void menuKeepPAC_Click(object sender, EventArgs e)
|
private void menuKeepPAC_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
config.listenerType = 4;
|
SetListenerType(4);
|
||||||
ChangePACButtonStatus(config.listenerType);
|
}
|
||||||
|
|
||||||
|
private void SetListenerType(int type)
|
||||||
|
{
|
||||||
|
config.listenerType = type;
|
||||||
|
ChangePACButtonStatus(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ChangePACButtonStatus(int type)
|
private void ChangePACButtonStatus(int type)
|
||||||
{
|
{
|
||||||
if (HttpProxyHandle.Update(config, false))
|
if (type != 0)
|
||||||
{
|
{
|
||||||
switch (type)
|
HttpProxyHandle.RestartHttpAgent(config, false);
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
menuGlobal.Checked = true;
|
|
||||||
menuGlobalPAC.Checked = false;
|
|
||||||
menuKeep.Checked = false;
|
|
||||||
menuKeepPAC.Checked = false;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
menuGlobal.Checked = false;
|
|
||||||
menuGlobalPAC.Checked = true;
|
|
||||||
menuKeep.Checked = false;
|
|
||||||
menuKeepPAC.Checked = false;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
menuGlobal.Checked = false;
|
|
||||||
menuGlobalPAC.Checked = false;
|
|
||||||
menuKeep.Checked = true;
|
|
||||||
menuKeepPAC.Checked = false;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
menuGlobal.Checked = false;
|
|
||||||
menuGlobalPAC.Checked = false;
|
|
||||||
menuKeep.Checked = false;
|
|
||||||
menuKeepPAC.Checked = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
HttpProxyHandle.CloseHttpAgent(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int k = 0; k < menuSysAgentMode.DropDownItems.Count; k++)
|
||||||
|
{
|
||||||
|
var item = ((ToolStripMenuItem)menuSysAgentMode.DropDownItems[k]);
|
||||||
|
item.Checked = (type == k);
|
||||||
|
}
|
||||||
|
|
||||||
ConfigHandler.SaveConfig(ref config, false);
|
ConfigHandler.SaveConfig(ref config, false);
|
||||||
DisplayToolStatus();
|
DisplayToolStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 改变系统代理
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="isChecked"></param>
|
|
||||||
private void ChangeSysAgent(bool isChecked)
|
|
||||||
{
|
|
||||||
if (isChecked)
|
|
||||||
{
|
|
||||||
if (HttpProxyHandle.RestartHttpAgent(config, false))
|
|
||||||
{
|
|
||||||
ChangePACButtonStatus(config.listenerType);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
HttpProxyHandle.Update(config, true);
|
|
||||||
HttpProxyHandle.CloseHttpAgent(config);
|
|
||||||
}
|
|
||||||
|
|
||||||
menuSysAgentEnabled.Checked =
|
|
||||||
menuSysAgentMode.Enabled = isChecked;
|
|
||||||
|
|
||||||
DisplayToolStatus();
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
@@ -1269,11 +1133,8 @@ namespace v2rayN.Forms
|
|||||||
|
|
||||||
private void tsbCheckUpdateN_Click(object sender, EventArgs e)
|
private void tsbCheckUpdateN_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
System.Diagnostics.Process.Start(Global.UpdateUrl);
|
//System.Diagnostics.Process.Start(Global.UpdateUrl);
|
||||||
}
|
DownloadHandle downloadHandle = null;
|
||||||
|
|
||||||
private void tsbCheckUpdateCore_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (downloadHandle == null)
|
if (downloadHandle == null)
|
||||||
{
|
{
|
||||||
downloadHandle = new DownloadHandle();
|
downloadHandle = new DownloadHandle();
|
||||||
@@ -1293,7 +1154,73 @@ namespace v2rayN.Forms
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
downloadHandle.DownloadFileAsync(config, url, null);
|
downloadHandle.DownloadFileAsync(config, url, null, -1);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AppendText(false, args.Msg);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
downloadHandle.UpdateCompleted += (sender2, args) =>
|
||||||
|
{
|
||||||
|
if (args.Success)
|
||||||
|
{
|
||||||
|
AppendText(false, UIRes.I18N("MsgDownloadV2rayCoreSuccessfully"));
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var fileName = Utils.GetPath(downloadHandle.DownloadFileName);
|
||||||
|
var process = Process.Start("v2rayUpgrade.exe", fileName);
|
||||||
|
if (process.Id > 0)
|
||||||
|
{
|
||||||
|
menuExit_Click(null, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
AppendText(false, ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AppendText(false, args.Msg);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
downloadHandle.Error += (sender2, args) =>
|
||||||
|
{
|
||||||
|
AppendText(true, args.GetException().Message);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
AppendText(false, UIRes.I18N("MsgStartUpdatingV2rayCore"));
|
||||||
|
downloadHandle.AbsoluteV2rayN(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void tsbCheckUpdateCore_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DownloadHandle downloadHandle = null;
|
||||||
|
if (downloadHandle == null)
|
||||||
|
{
|
||||||
|
downloadHandle = new DownloadHandle();
|
||||||
|
downloadHandle.AbsoluteCompleted += (sender2, args) =>
|
||||||
|
{
|
||||||
|
if (args.Success)
|
||||||
|
{
|
||||||
|
AppendText(false, UIRes.I18N("MsgParsingV2rayCoreSuccessfully"));
|
||||||
|
|
||||||
|
string url = args.Msg;
|
||||||
|
this.Invoke((MethodInvoker)(delegate
|
||||||
|
{
|
||||||
|
|
||||||
|
if (UI.ShowYesNo(string.Format(UIRes.I18N("DownloadYesNo"), url)) == DialogResult.No)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
downloadHandle.DownloadFileAsync(config, url, null, -1);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@@ -1315,15 +1242,8 @@ namespace v2rayN.Forms
|
|||||||
|
|
||||||
string fileName = downloadHandle.DownloadFileName;
|
string fileName = downloadHandle.DownloadFileName;
|
||||||
fileName = Utils.GetPath(fileName);
|
fileName = Utils.GetPath(fileName);
|
||||||
using (ZipArchive archive = ZipFile.OpenRead(fileName))
|
FileManager.ZipExtractToFile(fileName);
|
||||||
{
|
|
||||||
foreach (ZipArchiveEntry entry in archive.Entries)
|
|
||||||
{
|
|
||||||
if (entry.Length == 0)
|
|
||||||
continue;
|
|
||||||
entry.ExtractToFile(Utils.GetPath(entry.Name), true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AppendText(false, UIRes.I18N("MsgUpdateV2rayCoreSuccessfullyMore"));
|
AppendText(false, UIRes.I18N("MsgUpdateV2rayCoreSuccessfullyMore"));
|
||||||
|
|
||||||
Global.reloadV2ray = true;
|
Global.reloadV2ray = true;
|
||||||
@@ -1353,13 +1273,21 @@ namespace v2rayN.Forms
|
|||||||
|
|
||||||
private void tsbCheckUpdatePACList_Click(object sender, EventArgs e)
|
private void tsbCheckUpdatePACList_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
DownloadHandle pacListHandle = null;
|
||||||
if (pacListHandle == null)
|
if (pacListHandle == null)
|
||||||
{
|
{
|
||||||
pacListHandle = new PACListHandle();
|
pacListHandle = new DownloadHandle();
|
||||||
pacListHandle.UpdateCompleted += (sender2, args) =>
|
pacListHandle.UpdateCompleted += (sender2, args) =>
|
||||||
{
|
{
|
||||||
if (args.Success)
|
if (args.Success)
|
||||||
{
|
{
|
||||||
|
var result = args.Msg;
|
||||||
|
if (Utils.IsNullOrEmpty(result))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
pacListHandle.GenPacFile(result);
|
||||||
|
|
||||||
AppendText(false, UIRes.I18N("MsgPACUpdateSuccessfully"));
|
AppendText(false, UIRes.I18N("MsgPACUpdateSuccessfully"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1373,7 +1301,7 @@ namespace v2rayN.Forms
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
AppendText(false, UIRes.I18N("MsgStartUpdatingPAC"));
|
AppendText(false, UIRes.I18N("MsgStartUpdatingPAC"));
|
||||||
pacListHandle.UpdatePACFromGFWList(config);
|
pacListHandle.WebDownloadString(config.urlGFWList);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void tsbCheckClearPACList_Click(object sender, EventArgs e)
|
private void tsbCheckClearPACList_Click(object sender, EventArgs e)
|
||||||
@@ -1400,7 +1328,7 @@ namespace v2rayN.Forms
|
|||||||
|
|
||||||
private void tsbPromotion_Click(object sender, EventArgs e)
|
private void tsbPromotion_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
System.Diagnostics.Process.Start($"{Global.PromotionUrl}?t={DateTime.Now.Ticks}");
|
System.Diagnostics.Process.Start($"{Utils.Base64Decode(Global.PromotionUrl)}?t={DateTime.Now.Ticks}");
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -1506,8 +1434,6 @@ namespace v2rayN.Forms
|
|||||||
downloadHandle3.WebDownloadString(url);
|
downloadHandle3.WebDownloadString(url);
|
||||||
AppendText(false, $"{hashCode}{UIRes.I18N("MsgStartGettingSubscriptions")}");
|
AppendText(false, $"{hashCode}{UIRes.I18N("MsgStartGettingSubscriptions")}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -1528,7 +1454,6 @@ namespace v2rayN.Forms
|
|||||||
Utils.RegWriteValue(Global.MyRegPath, Global.MyRegKeyLanguage, value);
|
Utils.RegWriteValue(Global.MyRegPath, Global.MyRegKeyLanguage, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -291,7 +291,7 @@
|
|||||||
<value>ImageAboveText</value>
|
<value>ImageAboveText</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>448, 556</value>
|
<value>448, 534</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>cmsLv.Name" xml:space="preserve">
|
<data name=">>cmsLv.Name" xml:space="preserve">
|
||||||
<value>cmsLv</value>
|
<value>cmsLv</value>
|
||||||
@@ -333,7 +333,7 @@
|
|||||||
<value>lvServers</value>
|
<value>lvServers</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>lvServers.Type" xml:space="preserve">
|
<data name=">>lvServers.Type" xml:space="preserve">
|
||||||
<value>v2rayN.Forms.ListViewFlickerFree, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
<value>v2rayN.Base.ListViewFlickerFree, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>lvServers.Parent" xml:space="preserve">
|
<data name=">>lvServers.Parent" xml:space="preserve">
|
||||||
<value>splitContainer1.Panel1</value>
|
<value>splitContainer1.Panel1</value>
|
||||||
@@ -422,11 +422,11 @@
|
|||||||
<data name="cmsMain.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
<data name="cmsMain.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||||
<value>NoControl</value>
|
<value>NoControl</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="menuSysAgentEnabled.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="menuNotEnabledHttp.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>264, 22</value>
|
<value>547, 22</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="menuSysAgentEnabled.Text" xml:space="preserve">
|
<data name="menuNotEnabledHttp.Text" xml:space="preserve">
|
||||||
<value>Enable Http proxy</value>
|
<value>Not Enabled Http Proxy</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="menuGlobal.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="menuGlobal.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>547, 22</value>
|
<value>547, 22</value>
|
||||||
@@ -456,7 +456,7 @@
|
|||||||
<value>264, 22</value>
|
<value>264, 22</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="menuSysAgentMode.Text" xml:space="preserve">
|
<data name="menuSysAgentMode.Text" xml:space="preserve">
|
||||||
<value>Http proxy mode</value>
|
<value>Http proxy</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="menuServers.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="menuServers.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>264, 22</value>
|
<value>264, 22</value>
|
||||||
@@ -492,7 +492,7 @@
|
|||||||
<value>Exit</value>
|
<value>Exit</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>265, 164</value>
|
<value>265, 142</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>cmsMain.Name" xml:space="preserve">
|
<data name=">>cmsMain.Name" xml:space="preserve">
|
||||||
<value>cmsMain</value>
|
<value>cmsMain</value>
|
||||||
@@ -823,6 +823,9 @@
|
|||||||
<data name="tsbCheckClearPACList.Text" xml:space="preserve">
|
<data name="tsbCheckClearPACList.Text" xml:space="preserve">
|
||||||
<value>Simplify PAC (please set Core route)</value>
|
<value>Simplify PAC (please set Core route)</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="tsbCheckClearPACList.Visible" type="System.Boolean, mscorlib">
|
||||||
|
<value>False</value>
|
||||||
|
</data>
|
||||||
<data name="tsbCheckUpdate.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
|
<data name="tsbCheckUpdate.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
|
||||||
<value>Magenta</value>
|
<value>Magenta</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -1118,18 +1121,18 @@
|
|||||||
<data name=">>notifyMain.Type" xml:space="preserve">
|
<data name=">>notifyMain.Type" xml:space="preserve">
|
||||||
<value>System.Windows.Forms.NotifyIcon, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Windows.Forms.NotifyIcon, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>menuSysAgentEnabled.Name" xml:space="preserve">
|
|
||||||
<value>menuSysAgentEnabled</value>
|
|
||||||
</data>
|
|
||||||
<data name=">>menuSysAgentEnabled.Type" xml:space="preserve">
|
|
||||||
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</data>
|
|
||||||
<data name=">>menuSysAgentMode.Name" xml:space="preserve">
|
<data name=">>menuSysAgentMode.Name" xml:space="preserve">
|
||||||
<value>menuSysAgentMode</value>
|
<value>menuSysAgentMode</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>menuSysAgentMode.Type" xml:space="preserve">
|
<data name=">>menuSysAgentMode.Type" xml:space="preserve">
|
||||||
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name=">>menuNotEnabledHttp.Name" xml:space="preserve">
|
||||||
|
<value>menuNotEnabledHttp</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>menuNotEnabledHttp.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
<data name=">>menuGlobal.Name" xml:space="preserve">
|
<data name=">>menuGlobal.Name" xml:space="preserve">
|
||||||
<value>menuGlobal</value>
|
<value>menuGlobal</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -268,6 +268,12 @@
|
|||||||
<data name="menuExport2SubContent.Text" xml:space="preserve">
|
<data name="menuExport2SubContent.Text" xml:space="preserve">
|
||||||
<value>批量导出订阅内容至剪贴板(多选)</value>
|
<value>批量导出订阅内容至剪贴板(多选)</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="tsbServer.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>73, 53</value>
|
||||||
|
</data>
|
||||||
|
<data name="tsbServer.Text" xml:space="preserve">
|
||||||
|
<value> 服务器 </value>
|
||||||
|
</data>
|
||||||
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="cmsLv.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>279, 534</value>
|
<value>279, 534</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -288,26 +294,11 @@
|
|||||||
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
|
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="tsbServer.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="menuNotEnabledHttp.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>73, 53</value>
|
<value>340, 22</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="tsbServer.Text" xml:space="preserve">
|
<data name="menuNotEnabledHttp.Text" xml:space="preserve">
|
||||||
<value> 服务器 </value>
|
<value>关闭Http代理</value>
|
||||||
</data>
|
|
||||||
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
|
|
||||||
<value>196, 164</value>
|
|
||||||
</data>
|
|
||||||
<data name="menuSysAgentEnabled.Size" type="System.Drawing.Size, System.Drawing">
|
|
||||||
<value>195, 22</value>
|
|
||||||
</data>
|
|
||||||
<data name="menuSysAgentEnabled.Text" xml:space="preserve">
|
|
||||||
<value>启用Http代理</value>
|
|
||||||
</data>
|
|
||||||
<data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing">
|
|
||||||
<value>195, 22</value>
|
|
||||||
</data>
|
|
||||||
<data name="menuSysAgentMode.Text" xml:space="preserve">
|
|
||||||
<value>Http代理模式</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="menuGlobal.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="menuGlobal.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>340, 22</value>
|
<value>340, 22</value>
|
||||||
@@ -333,6 +324,12 @@
|
|||||||
<data name="menuKeepPAC.Text" xml:space="preserve">
|
<data name="menuKeepPAC.Text" xml:space="preserve">
|
||||||
<value>仅开启PAC,不自动配置PAC</value>
|
<value>仅开启PAC,不自动配置PAC</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="menuSysAgentMode.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>195, 22</value>
|
||||||
|
</data>
|
||||||
|
<data name="menuSysAgentMode.Text" xml:space="preserve">
|
||||||
|
<value>Http代理</value>
|
||||||
|
</data>
|
||||||
<data name="menuServers.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="menuServers.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>195, 22</value>
|
<value>195, 22</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -366,20 +363,17 @@
|
|||||||
<data name="menuExit.Text" xml:space="preserve">
|
<data name="menuExit.Text" xml:space="preserve">
|
||||||
<value>退出</value>
|
<value>退出</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>196, 142</value>
|
||||||
|
</data>
|
||||||
<data name="groupBox1.Text" xml:space="preserve">
|
<data name="groupBox1.Text" xml:space="preserve">
|
||||||
<value>服务器列表</value>
|
<value>服务器列表</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="groupBox2.Text" xml:space="preserve">
|
|
||||||
<value>信息</value>
|
|
||||||
</data>
|
|
||||||
<data name="toolSslServerSpeed.Text" xml:space="preserve">
|
<data name="toolSslServerSpeed.Text" xml:space="preserve">
|
||||||
<value>网速显示未启用</value>
|
<value>网速显示未启用</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="tsbSub.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="groupBox2.Text" xml:space="preserve">
|
||||||
<value>61, 53</value>
|
<value>信息</value>
|
||||||
</data>
|
|
||||||
<data name="tsbSub.Text" xml:space="preserve">
|
|
||||||
<value> 订阅 </value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="tsbSubSetting.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="tsbSubSetting.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>124, 22</value>
|
<value>124, 22</value>
|
||||||
@@ -393,6 +387,12 @@
|
|||||||
<data name="tsbSubUpdate.Text" xml:space="preserve">
|
<data name="tsbSubUpdate.Text" xml:space="preserve">
|
||||||
<value>更新订阅</value>
|
<value>更新订阅</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="tsbSub.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>61, 53</value>
|
||||||
|
</data>
|
||||||
|
<data name="tsbSub.Text" xml:space="preserve">
|
||||||
|
<value> 订阅 </value>
|
||||||
|
</data>
|
||||||
<data name="tsbOptionSetting.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="tsbOptionSetting.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>76, 53</value>
|
<value>76, 53</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -402,7 +402,7 @@
|
|||||||
<data name="tsbReload.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="tsbReload.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE3SURBVFhH7ZaBDQIhDEVvBEdwBDfQDXQER3AD3cARdAPd
|
YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAE3SURBVFhH7ZaBDQIhDEVvBEdwBDfQDXQER3AD3cARdAPd
|
||||||
QDfSDbQvuSb1AicFjJrwkxcN0FIolOuamv5VE2E+gLaPayWchEcE+hhTXVPhIoQmDcFYbKpoJtwEdX4X
|
QDfSDbQvuSb1AicFjJrwkxcN0FIolOuamv5VE2E+gLaPayWchEcE+hhTXVPhIoQmDcFYbKpoJtwEdX4X
|
||||||
jgIrXfTwnzb6dBw22BaJVdjJmWQs1/SdBRtE0U5cBXW2oSFRO0HtSEeW2FZ1wsq9sjuRdTDVAXnNuWLY
|
jgIrXfTwnzb6dBw22BaJVdjJmWQs1/SdBRtE0U5cBXW2oSFRO0HtSEeW2FZ1wsq9sjuRdTDVAXnNuWLY
|
||||||
6JnAl0sYa/Q5q1dhq35ci+Bkq2HJvbZpxGeybAAuw4Fq+cnW1wPITgHFYxvBUw+qHEIL1yq1vDKhVlH3
|
6JnAl0sYa/Q5q1dhq35ci+Bkq2HJvbZpxGeybAAuw4Fq+cnW1wPITgHFYxvBUw+qHEIL1yq1vDKhVlH3
|
||||||
@@ -416,12 +416,6 @@
|
|||||||
<data name="tsbReload.Text" xml:space="preserve">
|
<data name="tsbReload.Text" xml:space="preserve">
|
||||||
<value> 重启服务 </value>
|
<value> 重启服务 </value>
|
||||||
</data>
|
</data>
|
||||||
<data name="tsbCheckUpdate.Size" type="System.Drawing.Size, System.Drawing">
|
|
||||||
<value>85, 53</value>
|
|
||||||
</data>
|
|
||||||
<data name="tsbCheckUpdate.Text" xml:space="preserve">
|
|
||||||
<value> 检查更新 </value>
|
|
||||||
</data>
|
|
||||||
<data name="tsbCheckUpdateN.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="tsbCheckUpdateN.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>232, 22</value>
|
<value>232, 22</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -438,7 +432,7 @@
|
|||||||
<value>232, 22</value>
|
<value>232, 22</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="tsbCheckUpdatePACList.Text" xml:space="preserve">
|
<data name="tsbCheckUpdatePACList.Text" xml:space="preserve">
|
||||||
<value>检查更新PAC (需要Http代理)</value>
|
<value>检查更新PAC</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="tsbCheckClearPACList.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="tsbCheckClearPACList.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>232, 22</value>
|
<value>232, 22</value>
|
||||||
@@ -446,15 +440,21 @@
|
|||||||
<data name="tsbCheckClearPACList.Text" xml:space="preserve">
|
<data name="tsbCheckClearPACList.Text" xml:space="preserve">
|
||||||
<value>简化PAC (请设置Core路由)</value>
|
<value>简化PAC (请设置Core路由)</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="tsbCheckUpdate.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>85, 53</value>
|
||||||
|
</data>
|
||||||
|
<data name="tsbCheckUpdate.Text" xml:space="preserve">
|
||||||
|
<value> 检查更新 </value>
|
||||||
|
</data>
|
||||||
|
<data name="tsbAbout.Text" xml:space="preserve">
|
||||||
|
<value>关于</value>
|
||||||
|
</data>
|
||||||
<data name="tsbHelp.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="tsbHelp.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>69, 53</value>
|
<value>69, 53</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="tsbHelp.Text" xml:space="preserve">
|
<data name="tsbHelp.Text" xml:space="preserve">
|
||||||
<value> 帮助 </value>
|
<value> 帮助 </value>
|
||||||
</data>
|
</data>
|
||||||
<data name="tsbAbout.Text" xml:space="preserve">
|
|
||||||
<value>关于</value>
|
|
||||||
</data>
|
|
||||||
<data name="tsbPromotion.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="tsbPromotion.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>68, 53</value>
|
<value>68, 53</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -464,7 +464,7 @@
|
|||||||
<data name="tsbClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="tsbClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAySURBVFhH7c6xDQAgCEVBRnVTHU2ZABuMxV3yOvJDAAA/
|
YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAySURBVFhH7c6xDQAgCEVBRnVTHU2ZABuMxV3yOvJDAAA/
|
||||||
GqfZVG6X8mg1dfUAAPBQxAZd0SJruVXHWwAAAABJRU5ErkJggg==
|
GqfZVG6X8mg1dfUAAPBQxAZd0SJruVXHWwAAAABJRU5ErkJggg==
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
173
v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs
generated
173
v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs
generated
@@ -33,6 +33,8 @@
|
|||||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||||
this.tabPage1 = new System.Windows.Forms.TabPage();
|
this.tabPage1 = new System.Windows.Forms.TabPage();
|
||||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.label16 = new System.Windows.Forms.Label();
|
||||||
|
this.cmblistenerType = new System.Windows.Forms.ComboBox();
|
||||||
this.chksniffingEnabled2 = new System.Windows.Forms.CheckBox();
|
this.chksniffingEnabled2 = new System.Windows.Forms.CheckBox();
|
||||||
this.chksniffingEnabled = new System.Windows.Forms.CheckBox();
|
this.chksniffingEnabled = new System.Windows.Forms.CheckBox();
|
||||||
this.txtremoteDNS = new System.Windows.Forms.TextBox();
|
this.txtremoteDNS = new System.Windows.Forms.TextBox();
|
||||||
@@ -60,14 +62,13 @@
|
|||||||
this.txtUserdirect = new System.Windows.Forms.TextBox();
|
this.txtUserdirect = new System.Windows.Forms.TextBox();
|
||||||
this.tabPage5 = new System.Windows.Forms.TabPage();
|
this.tabPage5 = new System.Windows.Forms.TabPage();
|
||||||
this.txtUserblock = new System.Windows.Forms.TextBox();
|
this.txtUserblock = new System.Windows.Forms.TextBox();
|
||||||
|
this.tabPage8 = new System.Windows.Forms.TabPage();
|
||||||
|
this.cmbroutingMode = new System.Windows.Forms.ComboBox();
|
||||||
this.panel3 = new System.Windows.Forms.Panel();
|
this.panel3 = new System.Windows.Forms.Panel();
|
||||||
this.btnSetDefRountingRule = new System.Windows.Forms.Button();
|
this.btnSetDefRountingRule = new System.Windows.Forms.Button();
|
||||||
this.labRoutingTips = new System.Windows.Forms.Label();
|
this.labRoutingTips = new System.Windows.Forms.Label();
|
||||||
this.label4 = new System.Windows.Forms.Label();
|
|
||||||
this.cmbdomainStrategy = new System.Windows.Forms.ComboBox();
|
this.cmbdomainStrategy = new System.Windows.Forms.ComboBox();
|
||||||
this.label15 = new System.Windows.Forms.Label();
|
this.label15 = new System.Windows.Forms.Label();
|
||||||
this.label12 = new System.Windows.Forms.Label();
|
|
||||||
this.cmbroutingMode = new System.Windows.Forms.ComboBox();
|
|
||||||
this.tabPage6 = new System.Windows.Forms.TabPage();
|
this.tabPage6 = new System.Windows.Forms.TabPage();
|
||||||
this.chkKcpcongestion = new System.Windows.Forms.CheckBox();
|
this.chkKcpcongestion = new System.Windows.Forms.CheckBox();
|
||||||
this.txtKcpwriteBufferSize = new System.Windows.Forms.TextBox();
|
this.txtKcpwriteBufferSize = new System.Windows.Forms.TextBox();
|
||||||
@@ -84,14 +85,16 @@
|
|||||||
this.label6 = new System.Windows.Forms.Label();
|
this.label6 = new System.Windows.Forms.Label();
|
||||||
this.tabPage7 = new System.Windows.Forms.TabPage();
|
this.tabPage7 = new System.Windows.Forms.TabPage();
|
||||||
this.cbFreshrate = new System.Windows.Forms.ComboBox();
|
this.cbFreshrate = new System.Windows.Forms.ComboBox();
|
||||||
this.tbCacheDays = new System.Windows.Forms.TextBox();
|
|
||||||
this.lbFreshrate = new System.Windows.Forms.Label();
|
this.lbFreshrate = new System.Windows.Forms.Label();
|
||||||
this.lbCacheDays = new System.Windows.Forms.Label();
|
|
||||||
this.chkEnableStatistics = new System.Windows.Forms.CheckBox();
|
this.chkEnableStatistics = new System.Windows.Forms.CheckBox();
|
||||||
this.chkAllowLANConn = new System.Windows.Forms.CheckBox();
|
this.chkAllowLANConn = new System.Windows.Forms.CheckBox();
|
||||||
this.txturlGFWList = new System.Windows.Forms.TextBox();
|
this.txturlGFWList = new System.Windows.Forms.TextBox();
|
||||||
this.label13 = new System.Windows.Forms.Label();
|
this.label13 = new System.Windows.Forms.Label();
|
||||||
this.chkAutoRun = new System.Windows.Forms.CheckBox();
|
this.chkAutoRun = new System.Windows.Forms.CheckBox();
|
||||||
|
this.tabPage9 = new System.Windows.Forms.TabPage();
|
||||||
|
this.txtuserPacRule = new System.Windows.Forms.TextBox();
|
||||||
|
this.panel4 = new System.Windows.Forms.Panel();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
this.panel2 = new System.Windows.Forms.Panel();
|
this.panel2 = new System.Windows.Forms.Panel();
|
||||||
this.btnOK = new System.Windows.Forms.Button();
|
this.btnOK = new System.Windows.Forms.Button();
|
||||||
this.panel1 = new System.Windows.Forms.Panel();
|
this.panel1 = new System.Windows.Forms.Panel();
|
||||||
@@ -104,40 +107,45 @@
|
|||||||
this.tabPage3.SuspendLayout();
|
this.tabPage3.SuspendLayout();
|
||||||
this.tabPage4.SuspendLayout();
|
this.tabPage4.SuspendLayout();
|
||||||
this.tabPage5.SuspendLayout();
|
this.tabPage5.SuspendLayout();
|
||||||
|
this.tabPage8.SuspendLayout();
|
||||||
this.panel3.SuspendLayout();
|
this.panel3.SuspendLayout();
|
||||||
this.tabPage6.SuspendLayout();
|
this.tabPage6.SuspendLayout();
|
||||||
this.tabPage7.SuspendLayout();
|
this.tabPage7.SuspendLayout();
|
||||||
|
this.tabPage9.SuspendLayout();
|
||||||
|
this.panel4.SuspendLayout();
|
||||||
this.panel2.SuspendLayout();
|
this.panel2.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// btnClose
|
// btnClose
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.btnClose, "btnClose");
|
|
||||||
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||||
|
resources.ApplyResources(this.btnClose, "btnClose");
|
||||||
this.btnClose.Name = "btnClose";
|
this.btnClose.Name = "btnClose";
|
||||||
this.btnClose.UseVisualStyleBackColor = true;
|
this.btnClose.UseVisualStyleBackColor = true;
|
||||||
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||||
//
|
//
|
||||||
// tabControl1
|
// tabControl1
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.tabControl1, "tabControl1");
|
|
||||||
this.tabControl1.Controls.Add(this.tabPage1);
|
this.tabControl1.Controls.Add(this.tabPage1);
|
||||||
this.tabControl1.Controls.Add(this.tabPage2);
|
this.tabControl1.Controls.Add(this.tabPage2);
|
||||||
this.tabControl1.Controls.Add(this.tabPage6);
|
this.tabControl1.Controls.Add(this.tabPage6);
|
||||||
this.tabControl1.Controls.Add(this.tabPage7);
|
this.tabControl1.Controls.Add(this.tabPage7);
|
||||||
|
this.tabControl1.Controls.Add(this.tabPage9);
|
||||||
|
resources.ApplyResources(this.tabControl1, "tabControl1");
|
||||||
this.tabControl1.Name = "tabControl1";
|
this.tabControl1.Name = "tabControl1";
|
||||||
this.tabControl1.SelectedIndex = 0;
|
this.tabControl1.SelectedIndex = 0;
|
||||||
//
|
//
|
||||||
// tabPage1
|
// tabPage1
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.tabPage1, "tabPage1");
|
|
||||||
this.tabPage1.Controls.Add(this.groupBox1);
|
this.tabPage1.Controls.Add(this.groupBox1);
|
||||||
|
resources.ApplyResources(this.tabPage1, "tabPage1");
|
||||||
this.tabPage1.Name = "tabPage1";
|
this.tabPage1.Name = "tabPage1";
|
||||||
this.tabPage1.UseVisualStyleBackColor = true;
|
this.tabPage1.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// groupBox1
|
// groupBox1
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.groupBox1, "groupBox1");
|
this.groupBox1.Controls.Add(this.label16);
|
||||||
|
this.groupBox1.Controls.Add(this.cmblistenerType);
|
||||||
this.groupBox1.Controls.Add(this.chksniffingEnabled2);
|
this.groupBox1.Controls.Add(this.chksniffingEnabled2);
|
||||||
this.groupBox1.Controls.Add(this.chksniffingEnabled);
|
this.groupBox1.Controls.Add(this.chksniffingEnabled);
|
||||||
this.groupBox1.Controls.Add(this.txtremoteDNS);
|
this.groupBox1.Controls.Add(this.txtremoteDNS);
|
||||||
@@ -156,9 +164,28 @@
|
|||||||
this.groupBox1.Controls.Add(this.label5);
|
this.groupBox1.Controls.Add(this.label5);
|
||||||
this.groupBox1.Controls.Add(this.txtlocalPort);
|
this.groupBox1.Controls.Add(this.txtlocalPort);
|
||||||
this.groupBox1.Controls.Add(this.label2);
|
this.groupBox1.Controls.Add(this.label2);
|
||||||
|
resources.ApplyResources(this.groupBox1, "groupBox1");
|
||||||
this.groupBox1.Name = "groupBox1";
|
this.groupBox1.Name = "groupBox1";
|
||||||
this.groupBox1.TabStop = false;
|
this.groupBox1.TabStop = false;
|
||||||
//
|
//
|
||||||
|
// label16
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.label16, "label16");
|
||||||
|
this.label16.Name = "label16";
|
||||||
|
//
|
||||||
|
// cmblistenerType
|
||||||
|
//
|
||||||
|
this.cmblistenerType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cmblistenerType.FormattingEnabled = true;
|
||||||
|
this.cmblistenerType.Items.AddRange(new object[] {
|
||||||
|
resources.GetString("cmblistenerType.Items"),
|
||||||
|
resources.GetString("cmblistenerType.Items1"),
|
||||||
|
resources.GetString("cmblistenerType.Items2"),
|
||||||
|
resources.GetString("cmblistenerType.Items3"),
|
||||||
|
resources.GetString("cmblistenerType.Items4")});
|
||||||
|
resources.ApplyResources(this.cmblistenerType, "cmblistenerType");
|
||||||
|
this.cmblistenerType.Name = "cmblistenerType";
|
||||||
|
//
|
||||||
// chksniffingEnabled2
|
// chksniffingEnabled2
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.chksniffingEnabled2, "chksniffingEnabled2");
|
resources.ApplyResources(this.chksniffingEnabled2, "chksniffingEnabled2");
|
||||||
@@ -202,12 +229,12 @@
|
|||||||
//
|
//
|
||||||
// cmbprotocol2
|
// cmbprotocol2
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.cmbprotocol2, "cmbprotocol2");
|
|
||||||
this.cmbprotocol2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cmbprotocol2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cmbprotocol2.FormattingEnabled = true;
|
this.cmbprotocol2.FormattingEnabled = true;
|
||||||
this.cmbprotocol2.Items.AddRange(new object[] {
|
this.cmbprotocol2.Items.AddRange(new object[] {
|
||||||
resources.GetString("cmbprotocol2.Items"),
|
resources.GetString("cmbprotocol2.Items"),
|
||||||
resources.GetString("cmbprotocol2.Items1")});
|
resources.GetString("cmbprotocol2.Items1")});
|
||||||
|
resources.ApplyResources(this.cmbprotocol2, "cmbprotocol2");
|
||||||
this.cmbprotocol2.Name = "cmbprotocol2";
|
this.cmbprotocol2.Name = "cmbprotocol2";
|
||||||
//
|
//
|
||||||
// label3
|
// label3
|
||||||
@@ -222,8 +249,8 @@
|
|||||||
//
|
//
|
||||||
// cmbprotocol
|
// cmbprotocol
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.cmbprotocol, "cmbprotocol");
|
|
||||||
this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
resources.ApplyResources(this.cmbprotocol, "cmbprotocol");
|
||||||
this.cmbprotocol.FormattingEnabled = true;
|
this.cmbprotocol.FormattingEnabled = true;
|
||||||
this.cmbprotocol.Items.AddRange(new object[] {
|
this.cmbprotocol.Items.AddRange(new object[] {
|
||||||
resources.GetString("cmbprotocol.Items"),
|
resources.GetString("cmbprotocol.Items"),
|
||||||
@@ -249,7 +276,6 @@
|
|||||||
//
|
//
|
||||||
// cmbloglevel
|
// cmbloglevel
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
|
|
||||||
this.cmbloglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cmbloglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cmbloglevel.FormattingEnabled = true;
|
this.cmbloglevel.FormattingEnabled = true;
|
||||||
this.cmbloglevel.Items.AddRange(new object[] {
|
this.cmbloglevel.Items.AddRange(new object[] {
|
||||||
@@ -258,6 +284,7 @@
|
|||||||
resources.GetString("cmbloglevel.Items2"),
|
resources.GetString("cmbloglevel.Items2"),
|
||||||
resources.GetString("cmbloglevel.Items3"),
|
resources.GetString("cmbloglevel.Items3"),
|
||||||
resources.GetString("cmbloglevel.Items4")});
|
resources.GetString("cmbloglevel.Items4")});
|
||||||
|
resources.ApplyResources(this.cmbloglevel, "cmbloglevel");
|
||||||
this.cmbloglevel.Name = "cmbloglevel";
|
this.cmbloglevel.Name = "cmbloglevel";
|
||||||
//
|
//
|
||||||
// label5
|
// label5
|
||||||
@@ -277,32 +304,33 @@
|
|||||||
//
|
//
|
||||||
// tabPage2
|
// tabPage2
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.tabPage2, "tabPage2");
|
|
||||||
this.tabPage2.Controls.Add(this.groupBox2);
|
this.tabPage2.Controls.Add(this.groupBox2);
|
||||||
|
resources.ApplyResources(this.tabPage2, "tabPage2");
|
||||||
this.tabPage2.Name = "tabPage2";
|
this.tabPage2.Name = "tabPage2";
|
||||||
this.tabPage2.UseVisualStyleBackColor = true;
|
this.tabPage2.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// groupBox2
|
// groupBox2
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.groupBox2, "groupBox2");
|
|
||||||
this.groupBox2.Controls.Add(this.tabControl2);
|
this.groupBox2.Controls.Add(this.tabControl2);
|
||||||
this.groupBox2.Controls.Add(this.panel3);
|
this.groupBox2.Controls.Add(this.panel3);
|
||||||
|
resources.ApplyResources(this.groupBox2, "groupBox2");
|
||||||
this.groupBox2.Name = "groupBox2";
|
this.groupBox2.Name = "groupBox2";
|
||||||
this.groupBox2.TabStop = false;
|
this.groupBox2.TabStop = false;
|
||||||
//
|
//
|
||||||
// tabControl2
|
// tabControl2
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.tabControl2, "tabControl2");
|
|
||||||
this.tabControl2.Controls.Add(this.tabPage3);
|
this.tabControl2.Controls.Add(this.tabPage3);
|
||||||
this.tabControl2.Controls.Add(this.tabPage4);
|
this.tabControl2.Controls.Add(this.tabPage4);
|
||||||
this.tabControl2.Controls.Add(this.tabPage5);
|
this.tabControl2.Controls.Add(this.tabPage5);
|
||||||
|
this.tabControl2.Controls.Add(this.tabPage8);
|
||||||
|
resources.ApplyResources(this.tabControl2, "tabControl2");
|
||||||
this.tabControl2.Name = "tabControl2";
|
this.tabControl2.Name = "tabControl2";
|
||||||
this.tabControl2.SelectedIndex = 0;
|
this.tabControl2.SelectedIndex = 0;
|
||||||
//
|
//
|
||||||
// tabPage3
|
// tabPage3
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.tabPage3, "tabPage3");
|
|
||||||
this.tabPage3.Controls.Add(this.txtUseragent);
|
this.tabPage3.Controls.Add(this.txtUseragent);
|
||||||
|
resources.ApplyResources(this.tabPage3, "tabPage3");
|
||||||
this.tabPage3.Name = "tabPage3";
|
this.tabPage3.Name = "tabPage3";
|
||||||
this.tabPage3.UseVisualStyleBackColor = true;
|
this.tabPage3.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
@@ -313,8 +341,8 @@
|
|||||||
//
|
//
|
||||||
// tabPage4
|
// tabPage4
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.tabPage4, "tabPage4");
|
|
||||||
this.tabPage4.Controls.Add(this.txtUserdirect);
|
this.tabPage4.Controls.Add(this.txtUserdirect);
|
||||||
|
resources.ApplyResources(this.tabPage4, "tabPage4");
|
||||||
this.tabPage4.Name = "tabPage4";
|
this.tabPage4.Name = "tabPage4";
|
||||||
this.tabPage4.UseVisualStyleBackColor = true;
|
this.tabPage4.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
@@ -325,8 +353,8 @@
|
|||||||
//
|
//
|
||||||
// tabPage5
|
// tabPage5
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.tabPage5, "tabPage5");
|
|
||||||
this.tabPage5.Controls.Add(this.txtUserblock);
|
this.tabPage5.Controls.Add(this.txtUserblock);
|
||||||
|
resources.ApplyResources(this.tabPage5, "tabPage5");
|
||||||
this.tabPage5.Name = "tabPage5";
|
this.tabPage5.Name = "tabPage5";
|
||||||
this.tabPage5.UseVisualStyleBackColor = true;
|
this.tabPage5.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
@@ -335,16 +363,32 @@
|
|||||||
resources.ApplyResources(this.txtUserblock, "txtUserblock");
|
resources.ApplyResources(this.txtUserblock, "txtUserblock");
|
||||||
this.txtUserblock.Name = "txtUserblock";
|
this.txtUserblock.Name = "txtUserblock";
|
||||||
//
|
//
|
||||||
|
// tabPage8
|
||||||
|
//
|
||||||
|
this.tabPage8.Controls.Add(this.cmbroutingMode);
|
||||||
|
resources.ApplyResources(this.tabPage8, "tabPage8");
|
||||||
|
this.tabPage8.Name = "tabPage8";
|
||||||
|
this.tabPage8.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// cmbroutingMode
|
||||||
|
//
|
||||||
|
this.cmbroutingMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cmbroutingMode.FormattingEnabled = true;
|
||||||
|
this.cmbroutingMode.Items.AddRange(new object[] {
|
||||||
|
resources.GetString("cmbroutingMode.Items"),
|
||||||
|
resources.GetString("cmbroutingMode.Items1"),
|
||||||
|
resources.GetString("cmbroutingMode.Items2"),
|
||||||
|
resources.GetString("cmbroutingMode.Items3")});
|
||||||
|
resources.ApplyResources(this.cmbroutingMode, "cmbroutingMode");
|
||||||
|
this.cmbroutingMode.Name = "cmbroutingMode";
|
||||||
|
//
|
||||||
// panel3
|
// panel3
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.panel3, "panel3");
|
|
||||||
this.panel3.Controls.Add(this.btnSetDefRountingRule);
|
this.panel3.Controls.Add(this.btnSetDefRountingRule);
|
||||||
this.panel3.Controls.Add(this.labRoutingTips);
|
this.panel3.Controls.Add(this.labRoutingTips);
|
||||||
this.panel3.Controls.Add(this.label4);
|
|
||||||
this.panel3.Controls.Add(this.cmbdomainStrategy);
|
this.panel3.Controls.Add(this.cmbdomainStrategy);
|
||||||
this.panel3.Controls.Add(this.label15);
|
this.panel3.Controls.Add(this.label15);
|
||||||
this.panel3.Controls.Add(this.label12);
|
resources.ApplyResources(this.panel3, "panel3");
|
||||||
this.panel3.Controls.Add(this.cmbroutingMode);
|
|
||||||
this.panel3.Name = "panel3";
|
this.panel3.Name = "panel3";
|
||||||
//
|
//
|
||||||
// btnSetDefRountingRule
|
// btnSetDefRountingRule
|
||||||
@@ -356,25 +400,19 @@
|
|||||||
//
|
//
|
||||||
// labRoutingTips
|
// labRoutingTips
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
|
|
||||||
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
|
this.labRoutingTips.ForeColor = System.Drawing.Color.Brown;
|
||||||
|
resources.ApplyResources(this.labRoutingTips, "labRoutingTips");
|
||||||
this.labRoutingTips.Name = "labRoutingTips";
|
this.labRoutingTips.Name = "labRoutingTips";
|
||||||
//
|
//
|
||||||
// label4
|
|
||||||
//
|
|
||||||
resources.ApplyResources(this.label4, "label4");
|
|
||||||
this.label4.ForeColor = System.Drawing.Color.Brown;
|
|
||||||
this.label4.Name = "label4";
|
|
||||||
//
|
|
||||||
// cmbdomainStrategy
|
// cmbdomainStrategy
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy");
|
|
||||||
this.cmbdomainStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cmbdomainStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cmbdomainStrategy.FormattingEnabled = true;
|
this.cmbdomainStrategy.FormattingEnabled = true;
|
||||||
this.cmbdomainStrategy.Items.AddRange(new object[] {
|
this.cmbdomainStrategy.Items.AddRange(new object[] {
|
||||||
resources.GetString("cmbdomainStrategy.Items"),
|
resources.GetString("cmbdomainStrategy.Items"),
|
||||||
resources.GetString("cmbdomainStrategy.Items1"),
|
resources.GetString("cmbdomainStrategy.Items1"),
|
||||||
resources.GetString("cmbdomainStrategy.Items2")});
|
resources.GetString("cmbdomainStrategy.Items2")});
|
||||||
|
resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy");
|
||||||
this.cmbdomainStrategy.Name = "cmbdomainStrategy";
|
this.cmbdomainStrategy.Name = "cmbdomainStrategy";
|
||||||
//
|
//
|
||||||
// label15
|
// label15
|
||||||
@@ -382,26 +420,8 @@
|
|||||||
resources.ApplyResources(this.label15, "label15");
|
resources.ApplyResources(this.label15, "label15");
|
||||||
this.label15.Name = "label15";
|
this.label15.Name = "label15";
|
||||||
//
|
//
|
||||||
// label12
|
|
||||||
//
|
|
||||||
resources.ApplyResources(this.label12, "label12");
|
|
||||||
this.label12.Name = "label12";
|
|
||||||
//
|
|
||||||
// cmbroutingMode
|
|
||||||
//
|
|
||||||
resources.ApplyResources(this.cmbroutingMode, "cmbroutingMode");
|
|
||||||
this.cmbroutingMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
|
||||||
this.cmbroutingMode.FormattingEnabled = true;
|
|
||||||
this.cmbroutingMode.Items.AddRange(new object[] {
|
|
||||||
resources.GetString("cmbroutingMode.Items"),
|
|
||||||
resources.GetString("cmbroutingMode.Items1"),
|
|
||||||
resources.GetString("cmbroutingMode.Items2"),
|
|
||||||
resources.GetString("cmbroutingMode.Items3")});
|
|
||||||
this.cmbroutingMode.Name = "cmbroutingMode";
|
|
||||||
//
|
|
||||||
// tabPage6
|
// tabPage6
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.tabPage6, "tabPage6");
|
|
||||||
this.tabPage6.Controls.Add(this.chkKcpcongestion);
|
this.tabPage6.Controls.Add(this.chkKcpcongestion);
|
||||||
this.tabPage6.Controls.Add(this.txtKcpwriteBufferSize);
|
this.tabPage6.Controls.Add(this.txtKcpwriteBufferSize);
|
||||||
this.tabPage6.Controls.Add(this.label10);
|
this.tabPage6.Controls.Add(this.label10);
|
||||||
@@ -415,6 +435,7 @@
|
|||||||
this.tabPage6.Controls.Add(this.label7);
|
this.tabPage6.Controls.Add(this.label7);
|
||||||
this.tabPage6.Controls.Add(this.txtKcpmtu);
|
this.tabPage6.Controls.Add(this.txtKcpmtu);
|
||||||
this.tabPage6.Controls.Add(this.label6);
|
this.tabPage6.Controls.Add(this.label6);
|
||||||
|
resources.ApplyResources(this.tabPage6, "tabPage6");
|
||||||
this.tabPage6.Name = "tabPage6";
|
this.tabPage6.Name = "tabPage6";
|
||||||
this.tabPage6.UseVisualStyleBackColor = true;
|
this.tabPage6.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
@@ -486,41 +507,29 @@
|
|||||||
//
|
//
|
||||||
// tabPage7
|
// tabPage7
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.tabPage7, "tabPage7");
|
|
||||||
this.tabPage7.Controls.Add(this.cbFreshrate);
|
this.tabPage7.Controls.Add(this.cbFreshrate);
|
||||||
this.tabPage7.Controls.Add(this.tbCacheDays);
|
|
||||||
this.tabPage7.Controls.Add(this.lbFreshrate);
|
this.tabPage7.Controls.Add(this.lbFreshrate);
|
||||||
this.tabPage7.Controls.Add(this.lbCacheDays);
|
|
||||||
this.tabPage7.Controls.Add(this.chkEnableStatistics);
|
this.tabPage7.Controls.Add(this.chkEnableStatistics);
|
||||||
this.tabPage7.Controls.Add(this.chkAllowLANConn);
|
this.tabPage7.Controls.Add(this.chkAllowLANConn);
|
||||||
this.tabPage7.Controls.Add(this.txturlGFWList);
|
this.tabPage7.Controls.Add(this.txturlGFWList);
|
||||||
this.tabPage7.Controls.Add(this.label13);
|
this.tabPage7.Controls.Add(this.label13);
|
||||||
this.tabPage7.Controls.Add(this.chkAutoRun);
|
this.tabPage7.Controls.Add(this.chkAutoRun);
|
||||||
|
resources.ApplyResources(this.tabPage7, "tabPage7");
|
||||||
this.tabPage7.Name = "tabPage7";
|
this.tabPage7.Name = "tabPage7";
|
||||||
this.tabPage7.UseVisualStyleBackColor = true;
|
this.tabPage7.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// cbFreshrate
|
// cbFreshrate
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
|
|
||||||
this.cbFreshrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.cbFreshrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.cbFreshrate.FormattingEnabled = true;
|
this.cbFreshrate.FormattingEnabled = true;
|
||||||
|
resources.ApplyResources(this.cbFreshrate, "cbFreshrate");
|
||||||
this.cbFreshrate.Name = "cbFreshrate";
|
this.cbFreshrate.Name = "cbFreshrate";
|
||||||
//
|
//
|
||||||
// tbCacheDays
|
|
||||||
//
|
|
||||||
resources.ApplyResources(this.tbCacheDays, "tbCacheDays");
|
|
||||||
this.tbCacheDays.Name = "tbCacheDays";
|
|
||||||
//
|
|
||||||
// lbFreshrate
|
// lbFreshrate
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.lbFreshrate, "lbFreshrate");
|
resources.ApplyResources(this.lbFreshrate, "lbFreshrate");
|
||||||
this.lbFreshrate.Name = "lbFreshrate";
|
this.lbFreshrate.Name = "lbFreshrate";
|
||||||
//
|
//
|
||||||
// lbCacheDays
|
|
||||||
//
|
|
||||||
resources.ApplyResources(this.lbCacheDays, "lbCacheDays");
|
|
||||||
this.lbCacheDays.Name = "lbCacheDays";
|
|
||||||
//
|
|
||||||
// chkEnableStatistics
|
// chkEnableStatistics
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.chkEnableStatistics, "chkEnableStatistics");
|
resources.ApplyResources(this.chkEnableStatistics, "chkEnableStatistics");
|
||||||
@@ -549,11 +558,36 @@
|
|||||||
this.chkAutoRun.Name = "chkAutoRun";
|
this.chkAutoRun.Name = "chkAutoRun";
|
||||||
this.chkAutoRun.UseVisualStyleBackColor = true;
|
this.chkAutoRun.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
|
// tabPage9
|
||||||
|
//
|
||||||
|
this.tabPage9.Controls.Add(this.txtuserPacRule);
|
||||||
|
this.tabPage9.Controls.Add(this.panel4);
|
||||||
|
resources.ApplyResources(this.tabPage9, "tabPage9");
|
||||||
|
this.tabPage9.Name = "tabPage9";
|
||||||
|
this.tabPage9.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// txtuserPacRule
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.txtuserPacRule, "txtuserPacRule");
|
||||||
|
this.txtuserPacRule.Name = "txtuserPacRule";
|
||||||
|
//
|
||||||
|
// panel4
|
||||||
|
//
|
||||||
|
this.panel4.Controls.Add(this.label4);
|
||||||
|
resources.ApplyResources(this.panel4, "panel4");
|
||||||
|
this.panel4.Name = "panel4";
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
this.label4.ForeColor = System.Drawing.Color.Brown;
|
||||||
|
resources.ApplyResources(this.label4, "label4");
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
//
|
||||||
// panel2
|
// panel2
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.panel2, "panel2");
|
|
||||||
this.panel2.Controls.Add(this.btnClose);
|
this.panel2.Controls.Add(this.btnClose);
|
||||||
this.panel2.Controls.Add(this.btnOK);
|
this.panel2.Controls.Add(this.btnOK);
|
||||||
|
resources.ApplyResources(this.panel2, "panel2");
|
||||||
this.panel2.Name = "panel2";
|
this.panel2.Name = "panel2";
|
||||||
//
|
//
|
||||||
// btnOK
|
// btnOK
|
||||||
@@ -592,12 +626,16 @@
|
|||||||
this.tabPage4.PerformLayout();
|
this.tabPage4.PerformLayout();
|
||||||
this.tabPage5.ResumeLayout(false);
|
this.tabPage5.ResumeLayout(false);
|
||||||
this.tabPage5.PerformLayout();
|
this.tabPage5.PerformLayout();
|
||||||
|
this.tabPage8.ResumeLayout(false);
|
||||||
this.panel3.ResumeLayout(false);
|
this.panel3.ResumeLayout(false);
|
||||||
this.panel3.PerformLayout();
|
this.panel3.PerformLayout();
|
||||||
this.tabPage6.ResumeLayout(false);
|
this.tabPage6.ResumeLayout(false);
|
||||||
this.tabPage6.PerformLayout();
|
this.tabPage6.PerformLayout();
|
||||||
this.tabPage7.ResumeLayout(false);
|
this.tabPage7.ResumeLayout(false);
|
||||||
this.tabPage7.PerformLayout();
|
this.tabPage7.PerformLayout();
|
||||||
|
this.tabPage9.ResumeLayout(false);
|
||||||
|
this.tabPage9.PerformLayout();
|
||||||
|
this.panel4.ResumeLayout(false);
|
||||||
this.panel2.ResumeLayout(false);
|
this.panel2.ResumeLayout(false);
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
@@ -660,16 +698,19 @@
|
|||||||
private System.Windows.Forms.Panel panel3;
|
private System.Windows.Forms.Panel panel3;
|
||||||
private System.Windows.Forms.ComboBox cmbdomainStrategy;
|
private System.Windows.Forms.ComboBox cmbdomainStrategy;
|
||||||
private System.Windows.Forms.Label label15;
|
private System.Windows.Forms.Label label15;
|
||||||
private System.Windows.Forms.Label label12;
|
|
||||||
private System.Windows.Forms.ComboBox cmbroutingMode;
|
private System.Windows.Forms.ComboBox cmbroutingMode;
|
||||||
private System.Windows.Forms.CheckBox chksniffingEnabled;
|
private System.Windows.Forms.CheckBox chksniffingEnabled;
|
||||||
private System.Windows.Forms.CheckBox chksniffingEnabled2;
|
private System.Windows.Forms.CheckBox chksniffingEnabled2;
|
||||||
private System.Windows.Forms.Button btnSetDefRountingRule;
|
private System.Windows.Forms.Button btnSetDefRountingRule;
|
||||||
private System.Windows.Forms.CheckBox chkEnableStatistics;
|
private System.Windows.Forms.CheckBox chkEnableStatistics;
|
||||||
private System.Windows.Forms.TextBox tbCacheDays;
|
|
||||||
private System.Windows.Forms.Label lbCacheDays;
|
|
||||||
private System.Windows.Forms.ComboBox cbFreshrate;
|
private System.Windows.Forms.ComboBox cbFreshrate;
|
||||||
private System.Windows.Forms.Label lbFreshrate;
|
private System.Windows.Forms.Label lbFreshrate;
|
||||||
|
private System.Windows.Forms.Label label16;
|
||||||
|
private System.Windows.Forms.ComboBox cmblistenerType;
|
||||||
|
private System.Windows.Forms.TabPage tabPage8;
|
||||||
|
private System.Windows.Forms.TabPage tabPage9;
|
||||||
|
private System.Windows.Forms.TextBox txtuserPacRule;
|
||||||
|
private System.Windows.Forms.Panel panel4;
|
||||||
private System.Windows.Forms.Label label4;
|
private System.Windows.Forms.Label label4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,6 +22,8 @@ namespace v2rayN.Forms
|
|||||||
InitKCP();
|
InitKCP();
|
||||||
|
|
||||||
InitGUI();
|
InitGUI();
|
||||||
|
|
||||||
|
InitUserPAC();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -64,6 +66,8 @@ namespace v2rayN.Forms
|
|||||||
|
|
||||||
//remoteDNS
|
//remoteDNS
|
||||||
txtremoteDNS.Text = config.remoteDNS;
|
txtremoteDNS.Text = config.remoteDNS;
|
||||||
|
|
||||||
|
cmblistenerType.SelectedIndex = config.listenerType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -113,8 +117,6 @@ namespace v2rayN.Forms
|
|||||||
var enableStatistics = config.enableStatistics;
|
var enableStatistics = config.enableStatistics;
|
||||||
chkEnableStatistics.Checked = enableStatistics;
|
chkEnableStatistics.Checked = enableStatistics;
|
||||||
|
|
||||||
tbCacheDays.Text = config.CacheDays.ToString();
|
|
||||||
|
|
||||||
|
|
||||||
var cbSource = new ComboItem[]
|
var cbSource = new ComboItem[]
|
||||||
{
|
{
|
||||||
@@ -142,6 +144,11 @@ namespace v2rayN.Forms
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void InitUserPAC()
|
||||||
|
{
|
||||||
|
txtuserPacRule.Text = Utils.List2String(config.userPacRule, true);
|
||||||
|
}
|
||||||
|
|
||||||
private void btnOK_Click(object sender, EventArgs e)
|
private void btnOK_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (SaveBase() != 0)
|
if (SaveBase() != 0)
|
||||||
@@ -164,6 +171,11 @@ namespace v2rayN.Forms
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SaveUserPAC() != 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (ConfigHandler.SaveConfig(ref config) == 0)
|
if (ConfigHandler.SaveConfig(ref config) == 0)
|
||||||
{
|
{
|
||||||
this.DialogResult = DialogResult.OK;
|
this.DialogResult = DialogResult.OK;
|
||||||
@@ -251,6 +263,7 @@ namespace v2rayN.Forms
|
|||||||
//remoteDNS
|
//remoteDNS
|
||||||
config.remoteDNS = txtremoteDNS.Text.TrimEx();
|
config.remoteDNS = txtremoteDNS.Text.TrimEx();
|
||||||
|
|
||||||
|
config.listenerType = cmblistenerType.SelectedIndex;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -329,13 +342,6 @@ namespace v2rayN.Forms
|
|||||||
|
|
||||||
var lastEnableStatistics = config.enableStatistics;
|
var lastEnableStatistics = config.enableStatistics;
|
||||||
config.enableStatistics = chkEnableStatistics.Checked;
|
config.enableStatistics = chkEnableStatistics.Checked;
|
||||||
|
|
||||||
uint days = 0;
|
|
||||||
var valid = uint.TryParse(tbCacheDays.Text, out days);
|
|
||||||
if (!valid)
|
|
||||||
days = 7;
|
|
||||||
config.CacheDays = days;
|
|
||||||
|
|
||||||
config.statisticsFreshRate = (int)cbFreshrate.SelectedValue;
|
config.statisticsFreshRate = (int)cbFreshrate.SelectedValue;
|
||||||
|
|
||||||
//if(lastEnableStatistics != config.enableStatistics)
|
//if(lastEnableStatistics != config.enableStatistics)
|
||||||
@@ -350,6 +356,15 @@ namespace v2rayN.Forms
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int SaveUserPAC()
|
||||||
|
{
|
||||||
|
string userPacRule = txtuserPacRule.Text.TrimEx();
|
||||||
|
userPacRule = userPacRule.Replace("\"", "");
|
||||||
|
|
||||||
|
config.userPacRule = Utils.String2List(userPacRule);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
private void btnClose_Click(object sender, EventArgs e)
|
private void btnClose_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
this.DialogResult = DialogResult.Cancel;
|
this.DialogResult = DialogResult.Cancel;
|
||||||
@@ -372,6 +387,7 @@ namespace v2rayN.Forms
|
|||||||
txtUseragent.Text = Utils.GetEmbedText(Global.CustomRoutingFileName + Global.agentTag);
|
txtUseragent.Text = Utils.GetEmbedText(Global.CustomRoutingFileName + Global.agentTag);
|
||||||
txtUserdirect.Text = Utils.GetEmbedText(Global.CustomRoutingFileName + Global.directTag);
|
txtUserdirect.Text = Utils.GetEmbedText(Global.CustomRoutingFileName + Global.directTag);
|
||||||
txtUserblock.Text = Utils.GetEmbedText(Global.CustomRoutingFileName + Global.blockTag);
|
txtUserblock.Text = Utils.GetEmbedText(Global.CustomRoutingFileName + Global.blockTag);
|
||||||
|
cmbroutingMode.SelectedIndex = 3;
|
||||||
|
|
||||||
var lstUrl = new List<string>();
|
var lstUrl = new List<string>();
|
||||||
lstUrl.Add(Global.CustomRoutingListUrl + Global.agentTag);
|
lstUrl.Add(Global.CustomRoutingListUrl + Global.agentTag);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -121,6 +121,27 @@
|
|||||||
<value>取消(&C)</value>
|
<value>取消(&C)</value>
|
||||||
</data>
|
</data>
|
||||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
|
<data name="label16.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>53, 12</value>
|
||||||
|
</data>
|
||||||
|
<data name="label16.Text" xml:space="preserve">
|
||||||
|
<value>Http代理</value>
|
||||||
|
</data>
|
||||||
|
<data name="cmblistenerType.Items" xml:space="preserve">
|
||||||
|
<value>关闭Http代理</value>
|
||||||
|
</data>
|
||||||
|
<data name="cmblistenerType.Items1" xml:space="preserve">
|
||||||
|
<value>开启Http代理,并自动配置代理服务器(全局模式)</value>
|
||||||
|
</data>
|
||||||
|
<data name="cmblistenerType.Items2" xml:space="preserve">
|
||||||
|
<value>开启PAC,并自动配置PAC(PAC模式)</value>
|
||||||
|
</data>
|
||||||
|
<data name="cmblistenerType.Items3" xml:space="preserve">
|
||||||
|
<value>仅开启Http代理,不自动配置代理服务器(直连模式)</value>
|
||||||
|
</data>
|
||||||
|
<data name="cmblistenerType.Items4" xml:space="preserve">
|
||||||
|
<value>仅开启PAC,不自动配置PAC</value>
|
||||||
|
</data>
|
||||||
<data name="chksniffingEnabled2.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="chksniffingEnabled2.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>96, 16</value>
|
<value>96, 16</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -193,76 +214,32 @@
|
|||||||
<data name="tabPage1.Text" xml:space="preserve">
|
<data name="tabPage1.Text" xml:space="preserve">
|
||||||
<value> Core:基础设置 </value>
|
<value> Core:基础设置 </value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="txtUseragent.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>628, 449</value>
|
||||||
|
</data>
|
||||||
|
<data name="tabPage3.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>634, 455</value>
|
||||||
|
</data>
|
||||||
<data name="tabPage3.Text" xml:space="preserve">
|
<data name="tabPage3.Text" xml:space="preserve">
|
||||||
<value> 代理的Domain或IP </value>
|
<value> 1.代理的Domain或IP </value>
|
||||||
</data>
|
</data>
|
||||||
<data name="txtUserdirect.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="txtUserdirect.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>628, 404</value>
|
<value>628, 449</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="tabPage4.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="tabPage4.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>634, 410</value>
|
<value>634, 455</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="tabPage4.Text" xml:space="preserve">
|
<data name="tabPage4.Text" xml:space="preserve">
|
||||||
<value> 直连的Domain或IP </value>
|
<value> 2.直连的Domain或IP </value>
|
||||||
</data>
|
</data>
|
||||||
<data name="txtUserblock.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="txtUserblock.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>628, 404</value>
|
<value>628, 449</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="tabPage5.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="tabPage5.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>634, 410</value>
|
<value>634, 455</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="tabPage5.Text" xml:space="preserve">
|
<data name="tabPage5.Text" xml:space="preserve">
|
||||||
<value> 阻止的Domain或IP </value>
|
<value> 3.阻止的Domain或IP </value>
|
||||||
</data>
|
|
||||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
|
||||||
<data name="btnSetDefRountingRule.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
|
||||||
<value>NoControl</value>
|
|
||||||
</data>
|
|
||||||
<data name="btnSetDefRountingRule.Location" type="System.Drawing.Point, System.Drawing">
|
|
||||||
<value>7, 60</value>
|
|
||||||
</data>
|
|
||||||
<data name="btnSetDefRountingRule.Size" type="System.Drawing.Size, System.Drawing">
|
|
||||||
<value>201, 23</value>
|
|
||||||
</data>
|
|
||||||
<data name="btnSetDefRountingRule.Text" xml:space="preserve">
|
|
||||||
<value>一键设置默认自定义路由规则</value>
|
|
||||||
</data>
|
|
||||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
|
||||||
<data name="labRoutingTips.AutoSize" type="System.Boolean, mscorlib">
|
|
||||||
<value>True</value>
|
|
||||||
</data>
|
|
||||||
<data name="labRoutingTips.Location" type="System.Drawing.Point, System.Drawing">
|
|
||||||
<value>5, 96</value>
|
|
||||||
</data>
|
|
||||||
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
|
|
||||||
<value>383, 12</value>
|
|
||||||
</data>
|
|
||||||
<data name="labRoutingTips.Text" xml:space="preserve">
|
|
||||||
<value>*设置的规则,用逗号(,)隔开;支持Domain(纯字符串/正则/子域名)和IP</value>
|
|
||||||
</data>
|
|
||||||
<data name="label4.Text" xml:space="preserve">
|
|
||||||
<value>规则加载次序:自定义的代理/直连/阻止,选择的路由模式</value>
|
|
||||||
</data>
|
|
||||||
<data name="cmbdomainStrategy.Location" type="System.Drawing.Point, System.Drawing">
|
|
||||||
<value>81, 30</value>
|
|
||||||
</data>
|
|
||||||
<data name="cmbdomainStrategy.Size" type="System.Drawing.Size, System.Drawing">
|
|
||||||
<value>186, 20</value>
|
|
||||||
</data>
|
|
||||||
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
|
|
||||||
<value>53, 12</value>
|
|
||||||
</data>
|
|
||||||
<data name="label15.Text" xml:space="preserve">
|
|
||||||
<value>域名策略</value>
|
|
||||||
</data>
|
|
||||||
<data name="label12.Location" type="System.Drawing.Point, System.Drawing">
|
|
||||||
<value>295, 34</value>
|
|
||||||
</data>
|
|
||||||
<data name="label12.Size" type="System.Drawing.Size, System.Drawing">
|
|
||||||
<value>53, 12</value>
|
|
||||||
</data>
|
|
||||||
<data name="label12.Text" xml:space="preserve">
|
|
||||||
<value>路由模式</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="cmbroutingMode.Items" xml:space="preserve">
|
<data name="cmbroutingMode.Items" xml:space="preserve">
|
||||||
<value>全局</value>
|
<value>全局</value>
|
||||||
@@ -277,11 +254,64 @@
|
|||||||
<value>绕过局域网及大陆地址</value>
|
<value>绕过局域网及大陆地址</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="cmbroutingMode.Location" type="System.Drawing.Point, System.Drawing">
|
<data name="cmbroutingMode.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
<value>372, 30</value>
|
<value>19, 26</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="cmbroutingMode.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="cmbroutingMode.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>244, 20</value>
|
<value>244, 20</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="tabPage8.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>634, 455</value>
|
||||||
|
</data>
|
||||||
|
<data name="tabPage8.Text" xml:space="preserve">
|
||||||
|
<value> 4.预定义规则 </value>
|
||||||
|
</data>
|
||||||
|
<data name="tabControl2.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>3, 89</value>
|
||||||
|
</data>
|
||||||
|
<data name="tabControl2.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>642, 481</value>
|
||||||
|
</data>
|
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="btnSetDefRountingRule.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||||
|
<value>NoControl</value>
|
||||||
|
</data>
|
||||||
|
<data name="btnSetDefRountingRule.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>351, 14</value>
|
||||||
|
</data>
|
||||||
|
<data name="btnSetDefRountingRule.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>201, 23</value>
|
||||||
|
</data>
|
||||||
|
<data name="btnSetDefRountingRule.Text" xml:space="preserve">
|
||||||
|
<value>一键设置默认自定义路由规则</value>
|
||||||
|
</data>
|
||||||
|
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="labRoutingTips.AutoSize" type="System.Boolean, mscorlib">
|
||||||
|
<value>True</value>
|
||||||
|
</data>
|
||||||
|
<data name="labRoutingTips.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>5, 49</value>
|
||||||
|
</data>
|
||||||
|
<data name="labRoutingTips.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>383, 12</value>
|
||||||
|
</data>
|
||||||
|
<data name="labRoutingTips.Text" xml:space="preserve">
|
||||||
|
<value>*设置的规则,用逗号(,)隔开;支持Domain(纯字符串/正则/子域名)和IP</value>
|
||||||
|
</data>
|
||||||
|
<data name="cmbdomainStrategy.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>81, 14</value>
|
||||||
|
</data>
|
||||||
|
<data name="cmbdomainStrategy.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>186, 20</value>
|
||||||
|
</data>
|
||||||
|
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>53, 12</value>
|
||||||
|
</data>
|
||||||
|
<data name="label15.Text" xml:space="preserve">
|
||||||
|
<value>域名策略</value>
|
||||||
|
</data>
|
||||||
|
<data name="panel3.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>642, 72</value>
|
||||||
|
</data>
|
||||||
<data name="tabPage2.Text" xml:space="preserve">
|
<data name="tabPage2.Text" xml:space="preserve">
|
||||||
<value> Core:路由设置 </value>
|
<value> Core:路由设置 </value>
|
||||||
</data>
|
</data>
|
||||||
@@ -294,12 +324,6 @@
|
|||||||
<data name="lbFreshrate.Text" xml:space="preserve">
|
<data name="lbFreshrate.Text" xml:space="preserve">
|
||||||
<value>统计刷新频率</value>
|
<value>统计刷新频率</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="lbCacheDays.Size" type="System.Drawing.Size, System.Drawing">
|
|
||||||
<value>305, 12</value>
|
|
||||||
</data>
|
|
||||||
<data name="lbCacheDays.Text" xml:space="preserve">
|
|
||||||
<value>缓存天数(0-30, 0关闭缓存单独每天的数据使用情况)</value>
|
|
||||||
</data>
|
|
||||||
<data name="chkEnableStatistics.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="chkEnableStatistics.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>384, 16</value>
|
<value>384, 16</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -327,6 +351,12 @@
|
|||||||
<data name="tabPage7.Text" xml:space="preserve">
|
<data name="tabPage7.Text" xml:space="preserve">
|
||||||
<value> v2rayN设置 </value>
|
<value> v2rayN设置 </value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="label4.Text" xml:space="preserve">
|
||||||
|
<value>*设置用户PAC规则,用逗号(,)隔开</value>
|
||||||
|
</data>
|
||||||
|
<data name="tabPage9.Text" xml:space="preserve">
|
||||||
|
<value> 用户PAC设置 </value>
|
||||||
|
</data>
|
||||||
<data name="btnOK.Text" xml:space="preserve">
|
<data name="btnOK.Text" xml:space="preserve">
|
||||||
<value>确定(&O)</value>
|
<value>确定(&O)</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -5,19 +5,15 @@ namespace v2rayN
|
|||||||
{
|
{
|
||||||
#region 常量
|
#region 常量
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 更新链接
|
|
||||||
/// </summary>
|
|
||||||
public const string UpdateUrl = @"https://github.com/2dust/v2rayN/releases";
|
|
||||||
/// <summary>
|
|
||||||
/// 关于链接
|
|
||||||
/// </summary>
|
|
||||||
public const string AboutUrl = @"https://github.com/2dust/v2rayN";
|
public const string AboutUrl = @"https://github.com/2dust/v2rayN";
|
||||||
|
public const string UpdateUrl = AboutUrl + @"/releases";
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// SpeedTestUrl
|
/// SpeedTestUrl
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string SpeedTestUrl = @"http://speedtest-sfo2.digitalocean.com/10mb.test";
|
public const string SpeedTestUrl = @"http://speedtest-sgp1.digitalocean.com/10mb.test";
|
||||||
public const string SpeedPingTestUrl = @"https://www.google.com/generate_204";
|
public const string SpeedPingTestUrl = @"https://www.google.com/generate_204";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -30,7 +26,7 @@ namespace v2rayN
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// PromotionUrl
|
/// PromotionUrl
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string PromotionUrl = @"https://1.2345345.xyz/ads.html";
|
public const string PromotionUrl = @"aHR0cHM6Ly8xLjIzNDQ1Ni54eXovYWJjLmh0bWw=";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 本软件配置文件名
|
/// 本软件配置文件名
|
||||||
@@ -164,8 +160,9 @@ namespace v2rayN
|
|||||||
medium = 2000,
|
medium = 2000,
|
||||||
slow = 3000
|
slow = 3000
|
||||||
}
|
}
|
||||||
public const string StatisticLogDirectory = "Statistics";
|
public const string StatisticLogOverall = "StatisticLogOverall.json";
|
||||||
public const string StatisticLogOverall = "overall.txt";
|
|
||||||
|
public const string IEProxyExceptions = "<local>;localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;172.32.*";
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -219,6 +216,11 @@ namespace v2rayN
|
|||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Job processJob
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -41,10 +41,7 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
////默认监听端口
|
////默认监听端口
|
||||||
//config.pacPort = 8888;
|
//config.pacPort = 8888;
|
||||||
|
|
||||||
// 默认缓存七天
|
|
||||||
config.CacheDays = 7;
|
|
||||||
|
|
||||||
// 默认不开启统计
|
// 默认不开启统计
|
||||||
config.enableStatistics = false;
|
config.enableStatistics = false;
|
||||||
|
|
||||||
@@ -125,11 +122,19 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
config.urlGFWList = Global.GFWLIST_URL;
|
config.urlGFWList = Global.GFWLIST_URL;
|
||||||
}
|
}
|
||||||
|
//if (Utils.IsNullOrEmpty(config.remoteDNS))
|
||||||
|
//{
|
||||||
|
// config.remoteDNS = "1.1.1.1";
|
||||||
|
//}
|
||||||
|
|
||||||
if (config.subItem == null)
|
if (config.subItem == null)
|
||||||
{
|
{
|
||||||
config.subItem = new List<SubItem>();
|
config.subItem = new List<SubItem>();
|
||||||
}
|
}
|
||||||
|
if (config.userPacRule == null)
|
||||||
|
{
|
||||||
|
config.userPacRule = new List<string>();
|
||||||
|
}
|
||||||
|
|
||||||
if (config == null
|
if (config == null
|
||||||
|| config.index < 0
|
|| config.index < 0
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
using v2rayN.Base;
|
using v2rayN.Base;
|
||||||
using v2rayN.Mode;
|
using v2rayN.Mode;
|
||||||
|
using v2rayN.Properties;
|
||||||
|
|
||||||
namespace v2rayN.Handler
|
namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
@@ -37,19 +42,69 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private string latestUrl = "https://github.com/v2ray/v2ray-core/releases/latest";
|
|
||||||
private const string coreURL = "https://github.com/v2ray/v2ray-core/releases/download/{0}/v2ray-windows-{1}.zip";
|
|
||||||
private int progressPercentage = -1;
|
private int progressPercentage = -1;
|
||||||
private bool blFirst = true;
|
|
||||||
private long totalBytesToReceive = 0;
|
private long totalBytesToReceive = 0;
|
||||||
private DateTime totalDatetime = new DateTime();
|
private DateTime totalDatetime = new DateTime();
|
||||||
|
private int DownloadTimeout = -1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region v2rayN
|
||||||
|
|
||||||
|
private string nLatestUrl = "https://github.com/2dust/v2rayN/releases/latest";
|
||||||
|
private const string nUrl = "https://github.com/2dust/v2rayN/releases/download/{0}/v2rayN.zip";
|
||||||
|
|
||||||
|
public void AbsoluteV2rayN(Config config)
|
||||||
|
{
|
||||||
|
Utils.SetSecurityProtocol();
|
||||||
|
WebRequest request = WebRequest.Create(nLatestUrl);
|
||||||
|
request.BeginGetResponse(new AsyncCallback(OnResponseV2rayN), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnResponseV2rayN(IAsyncResult ar)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
HttpWebRequest request = (HttpWebRequest)ar.AsyncState;
|
||||||
|
HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(ar);
|
||||||
|
string redirectUrl = response.ResponseUri.AbsoluteUri;
|
||||||
|
string version = redirectUrl.Substring(redirectUrl.LastIndexOf("/", StringComparison.Ordinal) + 1);
|
||||||
|
|
||||||
|
var curVersion = FileVersionInfo.GetVersionInfo(Utils.GetExePath()).FileVersion.ToString();
|
||||||
|
if (curVersion == version)
|
||||||
|
{
|
||||||
|
if (AbsoluteCompleted != null)
|
||||||
|
{
|
||||||
|
AbsoluteCompleted(this, new ResultEventArgs(false, "Already the latest version"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string url = string.Format(nUrl, version);
|
||||||
|
if (AbsoluteCompleted != null)
|
||||||
|
{
|
||||||
|
AbsoluteCompleted(this, new ResultEventArgs(true, url));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Utils.SaveLog(ex.Message, ex);
|
||||||
|
|
||||||
|
if (Error != null)
|
||||||
|
Error(this, new ErrorEventArgs(ex));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Core
|
||||||
|
|
||||||
|
private string coreLatestUrl = "https://github.com/v2ray/v2ray-core/releases/latest";
|
||||||
|
private const string coreUrl = "https://github.com/v2ray/v2ray-core/releases/download/{0}/v2ray-windows-{1}.zip";
|
||||||
|
|
||||||
public void AbsoluteV2rayCore(Config config)
|
public void AbsoluteV2rayCore(Config config)
|
||||||
{
|
{
|
||||||
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; //TLS 1.2
|
Utils.SetSecurityProtocol();
|
||||||
ServicePointManager.DefaultConnectionLimit = 256;
|
WebRequest request = WebRequest.Create(coreLatestUrl);
|
||||||
WebRequest request = WebRequest.Create(latestUrl);
|
|
||||||
request.BeginGetResponse(new AsyncCallback(OnResponseV2rayCore), request);
|
request.BeginGetResponse(new AsyncCallback(OnResponseV2rayCore), request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +126,7 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
osBit = "32";
|
osBit = "32";
|
||||||
}
|
}
|
||||||
string url = string.Format(coreURL, version, osBit);
|
string url = string.Format(coreUrl, version, osBit);
|
||||||
if (AbsoluteCompleted != null)
|
if (AbsoluteCompleted != null)
|
||||||
{
|
{
|
||||||
AbsoluteCompleted(this, new ResultEventArgs(true, url));
|
AbsoluteCompleted(this, new ResultEventArgs(true, url));
|
||||||
@@ -86,21 +141,25 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
public void DownloadFileAsync(Config config, string url, WebProxy webProxy)
|
#region Download
|
||||||
|
|
||||||
|
public void DownloadFileAsync(Config config, string url, WebProxy webProxy, int downloadTimeout)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; //TLS 1.2
|
Utils.SetSecurityProtocol();
|
||||||
ServicePointManager.DefaultConnectionLimit = 256;
|
|
||||||
if (UpdateCompleted != null)
|
if (UpdateCompleted != null)
|
||||||
{
|
{
|
||||||
UpdateCompleted(this, new ResultEventArgs(false, "Downloading..."));
|
UpdateCompleted(this, new ResultEventArgs(false, "Downloading..."));
|
||||||
}
|
}
|
||||||
|
|
||||||
progressPercentage = -1;
|
progressPercentage = -1;
|
||||||
|
totalBytesToReceive = 0;
|
||||||
|
|
||||||
WebClientEx ws = new WebClientEx();
|
WebClientEx ws = new WebClientEx();
|
||||||
|
DownloadTimeout = downloadTimeout;
|
||||||
if (webProxy != null)
|
if (webProxy != null)
|
||||||
{
|
{
|
||||||
ws.Proxy = webProxy;// new WebProxy(Global.Loopback, Global.httpPort);
|
ws.Proxy = webProxy;// new WebProxy(Global.Loopback, Global.httpPort);
|
||||||
@@ -109,7 +168,6 @@ namespace v2rayN.Handler
|
|||||||
ws.DownloadFileCompleted += ws_DownloadFileCompleted;
|
ws.DownloadFileCompleted += ws_DownloadFileCompleted;
|
||||||
ws.DownloadProgressChanged += ws_DownloadProgressChanged;
|
ws.DownloadProgressChanged += ws_DownloadProgressChanged;
|
||||||
ws.DownloadFileAsync(new Uri(url), Utils.GetPath(DownloadFileName));
|
ws.DownloadFileAsync(new Uri(url), Utils.GetPath(DownloadFileName));
|
||||||
blFirst = true;
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -122,14 +180,23 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
void ws_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
|
void ws_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (blFirst)
|
|
||||||
{
|
|
||||||
totalBytesToReceive = e.TotalBytesToReceive - e.BytesReceived;
|
|
||||||
totalDatetime = DateTime.Now;
|
|
||||||
blFirst = false;
|
|
||||||
}
|
|
||||||
if (UpdateCompleted != null)
|
if (UpdateCompleted != null)
|
||||||
{
|
{
|
||||||
|
if (totalBytesToReceive == 0)
|
||||||
|
{
|
||||||
|
totalDatetime = DateTime.Now;
|
||||||
|
totalBytesToReceive = e.BytesReceived;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
totalBytesToReceive = e.BytesReceived;
|
||||||
|
|
||||||
|
if (DownloadTimeout != -1)
|
||||||
|
{
|
||||||
|
if ((DateTime.Now - totalDatetime).TotalSeconds > DownloadTimeout)
|
||||||
|
{
|
||||||
|
((WebClientEx)sender).CancelAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
if (progressPercentage != e.ProgressPercentage && e.ProgressPercentage % 10 == 0)
|
if (progressPercentage != e.ProgressPercentage && e.ProgressPercentage % 10 == 0)
|
||||||
{
|
{
|
||||||
progressPercentage = e.ProgressPercentage;
|
progressPercentage = e.ProgressPercentage;
|
||||||
@@ -143,19 +210,29 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (e.Error == null
|
if (UpdateCompleted != null)
|
||||||
|| Utils.IsNullOrEmpty(e.Error.ToString()))
|
|
||||||
{
|
{
|
||||||
if (UpdateCompleted != null)
|
if (e.Cancelled)
|
||||||
{
|
{
|
||||||
|
((WebClientEx)sender).Dispose();
|
||||||
|
TimeSpan ts = (DateTime.Now - totalDatetime);
|
||||||
|
string speed = string.Format("<{0} M/s", (totalBytesToReceive / ts.TotalMilliseconds / 1000).ToString("#0.##"));
|
||||||
|
UpdateCompleted(this, new ResultEventArgs(true, speed));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.Error == null
|
||||||
|
|| Utils.IsNullOrEmpty(e.Error.ToString()))
|
||||||
|
{
|
||||||
|
|
||||||
TimeSpan ts = (DateTime.Now - totalDatetime);
|
TimeSpan ts = (DateTime.Now - totalDatetime);
|
||||||
string speed = string.Format("{0} M/s", (totalBytesToReceive / ts.TotalMilliseconds / 1000).ToString("#0.##"));
|
string speed = string.Format("{0} M/s", (totalBytesToReceive / ts.TotalMilliseconds / 1000).ToString("#0.##"));
|
||||||
UpdateCompleted(this, new ResultEventArgs(true, speed));
|
UpdateCompleted(this, new ResultEventArgs(true, speed));
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
throw e.Error;
|
||||||
throw e.Error;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -176,8 +253,7 @@ namespace v2rayN.Handler
|
|||||||
string source = string.Empty;
|
string source = string.Empty;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; //TLS 1.2
|
Utils.SetSecurityProtocol();
|
||||||
ServicePointManager.DefaultConnectionLimit = 256;
|
|
||||||
|
|
||||||
WebClientEx ws = new WebClientEx();
|
WebClientEx ws = new WebClientEx();
|
||||||
ws.DownloadStringCompleted += Ws_DownloadStringCompleted;
|
ws.DownloadStringCompleted += Ws_DownloadStringCompleted;
|
||||||
@@ -216,6 +292,47 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region PAC
|
||||||
|
|
||||||
|
public string GenPacFile(string result)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File.WriteAllText(Utils.GetTempPath("gfwlist.txt"), result, Encoding.UTF8);
|
||||||
|
List<string> lines = ParsePacResult(result);
|
||||||
|
string abpContent = Utils.UnGzip(Resources.abp_js);
|
||||||
|
abpContent = abpContent.Replace("__RULES__", JsonConvert.SerializeObject(lines, Formatting.Indented));
|
||||||
|
File.WriteAllText(Utils.GetPath(Global.pacFILE), abpContent, Encoding.UTF8);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Utils.SaveLog(ex.Message, ex);
|
||||||
|
return ex.Message;
|
||||||
|
}
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<string> ParsePacResult(string response)
|
||||||
|
{
|
||||||
|
IEnumerable<char> IgnoredLineBegins = new[] { '!', '[' };
|
||||||
|
|
||||||
|
byte[] bytes = Convert.FromBase64String(response);
|
||||||
|
string content = Encoding.UTF8.GetString(bytes);
|
||||||
|
List<string> valid_lines = new List<string>();
|
||||||
|
using (var sr = new StringReader(content))
|
||||||
|
{
|
||||||
|
foreach (var line in sr.NonWhiteSpaceLines())
|
||||||
|
{
|
||||||
|
if (line.BeginWithAny(IgnoredLineBegins))
|
||||||
|
continue;
|
||||||
|
valid_lines.Add(line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return valid_lines;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
155
v2rayN/v2rayN/Handler/MainFormHandler.cs
Normal file
155
v2rayN/v2rayN/Handler/MainFormHandler.cs
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
using Grpc.Core;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Sockets;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using v2rayN.Base;
|
||||||
|
using v2rayN.Mode;
|
||||||
|
|
||||||
|
namespace v2rayN.Handler
|
||||||
|
{
|
||||||
|
class MainFormHandler
|
||||||
|
{
|
||||||
|
private static MainFormHandler instance;
|
||||||
|
|
||||||
|
//private DownloadHandle downloadHandle2;
|
||||||
|
//private Config _config;
|
||||||
|
//private V2rayHandler _v2rayHandler;
|
||||||
|
//private List<int> _selecteds;
|
||||||
|
//private Thread _workThread;
|
||||||
|
//Action<int, string> _updateFunc;
|
||||||
|
public static MainFormHandler Instance
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (instance == null)
|
||||||
|
{
|
||||||
|
instance = new MainFormHandler();
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Icon GetNotifyIcon(Config config, Icon def)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var color = ColorTranslator.FromHtml("#3399CC");
|
||||||
|
var index = config.listenerType;
|
||||||
|
if (index > 0)
|
||||||
|
{
|
||||||
|
color = (new Color[] { Color.Red, Color.Purple, Color.DarkGreen, Color.Orange })[index - 1];
|
||||||
|
//color = ColorTranslator.FromHtml(new string[] { "#CC0066", "#CC6600", "#99CC99", "#666699" }[index - 1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
var width = 128;
|
||||||
|
var height = 128;
|
||||||
|
|
||||||
|
var bitmap = new Bitmap(width, height);
|
||||||
|
var graphics = Graphics.FromImage(bitmap);
|
||||||
|
var drawBrush = new SolidBrush(color);
|
||||||
|
|
||||||
|
graphics.FillEllipse(drawBrush, new Rectangle(0, 0, width, height));
|
||||||
|
var zoom = 16;
|
||||||
|
graphics.DrawImage(new Bitmap(Properties.Resources.notify, width - zoom, width - zoom), zoom / 2, zoom / 2);
|
||||||
|
|
||||||
|
Icon createdIcon = Icon.FromHandle(bitmap.GetHicon());
|
||||||
|
|
||||||
|
drawBrush.Dispose();
|
||||||
|
graphics.Dispose();
|
||||||
|
bitmap.Dispose();
|
||||||
|
|
||||||
|
return createdIcon;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Utils.SaveLog(ex.Message, ex);
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Export2ClientConfig(int index, Config config)
|
||||||
|
{
|
||||||
|
//int index = GetLvSelectedIndex();
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (config.vmess[index].configType != (int)EConfigType.Vmess)
|
||||||
|
{
|
||||||
|
UI.Show(UIRes.I18N("NonVmessService"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SaveFileDialog fileDialog = new SaveFileDialog();
|
||||||
|
fileDialog.Filter = "Config|*.json";
|
||||||
|
fileDialog.FilterIndex = 2;
|
||||||
|
fileDialog.RestoreDirectory = true;
|
||||||
|
if (fileDialog.ShowDialog() != DialogResult.OK)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
string fileName = fileDialog.FileName;
|
||||||
|
if (Utils.IsNullOrEmpty(fileName))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Config configCopy = Utils.DeepCopy<Config>(config);
|
||||||
|
configCopy.index = index;
|
||||||
|
string msg;
|
||||||
|
if (V2rayConfigHandler.Export2ClientConfig(configCopy, fileName, out msg) != 0)
|
||||||
|
{
|
||||||
|
UI.Show(msg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UI.Show(string.Format(UIRes.I18N("SaveClientConfigurationIn"), fileName));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Export2ServerConfig(int index, Config config)
|
||||||
|
{
|
||||||
|
//int index = GetLvSelectedIndex();
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (config.vmess[index].configType != (int)EConfigType.Vmess)
|
||||||
|
{
|
||||||
|
UI.Show(UIRes.I18N("NonVmessService"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SaveFileDialog fileDialog = new SaveFileDialog();
|
||||||
|
fileDialog.Filter = "Config|*.json";
|
||||||
|
fileDialog.FilterIndex = 2;
|
||||||
|
fileDialog.RestoreDirectory = true;
|
||||||
|
if (fileDialog.ShowDialog() != DialogResult.OK)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
string fileName = fileDialog.FileName;
|
||||||
|
if (Utils.IsNullOrEmpty(fileName))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Config configCopy = Utils.DeepCopy<Config>(config);
|
||||||
|
configCopy.index = index;
|
||||||
|
string msg;
|
||||||
|
if (V2rayConfigHandler.Export2ServerConfig(configCopy, fileName, out msg) != 0)
|
||||||
|
{
|
||||||
|
UI.Show(msg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UI.Show(string.Format(UIRes.I18N("SaveServerConfigurationIn"), fileName));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,190 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.Win32;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace v2rayN.Handler
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 设置系统代理类
|
|
||||||
/// </summary>
|
|
||||||
class ProxySetting
|
|
||||||
{
|
|
||||||
public static bool UnsetProxy()
|
|
||||||
{
|
|
||||||
return SetProxy(null, null);
|
|
||||||
}
|
|
||||||
public static bool SetProxy(string strProxy)
|
|
||||||
{
|
|
||||||
return SetProxy(strProxy, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool SetProxy(string strProxy, string exceptions)
|
|
||||||
{
|
|
||||||
InternetPerConnOptionList list = new InternetPerConnOptionList();
|
|
||||||
|
|
||||||
int optionCount = string.IsNullOrEmpty(strProxy) ? 1 : (string.IsNullOrEmpty(exceptions) ? 2 : 3);
|
|
||||||
InternetConnectionOption[] options = new InternetConnectionOption[optionCount];
|
|
||||||
// USE a proxy server ...
|
|
||||||
options[0].m_Option = PerConnOption.INTERNET_PER_CONN_FLAGS;
|
|
||||||
options[0].m_Value.m_Int = (int)((optionCount < 2) ? PerConnFlags.PROXY_TYPE_DIRECT : (PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_PROXY));
|
|
||||||
// use THIS proxy server
|
|
||||||
if (optionCount > 1)
|
|
||||||
{
|
|
||||||
options[1].m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_SERVER;
|
|
||||||
options[1].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(strProxy);
|
|
||||||
// except for these addresses ...
|
|
||||||
if (optionCount > 2)
|
|
||||||
{
|
|
||||||
options[2].m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_BYPASS;
|
|
||||||
options[2].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(exceptions);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// default stuff
|
|
||||||
list.dwSize = Marshal.SizeOf(list);
|
|
||||||
list.szConnection = IntPtr.Zero;
|
|
||||||
list.dwOptionCount = options.Length;
|
|
||||||
list.dwOptionError = 0;
|
|
||||||
|
|
||||||
|
|
||||||
int optSize = Marshal.SizeOf(typeof(InternetConnectionOption));
|
|
||||||
// make a pointer out of all that ...
|
|
||||||
IntPtr optionsPtr = Marshal.AllocCoTaskMem(optSize * options.Length);
|
|
||||||
// copy the array over into that spot in memory ...
|
|
||||||
for (int i = 0; i < options.Length; ++i)
|
|
||||||
{
|
|
||||||
IntPtr opt = new IntPtr(optionsPtr.ToInt32() + (i * optSize));
|
|
||||||
Marshal.StructureToPtr(options[i], opt, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
list.options = optionsPtr;
|
|
||||||
|
|
||||||
// and then make a pointer out of the whole list
|
|
||||||
IntPtr ipcoListPtr = Marshal.AllocCoTaskMem((Int32)list.dwSize);
|
|
||||||
Marshal.StructureToPtr(list, ipcoListPtr, false);
|
|
||||||
|
|
||||||
// and finally, call the API method!
|
|
||||||
int returnvalue = NativeMethods.InternetSetOption(IntPtr.Zero,
|
|
||||||
InternetOption.INTERNET_OPTION_PER_CONNECTION_OPTION,
|
|
||||||
ipcoListPtr, list.dwSize) ? -1 : 0;
|
|
||||||
if (returnvalue == 0)
|
|
||||||
{ // get the error codes, they might be helpful
|
|
||||||
returnvalue = Marshal.GetLastWin32Error();
|
|
||||||
}
|
|
||||||
// FREE the data ASAP
|
|
||||||
Marshal.FreeCoTaskMem(optionsPtr);
|
|
||||||
Marshal.FreeCoTaskMem(ipcoListPtr);
|
|
||||||
if (returnvalue > 0)
|
|
||||||
{ // throw the error codes, they might be helpful
|
|
||||||
//throw new Win32Exception(Marshal.GetLastWin32Error());
|
|
||||||
}
|
|
||||||
|
|
||||||
return (returnvalue < 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#region WinInet structures
|
|
||||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
|
||||||
public struct InternetPerConnOptionList
|
|
||||||
{
|
|
||||||
public int dwSize; // size of the INTERNET_PER_CONN_OPTION_LIST struct
|
|
||||||
public IntPtr szConnection; // connection name to set/query options
|
|
||||||
public int dwOptionCount; // number of options to set/query
|
|
||||||
public int dwOptionError; // on error, which option failed
|
|
||||||
//[MarshalAs(UnmanagedType.)]
|
|
||||||
public IntPtr options;
|
|
||||||
};
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
|
||||||
public struct InternetConnectionOption
|
|
||||||
{
|
|
||||||
static readonly int Size;
|
|
||||||
public PerConnOption m_Option;
|
|
||||||
public InternetConnectionOptionValue m_Value;
|
|
||||||
static InternetConnectionOption()
|
|
||||||
{
|
|
||||||
InternetConnectionOption.Size = Marshal.SizeOf(typeof(InternetConnectionOption));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Nested Types
|
|
||||||
[StructLayout(LayoutKind.Explicit)]
|
|
||||||
public struct InternetConnectionOptionValue
|
|
||||||
{
|
|
||||||
// Fields
|
|
||||||
[FieldOffset(0)]
|
|
||||||
public System.Runtime.InteropServices.ComTypes.FILETIME m_FileTime;
|
|
||||||
[FieldOffset(0)]
|
|
||||||
public int m_Int;
|
|
||||||
[FieldOffset(0)]
|
|
||||||
public IntPtr m_StringPtr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region WinInet enums
|
|
||||||
//
|
|
||||||
// options manifests for Internet{Query|Set}Option
|
|
||||||
//
|
|
||||||
public enum InternetOption : uint
|
|
||||||
{
|
|
||||||
INTERNET_OPTION_PER_CONNECTION_OPTION = 75
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Options used in INTERNET_PER_CONN_OPTON struct
|
|
||||||
//
|
|
||||||
public enum PerConnOption
|
|
||||||
{
|
|
||||||
INTERNET_PER_CONN_FLAGS = 1, // Sets or retrieves the connection type. The Value member will contain one or more of the values from PerConnFlags
|
|
||||||
INTERNET_PER_CONN_PROXY_SERVER = 2, // Sets or retrieves a string containing the proxy servers.
|
|
||||||
INTERNET_PER_CONN_PROXY_BYPASS = 3, // Sets or retrieves a string containing the URLs that do not use the proxy server.
|
|
||||||
INTERNET_PER_CONN_AUTOCONFIG_URL = 4//, // Sets or retrieves a string containing the URL to the automatic configuration script.
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// PER_CONN_FLAGS
|
|
||||||
//
|
|
||||||
[Flags]
|
|
||||||
public enum PerConnFlags
|
|
||||||
{
|
|
||||||
PROXY_TYPE_DIRECT = 0x00000001, // direct to net
|
|
||||||
PROXY_TYPE_PROXY = 0x00000002, // via named proxy
|
|
||||||
PROXY_TYPE_AUTO_PROXY_URL = 0x00000004, // autoproxy URL
|
|
||||||
PROXY_TYPE_AUTO_DETECT = 0x00000008 // use autoproxy detection
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
internal static class NativeMethods
|
|
||||||
{
|
|
||||||
[DllImport("WinInet.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
|
||||||
public static extern bool InternetSetOption(IntPtr hInternet, InternetOption dwOption, IntPtr lpBuffer, int dwBufferLength);
|
|
||||||
}
|
|
||||||
|
|
||||||
//判断是否使用代理
|
|
||||||
public static bool UsedProxy()
|
|
||||||
{
|
|
||||||
RegistryKey rk = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", true);
|
|
||||||
if (rk.GetValue("ProxyEnable").ToString() == "1")
|
|
||||||
{
|
|
||||||
rk.Close();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
rk.Close();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//获得代理的IP和端口
|
|
||||||
public static string GetProxyProxyServer()
|
|
||||||
{
|
|
||||||
RegistryKey rk = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", true);
|
|
||||||
string ProxyServer = rk.GetValue("ProxyServer").ToString();
|
|
||||||
rk.Close();
|
|
||||||
return ProxyServer;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
|
|
||||||
namespace v2rayN.Handler
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 路由规则文件处理类
|
|
||||||
/// </summary>
|
|
||||||
class RoutingRuleHandler
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Parse Pac to v2ray rule
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="filePath"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static List<string> ParsePac(string filePath)
|
|
||||||
{
|
|
||||||
string result = Utils.LoadResource(filePath);
|
|
||||||
if (Utils.IsNullOrEmpty(result))
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//取得rule
|
|
||||||
string pattern = @"(?is)(?<=\[)(.*)(?=\])";
|
|
||||||
Regex rgx = new Regex(pattern);
|
|
||||||
result = rgx.Match(result).Value;
|
|
||||||
int index = result.IndexOf("];");
|
|
||||||
result = result.Substring(0, index);
|
|
||||||
if (Utils.IsNullOrEmpty(result))
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
string[] arrPac = result.Split(',');
|
|
||||||
List<string> lstPac = new List<string>();
|
|
||||||
foreach (string str in arrPac)
|
|
||||||
{
|
|
||||||
//处理有效值
|
|
||||||
if (Utils.IsNullOrEmpty(str)
|
|
||||||
|| str.Length <= 3)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
string value = str.Replace("\",", "").Replace("\"", "").Replace(",", "").Replace("\r\n", "").Replace(" ", "");
|
|
||||||
lstPac.Add(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
return lstPac;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using Grpc.Core;
|
using System;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
@@ -69,7 +68,7 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RunPing()
|
private void RunPing()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -100,7 +99,7 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RunTcping()
|
private void RunTcping()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -131,7 +130,7 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RunRealPing()
|
private void RunRealPing()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -245,7 +244,7 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
testCounter++;
|
testCounter++;
|
||||||
var webProxy = new WebProxy(Global.Loopback, httpPort + index);
|
var webProxy = new WebProxy(Global.Loopback, httpPort + index);
|
||||||
downloadHandle2.DownloadFileAsync(_config, url, webProxy);
|
downloadHandle2.DownloadFileAsync(_config, url, webProxy, 30);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -308,7 +307,5 @@ namespace v2rayN.Handler
|
|||||||
return msg;
|
return msg;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,91 +15,57 @@ namespace v2rayN.Handler
|
|||||||
class StatisticsHandler
|
class StatisticsHandler
|
||||||
{
|
{
|
||||||
private Mode.Config config_;
|
private Mode.Config config_;
|
||||||
|
private ServerStatistics serverStatistics_;
|
||||||
private Channel channel_;
|
private Channel channel_;
|
||||||
private StatsService.StatsServiceClient client_;
|
private StatsService.StatsServiceClient client_;
|
||||||
private Thread workThread_;
|
private Thread workThread_;
|
||||||
|
private bool exitFlag_;
|
||||||
|
|
||||||
Action<ulong, ulong, ulong, ulong, List<Mode.ServerStatistics>> updateFunc_;
|
Action<ulong, ulong, List<ServerStatItem>> updateFunc_;
|
||||||
|
|
||||||
private bool enabled_;
|
|
||||||
public bool Enable
|
public bool Enable
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return enabled_;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
enabled_ = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool UpdateUI;
|
|
||||||
|
|
||||||
public ulong TotalUp
|
|
||||||
{
|
|
||||||
get; private set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ulong TotalDown
|
|
||||||
{
|
|
||||||
get; private set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Mode.ServerStatistics> Statistic
|
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ulong Up
|
public bool UpdateUI
|
||||||
{
|
{
|
||||||
get; private set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ulong Down
|
public List<ServerStatItem> Statistic
|
||||||
{
|
{
|
||||||
get; private set;
|
get
|
||||||
|
{
|
||||||
|
return serverStatistics_.server;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private string logPath_;
|
public StatisticsHandler(Mode.Config config, Action<ulong, ulong, List<ServerStatItem>> update)
|
||||||
|
|
||||||
private bool exitFlag_; // true to close workThread_
|
|
||||||
|
|
||||||
public StatisticsHandler(Mode.Config config, Action<ulong, ulong, ulong, ulong, List<Mode.ServerStatistics>> update)
|
|
||||||
{
|
{
|
||||||
try
|
//try
|
||||||
{
|
//{
|
||||||
if (Environment.Is64BitOperatingSystem)
|
// if (Environment.Is64BitOperatingSystem)
|
||||||
{
|
// {
|
||||||
FileManager.UncompressFile(Utils.GetPath("grpc_csharp_ext.x64.dll"), Resources.grpc_csharp_ext_x64_dll);
|
// FileManager.UncompressFile(Utils.GetPath("grpc_csharp_ext.x64.dll"), Resources.grpc_csharp_ext_x64_dll);
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
FileManager.UncompressFile(Utils.GetPath("grpc_csharp_ext.x86.dll"), Resources.grpc_csharp_ext_x86_dll);
|
// FileManager.UncompressFile(Utils.GetPath("grpc_csharp_ext.x86.dll"), Resources.grpc_csharp_ext_x86_dll);
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
catch (IOException ex)
|
//catch (IOException ex)
|
||||||
{
|
//{
|
||||||
Utils.SaveLog(ex.Message, ex);
|
// Utils.SaveLog(ex.Message, ex);
|
||||||
|
|
||||||
}
|
//}
|
||||||
|
|
||||||
config_ = config;
|
config_ = config;
|
||||||
enabled_ = config.enableStatistics;
|
Enable = config.enableStatistics;
|
||||||
UpdateUI = false;
|
UpdateUI = false;
|
||||||
updateFunc_ = update;
|
updateFunc_ = update;
|
||||||
logPath_ = Utils.GetPath(Global.StatisticLogDirectory);
|
|
||||||
Statistic = new List<Mode.ServerStatistics>();
|
|
||||||
exitFlag_ = false;
|
exitFlag_ = false;
|
||||||
|
|
||||||
DeleteExpiredLog();
|
|
||||||
foreach (var server in config.vmess)
|
|
||||||
{
|
|
||||||
var statistic = new ServerStatistics(server.remarks, server.address, server.port, server.path, server.requestHost, 0, 0, 0, 0);
|
|
||||||
Statistic.Add(statistic);
|
|
||||||
}
|
|
||||||
|
|
||||||
LoadFromFile();
|
LoadFromFile();
|
||||||
|
|
||||||
GrpcInit();
|
GrpcInit();
|
||||||
@@ -125,7 +91,6 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
exitFlag_ = true;
|
exitFlag_ = true;
|
||||||
channel_.ShutdownAsync();
|
channel_.ShutdownAsync();
|
||||||
}
|
}
|
||||||
@@ -141,7 +106,7 @@ namespace v2rayN.Handler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (enabled_ && channel_.State == ChannelState.Ready)
|
if (Enable && channel_.State == ChannelState.Ready)
|
||||||
{
|
{
|
||||||
QueryStatsResponse res = null;
|
QueryStatsResponse res = null;
|
||||||
try
|
try
|
||||||
@@ -155,32 +120,23 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
if (res != null)
|
if (res != null)
|
||||||
{
|
{
|
||||||
var addr = config_.address();
|
var itemId = config_.getItemId();
|
||||||
var port = config_.port();
|
var serverStatItem = GetServerStatItem(itemId);
|
||||||
var path = config_.path();
|
|
||||||
var cur = Statistic.FindIndex(item => item.address == addr && item.port == port && item.path == path);
|
|
||||||
ulong up = 0,
|
ulong up = 0,
|
||||||
down = 0;
|
down = 0;
|
||||||
|
|
||||||
//TODO: parse output
|
//TODO: parse output
|
||||||
ParseOutput(res.Stat, out up, out down);
|
ParseOutput(res.Stat, out up, out down);
|
||||||
|
|
||||||
Up = up;
|
serverStatItem.todayUp += up;
|
||||||
Down = down;
|
serverStatItem.todayDown += down;
|
||||||
|
serverStatItem.totalUp += up;
|
||||||
TotalUp += up;
|
serverStatItem.totalDown += down;
|
||||||
TotalDown += down;
|
|
||||||
|
|
||||||
if (cur != -1)
|
|
||||||
{
|
|
||||||
Statistic[cur].todayUp += up;
|
|
||||||
Statistic[cur].todayDown += down;
|
|
||||||
Statistic[cur].totalUp += up;
|
|
||||||
Statistic[cur].totalDown += down;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (UpdateUI)
|
if (UpdateUI)
|
||||||
updateFunc_(TotalUp, TotalDown, Up, Down, Statistic);
|
{
|
||||||
|
updateFunc_(up, down, new List<ServerStatItem> { serverStatItem });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Thread.Sleep(config_.statisticsFreshRate);
|
Thread.Sleep(config_.statisticsFreshRate);
|
||||||
@@ -193,7 +149,82 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ParseOutput(Google.Protobuf.Collections.RepeatedField<Stat> source, out ulong up, out ulong down)
|
public void LoadFromFile()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string result = Utils.LoadResource(Utils.GetPath(Global.StatisticLogOverall));
|
||||||
|
if (!Utils.IsNullOrEmpty(result))
|
||||||
|
{
|
||||||
|
//转成Json
|
||||||
|
serverStatistics_ = Utils.FromJson<ServerStatistics>(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (serverStatistics_ == null)
|
||||||
|
{
|
||||||
|
serverStatistics_ = new ServerStatistics();
|
||||||
|
}
|
||||||
|
if (serverStatistics_.server == null)
|
||||||
|
{
|
||||||
|
serverStatistics_.server = new List<ServerStatItem>();
|
||||||
|
}
|
||||||
|
|
||||||
|
var ticks = DateTime.Now.Date.Ticks;
|
||||||
|
foreach (var item in serverStatistics_.server)
|
||||||
|
{
|
||||||
|
if (item.dateNow != ticks)
|
||||||
|
{
|
||||||
|
item.todayUp = 0;
|
||||||
|
item.todayDown = 0;
|
||||||
|
item.dateNow = ticks;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Utils.SaveLog(ex.Message, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SaveToFile()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Utils.ToJsonFile(serverStatistics_, Utils.GetPath(Global.StatisticLogOverall));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Utils.SaveLog(ex.Message, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private ServerStatItem GetServerStatItem(string itemId)
|
||||||
|
{
|
||||||
|
var ticks = DateTime.Now.Date.Ticks;
|
||||||
|
var cur = Statistic.FindIndex(item => item.itemId == itemId);
|
||||||
|
if (cur < 0)
|
||||||
|
{
|
||||||
|
Statistic.Add(new ServerStatItem
|
||||||
|
{
|
||||||
|
itemId = itemId,
|
||||||
|
totalUp = 0,
|
||||||
|
totalDown = 0,
|
||||||
|
todayUp = 0,
|
||||||
|
todayDown = 0,
|
||||||
|
dateNow = ticks
|
||||||
|
});
|
||||||
|
cur = Statistic.Count - 1;
|
||||||
|
}
|
||||||
|
if (Statistic[cur].dateNow != ticks)
|
||||||
|
{
|
||||||
|
Statistic[cur].todayUp = 0;
|
||||||
|
Statistic[cur].todayDown = 0;
|
||||||
|
Statistic[cur].dateNow = ticks;
|
||||||
|
}
|
||||||
|
return Statistic[cur];
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ParseOutput(Google.Protobuf.Collections.RepeatedField<Stat> source, out ulong up, out ulong down)
|
||||||
{
|
{
|
||||||
|
|
||||||
up = 0; down = 0;
|
up = 0; down = 0;
|
||||||
@@ -231,218 +262,6 @@ namespace v2rayN.Handler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveToFile()
|
|
||||||
{
|
|
||||||
if (!Directory.Exists(logPath_))
|
|
||||||
{
|
|
||||||
Directory.CreateDirectory(logPath_);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 总流量统计文件
|
|
||||||
var overallPath = Path.Combine(logPath_, Global.StatisticLogOverall);
|
|
||||||
if (!File.Exists(overallPath))
|
|
||||||
{
|
|
||||||
File.Create(overallPath);
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using (var overallWriter = new StreamWriter(overallPath))
|
|
||||||
{
|
|
||||||
double up_amount, down_amount;
|
|
||||||
string up_unit, down_unit;
|
|
||||||
|
|
||||||
Utils.ToHumanReadable(TotalUp, out up_amount, out up_unit);
|
|
||||||
Utils.ToHumanReadable(TotalDown, out down_amount, out down_unit);
|
|
||||||
|
|
||||||
overallWriter.WriteLine($"LastUpdate {DateTime.Now.ToString("yyyy-MM-dd")} {DateTime.Now.ToLongTimeString()}");
|
|
||||||
overallWriter.WriteLine($"UP {string.Format("{0:f2}", up_amount)}{up_unit} {TotalUp}");
|
|
||||||
overallWriter.WriteLine($"DOWN {string.Format("{0:f2}", down_amount)}{down_unit} {TotalDown}");
|
|
||||||
foreach (var s in Statistic)
|
|
||||||
{
|
|
||||||
overallWriter.WriteLine($"* {s.name} {s.address} {s.port} {s.path} {s.host} {s.totalUp} {s.totalDown}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Utils.SaveLog(ex.Message, ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 当天流量记录文件
|
|
||||||
var dailyPath = Path.Combine(logPath_, $"{DateTime.Now.ToString("yyyy-MM-dd")}.txt");
|
|
||||||
if (!File.Exists(dailyPath))
|
|
||||||
{
|
|
||||||
File.Create(dailyPath);
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using (var dailyWriter = new StreamWriter(dailyPath))
|
|
||||||
{
|
|
||||||
dailyWriter.WriteLine($"LastUpdate {DateTime.Now.ToString("yyyy-MM-dd")} {DateTime.Now.ToLongTimeString()}");
|
|
||||||
foreach (var s in Statistic)
|
|
||||||
{
|
|
||||||
dailyWriter.WriteLine($"* {s.name} {s.address} {s.port} {s.path} {s.host} {s.todayUp} {s.todayDown}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Utils.SaveLog(ex.Message, ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void LoadFromFile()
|
|
||||||
{
|
|
||||||
if (!Directory.Exists(logPath_)) return;
|
|
||||||
|
|
||||||
// 总流量统计文件
|
|
||||||
///
|
|
||||||
/// 文件结构
|
|
||||||
/// LastUpdate [date] [time]
|
|
||||||
/// UP [readable string] [amount]
|
|
||||||
/// DOWN [readable string] [amount]
|
|
||||||
/// 每行每个数据空格分隔
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Utils.SaveLog(logPath_ + Global.StatisticLogOverall);
|
|
||||||
var overallPath = Path.Combine(logPath_, Global.StatisticLogOverall);
|
|
||||||
if (File.Exists(overallPath))
|
|
||||||
{
|
|
||||||
using (var overallReader = new StreamReader(overallPath))
|
|
||||||
{
|
|
||||||
while (!overallReader.EndOfStream)
|
|
||||||
{
|
|
||||||
var line = overallReader.ReadLine();
|
|
||||||
if (line.StartsWith("LastUpdate"))
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (line.StartsWith("UP"))
|
|
||||||
{
|
|
||||||
var datas = line.Split(' ');
|
|
||||||
if (datas.Length < 3) return;
|
|
||||||
TotalUp = ulong.Parse(datas[2]);
|
|
||||||
}
|
|
||||||
else if (line.StartsWith("DOWN"))
|
|
||||||
{
|
|
||||||
var datas = line.Split(' ');
|
|
||||||
if (datas.Length < 3) return;
|
|
||||||
TotalDown = ulong.Parse(datas[2]);
|
|
||||||
}
|
|
||||||
else if (line.StartsWith("*"))
|
|
||||||
{
|
|
||||||
var datas = line.Split(' ');
|
|
||||||
if (datas.Length < 8) return;
|
|
||||||
var name = datas[1];
|
|
||||||
var address = datas[2];
|
|
||||||
var port = int.Parse(datas[3]);
|
|
||||||
var path = datas[4];
|
|
||||||
var host = datas[5];
|
|
||||||
var totalUp = ulong.Parse(datas[6]);
|
|
||||||
var totalDown = ulong.Parse(datas[7]);
|
|
||||||
|
|
||||||
var temp = new ServerStatistics(name, address, port, path, host, 0, 0, 0, 0);
|
|
||||||
var index = Statistic.FindIndex(item => Utils.IsIdenticalServer(item, temp));
|
|
||||||
if (index != -1)
|
|
||||||
{
|
|
||||||
Statistic[index].totalUp = totalUp;
|
|
||||||
Statistic[index].totalDown = totalDown;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var s = new Mode.ServerStatistics(name, address, port, path, host, totalUp, totalDown, 0, 0);
|
|
||||||
Statistic.Add(s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Utils.SaveLog(ex.Message, ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Utils.SaveLog(logPath_ + $"{DateTime.Now.ToString("yyyy-MM-dd")}.txt");
|
|
||||||
var dailyPath = Path.Combine(logPath_, $"{DateTime.Now.ToString("yyyy-MM-dd")}.txt");
|
|
||||||
if (File.Exists(dailyPath))
|
|
||||||
{
|
|
||||||
|
|
||||||
using (var dailyReader = new StreamReader(dailyPath))
|
|
||||||
{
|
|
||||||
while (!dailyReader.EndOfStream)
|
|
||||||
{
|
|
||||||
var line = dailyReader.ReadLine();
|
|
||||||
if (line.StartsWith("LastUpdate"))
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (line.StartsWith("*"))
|
|
||||||
{
|
|
||||||
var datas = line.Split(' ');
|
|
||||||
if (datas.Length < 8) return;
|
|
||||||
var name = datas[1];
|
|
||||||
var address = datas[2];
|
|
||||||
var port = int.Parse(datas[3]);
|
|
||||||
var path = datas[4];
|
|
||||||
var host = datas[5];
|
|
||||||
var todayUp = ulong.Parse(datas[6]);
|
|
||||||
var todayDown = ulong.Parse(datas[7]);
|
|
||||||
|
|
||||||
var temp = new ServerStatistics(name, address, port, path, host, 0, 0, 0, 0);
|
|
||||||
var index = Statistic.FindIndex(item => Utils.IsIdenticalServer(item, temp));
|
|
||||||
if (index != -1)
|
|
||||||
{
|
|
||||||
Statistic[index].todayUp = todayUp;
|
|
||||||
Statistic[index].todayDown = todayDown;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var s = new Mode.ServerStatistics(name, address, port, path, host, 0, 0, todayUp, todayDown);
|
|
||||||
Statistic.Add(s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Utils.SaveLog(ex.Message, ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void DeleteExpiredLog()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (!Directory.Exists(logPath_)) return;
|
|
||||||
var dirInfo = new DirectoryInfo(logPath_);
|
|
||||||
var files = dirInfo.GetFiles();
|
|
||||||
foreach (var file in files)
|
|
||||||
{
|
|
||||||
if (file.Name == "overall.txt") continue;
|
|
||||||
var name = file.Name.Split('.')[0];
|
|
||||||
var ft = DateTime.Parse(name);
|
|
||||||
var ct = DateTime.Now;
|
|
||||||
var dur = ct - ft;
|
|
||||||
if (dur.Days > config_.CacheDays)
|
|
||||||
{
|
|
||||||
file.Delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Utils.SaveLog(ex.Message, ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private int GetFreePort()
|
private int GetFreePort()
|
||||||
{
|
{
|
||||||
int defaultPort = 28123;
|
int defaultPort = 28123;
|
||||||
|
|||||||
@@ -403,6 +403,8 @@ namespace v2rayN.Handler
|
|||||||
//远程服务器地址和端口
|
//远程服务器地址和端口
|
||||||
serversItem.address = config.address();
|
serversItem.address = config.address();
|
||||||
serversItem.port = config.port();
|
serversItem.port = config.port();
|
||||||
|
serversItem.method = null;
|
||||||
|
serversItem.password = null;
|
||||||
|
|
||||||
if (!Utils.IsNullOrEmpty(config.security())
|
if (!Utils.IsNullOrEmpty(config.security())
|
||||||
&& !Utils.IsNullOrEmpty(config.id()))
|
&& !Utils.IsNullOrEmpty(config.id()))
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
using v2rayN.Mode;
|
using v2rayN.Mode;
|
||||||
|
|
||||||
namespace v2rayN.Handler
|
namespace v2rayN.Handler
|
||||||
@@ -147,9 +148,11 @@ namespace v2rayN.Handler
|
|||||||
|
|
||||||
Process p = new Process();
|
Process p = new Process();
|
||||||
p.StartInfo.FileName = fileName;
|
p.StartInfo.FileName = fileName;
|
||||||
|
p.StartInfo.WorkingDirectory = Utils.StartupPath();
|
||||||
p.StartInfo.UseShellExecute = false;
|
p.StartInfo.UseShellExecute = false;
|
||||||
p.StartInfo.RedirectStandardOutput = true;
|
p.StartInfo.RedirectStandardOutput = true;
|
||||||
p.StartInfo.CreateNoWindow = true;
|
p.StartInfo.CreateNoWindow = true;
|
||||||
|
p.StartInfo.StandardOutputEncoding = Encoding.UTF8;
|
||||||
p.OutputDataReceived += new DataReceivedEventHandler((sender, e) =>
|
p.OutputDataReceived += new DataReceivedEventHandler((sender, e) =>
|
||||||
{
|
{
|
||||||
if (!String.IsNullOrEmpty(e.Data))
|
if (!String.IsNullOrEmpty(e.Data))
|
||||||
@@ -161,6 +164,8 @@ namespace v2rayN.Handler
|
|||||||
p.Start();
|
p.Start();
|
||||||
p.BeginOutputReadLine();
|
p.BeginOutputReadLine();
|
||||||
processId = p.Id;
|
processId = p.Id;
|
||||||
|
|
||||||
|
Global.processJob.AddProcess(p.Handle);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 系统代理(http)总处理
|
/// 系统代理(http)总处理
|
||||||
/// 启动privoxy提供http协议
|
/// 启动privoxy提供http协议
|
||||||
/// 使用SysProxy设置IE系统代理或者PAC模式
|
/// 设置IE系统代理或者PAC模式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class HttpProxyHandle
|
class HttpProxyHandle
|
||||||
{
|
{
|
||||||
public static bool Update(Config config, bool forceDisable)
|
private static bool Update(Config config, bool forceDisable)
|
||||||
{
|
{
|
||||||
int type = config.listenerType;
|
int type = config.listenerType;
|
||||||
|
|
||||||
@@ -31,31 +31,31 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
if (type == 1)
|
if (type == 1)
|
||||||
{
|
{
|
||||||
//PACServerHandle.Stop();
|
//PACServerHandle.Stop();
|
||||||
SysProxyHandle.SetIEProxy(true, true, $"{Global.Loopback}:{port}", null);
|
ProxySetting.SetProxy($"{Global.Loopback}:{port}", Global.IEProxyExceptions, 2);
|
||||||
}
|
}
|
||||||
else if (type == 2)
|
else if (type == 2)
|
||||||
{
|
{
|
||||||
string pacUrl = GetPacUrl();
|
string pacUrl = GetPacUrl();
|
||||||
SysProxyHandle.SetIEProxy(true, false, null, pacUrl);
|
ProxySetting.SetProxy(pacUrl, "", 4);
|
||||||
//PACServerHandle.Stop();
|
//PACServerHandle.Stop();
|
||||||
PACServerHandle.Init(config);
|
PACServerHandle.Init(config);
|
||||||
}
|
}
|
||||||
else if (type == 3)
|
else if (type == 3)
|
||||||
{
|
{
|
||||||
//PACServerHandle.Stop();
|
//PACServerHandle.Stop();
|
||||||
SysProxyHandle.SetIEProxy(false, false, null, null);
|
ProxySetting.UnsetProxy();
|
||||||
}
|
}
|
||||||
else if (type == 4)
|
else if (type == 4)
|
||||||
{
|
{
|
||||||
string pacUrl = GetPacUrl();
|
string pacUrl = GetPacUrl();
|
||||||
SysProxyHandle.SetIEProxy(false, false, null, null);
|
ProxySetting.UnsetProxy();
|
||||||
//PACServerHandle.Stop();
|
//PACServerHandle.Stop();
|
||||||
PACServerHandle.Init(config);
|
PACServerHandle.Init(config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SysProxyHandle.SetIEProxy(false, false, null, null);
|
ProxySetting.UnsetProxy();
|
||||||
//PACServerHandle.Stop();
|
//PACServerHandle.Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,14 +70,14 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
/// 启用系统代理(http)
|
/// 启用系统代理(http)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="config"></param>
|
/// <param name="config"></param>
|
||||||
public static void StartHttpAgent(Config config)
|
private static void StartHttpAgent(Config config)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int localPort = config.GetLocalPort(Global.InboundSocks);
|
int localPort = config.GetLocalPort(Global.InboundSocks);
|
||||||
if (localPort > 0)
|
if (localPort > 0)
|
||||||
{
|
{
|
||||||
PrivoxyHandler.Instance.Start(localPort, config);
|
PrivoxyHandler.Instance.Restart(localPort, config);
|
||||||
if (PrivoxyHandler.Instance.RunningPort > 0)
|
if (PrivoxyHandler.Instance.RunningPort > 0)
|
||||||
{
|
{
|
||||||
Global.sysAgent = true;
|
Global.sysAgent = true;
|
||||||
@@ -100,11 +100,13 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Update(config, true);
|
||||||
|
|
||||||
PrivoxyHandler.Instance.Stop();
|
PrivoxyHandler.Instance.Stop();
|
||||||
|
|
||||||
Global.sysAgent = false;
|
Global.sysAgent = false;
|
||||||
Global.socksPort = 0;
|
Global.socksPort = 0;
|
||||||
Global.httpPort = 0;
|
Global.httpPort = 0;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -116,7 +118,7 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="config"></param>
|
/// <param name="config"></param>
|
||||||
/// <param name="forced"></param>
|
/// <param name="forced"></param>
|
||||||
public static bool RestartHttpAgent(Config config, bool forced)
|
public static void RestartHttpAgent(Config config, bool forced)
|
||||||
{
|
{
|
||||||
bool isRestart = false;
|
bool isRestart = false;
|
||||||
//强制重启或者socks端口变化
|
//强制重启或者socks端口变化
|
||||||
@@ -136,9 +138,8 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
{
|
{
|
||||||
CloseHttpAgent(config);
|
CloseHttpAgent(config);
|
||||||
StartHttpAgent(config);
|
StartHttpAgent(config);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
Update(config, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetPacUrl()
|
public static string GetPacUrl()
|
||||||
|
|||||||
@@ -1,93 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Net;
|
|
||||||
using System.Text;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using v2rayN.Base;
|
|
||||||
using v2rayN.Mode;
|
|
||||||
using v2rayN.Properties;
|
|
||||||
|
|
||||||
namespace v2rayN.HttpProxyHandler
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 提供PAC功能支持
|
|
||||||
/// </summary>
|
|
||||||
class PACListHandle
|
|
||||||
{
|
|
||||||
public event EventHandler<ResultEventArgs> UpdateCompleted;
|
|
||||||
|
|
||||||
public event ErrorEventHandler Error;
|
|
||||||
|
|
||||||
public class ResultEventArgs : EventArgs
|
|
||||||
{
|
|
||||||
public bool Success;
|
|
||||||
|
|
||||||
public ResultEventArgs(bool success)
|
|
||||||
{
|
|
||||||
this.Success = success;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static readonly IEnumerable<char> IgnoredLineBegins = new[] { '!', '[' };
|
|
||||||
|
|
||||||
public void UpdatePACFromGFWList(Config config)
|
|
||||||
{
|
|
||||||
string url = Global.GFWLIST_URL;
|
|
||||||
if (!Utils.IsNullOrEmpty(config.urlGFWList))
|
|
||||||
{
|
|
||||||
url = config.urlGFWList;
|
|
||||||
}
|
|
||||||
|
|
||||||
//默认用户已开启系统代理
|
|
||||||
//var httpProxy = config.inbound.FirstOrDefault(x => x.protocol=="http");
|
|
||||||
//if (httpProxy == null)
|
|
||||||
//{
|
|
||||||
// throw new Exception("未发现HTTP代理,无法设置代理更新");
|
|
||||||
//}
|
|
||||||
var http = new WebClientEx();
|
|
||||||
//http.Headers.Add("Connection", "Close");
|
|
||||||
//http.Proxy = new WebProxy(IPAddress.Loopback.ToString(), httpProxy.localPort);
|
|
||||||
http.DownloadStringCompleted += http_DownloadStringCompleted;
|
|
||||||
http.DownloadStringAsync(new Uri(url));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void http_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
File.WriteAllText(Utils.GetTempPath("gfwlist.txt"), e.Result, Encoding.UTF8);
|
|
||||||
List<string> lines = ParseResult(e.Result);
|
|
||||||
string abpContent = Utils.UnGzip(Resources.abp_js);
|
|
||||||
abpContent = abpContent.Replace("__RULES__", JsonConvert.SerializeObject(lines, Formatting.Indented));
|
|
||||||
File.WriteAllText(Utils.GetPath(Global.pacFILE), abpContent, Encoding.UTF8);
|
|
||||||
if (UpdateCompleted != null) UpdateCompleted(this, new ResultEventArgs(true));
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Utils.SaveLog(ex.Message, ex);
|
|
||||||
|
|
||||||
if (Error != null) Error(this, new ErrorEventArgs(ex));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<string> ParseResult(string response)
|
|
||||||
{
|
|
||||||
byte[] bytes = Convert.FromBase64String(response);
|
|
||||||
string content = Encoding.UTF8.GetString(bytes);
|
|
||||||
List<string> valid_lines = new List<string>();
|
|
||||||
using (var sr = new StringReader(content))
|
|
||||||
{
|
|
||||||
foreach (var line in sr.NonWhiteSpaceLines())
|
|
||||||
{
|
|
||||||
if (line.BeginWithAny(IgnoredLineBegins))
|
|
||||||
continue;
|
|
||||||
valid_lines.Add(line);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return valid_lines;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -17,6 +17,7 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
private static int pacPort = 0;
|
private static int pacPort = 0;
|
||||||
private static HttpWebServer server;
|
private static HttpWebServer server;
|
||||||
private static HttpWebServerB serverB;
|
private static HttpWebServerB serverB;
|
||||||
|
private static Config _config;
|
||||||
|
|
||||||
public static bool IsRunning
|
public static bool IsRunning
|
||||||
{
|
{
|
||||||
@@ -28,6 +29,7 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
|
|
||||||
public static void Init(Config config)
|
public static void Init(Config config)
|
||||||
{
|
{
|
||||||
|
_config = config;
|
||||||
Global.pacPort = config.GetLocalPort("pac");
|
Global.pacPort = config.GetLocalPort("pac");
|
||||||
|
|
||||||
if (InitServer("*"))
|
if (InitServer("*"))
|
||||||
@@ -161,7 +163,6 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static string GetPacList(string address)
|
private static string GetPacList(string address)
|
||||||
{
|
{
|
||||||
var port = Global.httpPort;
|
var port = Global.httpPort;
|
||||||
@@ -182,6 +183,18 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
}
|
}
|
||||||
var pac = File.ReadAllText(strPacfile, Encoding.UTF8);
|
var pac = File.ReadAllText(strPacfile, Encoding.UTF8);
|
||||||
pac = pac.Replace("__PROXY__", proxy);
|
pac = pac.Replace("__PROXY__", proxy);
|
||||||
|
|
||||||
|
if (_config.userPacRule.Count > 0)
|
||||||
|
{
|
||||||
|
var keyWords = "var rules = [";
|
||||||
|
if (pac.IndexOf(keyWords) >= 0)
|
||||||
|
{
|
||||||
|
var userPac = string.Join($"\",{Environment.NewLine}\"", _config.userPacRule.ToArray());
|
||||||
|
userPac = string.Format("\"{0}\",", userPac);
|
||||||
|
pac = pac.Replace(keyWords, keyWords + userPac);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return pac;
|
return pac;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|||||||
@@ -22,18 +22,17 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
|
|
||||||
private static int _uid;
|
private static int _uid;
|
||||||
private static string _uniqueConfigFile;
|
private static string _uniqueConfigFile;
|
||||||
private static Job _privoxyJob;
|
|
||||||
private Process _process;
|
private Process _process;
|
||||||
|
private static string _privoxyName = "v2ray_privoxy";
|
||||||
|
|
||||||
static PrivoxyHandler()
|
static PrivoxyHandler()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_uid = Application.StartupPath.GetHashCode(); // Currently we use ss's StartupPath to identify different Privoxy instance.
|
_uid = Application.StartupPath.GetHashCode();
|
||||||
_uniqueConfigFile = string.Format("privoxy_{0}.conf", _uid);
|
_uniqueConfigFile = string.Format("privoxy_{0}.conf", _uid);
|
||||||
_privoxyJob = new Job();
|
|
||||||
|
|
||||||
FileManager.UncompressFile(Utils.GetTempPath("v2ray_privoxy.exe"), Resources.privoxy_exe);
|
FileManager.UncompressFile(Utils.GetTempPath($"{_privoxyName}.exe"), Resources.privoxy_exe);
|
||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
@@ -41,11 +40,6 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private PrivoxyHandler()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单例
|
/// 单例
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -66,50 +60,61 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Restart(int localPort, Config config)
|
||||||
|
{
|
||||||
|
Stop();
|
||||||
|
Start(localPort, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void Start(int localPort, Config config)
|
public void Start(int localPort, Config config)
|
||||||
{
|
{
|
||||||
if (_process == null)
|
try
|
||||||
{
|
{
|
||||||
Process[] existingPrivoxy = Process.GetProcessesByName("v2ray_privoxy");
|
if (_process == null)
|
||||||
foreach (Process p in existingPrivoxy.Where(IsChildProcess))
|
|
||||||
{
|
{
|
||||||
KillProcess(p);
|
|
||||||
}
|
|
||||||
string privoxyConfig = Resources.privoxy_conf;
|
|
||||||
RunningPort = config.GetLocalPort(Global.InboundHttp);
|
|
||||||
privoxyConfig = privoxyConfig.Replace("__SOCKS_PORT__", localPort.ToString());
|
|
||||||
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_PORT__", RunningPort.ToString());
|
|
||||||
if (config.allowLANConn)
|
|
||||||
{
|
|
||||||
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_IP__", "0.0.0.0");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_IP__", Global.Loopback);
|
|
||||||
}
|
|
||||||
FileManager.ByteArrayToFile(Utils.GetTempPath(_uniqueConfigFile), Encoding.UTF8.GetBytes(privoxyConfig));
|
|
||||||
|
|
||||||
_process = new Process
|
string privoxyConfig = Resources.privoxy_conf;
|
||||||
{
|
RunningPort = config.GetLocalPort(Global.InboundHttp);
|
||||||
// Configure the process using the StartInfo properties.
|
privoxyConfig = privoxyConfig.Replace("__SOCKS_PORT__", localPort.ToString());
|
||||||
StartInfo =
|
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_PORT__", RunningPort.ToString());
|
||||||
|
if (config.allowLANConn)
|
||||||
{
|
{
|
||||||
FileName = "v2ray_privoxy.exe",
|
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_IP__", "0.0.0.0");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_IP__", Global.Loopback);
|
||||||
|
}
|
||||||
|
FileManager.ByteArrayToFile(Utils.GetTempPath(_uniqueConfigFile), Encoding.UTF8.GetBytes(privoxyConfig));
|
||||||
|
|
||||||
|
_process = new Process
|
||||||
|
{
|
||||||
|
// Configure the process using the StartInfo properties.
|
||||||
|
StartInfo =
|
||||||
|
{
|
||||||
|
FileName = $"{_privoxyName}.exe",
|
||||||
Arguments = _uniqueConfigFile,
|
Arguments = _uniqueConfigFile,
|
||||||
WorkingDirectory = Utils.GetTempPath(),
|
WorkingDirectory = Utils.GetTempPath(),
|
||||||
WindowStyle = ProcessWindowStyle.Hidden,
|
WindowStyle = ProcessWindowStyle.Hidden,
|
||||||
UseShellExecute = true,
|
UseShellExecute = true,
|
||||||
CreateNoWindow = true
|
CreateNoWindow = true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
_process.Start();
|
_process.Start();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add this process to job obj associated with this ss process, so that
|
* Add this process to job obj associated with this ss process, so that
|
||||||
* when ss exit unexpectedly, this process will be forced killed by system.
|
* when ss exit unexpectedly, this process will be forced killed by system.
|
||||||
*/
|
*/
|
||||||
_privoxyJob.AddProcess(_process.Handle);
|
|
||||||
|
|
||||||
|
Global.processJob.AddProcess(_process.Handle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
RunningPort = 0;
|
||||||
|
Utils.SaveLog(ex.Message, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,6 +127,14 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
_process = null;
|
_process = null;
|
||||||
RunningPort = 0;
|
RunningPort = 0;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Process[] existingPrivoxy = Process.GetProcessesByName(_privoxyName);
|
||||||
|
foreach (Process p in existingPrivoxy.Where(IsChildProcess))
|
||||||
|
{
|
||||||
|
KillProcess(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void KillProcess(Process p)
|
private static void KillProcess(Process p)
|
||||||
@@ -161,7 +174,7 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
*/
|
*/
|
||||||
var path = process.MainModule.FileName;
|
var path = process.MainModule.FileName;
|
||||||
|
|
||||||
return Utils.GetTempPath("v2ray_privoxy.exe").Equals(path);
|
return Utils.GetTempPath($"{_privoxyName}.exe").Equals(path);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -8,26 +8,46 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
{
|
{
|
||||||
public static bool UnsetProxy()
|
public static bool UnsetProxy()
|
||||||
{
|
{
|
||||||
return SetProxy(null, null);
|
return SetProxy(null, null, 1);
|
||||||
}
|
|
||||||
public static bool SetProxy(string strProxy)
|
|
||||||
{
|
|
||||||
return SetProxy(strProxy, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool SetProxy(string strProxy, string exceptions)
|
public static bool SetProxy(string strProxy, string exceptions, int type)
|
||||||
{
|
{
|
||||||
InternetPerConnOptionList list = new InternetPerConnOptionList();
|
InternetPerConnOptionList list = new InternetPerConnOptionList();
|
||||||
|
|
||||||
int optionCount = Utils.IsNullOrEmpty(strProxy) ? 1 : (Utils.IsNullOrEmpty(exceptions) ? 2 : 3);
|
int optionCount = 1;
|
||||||
|
if (type == 1)
|
||||||
|
{
|
||||||
|
optionCount = 1;
|
||||||
|
}
|
||||||
|
else if (type == 2 || type == 4)
|
||||||
|
{
|
||||||
|
optionCount = Utils.IsNullOrEmpty(exceptions) ? 2 : 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
int m_Int = (int)PerConnFlags.PROXY_TYPE_DIRECT;
|
||||||
|
PerConnOption m_Option = PerConnOption.INTERNET_PER_CONN_FLAGS;
|
||||||
|
if (type == 2)
|
||||||
|
{
|
||||||
|
m_Int = (int)(PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_PROXY);
|
||||||
|
m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_SERVER;
|
||||||
|
}
|
||||||
|
else if (type == 4)
|
||||||
|
{
|
||||||
|
m_Int = (int)(PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_AUTO_PROXY_URL);
|
||||||
|
m_Option = PerConnOption.INTERNET_PER_CONN_AUTOCONFIG_URL;
|
||||||
|
}
|
||||||
|
|
||||||
|
//int optionCount = Utils.IsNullOrEmpty(strProxy) ? 1 : (Utils.IsNullOrEmpty(exceptions) ? 2 : 3);
|
||||||
InternetConnectionOption[] options = new InternetConnectionOption[optionCount];
|
InternetConnectionOption[] options = new InternetConnectionOption[optionCount];
|
||||||
// USE a proxy server ...
|
// USE a proxy server ...
|
||||||
options[0].m_Option = PerConnOption.INTERNET_PER_CONN_FLAGS;
|
options[0].m_Option = PerConnOption.INTERNET_PER_CONN_FLAGS;
|
||||||
options[0].m_Value.m_Int = (int)((optionCount < 2) ? PerConnFlags.PROXY_TYPE_DIRECT : (PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_PROXY));
|
//options[0].m_Value.m_Int = (int)((optionCount < 2) ? PerConnFlags.PROXY_TYPE_DIRECT : (PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_PROXY));
|
||||||
|
options[0].m_Value.m_Int = m_Int;
|
||||||
// use THIS proxy server
|
// use THIS proxy server
|
||||||
if (optionCount > 1)
|
if (optionCount > 1)
|
||||||
{
|
{
|
||||||
options[1].m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_SERVER;
|
options[1].m_Option = m_Option;
|
||||||
options[1].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(strProxy);
|
options[1].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(strProxy);
|
||||||
// except for these addresses ...
|
// except for these addresses ...
|
||||||
if (optionCount > 2)
|
if (optionCount > 2)
|
||||||
@@ -181,7 +201,7 @@ namespace v2rayN.HttpProxyHandler
|
|||||||
string ProxyServer = rk.GetValue("ProxyServer").ToString();
|
string ProxyServer = rk.GetValue("ProxyServer").ToString();
|
||||||
rk.Close();
|
rk.Close();
|
||||||
return ProxyServer;
|
return ProxyServer;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,185 +0,0 @@
|
|||||||
using Newtonsoft.Json;
|
|
||||||
using System;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
|
||||||
using System.Text;
|
|
||||||
using v2rayN.Base;
|
|
||||||
using v2rayN.Mode;
|
|
||||||
using v2rayN.Properties;
|
|
||||||
using v2rayN.Tool;
|
|
||||||
|
|
||||||
namespace v2rayN.HttpProxyHandler
|
|
||||||
{
|
|
||||||
class SysProxyHandle
|
|
||||||
{
|
|
||||||
private const string _userWininetConfigFile = "user-wininet.json";
|
|
||||||
|
|
||||||
private static string _queryStr;
|
|
||||||
|
|
||||||
// In general, this won't change
|
|
||||||
// format:
|
|
||||||
// <flags><CR-LF>
|
|
||||||
// <proxy-server><CR-LF>
|
|
||||||
// <bypass-list><CR-LF>
|
|
||||||
// <pac-url>
|
|
||||||
private static SysproxyConfig _userSettings = null;
|
|
||||||
|
|
||||||
enum RET_ERRORS : int
|
|
||||||
{
|
|
||||||
RET_NO_ERROR = 0,
|
|
||||||
INVALID_FORMAT = 1,
|
|
||||||
NO_PERMISSION = 2,
|
|
||||||
SYSCALL_FAILED = 3,
|
|
||||||
NO_MEMORY = 4,
|
|
||||||
INVAILD_OPTION_COUNT = 5,
|
|
||||||
};
|
|
||||||
|
|
||||||
static SysProxyHandle()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
FileManager.UncompressFile(Utils.GetTempPath("sysproxy.exe"),
|
|
||||||
Environment.Is64BitOperatingSystem ? Resources.sysproxy64_exe : Resources.sysproxy_exe);
|
|
||||||
}
|
|
||||||
catch (IOException ex)
|
|
||||||
{
|
|
||||||
Utils.SaveLog(ex.Message, ex);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void SetIEProxy(bool enable, bool global, string proxyServer, string pacURL)
|
|
||||||
{
|
|
||||||
//Read();
|
|
||||||
|
|
||||||
//if (!_userSettings.UserSettingsRecorded)
|
|
||||||
//{
|
|
||||||
// // record user settings
|
|
||||||
// ExecSysproxy("query");
|
|
||||||
// ParseQueryStr(_queryStr);
|
|
||||||
//}
|
|
||||||
|
|
||||||
string arguments;
|
|
||||||
if (enable)
|
|
||||||
{
|
|
||||||
arguments = global
|
|
||||||
? string.Format(
|
|
||||||
//"global {0} <local>;localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;172.32.*;192.168.*",
|
|
||||||
"global {0} <local>;localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;172.32.*",
|
|
||||||
proxyServer)
|
|
||||||
: string.Format("pac {0}", pacURL);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// restore user settings
|
|
||||||
//var flags = _userSettings.Flags;
|
|
||||||
//var proxy_server = _userSettings.ProxyServer ?? "-";
|
|
||||||
//var bypass_list = _userSettings.BypassList ?? "-";
|
|
||||||
//var pac_url = _userSettings.PacUrl ?? "-";
|
|
||||||
////arguments = string.Format("set {0} {1} {2} {3}", flags, proxy_server, bypass_list, pac_url);
|
|
||||||
//set null settings
|
|
||||||
arguments = string.Format("set {0} {1} {2} {3}", 1, "-", "<local>", @"http://127.0.0.1");
|
|
||||||
|
|
||||||
// have to get new settings
|
|
||||||
//_userSettings.UserSettingsRecorded = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Save();
|
|
||||||
ExecSysproxy(arguments);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void ExecSysproxy(string arguments)
|
|
||||||
{
|
|
||||||
using (var process = new Process())
|
|
||||||
{
|
|
||||||
// Configure the process using the StartInfo properties.
|
|
||||||
process.StartInfo.FileName = Utils.GetTempPath("sysproxy.exe");
|
|
||||||
process.StartInfo.Arguments = arguments;
|
|
||||||
process.StartInfo.WorkingDirectory = Utils.GetTempPath();
|
|
||||||
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
|
||||||
process.StartInfo.UseShellExecute = false;
|
|
||||||
process.StartInfo.RedirectStandardError = true;
|
|
||||||
process.StartInfo.RedirectStandardOutput = true;
|
|
||||||
|
|
||||||
// Need to provide encoding info, or output/error strings we got will be wrong.
|
|
||||||
process.StartInfo.StandardOutputEncoding = Encoding.Unicode;
|
|
||||||
process.StartInfo.StandardErrorEncoding = Encoding.Unicode;
|
|
||||||
|
|
||||||
process.StartInfo.CreateNoWindow = true;
|
|
||||||
process.Start();
|
|
||||||
|
|
||||||
var stderr = process.StandardError.ReadToEnd();
|
|
||||||
var stdout = process.StandardOutput.ReadToEnd();
|
|
||||||
|
|
||||||
process.WaitForExit();
|
|
||||||
|
|
||||||
var exitCode = process.ExitCode;
|
|
||||||
if (exitCode != (int)RET_ERRORS.RET_NO_ERROR)
|
|
||||||
{
|
|
||||||
throw new Exception(stderr);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (arguments == "query")
|
|
||||||
{
|
|
||||||
if (stdout.IsNullOrWhiteSpace() || stdout.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
// we cannot get user settings
|
|
||||||
throw new Exception("failed to query wininet settings");
|
|
||||||
}
|
|
||||||
_queryStr = stdout;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void Save()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using (StreamWriter sw = new StreamWriter(File.Open(Utils.GetPath(_userWininetConfigFile), FileMode.Create)))
|
|
||||||
{
|
|
||||||
string jsonString = JsonConvert.SerializeObject(_userSettings, Formatting.Indented);
|
|
||||||
sw.Write(jsonString);
|
|
||||||
sw.Flush();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (IOException ex)
|
|
||||||
{
|
|
||||||
Utils.SaveLog(ex.Message, ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void Read()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
string configContent = File.ReadAllText(Utils.GetPath(_userWininetConfigFile));
|
|
||||||
_userSettings = JsonConvert.DeserializeObject<SysproxyConfig>(configContent);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Utils.SaveLog(ex.Message, ex);
|
|
||||||
// Suppress all exceptions. finally block will initialize new user config settings.
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (_userSettings == null) _userSettings = new SysproxyConfig();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void ParseQueryStr(string str)
|
|
||||||
{
|
|
||||||
string[] userSettingsArr = str.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
|
|
||||||
_userSettings.Flags = userSettingsArr[0];
|
|
||||||
|
|
||||||
// handle output from WinINET
|
|
||||||
if (userSettingsArr[1] == "(null)") _userSettings.ProxyServer = null;
|
|
||||||
else _userSettings.ProxyServer = userSettingsArr[1];
|
|
||||||
if (userSettingsArr[2] == "(null)") _userSettings.BypassList = null;
|
|
||||||
else _userSettings.BypassList = userSettingsArr[2];
|
|
||||||
if (userSettingsArr[3] == "(null)") _userSettings.PacUrl = null;
|
|
||||||
else _userSettings.PacUrl = userSettingsArr[3];
|
|
||||||
|
|
||||||
_userSettings.UserSettingsRecorded = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
BIN
v2rayN/v2rayN/LIB/libs.zip
Normal file
BIN
v2rayN/v2rayN/LIB/libs.zip
Normal file
Binary file not shown.
@@ -106,17 +106,8 @@ namespace v2rayN.Mode
|
|||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 启用Http代理
|
/// 监听状态 0-not 1-http 2-PAC
|
||||||
/// </summary>
|
|
||||||
public bool sysAgentEnabled
|
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 监听状态 0-不改变 1-全局 2-PAC
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int listenerType
|
public int listenerType
|
||||||
{
|
{
|
||||||
@@ -154,26 +145,7 @@ namespace v2rayN.Mode
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 统计数据缓存天数 [0, 30]
|
|
||||||
/// * 0 关闭单独每天使用流量的缓存
|
|
||||||
/// * 无论如何不会关闭总流量的缓存
|
|
||||||
/// </summary>
|
|
||||||
private uint cacheDays;
|
|
||||||
public uint CacheDays
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return cacheDays;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value < 0) cacheDays = 0;
|
|
||||||
else if (value > 30) cacheDays = 30;
|
|
||||||
else cacheDays = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自定义远程DNS
|
/// 自定义远程DNS
|
||||||
@@ -197,6 +169,11 @@ namespace v2rayN.Mode
|
|||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<string> userPacRule
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
#region 函数
|
#region 函数
|
||||||
|
|
||||||
public string address()
|
public string address()
|
||||||
@@ -346,6 +323,16 @@ namespace v2rayN.Mode
|
|||||||
return vmess[index].getSummary();
|
return vmess[index].getSummary();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string getItemId()
|
||||||
|
{
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
return vmess[index].getItemId();
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -429,6 +416,14 @@ namespace v2rayN.Mode
|
|||||||
}
|
}
|
||||||
return subid.Substring(0, 4);
|
return subid.Substring(0, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string getItemId()
|
||||||
|
{
|
||||||
|
var itemId = $"{address}{port}{requestHost}{path}";
|
||||||
|
itemId = Utils.Base64Encode(itemId);
|
||||||
|
return itemId;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 版本(现在=2)
|
/// 版本(现在=2)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,35 +1,43 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace v2rayN.Mode
|
namespace v2rayN.Mode
|
||||||
{
|
{
|
||||||
class ServerStatistics
|
[Serializable]
|
||||||
|
public class ServerStatistics
|
||||||
{
|
{
|
||||||
public string name;
|
public List<ServerStatItem> server
|
||||||
public string address;
|
|
||||||
public int port;
|
|
||||||
public string path;
|
|
||||||
public string host;
|
|
||||||
public ulong totalUp;
|
|
||||||
public ulong totalDown;
|
|
||||||
public ulong todayUp;
|
|
||||||
public ulong todayDown;
|
|
||||||
|
|
||||||
public ServerStatistics() { }
|
|
||||||
public ServerStatistics(string name, string addr, int port, string path, string host, ulong totalUp, ulong totalDown, ulong todayUp, ulong todayDown)
|
|
||||||
{
|
{
|
||||||
this.name = name;
|
get; set;
|
||||||
this.address = addr;
|
}
|
||||||
this.port = port;
|
}
|
||||||
this.path = path;
|
|
||||||
this.host = host;
|
[Serializable]
|
||||||
this.totalUp = totalUp;
|
public class ServerStatItem
|
||||||
this.totalDown = totalDown;
|
{
|
||||||
this.todayUp = todayUp;
|
public string itemId
|
||||||
this.todayDown = todayDown;
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
public ulong totalUp
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
public ulong totalDown
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
public ulong todayUp
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
public ulong todayDown
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
public long dateNow
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ using System.Diagnostics;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using v2rayN.Forms;
|
using v2rayN.Forms;
|
||||||
|
using v2rayN.Properties;
|
||||||
|
using v2rayN.Tool;
|
||||||
|
|
||||||
namespace v2rayN
|
namespace v2rayN
|
||||||
{
|
{
|
||||||
@@ -26,14 +28,20 @@ namespace v2rayN
|
|||||||
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
|
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
|
||||||
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
|
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
|
||||||
|
|
||||||
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
|
|
||||||
|
//AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
|
||||||
|
|
||||||
Process instance = RunningInstance();
|
Process instance = RunningInstance();
|
||||||
if (instance == null)
|
if (instance == null)
|
||||||
{
|
{
|
||||||
Utils.SaveLog("v2rayN start up");
|
if (!UnzipLibs())
|
||||||
|
{
|
||||||
|
UI.Show($"Error preparing the environment(准备运行环境出错)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Utils.SaveLog("v2rayN start up");
|
||||||
|
|
||||||
//设置语言环境
|
//设置语言环境
|
||||||
string lang = Utils.RegReadValue(Global.MyRegPath, Global.MyRegKeyLanguage, "zh-Hans");
|
string lang = Utils.RegReadValue(Global.MyRegPath, Global.MyRegKeyLanguage, "zh-Hans");
|
||||||
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lang);
|
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lang);
|
||||||
@@ -48,27 +56,27 @@ namespace v2rayN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
|
//private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
|
||||||
{
|
//{
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
string resourceName = "v2rayN.LIB." + new AssemblyName(args.Name).Name + ".dll";
|
// string resourceName = "v2rayN.LIB." + new AssemblyName(args.Name).Name + ".dll";
|
||||||
using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
|
// using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
|
||||||
{
|
// {
|
||||||
if (stream == null)
|
// if (stream == null)
|
||||||
{
|
// {
|
||||||
return null;
|
// return null;
|
||||||
}
|
// }
|
||||||
byte[] assemblyData = new byte[stream.Length];
|
// byte[] assemblyData = new byte[stream.Length];
|
||||||
stream.Read(assemblyData, 0, assemblyData.Length);
|
// stream.Read(assemblyData, 0, assemblyData.Length);
|
||||||
return Assembly.Load(assemblyData);
|
// return Assembly.Load(assemblyData);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
catch
|
// catch
|
||||||
{
|
// {
|
||||||
return null;
|
// return null;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取正在运行的实例,没有运行的实例返回null;
|
/// 获取正在运行的实例,没有运行的实例返回null;
|
||||||
@@ -100,5 +108,20 @@ namespace v2rayN
|
|||||||
Utils.SaveLog("CurrentDomain_UnhandledException", (Exception)e.ExceptionObject);
|
Utils.SaveLog("CurrentDomain_UnhandledException", (Exception)e.ExceptionObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool UnzipLibs()
|
||||||
|
{
|
||||||
|
var fileName = Utils.GetPath("libs.zip");
|
||||||
|
if (!FileManager.ByteArrayToFile(fileName, Resources.libs))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!FileManager.ZipExtractToFile(fileName))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
|
|||||||
// 方法是按如下所示使用“*”:
|
// 方法是按如下所示使用“*”:
|
||||||
//[assembly: AssemblyVersion("1.0.*")]
|
//[assembly: AssemblyVersion("1.0.*")]
|
||||||
//[assembly: AssemblyVersion("1.0.0")]
|
//[assembly: AssemblyVersion("1.0.0")]
|
||||||
[assembly: AssemblyFileVersion("2.49")]
|
[assembly: AssemblyFileVersion("3.0")]
|
||||||
|
|||||||
50
v2rayN/v2rayN/Properties/Resources.Designer.cs
generated
50
v2rayN/v2rayN/Properties/Resources.Designer.cs
generated
@@ -90,26 +90,6 @@ namespace v2rayN.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找 System.Byte[] 类型的本地化资源。
|
|
||||||
/// </summary>
|
|
||||||
internal static byte[] grpc_csharp_ext_x64_dll {
|
|
||||||
get {
|
|
||||||
object obj = ResourceManager.GetObject("grpc_csharp_ext_x64_dll", resourceCulture);
|
|
||||||
return ((byte[])(obj));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找 System.Byte[] 类型的本地化资源。
|
|
||||||
/// </summary>
|
|
||||||
internal static byte[] grpc_csharp_ext_x86_dll {
|
|
||||||
get {
|
|
||||||
object obj = ResourceManager.GetObject("grpc_csharp_ext_x86_dll", resourceCulture);
|
|
||||||
return ((byte[])(obj));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -120,6 +100,16 @@ namespace v2rayN.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找 System.Byte[] 类型的本地化资源。
|
||||||
|
/// </summary>
|
||||||
|
internal static byte[] libs {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("libs", resourceCulture);
|
||||||
|
return ((byte[])(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -226,25 +216,5 @@ namespace v2rayN.Properties {
|
|||||||
return ((System.Drawing.Bitmap)(obj));
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找 System.Byte[] 类型的本地化资源。
|
|
||||||
/// </summary>
|
|
||||||
internal static byte[] sysproxy_exe {
|
|
||||||
get {
|
|
||||||
object obj = ResourceManager.GetObject("sysproxy_exe", resourceCulture);
|
|
||||||
return ((byte[])(obj));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找 System.Byte[] 类型的本地化资源。
|
|
||||||
/// </summary>
|
|
||||||
internal static byte[] sysproxy64_exe {
|
|
||||||
get {
|
|
||||||
object obj = ResourceManager.GetObject("sysproxy64_exe", resourceCulture);
|
|
||||||
return ((byte[])(obj));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,15 +127,12 @@
|
|||||||
<data name="checkupdate" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="checkupdate" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\resources\checkupdate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\resources\checkupdate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="grpc_csharp_ext_x64_dll" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\resources\grpc_csharp_ext.x64.dll.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</data>
|
|
||||||
<data name="grpc_csharp_ext_x86_dll" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\resources\grpc_csharp_ext.x86.dll.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</data>
|
|
||||||
<data name="help" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="help" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\resources\help.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\resources\help.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="libs" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\lib\libs.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
<data name="minimize" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="minimize" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\minimize.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\minimize.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -166,10 +163,4 @@
|
|||||||
<data name="sub" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="sub" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\resources\sub.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\resources\sub.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="sysproxy64_exe" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\sysproxy64.exe.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</data>
|
|
||||||
<data name="sysproxy_exe" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\sysproxy.exe.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
Binary file not shown.
Binary file not shown.
@@ -49,7 +49,7 @@ var rules = [
|
|||||||
"|http://img.dlsite.jp/",
|
"|http://img.dlsite.jp/",
|
||||||
"||dm530.net",
|
"||dm530.net",
|
||||||
"share.dmhy.org",
|
"share.dmhy.org",
|
||||||
"@@|https://share.dmhy.org",
|
"||dmhy.org",
|
||||||
"||dmm.co.jp",
|
"||dmm.co.jp",
|
||||||
"|http://www.dmm.com/netgame",
|
"|http://www.dmm.com/netgame",
|
||||||
"||dnvod.tv",
|
"||dnvod.tv",
|
||||||
@@ -262,19 +262,25 @@ var rules = [
|
|||||||
"||daum.net",
|
"||daum.net",
|
||||||
"||depositphotos.com",
|
"||depositphotos.com",
|
||||||
"||disconnect.me",
|
"||disconnect.me",
|
||||||
|
"||documentingreality.com",
|
||||||
"||doubibackup.com",
|
"||doubibackup.com",
|
||||||
"||doubmirror.cf",
|
"||doubmirror.cf",
|
||||||
"||encyclopedia.com",
|
"||encyclopedia.com",
|
||||||
"||fangeqiang.com",
|
"||fangeqiang.com",
|
||||||
|
"||fanqiangdang.com",
|
||||||
"||cloud.feedly.com",
|
"||cloud.feedly.com",
|
||||||
|
"||feedx.net",
|
||||||
"||flyzy2005.com",
|
"||flyzy2005.com",
|
||||||
"||foreignpolicy.com",
|
"||foreignpolicy.com",
|
||||||
"||free-ss.site",
|
"||free-ss.site",
|
||||||
|
"||freehongkong.org",
|
||||||
"||blog.fuckgfw233.org",
|
"||blog.fuckgfw233.org",
|
||||||
"||g0v.social",
|
"||g0v.social",
|
||||||
"||globalvoices.org",
|
"||globalvoices.org",
|
||||||
"||glorystar.me",
|
"||glorystar.me",
|
||||||
"||goregrish.com",
|
"||goregrish.com",
|
||||||
|
"||guangnianvpn.com",
|
||||||
|
"||hanime.tv",
|
||||||
"||hbo.com",
|
"||hbo.com",
|
||||||
"||spaces.hightail.com",
|
"||spaces.hightail.com",
|
||||||
"||hkgalden.com",
|
"||hkgalden.com",
|
||||||
@@ -288,6 +294,7 @@ var rules = [
|
|||||||
"||joinmastodon.org",
|
"||joinmastodon.org",
|
||||||
"||liangzhichuanmei.com",
|
"||liangzhichuanmei.com",
|
||||||
"||lighti.me",
|
"||lighti.me",
|
||||||
|
"||lightyearvpn.com",
|
||||||
"||lihkg.com",
|
"||lihkg.com",
|
||||||
"||line-scdn.net",
|
"||line-scdn.net",
|
||||||
"||i.lithium.com",
|
"||i.lithium.com",
|
||||||
@@ -325,6 +332,7 @@ var rules = [
|
|||||||
"||api.pureapk.com",
|
"||api.pureapk.com",
|
||||||
"||quora.com",
|
"||quora.com",
|
||||||
"||quoracdn.net",
|
"||quoracdn.net",
|
||||||
|
"||qz.com",
|
||||||
"||cdn.seatguru.com",
|
"||cdn.seatguru.com",
|
||||||
"||secure.raxcdn.com",
|
"||secure.raxcdn.com",
|
||||||
"||redd.it",
|
"||redd.it",
|
||||||
@@ -368,6 +376,8 @@ var rules = [
|
|||||||
"||steemit.com",
|
"||steemit.com",
|
||||||
"||taiwanjustice.net",
|
"||taiwanjustice.net",
|
||||||
"||tinc-vpn.org",
|
"||tinc-vpn.org",
|
||||||
|
"||u15.info",
|
||||||
|
"||washingtonpost.com",
|
||||||
"||wenzhao.ca",
|
"||wenzhao.ca",
|
||||||
"||whatsonweibo.com",
|
"||whatsonweibo.com",
|
||||||
"||wire.com",
|
"||wire.com",
|
||||||
@@ -375,6 +385,7 @@ var rules = [
|
|||||||
"||xm.com",
|
"||xm.com",
|
||||||
"||xuehua.us",
|
"||xuehua.us",
|
||||||
"||yes-news.com",
|
"||yes-news.com",
|
||||||
|
"||yigeni.com",
|
||||||
"||you-get.org",
|
"||you-get.org",
|
||||||
"||zzcloud.me",
|
"||zzcloud.me",
|
||||||
"||aex.com",
|
"||aex.com",
|
||||||
@@ -697,459 +708,8 @@ var rules = [
|
|||||||
"||thefacebook.com",
|
"||thefacebook.com",
|
||||||
"||whatsapp.com",
|
"||whatsapp.com",
|
||||||
"||whatsapp.net",
|
"||whatsapp.net",
|
||||||
"|https://www.ftchinese.com",
|
".ftchinese.com",
|
||||||
".ftchinese.com/channel/video",
|
"||ftchinese.com",
|
||||||
".ftchinese.com/premium/001081066",
|
|
||||||
".ftchinese.com/story/00102753",
|
|
||||||
".ftchinese.com/story/001026616",
|
|
||||||
".ftchinese.com/story/001026749",
|
|
||||||
".ftchinese.com/story/001026807",
|
|
||||||
".ftchinese.com/story/001026808",
|
|
||||||
".ftchinese.com/story/001026834",
|
|
||||||
".ftchinese.com/story/001026880",
|
|
||||||
".ftchinese.com/story/001027429",
|
|
||||||
".ftchinese.com/story/001030341",
|
|
||||||
".ftchinese.com/story/001030502",
|
|
||||||
".ftchinese.com/story/001030803",
|
|
||||||
".ftchinese.com/story/001031317",
|
|
||||||
".ftchinese.com/story/001032617",
|
|
||||||
".ftchinese.com/story/001032636",
|
|
||||||
".ftchinese.com/story/001032692",
|
|
||||||
".ftchinese.com/story/001032762",
|
|
||||||
".ftchinese.com/story/001033138",
|
|
||||||
".ftchinese.com/story/001034917",
|
|
||||||
".ftchinese.com/story/001034926",
|
|
||||||
".ftchinese.com/story/001034927",
|
|
||||||
".ftchinese.com/story/001034928",
|
|
||||||
".ftchinese.com/story/001034952",
|
|
||||||
".ftchinese.com/story/001035890",
|
|
||||||
".ftchinese.com/story/001035972",
|
|
||||||
".ftchinese.com/story/001035993",
|
|
||||||
".ftchinese.com/story/001036417",
|
|
||||||
".ftchinese.com/story/001037090",
|
|
||||||
".ftchinese.com/story/001037091",
|
|
||||||
".ftchinese.com/story/001038178",
|
|
||||||
".ftchinese.com/story/001038199",
|
|
||||||
".ftchinese.com/story/001038220",
|
|
||||||
".ftchinese.com/story/001038819",
|
|
||||||
".ftchinese.com/story/001038862",
|
|
||||||
".ftchinese.com/story/001039067",
|
|
||||||
".ftchinese.com/story/001039178",
|
|
||||||
".ftchinese.com/story/001039211",
|
|
||||||
".ftchinese.com/story/001039271",
|
|
||||||
".ftchinese.com/story/001039295",
|
|
||||||
".ftchinese.com/story/001039369",
|
|
||||||
".ftchinese.com/story/001039482",
|
|
||||||
".ftchinese.com/story/001039534",
|
|
||||||
".ftchinese.com/story/001039555",
|
|
||||||
".ftchinese.com/story/001039576",
|
|
||||||
".ftchinese.com/story/001039712",
|
|
||||||
".ftchinese.com/story/001039779",
|
|
||||||
".ftchinese.com/story/001039809",
|
|
||||||
".ftchinese.com/story/001040134",
|
|
||||||
".ftchinese.com/story/001040835",
|
|
||||||
".ftchinese.com/story/001040890",
|
|
||||||
".ftchinese.com/story/001040918",
|
|
||||||
".ftchinese.com/story/001040992",
|
|
||||||
".ftchinese.com/story/001041209",
|
|
||||||
".ftchinese.com/story/001042100",
|
|
||||||
".ftchinese.com/story/001042252",
|
|
||||||
".ftchinese.com/story/001042272",
|
|
||||||
".ftchinese.com/story/001042280",
|
|
||||||
".ftchinese.com/story/001043029",
|
|
||||||
".ftchinese.com/story/001043066",
|
|
||||||
".ftchinese.com/story/001043096",
|
|
||||||
".ftchinese.com/story/001043124",
|
|
||||||
".ftchinese.com/story/001043152",
|
|
||||||
".ftchinese.com/story/001043189",
|
|
||||||
".ftchinese.com/story/001043428",
|
|
||||||
".ftchinese.com/story/001043439",
|
|
||||||
".ftchinese.com/story/001043534",
|
|
||||||
".ftchinese.com/story/001043675",
|
|
||||||
".ftchinese.com/story/001043680",
|
|
||||||
".ftchinese.com/story/001043702",
|
|
||||||
".ftchinese.com/story/001043849",
|
|
||||||
".ftchinese.com/story/001044099",
|
|
||||||
".ftchinese.com/story/001044776",
|
|
||||||
".ftchinese.com/story/001044871",
|
|
||||||
".ftchinese.com/story/001044897",
|
|
||||||
".ftchinese.com/story/001045114",
|
|
||||||
".ftchinese.com/story/001045139",
|
|
||||||
".ftchinese.com/story/001045186",
|
|
||||||
".ftchinese.com/story/001045755",
|
|
||||||
".ftchinese.com/story/001046087",
|
|
||||||
".ftchinese.com/story/001046105",
|
|
||||||
".ftchinese.com/story/001046118",
|
|
||||||
".ftchinese.com/story/001046132",
|
|
||||||
".ftchinese.com/story/001046517",
|
|
||||||
".ftchinese.com/story/001046822",
|
|
||||||
".ftchinese.com/story/001046866",
|
|
||||||
".ftchinese.com/story/001046942",
|
|
||||||
".ftchinese.com/story/001047180",
|
|
||||||
".ftchinese.com/story/001047206",
|
|
||||||
".ftchinese.com/story/001047304",
|
|
||||||
".ftchinese.com/story/001047317",
|
|
||||||
".ftchinese.com/story/001047345",
|
|
||||||
".ftchinese.com/story/001047358",
|
|
||||||
".ftchinese.com/story/001047375",
|
|
||||||
".ftchinese.com/story/001047381",
|
|
||||||
".ftchinese.com/story/001047413",
|
|
||||||
".ftchinese.com/story/001047456",
|
|
||||||
".ftchinese.com/story/001047491",
|
|
||||||
".ftchinese.com/story/001047545",
|
|
||||||
".ftchinese.com/story/001047558",
|
|
||||||
".ftchinese.com/story/001047568",
|
|
||||||
".ftchinese.com/story/001047627",
|
|
||||||
".ftchinese.com/story/001048293",
|
|
||||||
".ftchinese.com/story/001048343",
|
|
||||||
".ftchinese.com/story/001048710",
|
|
||||||
".ftchinese.com/story/001049289",
|
|
||||||
".ftchinese.com/story/001049360",
|
|
||||||
".ftchinese.com/story/001049896",
|
|
||||||
".ftchinese.com/story/001050152",
|
|
||||||
".ftchinese.com/story/001051027",
|
|
||||||
".ftchinese.com/story/001051161",
|
|
||||||
".ftchinese.com/story/001051372",
|
|
||||||
".ftchinese.com/story/001051479",
|
|
||||||
".ftchinese.com/story/001052138",
|
|
||||||
".ftchinese.com/story/001052161",
|
|
||||||
".ftchinese.com/story/001052525",
|
|
||||||
".ftchinese.com/story/001052549",
|
|
||||||
".ftchinese.com/story/001052701",
|
|
||||||
".ftchinese.com/story/001052965",
|
|
||||||
".ftchinese.com/story/001053149",
|
|
||||||
".ftchinese.com/story/001053150",
|
|
||||||
".ftchinese.com/story/001053200",
|
|
||||||
".ftchinese.com/story/001053425",
|
|
||||||
".ftchinese.com/story/001053496",
|
|
||||||
".ftchinese.com/story/001053526",
|
|
||||||
".ftchinese.com/story/001053557",
|
|
||||||
".ftchinese.com/story/001053906",
|
|
||||||
".ftchinese.com/story/001054049",
|
|
||||||
".ftchinese.com/story/001054103",
|
|
||||||
".ftchinese.com/story/001054109",
|
|
||||||
".ftchinese.com/story/001054119",
|
|
||||||
".ftchinese.com/story/001054123",
|
|
||||||
".ftchinese.com/story/001054139",
|
|
||||||
".ftchinese.com/story/001054166",
|
|
||||||
".ftchinese.com/story/001054168",
|
|
||||||
".ftchinese.com/story/001054190",
|
|
||||||
".ftchinese.com/story/001054437",
|
|
||||||
".ftchinese.com/story/001054526",
|
|
||||||
".ftchinese.com/story/001054607",
|
|
||||||
".ftchinese.com/story/001054644",
|
|
||||||
".ftchinese.com/story/001054786",
|
|
||||||
".ftchinese.com/story/001054843",
|
|
||||||
".ftchinese.com/story/001054925",
|
|
||||||
".ftchinese.com/story/001054940",
|
|
||||||
".ftchinese.com/story/001055051",
|
|
||||||
".ftchinese.com/story/001055063",
|
|
||||||
".ftchinese.com/story/001055069",
|
|
||||||
".ftchinese.com/story/001055136",
|
|
||||||
".ftchinese.com/story/001055170",
|
|
||||||
".ftchinese.com/story/001055202",
|
|
||||||
".ftchinese.com/story/001055242",
|
|
||||||
".ftchinese.com/story/001055263",
|
|
||||||
".ftchinese.com/story/001055274",
|
|
||||||
".ftchinese.com/story/001055299",
|
|
||||||
".ftchinese.com/story/001055480",
|
|
||||||
".ftchinese.com/story/001055551",
|
|
||||||
".ftchinese.com/story/001055559",
|
|
||||||
".ftchinese.com/story/001055566",
|
|
||||||
".ftchinese.com/story/001055840",
|
|
||||||
".ftchinese.com/story/001056099",
|
|
||||||
".ftchinese.com/story/001056108",
|
|
||||||
".ftchinese.com/story/001056131",
|
|
||||||
".ftchinese.com/story/001056375",
|
|
||||||
".ftchinese.com/story/001056491",
|
|
||||||
".ftchinese.com/story/001056529",
|
|
||||||
".ftchinese.com/story/001056534",
|
|
||||||
".ftchinese.com/story/001056538",
|
|
||||||
".ftchinese.com/story/001056541",
|
|
||||||
".ftchinese.com/story/001056554",
|
|
||||||
".ftchinese.com/story/001056557",
|
|
||||||
".ftchinese.com/story/001056560",
|
|
||||||
".ftchinese.com/story/001056567",
|
|
||||||
".ftchinese.com/story/001056574",
|
|
||||||
".ftchinese.com/story/001056588",
|
|
||||||
".ftchinese.com/story/001056594",
|
|
||||||
".ftchinese.com/story/001056596",
|
|
||||||
".ftchinese.com/story/001056684",
|
|
||||||
".ftchinese.com/story/001056832",
|
|
||||||
".ftchinese.com/story/001056833",
|
|
||||||
".ftchinese.com/story/001056851",
|
|
||||||
".ftchinese.com/story/001056874",
|
|
||||||
".ftchinese.com/story/001056896",
|
|
||||||
".ftchinese.com/story/001056927",
|
|
||||||
".ftchinese.com/story/001057011",
|
|
||||||
".ftchinese.com/story/001057018",
|
|
||||||
".ftchinese.com/story/001057044",
|
|
||||||
".ftchinese.com/story/001057162",
|
|
||||||
".ftchinese.com/story/001057500",
|
|
||||||
".ftchinese.com/story/001057504",
|
|
||||||
".ftchinese.com/story/001057509",
|
|
||||||
".ftchinese.com/story/001057518",
|
|
||||||
".ftchinese.com/story/001057532",
|
|
||||||
".ftchinese.com/story/001057533",
|
|
||||||
".ftchinese.com/story/001057556",
|
|
||||||
".ftchinese.com/story/001057580",
|
|
||||||
".ftchinese.com/story/001057638",
|
|
||||||
".ftchinese.com/story/001057644",
|
|
||||||
".ftchinese.com/story/001057817",
|
|
||||||
".ftchinese.com/story/001057875",
|
|
||||||
".ftchinese.com/story/001058009",
|
|
||||||
".ftchinese.com/story/001058056",
|
|
||||||
".ftchinese.com/story/001058224",
|
|
||||||
".ftchinese.com/story/001058257",
|
|
||||||
".ftchinese.com/story/001058295",
|
|
||||||
".ftchinese.com/story/001058328",
|
|
||||||
".ftchinese.com/story/001058339",
|
|
||||||
".ftchinese.com/story/001058344",
|
|
||||||
".ftchinese.com/story/001058352",
|
|
||||||
".ftchinese.com/story/001058413",
|
|
||||||
".ftchinese.com/story/001058421",
|
|
||||||
".ftchinese.com/story/001058440",
|
|
||||||
".ftchinese.com/story/001058458",
|
|
||||||
".ftchinese.com/story/001058468",
|
|
||||||
".ftchinese.com/story/001058561",
|
|
||||||
".ftchinese.com/story/001058566",
|
|
||||||
".ftchinese.com/story/001058567",
|
|
||||||
".ftchinese.com/story/001058585",
|
|
||||||
".ftchinese.com/story/001058628",
|
|
||||||
".ftchinese.com/story/001058656",
|
|
||||||
".ftchinese.com/story/001058665",
|
|
||||||
".ftchinese.com/story/001058678",
|
|
||||||
".ftchinese.com/story/001058691",
|
|
||||||
".ftchinese.com/story/001058721",
|
|
||||||
".ftchinese.com/story/001058728",
|
|
||||||
".ftchinese.com/story/001059464",
|
|
||||||
".ftchinese.com/story/001059484",
|
|
||||||
".ftchinese.com/story/001059537",
|
|
||||||
".ftchinese.com/story/001059538",
|
|
||||||
".ftchinese.com/story/001059551",
|
|
||||||
".ftchinese.com/story/001059818",
|
|
||||||
".ftchinese.com/story/001059914",
|
|
||||||
".ftchinese.com/story/001059920",
|
|
||||||
".ftchinese.com/story/001059957",
|
|
||||||
".ftchinese.com/story/001060088",
|
|
||||||
".ftchinese.com/story/001060156",
|
|
||||||
".ftchinese.com/story/001060157",
|
|
||||||
".ftchinese.com/story/001060160",
|
|
||||||
".ftchinese.com/story/001060181",
|
|
||||||
".ftchinese.com/story/001060185",
|
|
||||||
".ftchinese.com/story/001060493",
|
|
||||||
".ftchinese.com/story/001060495",
|
|
||||||
".ftchinese.com/story/001060590",
|
|
||||||
".ftchinese.com/story/001060846",
|
|
||||||
".ftchinese.com/story/001060847",
|
|
||||||
".ftchinese.com/story/001060875",
|
|
||||||
".ftchinese.com/story/001060921",
|
|
||||||
".ftchinese.com/story/001060946",
|
|
||||||
".ftchinese.com/story/001061120",
|
|
||||||
".ftchinese.com/story/001061474",
|
|
||||||
".ftchinese.com/story/001061524",
|
|
||||||
".ftchinese.com/story/001061642",
|
|
||||||
".ftchinese.com/story/001062017",
|
|
||||||
".ftchinese.com/story/001062020",
|
|
||||||
".ftchinese.com/story/001062028",
|
|
||||||
".ftchinese.com/story/001062092",
|
|
||||||
".ftchinese.com/story/001062096",
|
|
||||||
".ftchinese.com/story/001062147",
|
|
||||||
".ftchinese.com/story/001062176",
|
|
||||||
".ftchinese.com/story/001062188",
|
|
||||||
".ftchinese.com/story/001062254",
|
|
||||||
".ftchinese.com/story/001062374",
|
|
||||||
".ftchinese.com/story/001062482",
|
|
||||||
".ftchinese.com/story/001062496",
|
|
||||||
".ftchinese.com/story/001062501",
|
|
||||||
".ftchinese.com/story/001062508",
|
|
||||||
".ftchinese.com/story/001062519",
|
|
||||||
".ftchinese.com/story/001062554",
|
|
||||||
".ftchinese.com/story/001062741",
|
|
||||||
".ftchinese.com/story/001062794",
|
|
||||||
".ftchinese.com/story/001063160",
|
|
||||||
".ftchinese.com/story/001063359",
|
|
||||||
".ftchinese.com/story/001063512",
|
|
||||||
".ftchinese.com/story/001063668",
|
|
||||||
".ftchinese.com/story/001063692",
|
|
||||||
".ftchinese.com/story/001063763",
|
|
||||||
".ftchinese.com/story/001063764",
|
|
||||||
".ftchinese.com/story/001063826",
|
|
||||||
".ftchinese.com/story/001064127",
|
|
||||||
".ftchinese.com/story/001064312",
|
|
||||||
".ftchinese.com/story/001064705",
|
|
||||||
".ftchinese.com/story/001064807",
|
|
||||||
".ftchinese.com/story/001065120",
|
|
||||||
".ftchinese.com/story/001065168",
|
|
||||||
".ftchinese.com/story/001065249",
|
|
||||||
".ftchinese.com/story/001065287",
|
|
||||||
".ftchinese.com/story/001065335",
|
|
||||||
".ftchinese.com/story/001065337",
|
|
||||||
".ftchinese.com/story/001065541",
|
|
||||||
".ftchinese.com/story/001065715",
|
|
||||||
".ftchinese.com/story/001065735",
|
|
||||||
".ftchinese.com/story/001065756",
|
|
||||||
".ftchinese.com/story/001065802",
|
|
||||||
".ftchinese.com/story/001066112",
|
|
||||||
".ftchinese.com/story/001066136",
|
|
||||||
".ftchinese.com/story/001066140",
|
|
||||||
".ftchinese.com/story/001066465",
|
|
||||||
".ftchinese.com/story/001066881",
|
|
||||||
".ftchinese.com/story/001066950",
|
|
||||||
".ftchinese.com/story/001066959",
|
|
||||||
".ftchinese.com/story/001067435",
|
|
||||||
"www.ftchinese.com/story/001067479",
|
|
||||||
".ftchinese.com/story/001067528",
|
|
||||||
".ftchinese.com/story/001067545",
|
|
||||||
".ftchinese.com/story/001067572",
|
|
||||||
".ftchinese.com/story/001067648",
|
|
||||||
".ftchinese.com/story/001067650",
|
|
||||||
".ftchinese.com/story/001067680",
|
|
||||||
".ftchinese.com/story/001067692",
|
|
||||||
".ftchinese.com/story/001067871",
|
|
||||||
".ftchinese.com/story/001067923",
|
|
||||||
".ftchinese.com/story/001068062",
|
|
||||||
".ftchinese.com/story/001068248",
|
|
||||||
".ftchinese.com/story/001068278",
|
|
||||||
".ftchinese.com/story/001068379",
|
|
||||||
".ftchinese.com/story/001068483",
|
|
||||||
".ftchinese.com/story/001068506",
|
|
||||||
".ftchinese.com/story/001068547",
|
|
||||||
".ftchinese.com/story/001068616",
|
|
||||||
".ftchinese.com/story/001068622",
|
|
||||||
".ftchinese.com/story/001068707",
|
|
||||||
".ftchinese.com/story/001069146",
|
|
||||||
".ftchinese.com/story/001069373",
|
|
||||||
".ftchinese.com/story/001069516",
|
|
||||||
".ftchinese.com/story/001069517",
|
|
||||||
".ftchinese.com/story/001069687",
|
|
||||||
".ftchinese.com/story/001069741",
|
|
||||||
".ftchinese.com/story/001069861",
|
|
||||||
".ftchinese.com/story/001069952",
|
|
||||||
".ftchinese.com/story/001070053",
|
|
||||||
".ftchinese.com/story/001070177",
|
|
||||||
".ftchinese.com/story/001070307",
|
|
||||||
".ftchinese.com/story/001070809",
|
|
||||||
".ftchinese.com/story/001070990",
|
|
||||||
".ftchinese.com/story/001071042",
|
|
||||||
".ftchinese.com/story/001071044",
|
|
||||||
".ftchinese.com/story/001071106",
|
|
||||||
".ftchinese.com/story/001071166",
|
|
||||||
".ftchinese.com/story/001071181",
|
|
||||||
"ftchinese.com/story/001071200",
|
|
||||||
".ftchinese.com/story/001071208",
|
|
||||||
".ftchinese.com/story/001071238",
|
|
||||||
".ftchinese.com/story/001071683",
|
|
||||||
".ftchinese.com/story/001072271",
|
|
||||||
".ftchinese.com/story/001072348",
|
|
||||||
".ftchinese.com/story/001072677",
|
|
||||||
".ftchinese.com/story/001072726",
|
|
||||||
".ftchinese.com/story/001072794",
|
|
||||||
".ftchinese.com/story/001072853",
|
|
||||||
".ftchinese.com/story/001072895",
|
|
||||||
".ftchinese.com/story/001072993",
|
|
||||||
".ftchinese.com/story/001073043",
|
|
||||||
".ftchinese.com/story/001073103",
|
|
||||||
".ftchinese.com/story/001073157",
|
|
||||||
".ftchinese.com/story/001073216",
|
|
||||||
".ftchinese.com/story/001073246",
|
|
||||||
".ftchinese.com/story/001073305",
|
|
||||||
".ftchinese.com/story/001073307",
|
|
||||||
".ftchinese.com/story/001073408",
|
|
||||||
".ftchinese.com/story/001073537",
|
|
||||||
".ftchinese.com/story/001073672",
|
|
||||||
".ftchinese.com/story/001073849",
|
|
||||||
".ftchinese.com/story/001073906",
|
|
||||||
".ftchinese.com/story/001074089",
|
|
||||||
".ftchinese.com/story/001074110",
|
|
||||||
".ftchinese.com/story/001074128",
|
|
||||||
".ftchinese.com/story/001074157",
|
|
||||||
".ftchinese.com/story/001074246",
|
|
||||||
".ftchinese.com/story/001074307",
|
|
||||||
".ftchinese.com/story/001074347",
|
|
||||||
".ftchinese.com/story/001074423",
|
|
||||||
".ftchinese.com/story/001074454",
|
|
||||||
".ftchinese.com/story/001074467",
|
|
||||||
".ftchinese.com/story/001074493",
|
|
||||||
".ftchinese.com/story/001074550",
|
|
||||||
".ftchinese.com/story/001074562",
|
|
||||||
".ftchinese.com/story/001074653",
|
|
||||||
".ftchinese.com/story/001074693",
|
|
||||||
".ftchinese.com/story/001074699",
|
|
||||||
".ftchinese.com/story/001074712",
|
|
||||||
".ftchinese.com/story/001074713",
|
|
||||||
".ftchinese.com/story/001074768",
|
|
||||||
".ftchinese.com/story/001074782",
|
|
||||||
".ftchinese.com/story/001074794",
|
|
||||||
".ftchinese.com/story/001074822",
|
|
||||||
".ftchinese.com/story/001074874",
|
|
||||||
".ftchinese.com/story/001074891",
|
|
||||||
".ftchinese.com/story/001074918",
|
|
||||||
".ftchinese.com/story/001075081",
|
|
||||||
".ftchinese.com/story/001075134",
|
|
||||||
".ftchinese.com/story/001075142",
|
|
||||||
".ftchinese.com/story/001075216",
|
|
||||||
".ftchinese.com/story/001075230",
|
|
||||||
".ftchinese.com/story/001075238",
|
|
||||||
".ftchinese.com/story/001075262",
|
|
||||||
".ftchinese.com/story/001075269",
|
|
||||||
".ftchinese.com/story/001075491",
|
|
||||||
".ftchinese.com/story/001075500",
|
|
||||||
".ftchinese.com/story/001075650",
|
|
||||||
".ftchinese.com/story/001075678",
|
|
||||||
".ftchinese.com/story/001075703",
|
|
||||||
".ftchinese.com/story/001075739",
|
|
||||||
".ftchinese.com/story/001076066",
|
|
||||||
".ftchinese.com/story/001076142",
|
|
||||||
".ftchinese.com/story/001076459",
|
|
||||||
".ftchinese.com/story/001076470",
|
|
||||||
".ftchinese.com/story/001076538",
|
|
||||||
".ftchinese.com/story/001076573",
|
|
||||||
".ftchinese.com/story/001076901",
|
|
||||||
".ftchinese.com/story/001077067",
|
|
||||||
".ftchinese.com/story/001077084",
|
|
||||||
".ftchinese.com/story/001077235",
|
|
||||||
".ftchinese.com/story/001077344",
|
|
||||||
".ftchinese.com/story/001077390",
|
|
||||||
".ftchinese.com/story/001077392",
|
|
||||||
".ftchinese.com/story/001077465",
|
|
||||||
".ftchinese.com/story/001077468",
|
|
||||||
".ftchinese.com/story/001077492",
|
|
||||||
".ftchinese.com/story/001077745",
|
|
||||||
".ftchinese.com/story/001077768",
|
|
||||||
".ftchinese.com/story/001077804",
|
|
||||||
".ftchinese.com/story/001077852",
|
|
||||||
".ftchinese.com/story/001078646",
|
|
||||||
".ftchinese.com/story/001078928",
|
|
||||||
".ftchinese.com/story/001078967",
|
|
||||||
".ftchinese.com/story/001079559",
|
|
||||||
".ftchinese.com/story/001079641",
|
|
||||||
".ftchinese.com/story/001079909",
|
|
||||||
".ftchinese.com/story/001079934",
|
|
||||||
".ftchinese.com/story/001079992",
|
|
||||||
".ftchinese.com/story/001080054",
|
|
||||||
".ftchinese.com/story/001080109",
|
|
||||||
".ftchinese.com/story/001080169",
|
|
||||||
".ftchinese.com/story/001080226",
|
|
||||||
".ftchinese.com/story/001080429",
|
|
||||||
".ftchinese.com/story/001080471",
|
|
||||||
".ftchinese.com/story/001080550",
|
|
||||||
".ftchinese.com/story/001080581",
|
|
||||||
".ftchinese.com/story/001080647",
|
|
||||||
".ftchinese.com/story/001080778",
|
|
||||||
".ftchinese.com/story/001080892",
|
|
||||||
".ftchinese.com/story/001080915",
|
|
||||||
".ftchinese.com/story/001080935",
|
|
||||||
".ftchinese.com/story/001081059",
|
|
||||||
".ftchinese.com/story/001081127",
|
|
||||||
".ftchinese.com/tag/%E5%8D%81%E5%85%AB%E5%B1%8A%E4%B8%89%E4%B8%AD%E5%85%A8%E4%BC%9A",
|
|
||||||
".ftchinese.com/tag/%E6%B8%A9%E5%AE%B6%E5%AE%9D",
|
|
||||||
".ftchinese.com/tag/%E8%96%84%E7%86%99%E6%9D%A5",
|
|
||||||
".ftchinese.com/video/1437",
|
|
||||||
".ftchinese.com/video/1882",
|
|
||||||
".ftchinese.com/video/2446",
|
|
||||||
".ftchinese.com/video/2601",
|
|
||||||
".ftchinese.com/comments",
|
|
||||||
"||1e100.net",
|
"||1e100.net",
|
||||||
"||466453.com",
|
"||466453.com",
|
||||||
"||abc.xyz",
|
"||abc.xyz",
|
||||||
@@ -1595,6 +1155,7 @@ var rules = [
|
|||||||
"||2008xianzhang.info",
|
"||2008xianzhang.info",
|
||||||
"||2017.hk",
|
"||2017.hk",
|
||||||
"21andy.com/blog",
|
"21andy.com/blog",
|
||||||
|
".21join.com",
|
||||||
".21pron.com",
|
".21pron.com",
|
||||||
"21sextury.com",
|
"21sextury.com",
|
||||||
".228.net.tw",
|
".228.net.tw",
|
||||||
@@ -1636,9 +1197,10 @@ var rules = [
|
|||||||
"64wiki.com",
|
"64wiki.com",
|
||||||
".66.ca",
|
".66.ca",
|
||||||
"666kb.com",
|
"666kb.com",
|
||||||
"6park.com",
|
".6park.com",
|
||||||
"||6park.com",
|
"||6park.com",
|
||||||
"||6parker.com",
|
"||6parker.com",
|
||||||
|
"||6parknews.com",
|
||||||
"||7capture.com",
|
"||7capture.com",
|
||||||
".7cow.com",
|
".7cow.com",
|
||||||
".8-d.com",
|
".8-d.com",
|
||||||
@@ -1923,6 +1485,7 @@ var rules = [
|
|||||||
".avdb.tv",
|
".avdb.tv",
|
||||||
"||avdb.tv",
|
"||avdb.tv",
|
||||||
".avfantasy.com",
|
".avfantasy.com",
|
||||||
|
"||avg.com",
|
||||||
".avgle.com",
|
".avgle.com",
|
||||||
"||avgle.com",
|
"||avgle.com",
|
||||||
"||avidemux.org",
|
"||avidemux.org",
|
||||||
@@ -2716,6 +2279,8 @@ var rules = [
|
|||||||
"delicious.com/GFWbookmark",
|
"delicious.com/GFWbookmark",
|
||||||
".democrats.org",
|
".democrats.org",
|
||||||
"||democrats.org",
|
"||democrats.org",
|
||||||
|
".demosisto.hk",
|
||||||
|
"||demosisto.hk",
|
||||||
"||desc.se",
|
"||desc.se",
|
||||||
"||dessci.com",
|
"||dessci.com",
|
||||||
".destroy-china.jp",
|
".destroy-china.jp",
|
||||||
@@ -3416,6 +2981,7 @@ var rules = [
|
|||||||
"||toutyrater.github.io",
|
"||toutyrater.github.io",
|
||||||
"wsgzao.github.io",
|
"wsgzao.github.io",
|
||||||
"|https://wsgzao.github.io",
|
"|https://wsgzao.github.io",
|
||||||
|
"||raw.githubusercontent.com",
|
||||||
".gizlen.net",
|
".gizlen.net",
|
||||||
"||gizlen.net",
|
"||gizlen.net",
|
||||||
".gjczz.com",
|
".gjczz.com",
|
||||||
@@ -4390,7 +3956,7 @@ var rules = [
|
|||||||
".lsmradio.com/rad_archives",
|
".lsmradio.com/rad_archives",
|
||||||
".lsmwebcast.com",
|
".lsmwebcast.com",
|
||||||
".ltn.com.tw",
|
".ltn.com.tw",
|
||||||
"|http://ltn.com.tw",
|
"||ltn.com.tw",
|
||||||
".luke54.com",
|
".luke54.com",
|
||||||
".luke54.org",
|
".luke54.org",
|
||||||
".lupm.org",
|
".lupm.org",
|
||||||
@@ -4858,6 +4424,7 @@ var rules = [
|
|||||||
"|http://nvtongzhisheng.org",
|
"|http://nvtongzhisheng.org",
|
||||||
".nwtca.org",
|
".nwtca.org",
|
||||||
"|http://nyaa.eu",
|
"|http://nyaa.eu",
|
||||||
|
"||nyaa.si",
|
||||||
".nydus.ca",
|
".nydus.ca",
|
||||||
"nylon-angel.com",
|
"nylon-angel.com",
|
||||||
"nylonstockingsonline.com",
|
"nylonstockingsonline.com",
|
||||||
@@ -5321,6 +4888,7 @@ var rules = [
|
|||||||
"||rapidmoviez.com",
|
"||rapidmoviez.com",
|
||||||
"rapidvpn.com",
|
"rapidvpn.com",
|
||||||
"||rapidvpn.com",
|
"||rapidvpn.com",
|
||||||
|
"||rarbgprx.org",
|
||||||
".raremovie.cc",
|
".raremovie.cc",
|
||||||
"|http://raremovie.cc",
|
"|http://raremovie.cc",
|
||||||
".raremovie.net",
|
".raremovie.net",
|
||||||
@@ -6861,7 +6429,7 @@ var rules = [
|
|||||||
"||windscribe.com",
|
"||windscribe.com",
|
||||||
"||community.windy.com",
|
"||community.windy.com",
|
||||||
"||wingy.site",
|
"||wingy.site",
|
||||||
"winning11.com",
|
".winning11.com",
|
||||||
"winwhispers.info",
|
"winwhispers.info",
|
||||||
"||wiredbytes.com",
|
"||wiredbytes.com",
|
||||||
"||wiredpen.com",
|
"||wiredpen.com",
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
6
v2rayN/v2rayN/Resx/ResUI.Designer.cs
generated
6
v2rayN/v2rayN/Resx/ResUI.Designer.cs
generated
@@ -394,7 +394,7 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Download V2rayCore successfully 的本地化字符串。
|
/// 查找类似 Download V2ray successfully 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string MsgDownloadV2rayCoreSuccessfully {
|
internal static string MsgDownloadV2rayCoreSuccessfully {
|
||||||
get {
|
get {
|
||||||
@@ -448,7 +448,7 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Resolve V2rayCore successfully 的本地化字符串。
|
/// 查找类似 Resolve V2ray successfully 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string MsgParsingV2rayCoreSuccessfully {
|
internal static string MsgParsingV2rayCoreSuccessfully {
|
||||||
get {
|
get {
|
||||||
@@ -484,7 +484,7 @@ namespace v2rayN.Resx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Start updating V2rayCore... 的本地化字符串。
|
/// 查找类似 Start updating V2ray... 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string MsgStartUpdatingV2rayCore {
|
internal static string MsgStartUpdatingV2rayCore {
|
||||||
get {
|
get {
|
||||||
|
|||||||
@@ -269,7 +269,7 @@
|
|||||||
<value>Clear original subscription content</value>
|
<value>Clear original subscription content</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgDownloadV2rayCoreSuccessfully" xml:space="preserve">
|
<data name="MsgDownloadV2rayCoreSuccessfully" xml:space="preserve">
|
||||||
<value>Download V2rayCore successfully</value>
|
<value>Download V2ray successfully</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgFailedImportSubscription" xml:space="preserve">
|
<data name="MsgFailedImportSubscription" xml:space="preserve">
|
||||||
<value>Failed to import subscription content</value>
|
<value>Failed to import subscription content</value>
|
||||||
@@ -287,7 +287,7 @@
|
|||||||
<value>PAC update succeeded</value>
|
<value>PAC update succeeded</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgParsingV2rayCoreSuccessfully" xml:space="preserve">
|
<data name="MsgParsingV2rayCoreSuccessfully" xml:space="preserve">
|
||||||
<value>Resolve V2rayCore successfully</value>
|
<value>Resolve V2ray successfully</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgSimplifyPAC" xml:space="preserve">
|
<data name="MsgSimplifyPAC" xml:space="preserve">
|
||||||
<value>Simplify PAC Success</value>
|
<value>Simplify PAC Success</value>
|
||||||
@@ -299,7 +299,7 @@
|
|||||||
<value>Start updating PAC...</value>
|
<value>Start updating PAC...</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgStartUpdatingV2rayCore" xml:space="preserve">
|
<data name="MsgStartUpdatingV2rayCore" xml:space="preserve">
|
||||||
<value>Start updating V2rayCore...</value>
|
<value>Start updating V2ray...</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
|
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
|
||||||
<value>Subscription content decoding failed (non-BASE64 code)</value>
|
<value>Subscription content decoding failed (non-BASE64 code)</value>
|
||||||
|
|||||||
@@ -269,7 +269,7 @@
|
|||||||
<value>清除原订阅内容</value>
|
<value>清除原订阅内容</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgDownloadV2rayCoreSuccessfully" xml:space="preserve">
|
<data name="MsgDownloadV2rayCoreSuccessfully" xml:space="preserve">
|
||||||
<value>下载V2rayCore成功</value>
|
<value>下载V2ray成功</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgFailedImportSubscription" xml:space="preserve">
|
<data name="MsgFailedImportSubscription" xml:space="preserve">
|
||||||
<value>导入订阅内容失败</value>
|
<value>导入订阅内容失败</value>
|
||||||
@@ -287,7 +287,7 @@
|
|||||||
<value>PAC更新成功</value>
|
<value>PAC更新成功</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgParsingV2rayCoreSuccessfully" xml:space="preserve">
|
<data name="MsgParsingV2rayCoreSuccessfully" xml:space="preserve">
|
||||||
<value>解析V2rayCore成功</value>
|
<value>解析V2ray成功</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgSimplifyPAC" xml:space="preserve">
|
<data name="MsgSimplifyPAC" xml:space="preserve">
|
||||||
<value>简化PAC成功</value>
|
<value>简化PAC成功</value>
|
||||||
@@ -299,7 +299,7 @@
|
|||||||
<value>开始更新PAC...</value>
|
<value>开始更新PAC...</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgStartUpdatingV2rayCore" xml:space="preserve">
|
<data name="MsgStartUpdatingV2rayCore" xml:space="preserve">
|
||||||
<value>开始更新V2rayCore...</value>
|
<value>开始更新V2ray...</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
|
<data name="MsgSubscriptionDecodingFailed" xml:space="preserve">
|
||||||
<value>订阅内容解码失败(非BASE64码)</value>
|
<value>订阅内容解码失败(非BASE64码)</value>
|
||||||
|
|||||||
@@ -24,20 +24,27 @@ namespace v2rayN.Tool
|
|||||||
|
|
||||||
public static void UncompressFile(string fileName, byte[] content)
|
public static void UncompressFile(string fileName, byte[] content)
|
||||||
{
|
{
|
||||||
// Because the uncompressed size of the file is unknown,
|
try
|
||||||
// we are using an arbitrary buffer size.
|
|
||||||
byte[] buffer = new byte[4096];
|
|
||||||
int n;
|
|
||||||
|
|
||||||
using (var fs = File.Create(fileName))
|
|
||||||
using (var input = new GZipStream(new MemoryStream(content),
|
|
||||||
CompressionMode.Decompress, false))
|
|
||||||
{
|
{
|
||||||
while ((n = input.Read(buffer, 0, buffer.Length)) > 0)
|
// Because the uncompressed size of the file is unknown,
|
||||||
|
// we are using an arbitrary buffer size.
|
||||||
|
byte[] buffer = new byte[4096];
|
||||||
|
int n;
|
||||||
|
|
||||||
|
using (var fs = File.Create(fileName))
|
||||||
|
using (var input = new GZipStream(new MemoryStream(content),
|
||||||
|
CompressionMode.Decompress, false))
|
||||||
{
|
{
|
||||||
fs.Write(buffer, 0, n);
|
while ((n = input.Read(buffer, 0, buffer.Length)) > 0)
|
||||||
|
{
|
||||||
|
fs.Write(buffer, 0, n);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Utils.SaveLog(ex.Message, ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string NonExclusiveReadAllText(string path)
|
public static string NonExclusiveReadAllText(string path)
|
||||||
@@ -61,5 +68,52 @@ namespace v2rayN.Tool
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static bool ZipExtractToFile(string fileName)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (ZipArchive archive = ZipFile.OpenRead(fileName))
|
||||||
|
{
|
||||||
|
foreach (ZipArchiveEntry entry in archive.Entries)
|
||||||
|
{
|
||||||
|
if (entry.Length == 0)
|
||||||
|
continue;
|
||||||
|
entry.ExtractToFile(Utils.GetPath(entry.Name), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Utils.SaveLog(ex.Message, ex);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool ZipExtractToFullFile(string fileName)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (ZipArchive archive = ZipFile.OpenRead(fileName))
|
||||||
|
{
|
||||||
|
foreach (ZipArchiveEntry entry in archive.Entries)
|
||||||
|
{
|
||||||
|
if (entry.Length == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
string entryOuputPath = Utils.GetPath(entry.FullName);
|
||||||
|
FileInfo fileInfo = new FileInfo(entryOuputPath);
|
||||||
|
fileInfo.Directory.Create();
|
||||||
|
entry.ExtractToFile(entryOuputPath, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Utils.SaveLog(ex.Message, ex);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ namespace v2rayN
|
|||||||
|
|
||||||
if (!succ)
|
if (!succ)
|
||||||
{
|
{
|
||||||
//Logging.Error("Failed to call AssignProcessToJobObject! GetLastError=" + Marshal.GetLastWin32Error());
|
Utils.SaveLog("Failed to call AssignProcessToJobObject! GetLastError=" + Marshal.GetLastWin32Error());
|
||||||
}
|
}
|
||||||
|
|
||||||
return succ;
|
return succ;
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ namespace v2rayN
|
|||||||
{
|
{
|
||||||
if (wrap)
|
if (wrap)
|
||||||
{
|
{
|
||||||
return string.Join(",\r\n", lst.ToArray());
|
return string.Join("," + Environment.NewLine, lst.ToArray());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -176,7 +176,7 @@ namespace v2rayN
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
str = str.Replace("\r\n", "");
|
str = str.Replace(Environment.NewLine, "");
|
||||||
return new List<string>(str.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries));
|
return new List<string>(str.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries));
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
@@ -214,8 +214,8 @@ namespace v2rayN
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
plainText = plainText.TrimEx()
|
plainText = plainText.TrimEx()
|
||||||
|
.Replace(Environment.NewLine, "")
|
||||||
.Replace("\n", "")
|
.Replace("\n", "")
|
||||||
.Replace("\r\n", "")
|
|
||||||
.Replace("\r", "")
|
.Replace("\r", "")
|
||||||
.Replace(" ", "");
|
.Replace(" ", "");
|
||||||
|
|
||||||
@@ -443,15 +443,6 @@ namespace v2rayN
|
|||||||
return Regex.IsMatch(input, pattern, RegexOptions.IgnoreCase);
|
return Regex.IsMatch(input, pattern, RegexOptions.IgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsIdenticalServer(Mode.ServerStatistics a, Mode.ServerStatistics b)
|
|
||||||
{
|
|
||||||
return (a.address == b.address
|
|
||||||
&& a.port == b.port
|
|
||||||
&& a.path == b.path
|
|
||||||
&& a.host == b.host
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 开机自动启动
|
#region 开机自动启动
|
||||||
@@ -666,7 +657,14 @@ namespace v2rayN
|
|||||||
return lstIPAddress;
|
return lstIPAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void SetSecurityProtocol()
|
||||||
|
{
|
||||||
|
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
|
||||||
|
| SecurityProtocolType.Tls
|
||||||
|
| SecurityProtocolType.Tls11
|
||||||
|
| SecurityProtocolType.Tls12;
|
||||||
|
ServicePointManager.DefaultConnectionLimit = 256;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 杂项
|
#region 杂项
|
||||||
@@ -788,16 +786,13 @@ namespace v2rayN
|
|||||||
|
|
||||||
#region TempPath
|
#region TempPath
|
||||||
|
|
||||||
private static string _tempPath = null;
|
|
||||||
|
|
||||||
// return path to store temporary files
|
// return path to store temporary files
|
||||||
public static string GetTempPath()
|
public static string GetTempPath()
|
||||||
{
|
{
|
||||||
if (_tempPath == null)
|
string _tempPath = Path.Combine(StartupPath(), "v2ray_win_temp");
|
||||||
|
if (!Directory.Exists(_tempPath))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(Path.Combine(StartupPath(), "v2ray_win_temp"));
|
Directory.CreateDirectory(_tempPath);
|
||||||
// don't use "/", it will fail when we call explorer /select xxx/ss_win_temp\xxx.log
|
|
||||||
_tempPath = Path.Combine(StartupPath(), "v2ray_win_temp");
|
|
||||||
}
|
}
|
||||||
return _tempPath;
|
return _tempPath;
|
||||||
}
|
}
|
||||||
@@ -805,13 +800,7 @@ namespace v2rayN
|
|||||||
public static string GetTempPath(string filename)
|
public static string GetTempPath(string filename)
|
||||||
{
|
{
|
||||||
return Path.Combine(GetTempPath(), filename);
|
return Path.Combine(GetTempPath(), filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ClearTempPath()
|
|
||||||
{
|
|
||||||
//Directory.Delete(GetTempPath(), true);
|
|
||||||
//_tempPath = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string UnGzip(byte[] buf)
|
public static string UnGzip(byte[] buf)
|
||||||
{
|
{
|
||||||
@@ -863,7 +852,7 @@ namespace v2rayN
|
|||||||
|
|
||||||
SwWrite.WriteLine(string.Format("{0}{1}[{2}]{3}", "--------------------------------", strTitle, DateTime.Now.ToString("HH:mm:ss"), "--------------------------------"));
|
SwWrite.WriteLine(string.Format("{0}{1}[{2}]{3}", "--------------------------------", strTitle, DateTime.Now.ToString("HH:mm:ss"), "--------------------------------"));
|
||||||
SwWrite.Write(strContent);
|
SwWrite.Write(strContent);
|
||||||
SwWrite.WriteLine("\r\n");
|
SwWrite.WriteLine(Environment.NewLine);
|
||||||
SwWrite.WriteLine(" ");
|
SwWrite.WriteLine(" ");
|
||||||
SwWrite.Flush();
|
SwWrite.Flush();
|
||||||
SwWrite.Close();
|
SwWrite.Close();
|
||||||
|
|||||||
@@ -150,12 +150,6 @@
|
|||||||
<Compile Include="Forms\MainForm.Designer.cs">
|
<Compile Include="Forms\MainForm.Designer.cs">
|
||||||
<DependentUpon>MainForm.cs</DependentUpon>
|
<DependentUpon>MainForm.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Forms\RoutingRuleSettingForm.cs">
|
|
||||||
<SubType>Form</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Forms\RoutingRuleSettingForm.Designer.cs">
|
|
||||||
<DependentUpon>RoutingRuleSettingForm.cs</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Forms\SubSettingForm.cs">
|
<Compile Include="Forms\SubSettingForm.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -186,16 +180,15 @@
|
|||||||
<Compile Include="Forms\SubSettingControl.Designer.cs">
|
<Compile Include="Forms\SubSettingControl.Designer.cs">
|
||||||
<DependentUpon>SubSettingControl.cs</DependentUpon>
|
<DependentUpon>SubSettingControl.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Handler\MainFormHandler.cs" />
|
||||||
<Compile Include="Handler\SpeedtestHandler.cs" />
|
<Compile Include="Handler\SpeedtestHandler.cs" />
|
||||||
<Compile Include="Handler\StatisticsHandler.cs" />
|
<Compile Include="Handler\StatisticsHandler.cs" />
|
||||||
<Compile Include="Handler\DownloadHandle.cs" />
|
<Compile Include="Handler\DownloadHandle.cs" />
|
||||||
<Compile Include="Base\HttpWebServer.cs" />
|
<Compile Include="Base\HttpWebServer.cs" />
|
||||||
<Compile Include="Base\HttpWebServerB.cs" />
|
<Compile Include="Base\HttpWebServerB.cs" />
|
||||||
<Compile Include="HttpProxyHandler\PrivoxyHandler.cs" />
|
<Compile Include="HttpProxyHandler\PrivoxyHandler.cs" />
|
||||||
<Compile Include="HttpProxyHandler\PACListHandle.cs" />
|
|
||||||
<Compile Include="HttpProxyHandler\PACServerHandle.cs" />
|
<Compile Include="HttpProxyHandler\PACServerHandle.cs" />
|
||||||
<Compile Include="HttpProxyHandler\ProxySetting.cs" />
|
<Compile Include="HttpProxyHandler\ProxySetting.cs" />
|
||||||
<Compile Include="HttpProxyHandler\SysProxyHandle.cs" />
|
|
||||||
<Compile Include="HttpProxyHandler\HttpProxyHandle.cs" />
|
<Compile Include="HttpProxyHandler\HttpProxyHandle.cs" />
|
||||||
<Compile Include="Base\WebClientEx.cs">
|
<Compile Include="Base\WebClientEx.cs">
|
||||||
<SubType>Component</SubType>
|
<SubType>Component</SubType>
|
||||||
@@ -236,7 +229,6 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Global.cs" />
|
<Compile Include="Global.cs" />
|
||||||
<Compile Include="Handler\QRCodeHelper.cs" />
|
<Compile Include="Handler\QRCodeHelper.cs" />
|
||||||
<Compile Include="Handler\RoutingRuleHandler.cs" />
|
|
||||||
<Compile Include="Mode\VmessQRCode.cs" />
|
<Compile Include="Mode\VmessQRCode.cs" />
|
||||||
<Compile Include="Mode\V2rayTcpRequest.cs" />
|
<Compile Include="Mode\V2rayTcpRequest.cs" />
|
||||||
<Compile Include="Handler\ConfigHandler.cs" />
|
<Compile Include="Handler\ConfigHandler.cs" />
|
||||||
@@ -292,11 +284,9 @@
|
|||||||
<DependentUpon>QRCodeControl.cs</DependentUpon>
|
<DependentUpon>QRCodeControl.cs</DependentUpon>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Forms\RoutingRuleSettingForm.resx">
|
|
||||||
<DependentUpon>RoutingRuleSettingForm.cs</DependentUpon>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<EmbeddedResource Include="Forms\SubSettingControl.resx">
|
<EmbeddedResource Include="Forms\SubSettingControl.resx">
|
||||||
<DependentUpon>SubSettingControl.cs</DependentUpon>
|
<DependentUpon>SubSettingControl.cs</DependentUpon>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Forms\SubSettingControl.zh-Hans.resx">
|
<EmbeddedResource Include="Forms\SubSettingControl.zh-Hans.resx">
|
||||||
<DependentUpon>SubSettingControl.cs</DependentUpon>
|
<DependentUpon>SubSettingControl.cs</DependentUpon>
|
||||||
@@ -339,6 +329,7 @@
|
|||||||
<EmbeddedResource Include="app.config">
|
<EmbeddedResource Include="app.config">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<None Include="LIB\libs.zip" />
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
<None Include="Properties\Settings.settings">
|
<None Include="Properties\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
@@ -354,11 +345,7 @@
|
|||||||
<EmbeddedResource Include="Sample\custom_routing_proxy" />
|
<EmbeddedResource Include="Sample\custom_routing_proxy" />
|
||||||
<Protobuf Include="Protos\Statistics.proto" />
|
<Protobuf Include="Protos\Statistics.proto" />
|
||||||
<None Include="Resources\abp.js.gz" />
|
<None Include="Resources\abp.js.gz" />
|
||||||
<None Include="Resources\grpc_csharp_ext.x64.dll.gz" />
|
|
||||||
<None Include="Resources\grpc_csharp_ext.x86.dll.gz" />
|
|
||||||
<None Include="Resources\pac.txt.gz" />
|
<None Include="Resources\pac.txt.gz" />
|
||||||
<None Include="Resources\sysproxy.exe.gz" />
|
|
||||||
<None Include="Resources\sysproxy64.exe.gz" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Resx\ResUI.zh-Hans.resx">
|
<EmbeddedResource Include="Resx\ResUI.zh-Hans.resx">
|
||||||
@@ -424,16 +411,18 @@
|
|||||||
<None Include="Resources\sub.png" />
|
<None Include="Resources\sub.png" />
|
||||||
<None Include="Resources\checkupdate.png" />
|
<None Include="Resources\checkupdate.png" />
|
||||||
<None Include="Resources\about.png" />
|
<None Include="Resources\about.png" />
|
||||||
<EmbeddedResource Include="LIB\Google.Protobuf.dll" />
|
<None Include="LIB\Google.Protobuf.dll" />
|
||||||
<EmbeddedResource Include="LIB\Grpc.Core.Api.dll" />
|
<None Include="LIB\Grpc.Core.Api.dll" />
|
||||||
<EmbeddedResource Include="LIB\Grpc.Core.dll" />
|
<None Include="LIB\Grpc.Core.dll" />
|
||||||
<EmbeddedResource Include="LIB\Newtonsoft.Json.dll" />
|
<None Include="LIB\Newtonsoft.Json.dll" />
|
||||||
<EmbeddedResource Include="LIB\System.Buffers.dll" />
|
<None Include="LIB\System.Buffers.dll" />
|
||||||
<EmbeddedResource Include="LIB\System.Memory.dll" />
|
<None Include="LIB\System.Memory.dll" />
|
||||||
<EmbeddedResource Include="LIB\System.Runtime.CompilerServices.Unsafe.dll" />
|
<None Include="LIB\System.Runtime.CompilerServices.Unsafe.dll" />
|
||||||
<EmbeddedResource Include="LIB\zxing.dll" />
|
<None Include="LIB\zxing.dll" />
|
||||||
<EmbeddedResource Include="LIB\zxing.presentation.dll" />
|
<None Include="LIB\zxing.presentation.dll" />
|
||||||
<EmbeddedResource Include="LIB\netstandard.dll" />
|
<None Include="LIB\netstandard.dll" />
|
||||||
|
<Content Include="LIB\grpc_csharp_ext.x64.dll" />
|
||||||
|
<Content Include="LIB\grpc_csharp_ext.x86.dll" />
|
||||||
<Content Include="Resources\help.png" />
|
<Content Include="Resources\help.png" />
|
||||||
<None Include="Resources\notify.png" />
|
<None Include="Resources\notify.png" />
|
||||||
<Content Include="Resources\privoxy_conf.txt" />
|
<Content Include="Resources\privoxy_conf.txt" />
|
||||||
|
|||||||
6
v2rayN/v2rayUpgrade/App.config
Normal file
6
v2rayN/v2rayUpgrade/App.config
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
106
v2rayN/v2rayUpgrade/MainForm.Designer.cs
generated
Normal file
106
v2rayN/v2rayUpgrade/MainForm.Designer.cs
generated
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
namespace v2rayUpgrade
|
||||||
|
{
|
||||||
|
partial class MainForm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 必需的设计器变量。
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 清理所有正在使用的资源。
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows 窗体设计器生成的代码
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设计器支持所需的方法 - 不要修改
|
||||||
|
/// 使用代码编辑器修改此方法的内容。
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.btnClose = new System.Windows.Forms.Button();
|
||||||
|
this.btnOK = new System.Windows.Forms.Button();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// btnClose
|
||||||
|
//
|
||||||
|
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||||
|
this.btnClose.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||||
|
this.btnClose.Location = new System.Drawing.Point(367, 118);
|
||||||
|
this.btnClose.Name = "btnClose";
|
||||||
|
this.btnClose.Size = new System.Drawing.Size(184, 89);
|
||||||
|
this.btnClose.TabIndex = 6;
|
||||||
|
this.btnClose.Text = "&Exit(退出)";
|
||||||
|
this.btnClose.UseVisualStyleBackColor = true;
|
||||||
|
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||||
|
//
|
||||||
|
// btnOK
|
||||||
|
//
|
||||||
|
this.btnOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||||
|
this.btnOK.Location = new System.Drawing.Point(81, 118);
|
||||||
|
this.btnOK.Name = "btnOK";
|
||||||
|
this.btnOK.Size = new System.Drawing.Size(184, 89);
|
||||||
|
this.btnOK.TabIndex = 7;
|
||||||
|
this.btnOK.Text = "&Upgrade(升级)";
|
||||||
|
this.btnOK.UseVisualStyleBackColor = true;
|
||||||
|
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||||
|
this.label1.Location = new System.Drawing.Point(79, 64);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(205, 15);
|
||||||
|
this.label1.TabIndex = 8;
|
||||||
|
this.label1.Text = "升级成功后将自动重启v2rayN";
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||||
|
this.label2.Location = new System.Drawing.Point(79, 37);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(471, 15);
|
||||||
|
this.label2.TabIndex = 9;
|
||||||
|
this.label2.Text = "v2rayN will restart automatically after successful upgrade";
|
||||||
|
//
|
||||||
|
// MainForm
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(616, 284);
|
||||||
|
this.Controls.Add(this.label2);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Controls.Add(this.btnClose);
|
||||||
|
this.Controls.Add(this.btnOK);
|
||||||
|
this.Name = "MainForm";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.Text = "v2rayUpgrade";
|
||||||
|
this.Load += new System.EventHandler(this.MainForm_Load);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Button btnClose;
|
||||||
|
private System.Windows.Forms.Button btnOK;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
115
v2rayN/v2rayUpgrade/MainForm.cs
Normal file
115
v2rayN/v2rayUpgrade/MainForm.cs
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.IO.Compression;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace v2rayUpgrade
|
||||||
|
{
|
||||||
|
public partial class MainForm : Form
|
||||||
|
{
|
||||||
|
private string[] _args;
|
||||||
|
|
||||||
|
|
||||||
|
public MainForm(string[] args)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_args = args;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MainForm_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnOK_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (_args.Length <= 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var fileName = _args[0];
|
||||||
|
var startKey = "v2rayN/";
|
||||||
|
|
||||||
|
using (ZipArchive archive = ZipFile.OpenRead(fileName))
|
||||||
|
{
|
||||||
|
foreach (ZipArchiveEntry entry in archive.Entries)
|
||||||
|
{
|
||||||
|
if (entry.Length == 0)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
var fullName = entry.FullName;
|
||||||
|
if (fullName.StartsWith(startKey))
|
||||||
|
{
|
||||||
|
fullName = fullName.Substring(startKey.Length, fullName.Length - startKey.Length);
|
||||||
|
}
|
||||||
|
|
||||||
|
string entryOuputPath = GetPath(fullName);
|
||||||
|
|
||||||
|
FileInfo fileInfo = new FileInfo(entryOuputPath);
|
||||||
|
fileInfo.Directory.Create();
|
||||||
|
entry.ExtractToFile(entryOuputPath, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
MessageBox.Show("Upgrade Failed(升级失败)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageBox.Show("Upgrade successed(升级成功)");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Process.Start("v2rayN.exe");
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnClose_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetExePath()
|
||||||
|
{
|
||||||
|
return Application.ExecutablePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string StartupPath()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string exePath = GetExePath();
|
||||||
|
return exePath.Substring(0, exePath.LastIndexOf("\\", StringComparison.Ordinal));
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return Application.StartupPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static string GetPath(string fileName)
|
||||||
|
{
|
||||||
|
string startupPath = StartupPath();
|
||||||
|
if (string.IsNullOrEmpty(fileName))
|
||||||
|
{
|
||||||
|
return startupPath;
|
||||||
|
}
|
||||||
|
return Path.Combine(startupPath, fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
v2rayN/v2rayUpgrade/MainForm.resx
Normal file
120
v2rayN/v2rayUpgrade/MainForm.resx
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
28
v2rayN/v2rayUpgrade/Program.cs
Normal file
28
v2rayN/v2rayUpgrade/Program.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace v2rayUpgrade
|
||||||
|
{
|
||||||
|
static class Program
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 应用程序的主入口点。
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
if (args.Length <= 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Please use v2rayN to upgrade(请用v2rayN升级)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
Application.Run(new MainForm(args));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
36
v2rayN/v2rayUpgrade/Properties/AssemblyInfo.cs
Normal file
36
v2rayN/v2rayUpgrade/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// 有关程序集的一般信息由以下
|
||||||
|
// 控制。更改这些特性值可修改
|
||||||
|
// 与程序集关联的信息。
|
||||||
|
[assembly: AssemblyTitle("v2rayUpgrade")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("v2rayUpgrade")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||||
|
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||||
|
//请将此类型的 ComVisible 特性设置为 true。
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||||
|
[assembly: Guid("f82be52a-155c-492c-9e0a-1e917ec62c78")]
|
||||||
|
|
||||||
|
// 程序集的版本信息由下列四个值组成:
|
||||||
|
//
|
||||||
|
// 主版本
|
||||||
|
// 次版本
|
||||||
|
// 生成号
|
||||||
|
// 修订号
|
||||||
|
//
|
||||||
|
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
|
||||||
|
// 方法是按如下所示使用“*”: :
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
71
v2rayN/v2rayUpgrade/Properties/Resources.Designer.cs
generated
Normal file
71
v2rayN/v2rayUpgrade/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码由工具生成。
|
||||||
|
// 运行时版本: 4.0.30319.42000
|
||||||
|
//
|
||||||
|
// 对此文件的更改可能导致不正确的行为,如果
|
||||||
|
// 重新生成代码,则所做更改将丢失。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace v2rayUpgrade.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 强类型资源类,用于查找本地化字符串等。
|
||||||
|
/// </summary>
|
||||||
|
// 此类是由 StronglyTypedResourceBuilder
|
||||||
|
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||||
|
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||||
|
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources
|
||||||
|
{
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 返回此类使用的缓存 ResourceManager 实例。
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if ((resourceMan == null))
|
||||||
|
{
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("v2rayUpgrade.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 覆盖当前线程的 CurrentUICulture 属性
|
||||||
|
/// 使用此强类型的资源类的资源查找。
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
117
v2rayN/v2rayUpgrade/Properties/Resources.resx
Normal file
117
v2rayN/v2rayUpgrade/Properties/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
30
v2rayN/v2rayUpgrade/Properties/Settings.Designer.cs
generated
Normal file
30
v2rayN/v2rayUpgrade/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace v2rayUpgrade.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
v2rayN/v2rayUpgrade/Properties/Settings.settings
Normal file
7
v2rayN/v2rayUpgrade/Properties/Settings.settings
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
||||||
85
v2rayN/v2rayUpgrade/v2rayUpgrade.csproj
Normal file
85
v2rayN/v2rayUpgrade/v2rayUpgrade.csproj
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{F82BE52A-155C-492C-9E0A-1E917EC62C78}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<RootNamespace>v2rayUpgrade</RootNamespace>
|
||||||
|
<AssemblyName>v2rayUpgrade</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.IO.Compression" />
|
||||||
|
<Reference Include="System.IO.Compression.FileSystem" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Deployment" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="MainForm.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="MainForm.Designer.cs">
|
||||||
|
<DependentUpon>MainForm.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<EmbeddedResource Include="MainForm.resx">
|
||||||
|
<DependentUpon>MainForm.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
6
v2rayN/v2rayUpgrade/v2rayUpgrade.csproj.user
Normal file
6
v2rayN/v2rayUpgrade/v2rayUpgrade.csproj.user
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||||
|
<StartArguments>D:\Github\v2rayN\v2rayN\v2rayUpgrade\bin\Debug\v2ray-windows.zip</StartArguments>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
Reference in New Issue
Block a user