mirror of
https://github.com/2dust/v2rayN.git
synced 2025-07-01 12:32:10 +00:00
up4.16
This commit is contained in:
parent
4d872e9143
commit
7513ff860b
12 changed files with 2041 additions and 1746 deletions
204
v2rayN/v2rayN/Forms/MainForm.Designer.cs
generated
204
v2rayN/v2rayN/Forms/MainForm.Designer.cs
generated
|
@ -129,6 +129,9 @@
|
|||
this.tsbPromotion = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.tsbClose = new System.Windows.Forms.ToolStripButton();
|
||||
this.tsbCheckUpdateGeoSite = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tsbCheckUpdateGeoIP = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator();
|
||||
((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit();
|
||||
this.scMain.Panel1.SuspendLayout();
|
||||
this.scMain.Panel2.SuspendLayout();
|
||||
|
@ -150,19 +153,17 @@
|
|||
//
|
||||
// scMain.Panel1
|
||||
//
|
||||
resources.ApplyResources(this.scMain.Panel1, "scMain.Panel1");
|
||||
this.scMain.Panel1.Controls.Add(this.lvServers);
|
||||
//
|
||||
// scMain.Panel2
|
||||
//
|
||||
resources.ApplyResources(this.scMain.Panel2, "scMain.Panel2");
|
||||
this.scMain.Panel2.Controls.Add(this.qrCodeControl);
|
||||
this.scMain.TabStop = false;
|
||||
//
|
||||
// lvServers
|
||||
//
|
||||
resources.ApplyResources(this.lvServers, "lvServers");
|
||||
this.lvServers.ContextMenuStrip = this.cmsLv;
|
||||
resources.ApplyResources(this.lvServers, "lvServers");
|
||||
this.lvServers.FullRowSelect = true;
|
||||
this.lvServers.GridLines = true;
|
||||
this.lvServers.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
|
||||
|
@ -181,7 +182,6 @@
|
|||
//
|
||||
// cmsLv
|
||||
//
|
||||
resources.ApplyResources(this.cmsLv, "cmsLv");
|
||||
this.cmsLv.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.cmsLv.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.menuAddVmessServer,
|
||||
|
@ -217,194 +217,195 @@
|
|||
this.menuExport2SubContent});
|
||||
this.cmsLv.Name = "cmsLv";
|
||||
this.cmsLv.OwnerItem = this.tsbServer;
|
||||
resources.ApplyResources(this.cmsLv, "cmsLv");
|
||||
//
|
||||
// menuAddVmessServer
|
||||
//
|
||||
resources.ApplyResources(this.menuAddVmessServer, "menuAddVmessServer");
|
||||
this.menuAddVmessServer.Name = "menuAddVmessServer";
|
||||
resources.ApplyResources(this.menuAddVmessServer, "menuAddVmessServer");
|
||||
this.menuAddVmessServer.Click += new System.EventHandler(this.menuAddVmessServer_Click);
|
||||
//
|
||||
// menuAddVlessServer
|
||||
//
|
||||
resources.ApplyResources(this.menuAddVlessServer, "menuAddVlessServer");
|
||||
this.menuAddVlessServer.Name = "menuAddVlessServer";
|
||||
resources.ApplyResources(this.menuAddVlessServer, "menuAddVlessServer");
|
||||
this.menuAddVlessServer.Click += new System.EventHandler(this.menuAddVlessServer_Click);
|
||||
//
|
||||
// menuAddShadowsocksServer
|
||||
//
|
||||
resources.ApplyResources(this.menuAddShadowsocksServer, "menuAddShadowsocksServer");
|
||||
this.menuAddShadowsocksServer.Name = "menuAddShadowsocksServer";
|
||||
resources.ApplyResources(this.menuAddShadowsocksServer, "menuAddShadowsocksServer");
|
||||
this.menuAddShadowsocksServer.Click += new System.EventHandler(this.menuAddShadowsocksServer_Click);
|
||||
//
|
||||
// menuAddSocksServer
|
||||
//
|
||||
resources.ApplyResources(this.menuAddSocksServer, "menuAddSocksServer");
|
||||
this.menuAddSocksServer.Name = "menuAddSocksServer";
|
||||
resources.ApplyResources(this.menuAddSocksServer, "menuAddSocksServer");
|
||||
this.menuAddSocksServer.Click += new System.EventHandler(this.menuAddSocksServer_Click);
|
||||
//
|
||||
// menuAddTrojanServer
|
||||
//
|
||||
resources.ApplyResources(this.menuAddTrojanServer, "menuAddTrojanServer");
|
||||
this.menuAddTrojanServer.Name = "menuAddTrojanServer";
|
||||
resources.ApplyResources(this.menuAddTrojanServer, "menuAddTrojanServer");
|
||||
this.menuAddTrojanServer.Click += new System.EventHandler(this.menuAddTrojanServer_Click);
|
||||
//
|
||||
// menuAddCustomServer
|
||||
//
|
||||
resources.ApplyResources(this.menuAddCustomServer, "menuAddCustomServer");
|
||||
this.menuAddCustomServer.Name = "menuAddCustomServer";
|
||||
resources.ApplyResources(this.menuAddCustomServer, "menuAddCustomServer");
|
||||
this.menuAddCustomServer.Click += new System.EventHandler(this.menuAddCustomServer_Click);
|
||||
//
|
||||
// menuAddServers
|
||||
//
|
||||
resources.ApplyResources(this.menuAddServers, "menuAddServers");
|
||||
this.menuAddServers.Name = "menuAddServers";
|
||||
resources.ApplyResources(this.menuAddServers, "menuAddServers");
|
||||
this.menuAddServers.Click += new System.EventHandler(this.menuAddServers_Click);
|
||||
//
|
||||
// menuScanScreen
|
||||
//
|
||||
resources.ApplyResources(this.menuScanScreen, "menuScanScreen");
|
||||
this.menuScanScreen.Name = "menuScanScreen";
|
||||
resources.ApplyResources(this.menuScanScreen, "menuScanScreen");
|
||||
this.menuScanScreen.Click += new System.EventHandler(this.menuScanScreen_Click);
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
|
||||
//
|
||||
// menuRemoveServer
|
||||
//
|
||||
resources.ApplyResources(this.menuRemoveServer, "menuRemoveServer");
|
||||
this.menuRemoveServer.Name = "menuRemoveServer";
|
||||
resources.ApplyResources(this.menuRemoveServer, "menuRemoveServer");
|
||||
this.menuRemoveServer.Click += new System.EventHandler(this.menuRemoveServer_Click);
|
||||
//
|
||||
// menuRemoveDuplicateServer
|
||||
//
|
||||
resources.ApplyResources(this.menuRemoveDuplicateServer, "menuRemoveDuplicateServer");
|
||||
this.menuRemoveDuplicateServer.Name = "menuRemoveDuplicateServer";
|
||||
resources.ApplyResources(this.menuRemoveDuplicateServer, "menuRemoveDuplicateServer");
|
||||
this.menuRemoveDuplicateServer.Click += new System.EventHandler(this.menuRemoveDuplicateServer_Click);
|
||||
//
|
||||
// menuCopyServer
|
||||
//
|
||||
resources.ApplyResources(this.menuCopyServer, "menuCopyServer");
|
||||
this.menuCopyServer.Name = "menuCopyServer";
|
||||
resources.ApplyResources(this.menuCopyServer, "menuCopyServer");
|
||||
this.menuCopyServer.Click += new System.EventHandler(this.menuCopyServer_Click);
|
||||
//
|
||||
// menuSetDefaultServer
|
||||
//
|
||||
resources.ApplyResources(this.menuSetDefaultServer, "menuSetDefaultServer");
|
||||
this.menuSetDefaultServer.Name = "menuSetDefaultServer";
|
||||
resources.ApplyResources(this.menuSetDefaultServer, "menuSetDefaultServer");
|
||||
this.menuSetDefaultServer.Click += new System.EventHandler(this.menuSetDefaultServer_Click);
|
||||
//
|
||||
// toolStripSeparator3
|
||||
//
|
||||
resources.ApplyResources(this.toolStripSeparator3, "toolStripSeparator3");
|
||||
this.toolStripSeparator3.Name = "toolStripSeparator3";
|
||||
resources.ApplyResources(this.toolStripSeparator3, "toolStripSeparator3");
|
||||
//
|
||||
// menuMoveTop
|
||||
//
|
||||
resources.ApplyResources(this.menuMoveTop, "menuMoveTop");
|
||||
this.menuMoveTop.Name = "menuMoveTop";
|
||||
resources.ApplyResources(this.menuMoveTop, "menuMoveTop");
|
||||
this.menuMoveTop.Click += new System.EventHandler(this.menuMoveTop_Click);
|
||||
//
|
||||
// menuMoveUp
|
||||
//
|
||||
resources.ApplyResources(this.menuMoveUp, "menuMoveUp");
|
||||
this.menuMoveUp.Name = "menuMoveUp";
|
||||
resources.ApplyResources(this.menuMoveUp, "menuMoveUp");
|
||||
this.menuMoveUp.Click += new System.EventHandler(this.menuMoveUp_Click);
|
||||
//
|
||||
// menuMoveDown
|
||||
//
|
||||
resources.ApplyResources(this.menuMoveDown, "menuMoveDown");
|
||||
this.menuMoveDown.Name = "menuMoveDown";
|
||||
resources.ApplyResources(this.menuMoveDown, "menuMoveDown");
|
||||
this.menuMoveDown.Click += new System.EventHandler(this.menuMoveDown_Click);
|
||||
//
|
||||
// menuMoveBottom
|
||||
//
|
||||
resources.ApplyResources(this.menuMoveBottom, "menuMoveBottom");
|
||||
this.menuMoveBottom.Name = "menuMoveBottom";
|
||||
resources.ApplyResources(this.menuMoveBottom, "menuMoveBottom");
|
||||
this.menuMoveBottom.Click += new System.EventHandler(this.menuMoveBottom_Click);
|
||||
//
|
||||
// menuSelectAll
|
||||
//
|
||||
resources.ApplyResources(this.menuSelectAll, "menuSelectAll");
|
||||
this.menuSelectAll.Name = "menuSelectAll";
|
||||
resources.ApplyResources(this.menuSelectAll, "menuSelectAll");
|
||||
this.menuSelectAll.Click += new System.EventHandler(this.menuSelectAll_Click);
|
||||
//
|
||||
// toolStripSeparator9
|
||||
//
|
||||
resources.ApplyResources(this.toolStripSeparator9, "toolStripSeparator9");
|
||||
this.toolStripSeparator9.Name = "toolStripSeparator9";
|
||||
resources.ApplyResources(this.toolStripSeparator9, "toolStripSeparator9");
|
||||
//
|
||||
// menuPingServer
|
||||
//
|
||||
resources.ApplyResources(this.menuPingServer, "menuPingServer");
|
||||
this.menuPingServer.Name = "menuPingServer";
|
||||
resources.ApplyResources(this.menuPingServer, "menuPingServer");
|
||||
this.menuPingServer.Click += new System.EventHandler(this.menuPingServer_Click);
|
||||
//
|
||||
// menuTcpingServer
|
||||
//
|
||||
resources.ApplyResources(this.menuTcpingServer, "menuTcpingServer");
|
||||
this.menuTcpingServer.Name = "menuTcpingServer";
|
||||
resources.ApplyResources(this.menuTcpingServer, "menuTcpingServer");
|
||||
this.menuTcpingServer.Click += new System.EventHandler(this.menuTcpingServer_Click);
|
||||
//
|
||||
// menuRealPingServer
|
||||
//
|
||||
resources.ApplyResources(this.menuRealPingServer, "menuRealPingServer");
|
||||
this.menuRealPingServer.Name = "menuRealPingServer";
|
||||
resources.ApplyResources(this.menuRealPingServer, "menuRealPingServer");
|
||||
this.menuRealPingServer.Click += new System.EventHandler(this.menuRealPingServer_Click);
|
||||
//
|
||||
// menuSpeedServer
|
||||
//
|
||||
resources.ApplyResources(this.menuSpeedServer, "menuSpeedServer");
|
||||
this.menuSpeedServer.Name = "menuSpeedServer";
|
||||
resources.ApplyResources(this.menuSpeedServer, "menuSpeedServer");
|
||||
this.menuSpeedServer.Click += new System.EventHandler(this.menuSpeedServer_Click);
|
||||
//
|
||||
// tsbTestMe
|
||||
//
|
||||
resources.ApplyResources(this.tsbTestMe, "tsbTestMe");
|
||||
this.tsbTestMe.Name = "tsbTestMe";
|
||||
resources.ApplyResources(this.tsbTestMe, "tsbTestMe");
|
||||
this.tsbTestMe.Click += new System.EventHandler(this.tsbTestMe_Click);
|
||||
//
|
||||
// menuClearServerStatistics
|
||||
//
|
||||
resources.ApplyResources(this.menuClearServerStatistics, "menuClearServerStatistics");
|
||||
this.menuClearServerStatistics.Name = "menuClearServerStatistics";
|
||||
resources.ApplyResources(this.menuClearServerStatistics, "menuClearServerStatistics");
|
||||
this.menuClearServerStatistics.Click += new System.EventHandler(this.menuClearStatistic_Click);
|
||||
//
|
||||
// toolStripSeparator6
|
||||
//
|
||||
resources.ApplyResources(this.toolStripSeparator6, "toolStripSeparator6");
|
||||
this.toolStripSeparator6.Name = "toolStripSeparator6";
|
||||
resources.ApplyResources(this.toolStripSeparator6, "toolStripSeparator6");
|
||||
//
|
||||
// menuExport2ClientConfig
|
||||
//
|
||||
resources.ApplyResources(this.menuExport2ClientConfig, "menuExport2ClientConfig");
|
||||
this.menuExport2ClientConfig.Name = "menuExport2ClientConfig";
|
||||
resources.ApplyResources(this.menuExport2ClientConfig, "menuExport2ClientConfig");
|
||||
this.menuExport2ClientConfig.Click += new System.EventHandler(this.menuExport2ClientConfig_Click);
|
||||
//
|
||||
// menuExport2ServerConfig
|
||||
//
|
||||
resources.ApplyResources(this.menuExport2ServerConfig, "menuExport2ServerConfig");
|
||||
this.menuExport2ServerConfig.Name = "menuExport2ServerConfig";
|
||||
resources.ApplyResources(this.menuExport2ServerConfig, "menuExport2ServerConfig");
|
||||
this.menuExport2ServerConfig.Click += new System.EventHandler(this.menuExport2ServerConfig_Click);
|
||||
//
|
||||
// menuExport2ShareUrl
|
||||
//
|
||||
resources.ApplyResources(this.menuExport2ShareUrl, "menuExport2ShareUrl");
|
||||
this.menuExport2ShareUrl.Name = "menuExport2ShareUrl";
|
||||
resources.ApplyResources(this.menuExport2ShareUrl, "menuExport2ShareUrl");
|
||||
this.menuExport2ShareUrl.Click += new System.EventHandler(this.menuExport2ShareUrl_Click);
|
||||
//
|
||||
// menuExport2SubContent
|
||||
//
|
||||
resources.ApplyResources(this.menuExport2SubContent, "menuExport2SubContent");
|
||||
this.menuExport2SubContent.Name = "menuExport2SubContent";
|
||||
resources.ApplyResources(this.menuExport2SubContent, "menuExport2SubContent");
|
||||
this.menuExport2SubContent.Click += new System.EventHandler(this.menuExport2SubContent_Click);
|
||||
//
|
||||
// tsbServer
|
||||
//
|
||||
resources.ApplyResources(this.tsbServer, "tsbServer");
|
||||
this.tsbServer.DropDown = this.cmsLv;
|
||||
this.tsbServer.Image = global::v2rayN.Properties.Resources.server;
|
||||
resources.ApplyResources(this.tsbServer, "tsbServer");
|
||||
this.tsbServer.Name = "tsbServer";
|
||||
//
|
||||
// qrCodeControl
|
||||
|
@ -414,14 +415,14 @@
|
|||
//
|
||||
// notifyMain
|
||||
//
|
||||
resources.ApplyResources(this.notifyMain, "notifyMain");
|
||||
this.notifyMain.ContextMenuStrip = this.cmsMain;
|
||||
resources.ApplyResources(this.notifyMain, "notifyMain");
|
||||
this.notifyMain.MouseClick += new System.Windows.Forms.MouseEventHandler(this.notifyMain_MouseClick);
|
||||
//
|
||||
// cmsMain
|
||||
//
|
||||
resources.ApplyResources(this.cmsMain, "cmsMain");
|
||||
this.cmsMain.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
resources.ApplyResources(this.cmsMain, "cmsMain");
|
||||
this.cmsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.menuSysAgentMode,
|
||||
this.menuRoutings,
|
||||
|
@ -439,73 +440,73 @@
|
|||
//
|
||||
// menuSysAgentMode
|
||||
//
|
||||
resources.ApplyResources(this.menuSysAgentMode, "menuSysAgentMode");
|
||||
this.menuSysAgentMode.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.menuKeepClear,
|
||||
this.menuGlobal,
|
||||
this.menuKeepNothing});
|
||||
this.menuSysAgentMode.Name = "menuSysAgentMode";
|
||||
resources.ApplyResources(this.menuSysAgentMode, "menuSysAgentMode");
|
||||
//
|
||||
// menuKeepClear
|
||||
//
|
||||
resources.ApplyResources(this.menuKeepClear, "menuKeepClear");
|
||||
this.menuKeepClear.Name = "menuKeepClear";
|
||||
resources.ApplyResources(this.menuKeepClear, "menuKeepClear");
|
||||
this.menuKeepClear.Click += new System.EventHandler(this.menuKeepClear_Click);
|
||||
//
|
||||
// menuGlobal
|
||||
//
|
||||
resources.ApplyResources(this.menuGlobal, "menuGlobal");
|
||||
this.menuGlobal.Name = "menuGlobal";
|
||||
resources.ApplyResources(this.menuGlobal, "menuGlobal");
|
||||
this.menuGlobal.Click += new System.EventHandler(this.menuGlobal_Click);
|
||||
//
|
||||
// menuKeepNothing
|
||||
//
|
||||
resources.ApplyResources(this.menuKeepNothing, "menuKeepNothing");
|
||||
this.menuKeepNothing.Name = "menuKeepNothing";
|
||||
resources.ApplyResources(this.menuKeepNothing, "menuKeepNothing");
|
||||
this.menuKeepNothing.Click += new System.EventHandler(this.menuKeepNothing_Click);
|
||||
//
|
||||
// menuRoutings
|
||||
//
|
||||
resources.ApplyResources(this.menuRoutings, "menuRoutings");
|
||||
this.menuRoutings.Name = "menuRoutings";
|
||||
resources.ApplyResources(this.menuRoutings, "menuRoutings");
|
||||
//
|
||||
// menuServers
|
||||
//
|
||||
resources.ApplyResources(this.menuServers, "menuServers");
|
||||
this.menuServers.Name = "menuServers";
|
||||
resources.ApplyResources(this.menuServers, "menuServers");
|
||||
//
|
||||
// toolStripSeparator13
|
||||
//
|
||||
resources.ApplyResources(this.toolStripSeparator13, "toolStripSeparator13");
|
||||
this.toolStripSeparator13.Name = "toolStripSeparator13";
|
||||
resources.ApplyResources(this.toolStripSeparator13, "toolStripSeparator13");
|
||||
//
|
||||
// menuAddServers2
|
||||
//
|
||||
resources.ApplyResources(this.menuAddServers2, "menuAddServers2");
|
||||
this.menuAddServers2.Name = "menuAddServers2";
|
||||
resources.ApplyResources(this.menuAddServers2, "menuAddServers2");
|
||||
this.menuAddServers2.Click += new System.EventHandler(this.menuAddServers_Click);
|
||||
//
|
||||
// menuScanScreen2
|
||||
//
|
||||
resources.ApplyResources(this.menuScanScreen2, "menuScanScreen2");
|
||||
this.menuScanScreen2.Name = "menuScanScreen2";
|
||||
resources.ApplyResources(this.menuScanScreen2, "menuScanScreen2");
|
||||
this.menuScanScreen2.Click += new System.EventHandler(this.menuScanScreen_Click);
|
||||
//
|
||||
// menuUpdateSubscriptions
|
||||
//
|
||||
resources.ApplyResources(this.menuUpdateSubscriptions, "menuUpdateSubscriptions");
|
||||
this.menuUpdateSubscriptions.Name = "menuUpdateSubscriptions";
|
||||
resources.ApplyResources(this.menuUpdateSubscriptions, "menuUpdateSubscriptions");
|
||||
this.menuUpdateSubscriptions.Click += new System.EventHandler(this.menuUpdateSubscriptions_Click);
|
||||
//
|
||||
// toolStripSeparator2
|
||||
//
|
||||
resources.ApplyResources(this.toolStripSeparator2, "toolStripSeparator2");
|
||||
this.toolStripSeparator2.Name = "toolStripSeparator2";
|
||||
resources.ApplyResources(this.toolStripSeparator2, "toolStripSeparator2");
|
||||
//
|
||||
// menuExit
|
||||
//
|
||||
resources.ApplyResources(this.menuExit, "menuExit");
|
||||
this.menuExit.Name = "menuExit";
|
||||
resources.ApplyResources(this.menuExit, "menuExit");
|
||||
this.menuExit.Click += new System.EventHandler(this.menuExit_Click);
|
||||
//
|
||||
// bgwScan
|
||||
|
@ -516,25 +517,25 @@
|
|||
//
|
||||
// groupBox1
|
||||
//
|
||||
resources.ApplyResources(this.groupBox1, "groupBox1");
|
||||
this.groupBox1.Controls.Add(this.scMain);
|
||||
resources.ApplyResources(this.groupBox1, "groupBox1");
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.TabStop = false;
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
resources.ApplyResources(this.groupBox2, "groupBox2");
|
||||
this.groupBox2.Controls.Add(this.txtMsgBox);
|
||||
this.groupBox2.Controls.Add(this.ssMain);
|
||||
resources.ApplyResources(this.groupBox2, "groupBox2");
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.TabStop = false;
|
||||
//
|
||||
// txtMsgBox
|
||||
//
|
||||
resources.ApplyResources(this.txtMsgBox, "txtMsgBox");
|
||||
this.txtMsgBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(49)))), ((int)(((byte)(52)))));
|
||||
this.txtMsgBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.txtMsgBox.ContextMenuStrip = this.cmsMsgBox;
|
||||
resources.ApplyResources(this.txtMsgBox, "txtMsgBox");
|
||||
this.txtMsgBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(226)))), ((int)(((byte)(228)))));
|
||||
this.txtMsgBox.Name = "txtMsgBox";
|
||||
this.txtMsgBox.ReadOnly = true;
|
||||
|
@ -542,41 +543,40 @@
|
|||
//
|
||||
// cmsMsgBox
|
||||
//
|
||||
resources.ApplyResources(this.cmsMsgBox, "cmsMsgBox");
|
||||
this.cmsMsgBox.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.menuMsgBoxSelectAll,
|
||||
this.menuMsgBoxCopy,
|
||||
this.menuMsgBoxCopyAll,
|
||||
this.menuMsgBoxAddRoutingRule});
|
||||
this.cmsMsgBox.Name = "cmsMsgBox";
|
||||
resources.ApplyResources(this.cmsMsgBox, "cmsMsgBox");
|
||||
//
|
||||
// menuMsgBoxSelectAll
|
||||
//
|
||||
resources.ApplyResources(this.menuMsgBoxSelectAll, "menuMsgBoxSelectAll");
|
||||
this.menuMsgBoxSelectAll.Name = "menuMsgBoxSelectAll";
|
||||
resources.ApplyResources(this.menuMsgBoxSelectAll, "menuMsgBoxSelectAll");
|
||||
this.menuMsgBoxSelectAll.Click += new System.EventHandler(this.menuMsgBoxSelectAll_Click);
|
||||
//
|
||||
// menuMsgBoxCopy
|
||||
//
|
||||
resources.ApplyResources(this.menuMsgBoxCopy, "menuMsgBoxCopy");
|
||||
this.menuMsgBoxCopy.Name = "menuMsgBoxCopy";
|
||||
resources.ApplyResources(this.menuMsgBoxCopy, "menuMsgBoxCopy");
|
||||
this.menuMsgBoxCopy.Click += new System.EventHandler(this.menuMsgBoxCopy_Click);
|
||||
//
|
||||
// menuMsgBoxCopyAll
|
||||
//
|
||||
resources.ApplyResources(this.menuMsgBoxCopyAll, "menuMsgBoxCopyAll");
|
||||
this.menuMsgBoxCopyAll.Name = "menuMsgBoxCopyAll";
|
||||
resources.ApplyResources(this.menuMsgBoxCopyAll, "menuMsgBoxCopyAll");
|
||||
this.menuMsgBoxCopyAll.Click += new System.EventHandler(this.menuMsgBoxCopyAll_Click);
|
||||
//
|
||||
// menuMsgBoxAddRoutingRule
|
||||
//
|
||||
resources.ApplyResources(this.menuMsgBoxAddRoutingRule, "menuMsgBoxAddRoutingRule");
|
||||
this.menuMsgBoxAddRoutingRule.Name = "menuMsgBoxAddRoutingRule";
|
||||
resources.ApplyResources(this.menuMsgBoxAddRoutingRule, "menuMsgBoxAddRoutingRule");
|
||||
this.menuMsgBoxAddRoutingRule.Click += new System.EventHandler(this.menuMsgBoxAddRoutingRule_Click);
|
||||
//
|
||||
// ssMain
|
||||
//
|
||||
resources.ApplyResources(this.ssMain, "ssMain");
|
||||
this.ssMain.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.ssMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolSslSocksPortLab,
|
||||
|
@ -588,6 +588,7 @@
|
|||
this.toolSslBlank3,
|
||||
this.toolSslServerSpeed,
|
||||
this.toolSslBlank4});
|
||||
resources.ApplyResources(this.ssMain, "ssMain");
|
||||
this.ssMain.Name = "ssMain";
|
||||
this.ssMain.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.ssMain_ItemClicked);
|
||||
//
|
||||
|
@ -598,8 +599,8 @@
|
|||
//
|
||||
// toolSslSocksPort
|
||||
//
|
||||
resources.ApplyResources(this.toolSslSocksPort, "toolSslSocksPort");
|
||||
this.toolSslSocksPort.Name = "toolSslSocksPort";
|
||||
resources.ApplyResources(this.toolSslSocksPort, "toolSslSocksPort");
|
||||
//
|
||||
// toolSslBlank1
|
||||
//
|
||||
|
@ -614,8 +615,8 @@
|
|||
//
|
||||
// toolSslHttpPort
|
||||
//
|
||||
resources.ApplyResources(this.toolSslHttpPort, "toolSslHttpPort");
|
||||
this.toolSslHttpPort.Name = "toolSslHttpPort";
|
||||
resources.ApplyResources(this.toolSslHttpPort, "toolSslHttpPort");
|
||||
//
|
||||
// toolSslBlank2
|
||||
//
|
||||
|
@ -637,8 +638,8 @@
|
|||
//
|
||||
// toolSslBlank4
|
||||
//
|
||||
resources.ApplyResources(this.toolSslBlank4, "toolSslBlank4");
|
||||
this.toolSslBlank4.Name = "toolSslBlank4";
|
||||
resources.ApplyResources(this.toolSslBlank4, "toolSslBlank4");
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
|
@ -647,7 +648,6 @@
|
|||
//
|
||||
// tsMain
|
||||
//
|
||||
resources.ApplyResources(this.tsMain, "tsMain");
|
||||
this.tsMain.ImageScalingSize = new System.Drawing.Size(32, 32);
|
||||
this.tsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.tsbServer,
|
||||
|
@ -665,87 +665,88 @@
|
|||
this.tsbPromotion,
|
||||
this.toolStripSeparator11,
|
||||
this.tsbClose});
|
||||
resources.ApplyResources(this.tsMain, "tsMain");
|
||||
this.tsMain.Name = "tsMain";
|
||||
this.tsMain.TabStop = true;
|
||||
//
|
||||
// toolStripSeparator4
|
||||
//
|
||||
resources.ApplyResources(this.toolStripSeparator4, "toolStripSeparator4");
|
||||
this.toolStripSeparator4.Name = "toolStripSeparator4";
|
||||
resources.ApplyResources(this.toolStripSeparator4, "toolStripSeparator4");
|
||||
//
|
||||
// tsbSub
|
||||
//
|
||||
resources.ApplyResources(this.tsbSub, "tsbSub");
|
||||
this.tsbSub.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.tsbSubSetting,
|
||||
this.tsbSubUpdate});
|
||||
this.tsbSub.Image = global::v2rayN.Properties.Resources.sub;
|
||||
resources.ApplyResources(this.tsbSub, "tsbSub");
|
||||
this.tsbSub.Name = "tsbSub";
|
||||
//
|
||||
// tsbSubSetting
|
||||
//
|
||||
resources.ApplyResources(this.tsbSubSetting, "tsbSubSetting");
|
||||
this.tsbSubSetting.Name = "tsbSubSetting";
|
||||
resources.ApplyResources(this.tsbSubSetting, "tsbSubSetting");
|
||||
this.tsbSubSetting.Click += new System.EventHandler(this.tsbSubSetting_Click);
|
||||
//
|
||||
// tsbSubUpdate
|
||||
//
|
||||
resources.ApplyResources(this.tsbSubUpdate, "tsbSubUpdate");
|
||||
this.tsbSubUpdate.Name = "tsbSubUpdate";
|
||||
resources.ApplyResources(this.tsbSubUpdate, "tsbSubUpdate");
|
||||
this.tsbSubUpdate.Click += new System.EventHandler(this.tsbSubUpdate_Click);
|
||||
//
|
||||
// tsbQRCodeSwitch
|
||||
//
|
||||
resources.ApplyResources(this.tsbQRCodeSwitch, "tsbQRCodeSwitch");
|
||||
this.tsbQRCodeSwitch.CheckOnClick = true;
|
||||
this.tsbQRCodeSwitch.ForeColor = System.Drawing.Color.Black;
|
||||
this.tsbQRCodeSwitch.Image = global::v2rayN.Properties.Resources.share;
|
||||
resources.ApplyResources(this.tsbQRCodeSwitch, "tsbQRCodeSwitch");
|
||||
this.tsbQRCodeSwitch.Name = "tsbQRCodeSwitch";
|
||||
this.tsbQRCodeSwitch.CheckedChanged += new System.EventHandler(this.tsbQRCodeSwitch_CheckedChanged);
|
||||
//
|
||||
// toolStripSeparator8
|
||||
//
|
||||
resources.ApplyResources(this.toolStripSeparator8, "toolStripSeparator8");
|
||||
this.toolStripSeparator8.Name = "toolStripSeparator8";
|
||||
resources.ApplyResources(this.toolStripSeparator8, "toolStripSeparator8");
|
||||
//
|
||||
// tsbSetting
|
||||
//
|
||||
resources.ApplyResources(this.tsbSetting, "tsbSetting");
|
||||
this.tsbSetting.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.tsbOptionSetting,
|
||||
this.tsbRoutingSetting,
|
||||
this.toolStripSeparator14,
|
||||
this.tsbBackupGuiNConfig});
|
||||
this.tsbSetting.Image = global::v2rayN.Properties.Resources.option;
|
||||
resources.ApplyResources(this.tsbSetting, "tsbSetting");
|
||||
this.tsbSetting.Name = "tsbSetting";
|
||||
//
|
||||
// tsbOptionSetting
|
||||
//
|
||||
resources.ApplyResources(this.tsbOptionSetting, "tsbOptionSetting");
|
||||
this.tsbOptionSetting.Name = "tsbOptionSetting";
|
||||
resources.ApplyResources(this.tsbOptionSetting, "tsbOptionSetting");
|
||||
this.tsbOptionSetting.Click += new System.EventHandler(this.tsbOptionSetting_Click);
|
||||
//
|
||||
// tsbRoutingSetting
|
||||
//
|
||||
resources.ApplyResources(this.tsbRoutingSetting, "tsbRoutingSetting");
|
||||
this.tsbRoutingSetting.Name = "tsbRoutingSetting";
|
||||
resources.ApplyResources(this.tsbRoutingSetting, "tsbRoutingSetting");
|
||||
this.tsbRoutingSetting.Click += new System.EventHandler(this.tsbRoutingSetting_Click);
|
||||
//
|
||||
// toolStripSeparator14
|
||||
//
|
||||
resources.ApplyResources(this.toolStripSeparator14, "toolStripSeparator14");
|
||||
this.toolStripSeparator14.Name = "toolStripSeparator14";
|
||||
resources.ApplyResources(this.toolStripSeparator14, "toolStripSeparator14");
|
||||
//
|
||||
// tsbBackupGuiNConfig
|
||||
//
|
||||
resources.ApplyResources(this.tsbBackupGuiNConfig, "tsbBackupGuiNConfig");
|
||||
this.tsbBackupGuiNConfig.Name = "tsbBackupGuiNConfig";
|
||||
resources.ApplyResources(this.tsbBackupGuiNConfig, "tsbBackupGuiNConfig");
|
||||
this.tsbBackupGuiNConfig.Click += new System.EventHandler(this.tsbBackupGuiNConfig_Click);
|
||||
//
|
||||
// toolStripSeparator5
|
||||
//
|
||||
resources.ApplyResources(this.toolStripSeparator5, "toolStripSeparator5");
|
||||
this.toolStripSeparator5.Name = "toolStripSeparator5";
|
||||
resources.ApplyResources(this.toolStripSeparator5, "toolStripSeparator5");
|
||||
//
|
||||
// tsbReload
|
||||
//
|
||||
|
@ -755,45 +756,47 @@
|
|||
//
|
||||
// toolStripSeparator7
|
||||
//
|
||||
resources.ApplyResources(this.toolStripSeparator7, "toolStripSeparator7");
|
||||
this.toolStripSeparator7.Name = "toolStripSeparator7";
|
||||
resources.ApplyResources(this.toolStripSeparator7, "toolStripSeparator7");
|
||||
//
|
||||
// tsbCheckUpdate
|
||||
//
|
||||
resources.ApplyResources(this.tsbCheckUpdate, "tsbCheckUpdate");
|
||||
this.tsbCheckUpdate.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.tsbCheckUpdateN,
|
||||
this.tsbCheckUpdateCore,
|
||||
this.tsbCheckUpdateXrayCore});
|
||||
this.tsbCheckUpdateXrayCore,
|
||||
this.toolStripSeparator15,
|
||||
this.tsbCheckUpdateGeoSite,
|
||||
this.tsbCheckUpdateGeoIP});
|
||||
this.tsbCheckUpdate.Image = global::v2rayN.Properties.Resources.checkupdate;
|
||||
resources.ApplyResources(this.tsbCheckUpdate, "tsbCheckUpdate");
|
||||
this.tsbCheckUpdate.Name = "tsbCheckUpdate";
|
||||
//
|
||||
// tsbCheckUpdateN
|
||||
//
|
||||
resources.ApplyResources(this.tsbCheckUpdateN, "tsbCheckUpdateN");
|
||||
this.tsbCheckUpdateN.Name = "tsbCheckUpdateN";
|
||||
resources.ApplyResources(this.tsbCheckUpdateN, "tsbCheckUpdateN");
|
||||
this.tsbCheckUpdateN.Click += new System.EventHandler(this.tsbCheckUpdateN_Click);
|
||||
//
|
||||
// tsbCheckUpdateCore
|
||||
//
|
||||
resources.ApplyResources(this.tsbCheckUpdateCore, "tsbCheckUpdateCore");
|
||||
this.tsbCheckUpdateCore.Name = "tsbCheckUpdateCore";
|
||||
resources.ApplyResources(this.tsbCheckUpdateCore, "tsbCheckUpdateCore");
|
||||
this.tsbCheckUpdateCore.Click += new System.EventHandler(this.tsbCheckUpdateCore_Click);
|
||||
//
|
||||
// tsbCheckUpdateXrayCore
|
||||
//
|
||||
resources.ApplyResources(this.tsbCheckUpdateXrayCore, "tsbCheckUpdateXrayCore");
|
||||
this.tsbCheckUpdateXrayCore.Name = "tsbCheckUpdateXrayCore";
|
||||
resources.ApplyResources(this.tsbCheckUpdateXrayCore, "tsbCheckUpdateXrayCore");
|
||||
this.tsbCheckUpdateXrayCore.Click += new System.EventHandler(this.tsbCheckUpdateXrayCore_Click);
|
||||
//
|
||||
// toolStripSeparator10
|
||||
//
|
||||
resources.ApplyResources(this.toolStripSeparator10, "toolStripSeparator10");
|
||||
this.toolStripSeparator10.Name = "toolStripSeparator10";
|
||||
resources.ApplyResources(this.toolStripSeparator10, "toolStripSeparator10");
|
||||
//
|
||||
// tsbHelp
|
||||
//
|
||||
resources.ApplyResources(this.tsbHelp, "tsbHelp");
|
||||
this.tsbHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.tsbAbout,
|
||||
this.tsbV2rayWebsite,
|
||||
|
@ -801,49 +804,50 @@
|
|||
this.tsbLanguageDef,
|
||||
this.tsbLanguageZhHans});
|
||||
this.tsbHelp.Image = global::v2rayN.Properties.Resources.help;
|
||||
resources.ApplyResources(this.tsbHelp, "tsbHelp");
|
||||
this.tsbHelp.Name = "tsbHelp";
|
||||
//
|
||||
// tsbAbout
|
||||
//
|
||||
resources.ApplyResources(this.tsbAbout, "tsbAbout");
|
||||
this.tsbAbout.Name = "tsbAbout";
|
||||
resources.ApplyResources(this.tsbAbout, "tsbAbout");
|
||||
this.tsbAbout.Click += new System.EventHandler(this.tsbAbout_Click);
|
||||
//
|
||||
// tsbV2rayWebsite
|
||||
//
|
||||
resources.ApplyResources(this.tsbV2rayWebsite, "tsbV2rayWebsite");
|
||||
this.tsbV2rayWebsite.Name = "tsbV2rayWebsite";
|
||||
resources.ApplyResources(this.tsbV2rayWebsite, "tsbV2rayWebsite");
|
||||
this.tsbV2rayWebsite.Click += new System.EventHandler(this.tsbV2rayWebsite_Click);
|
||||
//
|
||||
// toolStripSeparator12
|
||||
//
|
||||
resources.ApplyResources(this.toolStripSeparator12, "toolStripSeparator12");
|
||||
this.toolStripSeparator12.Name = "toolStripSeparator12";
|
||||
resources.ApplyResources(this.toolStripSeparator12, "toolStripSeparator12");
|
||||
//
|
||||
// tsbLanguageDef
|
||||
//
|
||||
resources.ApplyResources(this.tsbLanguageDef, "tsbLanguageDef");
|
||||
this.tsbLanguageDef.Name = "tsbLanguageDef";
|
||||
resources.ApplyResources(this.tsbLanguageDef, "tsbLanguageDef");
|
||||
this.tsbLanguageDef.Click += new System.EventHandler(this.tsbLanguageDef_Click);
|
||||
//
|
||||
// tsbLanguageZhHans
|
||||
//
|
||||
resources.ApplyResources(this.tsbLanguageZhHans, "tsbLanguageZhHans");
|
||||
this.tsbLanguageZhHans.Name = "tsbLanguageZhHans";
|
||||
resources.ApplyResources(this.tsbLanguageZhHans, "tsbLanguageZhHans");
|
||||
this.tsbLanguageZhHans.Click += new System.EventHandler(this.tsbLanguageZhHans_Click);
|
||||
//
|
||||
// tsbPromotion
|
||||
//
|
||||
resources.ApplyResources(this.tsbPromotion, "tsbPromotion");
|
||||
this.tsbPromotion.ForeColor = System.Drawing.Color.Black;
|
||||
this.tsbPromotion.Image = global::v2rayN.Properties.Resources.promotion;
|
||||
resources.ApplyResources(this.tsbPromotion, "tsbPromotion");
|
||||
this.tsbPromotion.Name = "tsbPromotion";
|
||||
this.tsbPromotion.Click += new System.EventHandler(this.tsbPromotion_Click);
|
||||
//
|
||||
// toolStripSeparator11
|
||||
//
|
||||
resources.ApplyResources(this.toolStripSeparator11, "toolStripSeparator11");
|
||||
this.toolStripSeparator11.Name = "toolStripSeparator11";
|
||||
resources.ApplyResources(this.toolStripSeparator11, "toolStripSeparator11");
|
||||
//
|
||||
// tsbClose
|
||||
//
|
||||
|
@ -851,6 +855,23 @@
|
|||
this.tsbClose.Name = "tsbClose";
|
||||
this.tsbClose.Click += new System.EventHandler(this.tsbClose_Click);
|
||||
//
|
||||
// tsbCheckUpdateGeoSite
|
||||
//
|
||||
this.tsbCheckUpdateGeoSite.Name = "tsbCheckUpdateGeoSite";
|
||||
resources.ApplyResources(this.tsbCheckUpdateGeoSite, "tsbCheckUpdateGeoSite");
|
||||
this.tsbCheckUpdateGeoSite.Click += new System.EventHandler(this.tsbCheckUpdateGeoSite_Click);
|
||||
//
|
||||
// tsbCheckUpdateGeoIP
|
||||
//
|
||||
this.tsbCheckUpdateGeoIP.Name = "tsbCheckUpdateGeoIP";
|
||||
resources.ApplyResources(this.tsbCheckUpdateGeoIP, "tsbCheckUpdateGeoIP");
|
||||
this.tsbCheckUpdateGeoIP.Click += new System.EventHandler(this.tsbCheckUpdateGeoIP_Click);
|
||||
//
|
||||
// toolStripSeparator15
|
||||
//
|
||||
this.toolStripSeparator15.Name = "toolStripSeparator15";
|
||||
resources.ApplyResources(this.toolStripSeparator15, "toolStripSeparator15");
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
|
@ -987,6 +1008,9 @@
|
|||
private System.Windows.Forms.ToolStripMenuItem menuMsgBoxCopyAll;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator14;
|
||||
private System.Windows.Forms.ToolStripMenuItem tsbBackupGuiNConfig;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator15;
|
||||
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateGeoSite;
|
||||
private System.Windows.Forms.ToolStripMenuItem tsbCheckUpdateGeoIP;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -650,7 +650,8 @@ namespace v2rayN.Forms
|
|||
|
||||
private void tsbTestMe_Click(object sender, EventArgs e)
|
||||
{
|
||||
string result = httpProxyTest() + "ms";
|
||||
SpeedtestHandler statistics = new SpeedtestHandler(ref config);
|
||||
string result = statistics.RunAvailabilityCheck() + "ms";
|
||||
AppendText(false, string.Format(UIRes.I18N("TestMeOutput"), result));
|
||||
}
|
||||
|
||||
|
@ -662,12 +663,6 @@ namespace v2rayN.Forms
|
|||
}
|
||||
}
|
||||
|
||||
private int httpProxyTest()
|
||||
{
|
||||
SpeedtestHandler statistics = new SpeedtestHandler(ref config, ref v2rayHandler, lvSelecteds, "", UpdateSpeedtestHandler);
|
||||
return statistics.RunAvailabilityCheck();
|
||||
}
|
||||
|
||||
private void menuExport2ClientConfig_Click(object sender, EventArgs e)
|
||||
{
|
||||
int index = GetLvSelectedIndex();
|
||||
|
@ -1167,88 +1162,17 @@ namespace v2rayN.Forms
|
|||
|
||||
#region CheckUpdate
|
||||
|
||||
private void askToDownload(DownloadHandle downloadHandle, string url)
|
||||
{
|
||||
if (UI.ShowYesNo(string.Format(UIRes.I18N("DownloadYesNo"), url)) == DialogResult.Yes)
|
||||
{
|
||||
if (httpProxyTest() > 0)
|
||||
{
|
||||
int httpPort = config.GetLocalPort(Global.InboundHttp);
|
||||
WebProxy webProxy = new WebProxy(Global.Loopback, httpPort);
|
||||
downloadHandle.DownloadFileAsync(url, webProxy, 600);
|
||||
}
|
||||
else
|
||||
{
|
||||
downloadHandle.DownloadFileAsync(url, null, 600);
|
||||
}
|
||||
}
|
||||
}
|
||||
private void tsbCheckUpdateN_Click(object sender, EventArgs e)
|
||||
{
|
||||
//System.Diagnostics.Process.Start(Global.UpdateUrl);
|
||||
DownloadHandle downloadHandle = null;
|
||||
if (downloadHandle == null)
|
||||
void _updateUI(bool success, string msg)
|
||||
{
|
||||
downloadHandle = new DownloadHandle();
|
||||
downloadHandle.AbsoluteCompleted += (sender2, args) =>
|
||||
AppendText(false, msg);
|
||||
if (success)
|
||||
{
|
||||
if (args.Success)
|
||||
{
|
||||
AppendText(false, string.Format(UIRes.I18N("MsgParsingSuccessfully"), "v2rayN"));
|
||||
|
||||
string url = args.Msg;
|
||||
this.Invoke((MethodInvoker)(delegate
|
||||
{
|
||||
askToDownload(downloadHandle, url);
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
AppendText(false, args.Msg);
|
||||
}
|
||||
};
|
||||
downloadHandle.UpdateCompleted += (sender2, args) =>
|
||||
{
|
||||
if (args.Success)
|
||||
{
|
||||
AppendText(false, UIRes.I18N("MsgDownloadV2rayCoreSuccessfully"));
|
||||
|
||||
try
|
||||
{
|
||||
string fileName = Utils.GetPath(downloadHandle.DownloadFileName);
|
||||
Process process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = "v2rayUpgrade.exe",
|
||||
Arguments = "\"" + fileName + "\"",
|
||||
WorkingDirectory = Utils.StartupPath()
|
||||
}
|
||||
};
|
||||
process.Start();
|
||||
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, string.Format(UIRes.I18N("MsgStartUpdating"), "v2rayN"));
|
||||
downloadHandle.CheckUpdateAsync("v2rayN");
|
||||
menuExit_Click(null, null);
|
||||
}
|
||||
};
|
||||
(new UpdateHandle()).CheckUpdateGuiN(config, _updateUI);
|
||||
}
|
||||
|
||||
private void tsbCheckUpdateCore_Click(object sender, EventArgs e)
|
||||
|
@ -1263,67 +1187,52 @@ namespace v2rayN.Forms
|
|||
|
||||
private void CheckUpdateCore(string type)
|
||||
{
|
||||
DownloadHandle downloadHandle = null;
|
||||
if (downloadHandle == null)
|
||||
void _updateUI(bool success, string msg)
|
||||
{
|
||||
downloadHandle = new DownloadHandle();
|
||||
downloadHandle.AbsoluteCompleted += (sender2, args) =>
|
||||
AppendText(false, msg);
|
||||
if (success)
|
||||
{
|
||||
if (args.Success)
|
||||
{
|
||||
AppendText(false, string.Format(UIRes.I18N("MsgParsingSuccessfully"), "Core"));
|
||||
CloseV2ray();
|
||||
|
||||
string url = args.Msg;
|
||||
this.Invoke((MethodInvoker)(delegate
|
||||
{
|
||||
askToDownload(downloadHandle, url);
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
AppendText(false, args.Msg);
|
||||
}
|
||||
};
|
||||
downloadHandle.UpdateCompleted += (sender2, args) =>
|
||||
string fileName = Global.DownloadFileName;
|
||||
fileName = Utils.GetPath(fileName);
|
||||
FileManager.ZipExtractToFile(fileName, config.ignoreGeoUpdateCore ? "geo" : "");
|
||||
|
||||
AppendText(false, UIRes.I18N("MsgUpdateV2rayCoreSuccessfullyMore"));
|
||||
|
||||
Global.reloadV2ray = true;
|
||||
LoadV2ray();
|
||||
|
||||
AppendText(false, UIRes.I18N("MsgUpdateV2rayCoreSuccessfully"));
|
||||
}
|
||||
};
|
||||
(new UpdateHandle()).CheckUpdateCore(type, config, _updateUI);
|
||||
}
|
||||
|
||||
private void tsbCheckUpdateGeoSite_Click(object sender, EventArgs e)
|
||||
{
|
||||
(new UpdateHandle()).UpdateGeoFile("geosite", config, (bool success, string msg) =>
|
||||
{
|
||||
AppendText(false, msg);
|
||||
if (success)
|
||||
{
|
||||
if (args.Success)
|
||||
{
|
||||
AppendText(false, UIRes.I18N("MsgDownloadV2rayCoreSuccessfully"));
|
||||
AppendText(false, UIRes.I18N("MsgUnpacking"));
|
||||
Global.reloadV2ray = true;
|
||||
LoadV2ray();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
CloseV2ray();
|
||||
|
||||
string fileName = downloadHandle.DownloadFileName;
|
||||
fileName = Utils.GetPath(fileName);
|
||||
FileManager.ZipExtractToFile(fileName, config.ignoreGeoUpdateCore ? "geo" : "");
|
||||
|
||||
AppendText(false, UIRes.I18N("MsgUpdateV2rayCoreSuccessfullyMore"));
|
||||
|
||||
Global.reloadV2ray = true;
|
||||
LoadV2ray();
|
||||
|
||||
AppendText(false, UIRes.I18N("MsgUpdateV2rayCoreSuccessfully"));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
AppendText(false, ex.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AppendText(false, args.Msg);
|
||||
}
|
||||
};
|
||||
downloadHandle.Error += (sender2, args) =>
|
||||
private void tsbCheckUpdateGeoIP_Click(object sender, EventArgs e)
|
||||
{
|
||||
(new UpdateHandle()).UpdateGeoFile("geoip", config, (bool success, string msg) =>
|
||||
{
|
||||
AppendText(false, msg);
|
||||
if (success)
|
||||
{
|
||||
AppendText(true, args.GetException().Message);
|
||||
};
|
||||
}
|
||||
|
||||
AppendText(false, string.Format(UIRes.I18N("MsgStartUpdating"), "Core"));
|
||||
downloadHandle.CheckUpdateAsync(type);
|
||||
Global.reloadV2ray = true;
|
||||
LoadV2ray();
|
||||
}
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -1397,15 +1306,16 @@ namespace v2rayN.Forms
|
|||
/// </summary>
|
||||
private void UpdateSubscriptionProcess()
|
||||
{
|
||||
void _updateUI(bool refresh, string msg)
|
||||
void _updateUI(bool success, string msg)
|
||||
{
|
||||
AppendText(false, msg);
|
||||
if (refresh)
|
||||
if (success)
|
||||
{
|
||||
RefreshServers();
|
||||
}
|
||||
};
|
||||
MainFormHandler.Instance.UpdateSubscriptionProcess(config, _updateUI);
|
||||
|
||||
(new UpdateHandle()).UpdateSubscriptionProcess(config, _updateUI);
|
||||
}
|
||||
|
||||
private void tsbQRCodeSwitch_CheckedChanged(object sender, EventArgs e)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -318,15 +318,6 @@
|
|||
ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw==
|
||||
</value>
|
||||
</data>
|
||||
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>196, 170</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>系统代理</value>
|
||||
</data>
|
||||
<data name="menuKeepClear.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>172, 22</value>
|
||||
</data>
|
||||
|
@ -345,6 +336,12 @@
|
|||
<data name="menuKeepNothing.Text" xml:space="preserve">
|
||||
<value>不改变系统代理</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>系统代理</value>
|
||||
</data>
|
||||
<data name="menuRoutings.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>195, 22</value>
|
||||
</data>
|
||||
|
@ -387,15 +384,12 @@
|
|||
<data name="menuExit.Text" xml:space="preserve">
|
||||
<value>退出</value>
|
||||
</data>
|
||||
<data name="cmsMain.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>196, 170</value>
|
||||
</data>
|
||||
<data name="groupBox1.Text" xml:space="preserve">
|
||||
<value>服务器列表</value>
|
||||
</data>
|
||||
<data name="groupBox2.Text" xml:space="preserve">
|
||||
<value>信息</value>
|
||||
</data>
|
||||
<data name="cmsMsgBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>222, 92</value>
|
||||
</data>
|
||||
<data name="menuMsgBoxSelectAll.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>221, 22</value>
|
||||
</data>
|
||||
|
@ -420,9 +414,27 @@
|
|||
<data name="menuMsgBoxAddRoutingRule.Text" xml:space="preserve">
|
||||
<value>快速添加路由规则 (Ctrl+V)</value>
|
||||
</data>
|
||||
<data name="cmsMsgBox.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>222, 92</value>
|
||||
</data>
|
||||
<data name="toolSslServerSpeed.Text" xml:space="preserve">
|
||||
<value>网速显示未启用</value>
|
||||
</data>
|
||||
<data name="groupBox2.Text" xml:space="preserve">
|
||||
<value>信息</value>
|
||||
</data>
|
||||
<data name="tsbSubSetting.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>124, 22</value>
|
||||
</data>
|
||||
<data name="tsbSubSetting.Text" xml:space="preserve">
|
||||
<value>订阅设置</value>
|
||||
</data>
|
||||
<data name="tsbSubUpdate.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>124, 22</value>
|
||||
</data>
|
||||
<data name="tsbSubUpdate.Text" xml:space="preserve">
|
||||
<value>更新订阅</value>
|
||||
</data>
|
||||
<data name="tsbSub.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>61, 53</value>
|
||||
</data>
|
||||
|
@ -435,12 +447,21 @@
|
|||
<data name="tsbQRCodeSwitch.Text" xml:space="preserve">
|
||||
<value> 分享 </value>
|
||||
</data>
|
||||
<data name="tsbOptionSetting.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>189, 22</value>
|
||||
</data>
|
||||
<data name="tsbOptionSetting.Text" xml:space="preserve">
|
||||
<value>参数设置</value>
|
||||
</data>
|
||||
<data name="tsbRoutingSetting.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>189, 22</value>
|
||||
</data>
|
||||
<data name="tsbRoutingSetting.Text" xml:space="preserve">
|
||||
<value>路由设置</value>
|
||||
</data>
|
||||
<data name="toolStripSeparator14.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>186, 6</value>
|
||||
</data>
|
||||
<data name="tsbBackupGuiNConfig.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>189, 22</value>
|
||||
</data>
|
||||
|
@ -470,12 +491,36 @@
|
|||
<data name="tsbReload.Text" xml:space="preserve">
|
||||
<value> 重启服务 </value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateN.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>135, 22</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateN.Text" xml:space="preserve">
|
||||
<value>v2rayN</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateCore.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>135, 22</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateCore.Text" xml:space="preserve">
|
||||
<value>v2fly-Core</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateXrayCore.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>135, 22</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateXrayCore.Text" xml:space="preserve">
|
||||
<value>Xray-Core</value>
|
||||
</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>v2rayN 项目</value>
|
||||
</data>
|
||||
<data name="tsbV2rayWebsite.Text" xml:space="preserve">
|
||||
<value>V2Ray 官网</value>
|
||||
</data>
|
||||
<data name="tsbHelp.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>69, 53</value>
|
||||
</data>
|
||||
|
@ -501,40 +546,4 @@
|
|||
<data name="tsbClose.Text" xml:space="preserve">
|
||||
<value> 关闭窗口 </value>
|
||||
</data>
|
||||
<data name="tsbSubSetting.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>124, 22</value>
|
||||
</data>
|
||||
<data name="tsbSubSetting.Text" xml:space="preserve">
|
||||
<value>订阅设置</value>
|
||||
</data>
|
||||
<data name="tsbSubUpdate.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>124, 22</value>
|
||||
</data>
|
||||
<data name="tsbSubUpdate.Text" xml:space="preserve">
|
||||
<value>更新订阅</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateN.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>135, 22</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateN.Text" xml:space="preserve">
|
||||
<value>v2rayN</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateCore.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>135, 22</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateCore.Text" xml:space="preserve">
|
||||
<value>v2fly-Core</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateXrayCore.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>135, 22</value>
|
||||
</data>
|
||||
<data name="tsbCheckUpdateXrayCore.Text" xml:space="preserve">
|
||||
<value>Xray-Core</value>
|
||||
</data>
|
||||
<data name="tsbAbout.Text" xml:space="preserve">
|
||||
<value>v2rayN 项目</value>
|
||||
</data>
|
||||
<data name="tsbV2rayWebsite.Text" xml:space="preserve">
|
||||
<value>V2Ray 官网</value>
|
||||
</data>
|
||||
</root>
|
|
@ -7,7 +7,7 @@ namespace v2rayN
|
|||
{
|
||||
#region 常量
|
||||
|
||||
|
||||
public const string DownloadFileName = "v2ray-windows.zip";
|
||||
public const string v2rayWebsiteUrl = @"https://www.v2fly.org/";
|
||||
public const string AboutUrl = @"https://github.com/2dust/v2rayN";
|
||||
public const string UpdateUrl = AboutUrl + @"/releases";
|
||||
|
|
|
@ -1,16 +1,7 @@
|
|||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using v2rayN.Base;
|
||||
using v2rayN.Mode;
|
||||
using v2rayN.Properties;
|
||||
|
||||
namespace v2rayN.Handler
|
||||
{
|
||||
|
@ -19,19 +10,10 @@ namespace v2rayN.Handler
|
|||
/// </summary>
|
||||
class DownloadHandle
|
||||
{
|
||||
public event EventHandler<ResultEventArgs> AbsoluteCompleted;
|
||||
|
||||
public event EventHandler<ResultEventArgs> UpdateCompleted;
|
||||
|
||||
public event ErrorEventHandler Error;
|
||||
|
||||
public string DownloadFileName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "v2ray-windows.zip";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ResultEventArgs : EventArgs
|
||||
{
|
||||
|
@ -49,155 +31,7 @@ namespace v2rayN.Handler
|
|||
private long totalBytesToReceive = 0;
|
||||
private DateTime totalDatetime = new DateTime();
|
||||
private int DownloadTimeout = -1;
|
||||
|
||||
#region Check for updates
|
||||
|
||||
private readonly string nLatestUrl = Global.NUrl + "/latest";
|
||||
private const string nUrl = Global.NUrl + "/download/{0}/v2rayN.zip";
|
||||
private readonly string v2flyCoreLatestUrl = Global.v2flyCoreUrl + "/latest";
|
||||
private const string v2flyCoreUrl = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip";
|
||||
private readonly string xrayCoreLatestUrl = Global.xrayCoreUrl + "/latest";
|
||||
private const string xrayCoreUrl = Global.xrayCoreUrl + "/download/{0}/Xray-windows-{1}.zip";
|
||||
|
||||
public async void CheckUpdateAsync(string type)
|
||||
{
|
||||
Utils.SetSecurityProtocol();
|
||||
WebRequestHandler webRequestHandler = new WebRequestHandler
|
||||
{
|
||||
AllowAutoRedirect = false
|
||||
};
|
||||
HttpClient httpClient = new HttpClient(webRequestHandler);
|
||||
|
||||
string url;
|
||||
if (type == "v2fly")
|
||||
{
|
||||
url = v2flyCoreLatestUrl;
|
||||
}
|
||||
else if (type == "xray")
|
||||
{
|
||||
url = xrayCoreLatestUrl;
|
||||
}
|
||||
else if (type == "v2rayN")
|
||||
{
|
||||
url = nLatestUrl;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Type");
|
||||
}
|
||||
HttpResponseMessage response = await httpClient.GetAsync(url);
|
||||
if (response.StatusCode.ToString() == "Redirect")
|
||||
{
|
||||
responseHandler(type, response.Headers.Location.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.SaveLog("StatusCode error: " + url);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取V2RayCore版本
|
||||
/// </summary>
|
||||
public string getCoreVersion(string type)
|
||||
{
|
||||
try
|
||||
{
|
||||
var core = string.Empty;
|
||||
var match = string.Empty;
|
||||
if (type == "v2fly")
|
||||
{
|
||||
core = "v2ray.exe";
|
||||
match = "V2Ray";
|
||||
}
|
||||
else if (type == "xray")
|
||||
{
|
||||
core = "xray.exe";
|
||||
match = "Xray";
|
||||
}
|
||||
string filePath = Utils.GetPath(core);
|
||||
if (!File.Exists(filePath))
|
||||
{
|
||||
string msg = string.Format(UIRes.I18N("NotFoundCore"), @"");
|
||||
//ShowMsg(true, msg);
|
||||
return "";
|
||||
}
|
||||
|
||||
Process p = new Process();
|
||||
p.StartInfo.FileName = filePath;
|
||||
p.StartInfo.Arguments = "-version";
|
||||
p.StartInfo.WorkingDirectory = Utils.StartupPath();
|
||||
p.StartInfo.UseShellExecute = false;
|
||||
p.StartInfo.RedirectStandardOutput = true;
|
||||
p.StartInfo.CreateNoWindow = true;
|
||||
p.StartInfo.StandardOutputEncoding = Encoding.UTF8;
|
||||
p.Start();
|
||||
p.WaitForExit(5000);
|
||||
string echo = p.StandardOutput.ReadToEnd();
|
||||
string version = Regex.Match(echo, $"{match} ([0-9.]+) \\(").Groups[1].Value;
|
||||
return version;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
private void responseHandler(string type, string redirectUrl)
|
||||
{
|
||||
try
|
||||
{
|
||||
string version = redirectUrl.Substring(redirectUrl.LastIndexOf("/", StringComparison.Ordinal) + 1);
|
||||
|
||||
string curVersion;
|
||||
string message;
|
||||
string url;
|
||||
if (type == "v2fly")
|
||||
{
|
||||
curVersion = "v" + getCoreVersion(type);
|
||||
message = string.Format(UIRes.I18N("IsLatestCore"), curVersion);
|
||||
string osBit = Environment.Is64BitProcess ? "64" : "32";
|
||||
url = string.Format(v2flyCoreUrl, version, osBit);
|
||||
}
|
||||
else if (type == "xray")
|
||||
{
|
||||
curVersion = "v" + getCoreVersion(type);
|
||||
message = string.Format(UIRes.I18N("IsLatestCore"), curVersion);
|
||||
string osBit = Environment.Is64BitProcess ? "64" : "32";
|
||||
url = string.Format(xrayCoreUrl, version, osBit);
|
||||
}
|
||||
else if (type == "v2rayN")
|
||||
{
|
||||
curVersion = FileVersionInfo.GetVersionInfo(Utils.GetExePath()).FileVersion.ToString();
|
||||
message = string.Format(UIRes.I18N("IsLatestN"), curVersion);
|
||||
url = string.Format(nUrl, version);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Type");
|
||||
}
|
||||
|
||||
if (curVersion == version)
|
||||
{
|
||||
AbsoluteCompleted?.Invoke(this, new ResultEventArgs(false, message));
|
||||
return;
|
||||
}
|
||||
|
||||
AbsoluteCompleted?.Invoke(this, new ResultEventArgs(true, url));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
|
||||
Error?.Invoke(this, new ErrorEventArgs(ex));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Download
|
||||
|
||||
|
||||
public WebClientEx DownloadFileAsync(string url, WebProxy webProxy, int downloadTimeout)
|
||||
{
|
||||
WebClientEx ws = new WebClientEx();
|
||||
|
@ -218,7 +52,7 @@ namespace v2rayN.Handler
|
|||
|
||||
ws.DownloadFileCompleted += ws_DownloadFileCompleted;
|
||||
ws.DownloadProgressChanged += ws_DownloadProgressChanged;
|
||||
ws.DownloadFileAsync(new Uri(url), Utils.GetPath(DownloadFileName));
|
||||
ws.DownloadFileAsync(new Uri(url), Utils.GetPath(Global.DownloadFileName));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -354,7 +188,6 @@ namespace v2rayN.Handler
|
|||
return string.Empty;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,10 @@ namespace v2rayN.Handler
|
|||
private List<int> _selecteds;
|
||||
Action<int, string> _updateFunc;
|
||||
|
||||
public SpeedtestHandler(ref Config config)
|
||||
{
|
||||
_config = config;
|
||||
}
|
||||
|
||||
public SpeedtestHandler(ref Config config, ref V2rayHandler v2rayHandler, List<int> selecteds, string actionType, Action<int, string> update)
|
||||
{
|
||||
|
|
453
v2rayN/v2rayN/Handler/UpdateHandle.cs
Normal file
453
v2rayN/v2rayN/Handler/UpdateHandle.cs
Normal file
|
@ -0,0 +1,453 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using v2rayN.Mode;
|
||||
|
||||
namespace v2rayN.Handler
|
||||
{
|
||||
class UpdateHandle
|
||||
{
|
||||
Action<bool, string> _updateFunc;
|
||||
private Config _config;
|
||||
|
||||
public event EventHandler<ResultEventArgs> AbsoluteCompleted;
|
||||
|
||||
public class ResultEventArgs : EventArgs
|
||||
{
|
||||
public bool Success;
|
||||
public string Msg;
|
||||
|
||||
public ResultEventArgs(bool success, string msg)
|
||||
{
|
||||
this.Success = success;
|
||||
this.Msg = msg;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly string nLatestUrl = Global.NUrl + "/latest";
|
||||
private const string nUrl = Global.NUrl + "/download/{0}/v2rayN.zip";
|
||||
private readonly string v2flyCoreLatestUrl = Global.v2flyCoreUrl + "/latest";
|
||||
private const string v2flyCoreUrl = Global.v2flyCoreUrl + "/download/{0}/v2ray-windows-{1}.zip";
|
||||
private readonly string xrayCoreLatestUrl = Global.xrayCoreUrl + "/latest";
|
||||
private const string xrayCoreUrl = Global.xrayCoreUrl + "/download/{0}/Xray-windows-{1}.zip";
|
||||
private const string geoUrl = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/{0}.dat";
|
||||
|
||||
public void CheckUpdateGuiN(Config config, Action<bool, string> update)
|
||||
{
|
||||
_config = config;
|
||||
_updateFunc = update;
|
||||
|
||||
DownloadHandle downloadHandle = null;
|
||||
if (downloadHandle == null)
|
||||
{
|
||||
downloadHandle = new DownloadHandle();
|
||||
|
||||
downloadHandle.UpdateCompleted += (sender2, args) =>
|
||||
{
|
||||
if (args.Success)
|
||||
{
|
||||
_updateFunc(false, UIRes.I18N("MsgDownloadV2rayCoreSuccessfully"));
|
||||
|
||||
try
|
||||
{
|
||||
string fileName = Utils.GetPath(Global.DownloadFileName);
|
||||
Process process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = "v2rayUpgrade.exe",
|
||||
Arguments = "\"" + fileName + "\"",
|
||||
WorkingDirectory = Utils.StartupPath()
|
||||
}
|
||||
};
|
||||
process.Start();
|
||||
if (process.Id > 0)
|
||||
{
|
||||
_updateFunc(true, "");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_updateFunc(false, ex.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_updateFunc(false, args.Msg);
|
||||
}
|
||||
};
|
||||
downloadHandle.Error += (sender2, args) =>
|
||||
{
|
||||
_updateFunc(false, args.GetException().Message);
|
||||
};
|
||||
}
|
||||
AbsoluteCompleted += (sender2, args) =>
|
||||
{
|
||||
if (args.Success)
|
||||
{
|
||||
_updateFunc(false, string.Format(UIRes.I18N("MsgParsingSuccessfully"), "v2rayN"));
|
||||
|
||||
string url = args.Msg;
|
||||
askToDownload(downloadHandle, url);
|
||||
}
|
||||
else
|
||||
{
|
||||
_updateFunc(false, args.Msg);
|
||||
}
|
||||
};
|
||||
_updateFunc(false, string.Format(UIRes.I18N("MsgStartUpdating"), "v2rayN"));
|
||||
CheckUpdateAsync("v2rayN");
|
||||
}
|
||||
|
||||
|
||||
public void CheckUpdateCore(string type, Config config, Action<bool, string> update)
|
||||
{
|
||||
_config = config;
|
||||
_updateFunc = update;
|
||||
|
||||
DownloadHandle downloadHandle = null;
|
||||
if (downloadHandle == null)
|
||||
{
|
||||
downloadHandle = new DownloadHandle();
|
||||
downloadHandle.UpdateCompleted += (sender2, args) =>
|
||||
{
|
||||
if (args.Success)
|
||||
{
|
||||
_updateFunc(false, UIRes.I18N("MsgDownloadV2rayCoreSuccessfully"));
|
||||
_updateFunc(false, UIRes.I18N("MsgUnpacking"));
|
||||
|
||||
try
|
||||
{
|
||||
_updateFunc(true, "");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_updateFunc(false, ex.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_updateFunc(false, args.Msg);
|
||||
}
|
||||
};
|
||||
downloadHandle.Error += (sender2, args) =>
|
||||
{
|
||||
_updateFunc(true, args.GetException().Message);
|
||||
};
|
||||
}
|
||||
|
||||
AbsoluteCompleted += (sender2, args) =>
|
||||
{
|
||||
if (args.Success)
|
||||
{
|
||||
_updateFunc(false, string.Format(UIRes.I18N("MsgParsingSuccessfully"), "Core"));
|
||||
string url = args.Msg;
|
||||
askToDownload(downloadHandle, url);
|
||||
}
|
||||
else
|
||||
{
|
||||
_updateFunc(false, args.Msg);
|
||||
}
|
||||
};
|
||||
_updateFunc(false, string.Format(UIRes.I18N("MsgStartUpdating"), "Core"));
|
||||
CheckUpdateAsync(type);
|
||||
}
|
||||
|
||||
|
||||
public void UpdateSubscriptionProcess(Config config, Action<bool, string> update)
|
||||
{
|
||||
_config = config;
|
||||
_updateFunc = update;
|
||||
|
||||
_updateFunc(false, UIRes.I18N("MsgUpdateSubscriptionStart"));
|
||||
|
||||
if (config.subItem == null || config.subItem.Count <= 0)
|
||||
{
|
||||
_updateFunc(false, UIRes.I18N("MsgNoValidSubscription"));
|
||||
return;
|
||||
}
|
||||
|
||||
for (int k = 1; k <= config.subItem.Count; k++)
|
||||
{
|
||||
string id = config.subItem[k - 1].id.Trim();
|
||||
string url = config.subItem[k - 1].url.Trim();
|
||||
string hashCode = $"{k}->";
|
||||
if (config.subItem[k - 1].enabled == false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (Utils.IsNullOrEmpty(id) || Utils.IsNullOrEmpty(url))
|
||||
{
|
||||
_updateFunc(false, $"{hashCode}{UIRes.I18N("MsgNoValidSubscription")}");
|
||||
continue;
|
||||
}
|
||||
|
||||
DownloadHandle downloadHandle3 = new DownloadHandle();
|
||||
downloadHandle3.UpdateCompleted += (sender2, args) =>
|
||||
{
|
||||
if (args.Success)
|
||||
{
|
||||
_updateFunc(false, $"{hashCode}{UIRes.I18N("MsgGetSubscriptionSuccessfully")}");
|
||||
string result = Utils.Base64Decode(args.Msg);
|
||||
if (Utils.IsNullOrEmpty(result))
|
||||
{
|
||||
_updateFunc(false, $"{hashCode}{UIRes.I18N("MsgSubscriptionDecodingFailed")}");
|
||||
return;
|
||||
}
|
||||
|
||||
ConfigHandler.RemoveServerViaSubid(ref config, id);
|
||||
_updateFunc(false, $"{hashCode}{UIRes.I18N("MsgClearSubscription")}");
|
||||
// RefreshServers();
|
||||
int ret = MainFormHandler.Instance.AddBatchServers(config, result, id);
|
||||
if (ret > 0)
|
||||
{
|
||||
// RefreshServers();
|
||||
}
|
||||
else
|
||||
{
|
||||
_updateFunc(false, $"{hashCode}{UIRes.I18N("MsgFailedImportSubscription")}");
|
||||
}
|
||||
_updateFunc(true, $"{hashCode}{UIRes.I18N("MsgUpdateSubscriptionEnd")}");
|
||||
}
|
||||
else
|
||||
{
|
||||
_updateFunc(false, args.Msg);
|
||||
}
|
||||
};
|
||||
downloadHandle3.Error += (sender2, args) =>
|
||||
{
|
||||
_updateFunc(false, args.GetException().Message);
|
||||
};
|
||||
|
||||
downloadHandle3.WebDownloadString(url);
|
||||
_updateFunc(false, $"{hashCode}{UIRes.I18N("MsgStartGettingSubscriptions")}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void UpdateGeoFile(string geoName, Config config, Action<bool, string> update)
|
||||
{
|
||||
_config = config;
|
||||
_updateFunc = update;
|
||||
|
||||
DownloadHandle downloadHandle = null;
|
||||
if (downloadHandle == null)
|
||||
{
|
||||
downloadHandle = new DownloadHandle();
|
||||
|
||||
downloadHandle.UpdateCompleted += (sender2, args) =>
|
||||
{
|
||||
if (args.Success)
|
||||
{
|
||||
_updateFunc(false, UIRes.I18N("MsgDownloadV2rayCoreSuccessfully"));
|
||||
|
||||
try
|
||||
{
|
||||
string fileName = Utils.GetPath(Global.DownloadFileName);
|
||||
if (File.Exists(fileName))
|
||||
{
|
||||
string targetPath = Utils.GetPath($"{geoName}.dat");
|
||||
if (File.Exists(targetPath))
|
||||
{
|
||||
File.Delete(targetPath);
|
||||
}
|
||||
File.Move(fileName, targetPath);
|
||||
_updateFunc(true, "");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_updateFunc(false, ex.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_updateFunc(false, args.Msg);
|
||||
}
|
||||
};
|
||||
downloadHandle.Error += (sender2, args) =>
|
||||
{
|
||||
_updateFunc(false, args.GetException().Message);
|
||||
};
|
||||
}
|
||||
|
||||
var url = string.Format(geoUrl, geoName);
|
||||
askToDownload(downloadHandle, url);
|
||||
}
|
||||
|
||||
#region private
|
||||
|
||||
private async void CheckUpdateAsync(string type)
|
||||
{
|
||||
try
|
||||
{
|
||||
Utils.SetSecurityProtocol();
|
||||
WebRequestHandler webRequestHandler = new WebRequestHandler
|
||||
{
|
||||
AllowAutoRedirect = false
|
||||
};
|
||||
HttpClient httpClient = new HttpClient(webRequestHandler);
|
||||
|
||||
string url;
|
||||
if (type == "v2fly")
|
||||
{
|
||||
url = v2flyCoreLatestUrl;
|
||||
}
|
||||
else if (type == "xray")
|
||||
{
|
||||
url = xrayCoreLatestUrl;
|
||||
}
|
||||
else if (type == "v2rayN")
|
||||
{
|
||||
url = nLatestUrl;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Type");
|
||||
}
|
||||
HttpResponseMessage response = await httpClient.GetAsync(url);
|
||||
if (response.StatusCode.ToString() == "Redirect")
|
||||
{
|
||||
responseHandler(type, response.Headers.Location.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.SaveLog("StatusCode error: " + url);
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
_updateFunc(false, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取V2RayCore版本
|
||||
/// </summary>
|
||||
private string getCoreVersion(string type)
|
||||
{
|
||||
try
|
||||
{
|
||||
var core = string.Empty;
|
||||
var match = string.Empty;
|
||||
if (type == "v2fly")
|
||||
{
|
||||
core = "v2ray.exe";
|
||||
match = "V2Ray";
|
||||
}
|
||||
else if (type == "xray")
|
||||
{
|
||||
core = "xray.exe";
|
||||
match = "Xray";
|
||||
}
|
||||
string filePath = Utils.GetPath(core);
|
||||
if (!File.Exists(filePath))
|
||||
{
|
||||
string msg = string.Format(UIRes.I18N("NotFoundCore"), @"");
|
||||
//ShowMsg(true, msg);
|
||||
return "";
|
||||
}
|
||||
|
||||
Process p = new Process();
|
||||
p.StartInfo.FileName = filePath;
|
||||
p.StartInfo.Arguments = "-version";
|
||||
p.StartInfo.WorkingDirectory = Utils.StartupPath();
|
||||
p.StartInfo.UseShellExecute = false;
|
||||
p.StartInfo.RedirectStandardOutput = true;
|
||||
p.StartInfo.CreateNoWindow = true;
|
||||
p.StartInfo.StandardOutputEncoding = Encoding.UTF8;
|
||||
p.Start();
|
||||
p.WaitForExit(5000);
|
||||
string echo = p.StandardOutput.ReadToEnd();
|
||||
string version = Regex.Match(echo, $"{match} ([0-9.]+) \\(").Groups[1].Value;
|
||||
return version;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
_updateFunc(false, ex.Message);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
private void responseHandler(string type, string redirectUrl)
|
||||
{
|
||||
try
|
||||
{
|
||||
string version = redirectUrl.Substring(redirectUrl.LastIndexOf("/", StringComparison.Ordinal) + 1);
|
||||
|
||||
string curVersion;
|
||||
string message;
|
||||
string url;
|
||||
if (type == "v2fly")
|
||||
{
|
||||
curVersion = "v" + getCoreVersion(type);
|
||||
message = string.Format(UIRes.I18N("IsLatestCore"), curVersion);
|
||||
string osBit = Environment.Is64BitProcess ? "64" : "32";
|
||||
url = string.Format(v2flyCoreUrl, version, osBit);
|
||||
}
|
||||
else if (type == "xray")
|
||||
{
|
||||
curVersion = "v" + getCoreVersion(type);
|
||||
message = string.Format(UIRes.I18N("IsLatestCore"), curVersion);
|
||||
string osBit = Environment.Is64BitProcess ? "64" : "32";
|
||||
url = string.Format(xrayCoreUrl, version, osBit);
|
||||
}
|
||||
else if (type == "v2rayN")
|
||||
{
|
||||
curVersion = FileVersionInfo.GetVersionInfo(Utils.GetExePath()).FileVersion.ToString();
|
||||
message = string.Format(UIRes.I18N("IsLatestN"), curVersion);
|
||||
url = string.Format(nUrl, version);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Type");
|
||||
}
|
||||
|
||||
if (curVersion == version)
|
||||
{
|
||||
AbsoluteCompleted?.Invoke(this, new ResultEventArgs(false, message));
|
||||
return;
|
||||
}
|
||||
|
||||
AbsoluteCompleted?.Invoke(this, new ResultEventArgs(true, url));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Utils.SaveLog(ex.Message, ex);
|
||||
_updateFunc(false, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void askToDownload(DownloadHandle downloadHandle, string url)
|
||||
{
|
||||
if (UI.ShowYesNo(string.Format(UIRes.I18N("DownloadYesNo"), url)) == DialogResult.Yes)
|
||||
{
|
||||
if (httpProxyTest() > 0)
|
||||
{
|
||||
int httpPort = _config.GetLocalPort(Global.InboundHttp);
|
||||
WebProxy webProxy = new WebProxy(Global.Loopback, httpPort);
|
||||
downloadHandle.DownloadFileAsync(url, webProxy, 600);
|
||||
}
|
||||
else
|
||||
{
|
||||
downloadHandle.DownloadFileAsync(url, null, 600);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int httpProxyTest()
|
||||
{
|
||||
SpeedtestHandler statistics = new SpeedtestHandler(ref _config);
|
||||
return statistics.RunAvailabilityCheck();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -249,8 +249,12 @@ namespace v2rayN.Handler
|
|||
var it = Utils.DeepCopy(rules);
|
||||
it.ip = null;
|
||||
it.type = "field";
|
||||
for (int k = 0; k < it.domain.Count; k++)
|
||||
for (int k = it.domain.Count - 1; k >= 0; k--)
|
||||
{
|
||||
if (it.domain[k].StartsWith("#"))
|
||||
{
|
||||
it.domain.RemoveAt(k);
|
||||
}
|
||||
it.domain[k] = it.domain[k].Replace(Global.RoutingRuleComma, ",");
|
||||
}
|
||||
//if (Utils.IsNullOrEmpty(it.port))
|
||||
|
@ -704,7 +708,7 @@ namespace v2rayN.Handler
|
|||
break;
|
||||
case "grpc":
|
||||
var grpcSettings = new GrpcSettings();
|
||||
|
||||
|
||||
grpcSettings.serviceName = config.path();
|
||||
streamSettings.grpcSettings = grpcSettings;
|
||||
break;
|
||||
|
|
|
@ -32,4 +32,4 @@ using System.Runtime.InteropServices;
|
|||
// 方法是按如下所示使用“*”:
|
||||
//[assembly: AssemblyVersion("1.0.*")]
|
||||
//[assembly: AssemblyVersion("1.0.0")]
|
||||
[assembly: AssemblyFileVersion("4.15")]
|
||||
[assembly: AssemblyFileVersion("4.16")]
|
||||
|
|
|
@ -766,9 +766,9 @@ namespace v2rayN
|
|||
try
|
||||
{
|
||||
IDataObject data = Clipboard.GetDataObject();
|
||||
if (data.GetDataPresent(DataFormats.Text))
|
||||
if (data.GetDataPresent(DataFormats.UnicodeText))
|
||||
{
|
||||
strData = data.GetData(DataFormats.Text).ToString();
|
||||
strData = data.GetData(DataFormats.UnicodeText).ToString();
|
||||
}
|
||||
return strData;
|
||||
}
|
||||
|
|
|
@ -138,6 +138,7 @@
|
|||
<DependentUpon>RoutingRuleSettingForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Handler\ShareHandler.cs" />
|
||||
<Compile Include="Handler\UpdateHandle.cs" />
|
||||
<Compile Include="Mode\ComboItem.cs" />
|
||||
<Compile Include="Forms\MainForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
|
|
Loading…
Reference in a new issue