From d8ee3c3bbacdcbeb10db1af85ec77c2e4ada5a3b Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Thu, 31 Dec 2020 20:15:01 +0800 Subject: [PATCH] up --- .../RoutingSettingDetailsForm.Designer.cs | 39 +- .../v2rayN/Forms/RoutingSettingDetailsForm.cs | 22 + .../Forms/RoutingSettingDetailsForm.resx | 1003 ++++++++++------- v2rayN/v2rayN/Forms/RoutingSettingForm.cs | 6 +- v2rayN/v2rayN/Forms/RoutingSettingForm.resx | 256 +++-- v2rayN/v2rayN/Handler/V2rayConfigHandler.cs | 72 +- v2rayN/v2rayN/Mode/RulesItem.cs | 27 +- v2rayN/v2rayN/Resx/Resx.zip | Bin 7367 -> 0 bytes v2rayN/v2rayN/Sample/custom_routing_block | 1 - v2rayN/v2rayN/Sample/custom_routing_direct | 132 --- v2rayN/v2rayN/Sample/custom_routing_private | 3 - v2rayN/v2rayN/Sample/custom_routing_proxy | 33 - v2rayN/v2rayN/v2rayN.csproj | 4 - 13 files changed, 845 insertions(+), 753 deletions(-) delete mode 100644 v2rayN/v2rayN/Resx/Resx.zip delete mode 100644 v2rayN/v2rayN/Sample/custom_routing_block delete mode 100644 v2rayN/v2rayN/Sample/custom_routing_direct delete mode 100644 v2rayN/v2rayN/Sample/custom_routing_private delete mode 100644 v2rayN/v2rayN/Sample/custom_routing_proxy diff --git a/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.Designer.cs b/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.Designer.cs index 4cf4fe18..ee40a2d0 100644 --- a/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.Designer.cs +++ b/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.Designer.cs @@ -46,6 +46,8 @@ this.txtIP = new System.Windows.Forms.TextBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.txtDomain = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.clbProtocol = new System.Windows.Forms.CheckedListBox(); this.panel3.SuspendLayout(); this.panel4.SuspendLayout(); this.panel2.SuspendLayout(); @@ -60,7 +62,8 @@ // // panel3 // - resources.ApplyResources(this.panel3, "panel3"); + this.panel3.Controls.Add(this.clbProtocol); + this.panel3.Controls.Add(this.label3); this.panel3.Controls.Add(this.txtPort); this.panel3.Controls.Add(this.label1); this.panel3.Controls.Add(this.labRoutingTips); @@ -68,6 +71,7 @@ this.panel3.Controls.Add(this.cmbOutboundTag); this.panel3.Controls.Add(this.txtRemarks); this.panel3.Controls.Add(this.label2); + resources.ApplyResources(this.panel3, "panel3"); this.panel3.Name = "panel3"; // // txtPort @@ -82,8 +86,8 @@ // // labRoutingTips // - resources.ApplyResources(this.labRoutingTips, "labRoutingTips"); this.labRoutingTips.ForeColor = System.Drawing.Color.Brown; + resources.ApplyResources(this.labRoutingTips, "labRoutingTips"); this.labRoutingTips.Name = "labRoutingTips"; // // label4 @@ -93,13 +97,13 @@ // // cmbOutboundTag // - resources.ApplyResources(this.cmbOutboundTag, "cmbOutboundTag"); this.cmbOutboundTag.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbOutboundTag.FormattingEnabled = true; this.cmbOutboundTag.Items.AddRange(new object[] { resources.GetString("cmbOutboundTag.Items"), resources.GetString("cmbOutboundTag.Items1"), resources.GetString("cmbOutboundTag.Items2")}); + resources.ApplyResources(this.cmbOutboundTag, "cmbOutboundTag"); this.cmbOutboundTag.Name = "cmbOutboundTag"; // // txtRemarks @@ -114,15 +118,15 @@ // // panel4 // - resources.ApplyResources(this.panel4, "panel4"); this.panel4.Controls.Add(this.btnClose); this.panel4.Controls.Add(this.btnOK); + resources.ApplyResources(this.panel4, "panel4"); this.panel4.Name = "panel4"; // // btnClose // - resources.ApplyResources(this.btnClose, "btnClose"); this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; + resources.ApplyResources(this.btnClose, "btnClose"); this.btnClose.Name = "btnClose"; this.btnClose.UseVisualStyleBackColor = true; this.btnClose.Click += new System.EventHandler(this.btnClose_Click); @@ -136,15 +140,15 @@ // // panel2 // - resources.ApplyResources(this.panel2, "panel2"); this.panel2.Controls.Add(this.groupBox2); this.panel2.Controls.Add(this.groupBox1); + resources.ApplyResources(this.panel2, "panel2"); this.panel2.Name = "panel2"; // // groupBox2 // - resources.ApplyResources(this.groupBox2, "groupBox2"); this.groupBox2.Controls.Add(this.txtIP); + resources.ApplyResources(this.groupBox2, "groupBox2"); this.groupBox2.Name = "groupBox2"; this.groupBox2.TabStop = false; // @@ -155,8 +159,8 @@ // // groupBox1 // - resources.ApplyResources(this.groupBox1, "groupBox1"); this.groupBox1.Controls.Add(this.txtDomain); + resources.ApplyResources(this.groupBox1, "groupBox1"); this.groupBox1.Name = "groupBox1"; this.groupBox1.TabStop = false; // @@ -165,6 +169,23 @@ resources.ApplyResources(this.txtDomain, "txtDomain"); this.txtDomain.Name = "txtDomain"; // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.Name = "label3"; + // + // clbProtocol + // + this.clbProtocol.CheckOnClick = true; + resources.ApplyResources(this.clbProtocol, "clbProtocol"); + this.clbProtocol.FormattingEnabled = true; + this.clbProtocol.Items.AddRange(new object[] { + resources.GetString("clbProtocol.Items"), + resources.GetString("clbProtocol.Items1"), + resources.GetString("clbProtocol.Items2")}); + this.clbProtocol.MultiColumn = true; + this.clbProtocol.Name = "clbProtocol"; + // // RoutingSettingDetailsForm // resources.ApplyResources(this, "$this"); @@ -207,5 +228,7 @@ private System.Windows.Forms.Label labRoutingTips; private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox txtPort; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.CheckedListBox clbProtocol; } } \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.cs b/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.cs index 09b5a39e..a0511439 100644 --- a/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.cs +++ b/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Windows.Forms; using v2rayN.Base; using v2rayN.Handler; @@ -42,6 +43,16 @@ namespace v2rayN.Forms routingItem.outboundTag = cmbOutboundTag.Text; routingItem.domain = Utils.String2List(txtDomain.Text); routingItem.ip = Utils.String2List(txtIP.Text); + + var protocol = new List(); + for (int i = 0; i < clbProtocol.Items.Count; i++) + { + if (clbProtocol.GetItemChecked(i)) + { + protocol.Add(clbProtocol.Items[i].ToString()); + } + } + routingItem.protocol = protocol; } } private void BindingData() @@ -53,6 +64,17 @@ namespace v2rayN.Forms cmbOutboundTag.Text = routingItem.outboundTag; txtDomain.Text = Utils.List2String(routingItem.domain, true); txtIP.Text = Utils.List2String(routingItem.ip, true); + + if (routingItem.protocol != null) + { + for (int i = 0; i < clbProtocol.Items.Count; i++) + { + if (routingItem.protocol.Contains(clbProtocol.Items[i].ToString())) + { + clbProtocol.SetItemChecked(i, true); + } + } + } } } private void ClearBind() diff --git a/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.resx b/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.resx index 8153fa31..0481d1dd 100644 --- a/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.resx +++ b/v2rayN/v2rayN/Forms/RoutingSettingDetailsForm.resx @@ -117,472 +117,607 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - - 32 - - - 30 - - - 31 - - - proxy - - - Fill - - - panel1 - - - 3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 - - - NoControl - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - Left - - - NoControl - - - 0 - - - - 29, 12 - - - panel2 - - - RoutingSettingDetailsForm - - - Fill - - - 1 - - - Fill - - - 411, 15 - - - 119, 20 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Bottom - Top - - 0 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 344, 417 - - - $this - - - 504, 15 - - - groupBox1 - - - NoControl - - - 6 - - - label1 - - - 742, 437 - + 0, 0 - - 4 - - - panel3 - - - True - - - panel3 - - - 3 - - - panel4 - - - 5 - - - 19, 43 - - - 25 - - - 3, 17 - - - panel3 - - - 274, 20 - - - labRoutingTips - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 491, 20 - - - groupBox1 - - - 1 - - - RoutingSettingDetailsForm - - - 166, 21 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel3 - - - 544, 16 - - - groupBox2 - - - 3 - - - 1 - - - 386, 417 - - - panel3 - - - 392, 0 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - panel4 - - - NoControl - - - Top - - - 598, 16 - - - $this - - - groupBox2 - - - panel3 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - txtPort - - - panel4 - - - 3, 17 - - - 1 - 742, 10 - - 0, 0 - - - 24 - - - label4 - - - &OK - - - 75, 23 - - - btnClose - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 34 - - - 29 - - - block - - - direct - - - 0 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - btnOK - - - 2 - - - 110, 21 - - - 4 - + 7 - - 0 + + panel1 - - 11 - - - 0 - - - panel3 - - - 8 - - - v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - 0, 10 - - - Remarks - - - Fill - - - 742, 60 - - - 0, 79 - - - $this - - - 47, 12 - - - &Cancel - - - *Set the rules, separated by commas (,); support Domain (pure string / regular / subdomain) and IP - - - 742, 69 - - - True - - - 6, 12 - - - Port - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - txtIP - - - 0 - - - label2 - - - cmbOutboundTag - - - True - - - 19, 20 - - - NoControl - - - 742, 576 - - - 10 - - - 392, 437 - - - 75, 23 - - - NoControl - - - True - - - 4 - - - 5 - - - txtDomain - - - 84, 16 - - - IP - - + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + $this - - 0, 516 + + 3 - - 33 + + 80 - - 47, 12 + + http - - 350, 437 + + tls - + + bittorrent + + + 347, 43 + + + 245, 20 + + + 39 + + + clbProtocol + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + panel3 - - Domain + + 0 - - txtRemarks + + True - - 347, 16 + + NoControl - - Out Tag + + 274, 47 - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 53, 12 + + + 36 + + + protocol + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 1 + + + 84, 43 + + + 166, 21 35 + + txtPort + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 2 + + + True + + + NoControl + + + 19, 47 + + + 29, 12 + + + 34 + + + Port + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 3 + + + NoControl + + + 19, 82 + + + 598, 16 + + + 33 + + + *Set the rules, separated by commas (,); support Domain (pure string / regular / subdomain) and IP + + + labRoutingTips + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 4 + + + True + + + NoControl + + + 274, 20 + + + 47, 12 + + + 32 + + + Out Tag + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 5 + + + proxy + + + direct + + + block + + + 347, 16 + + + 119, 20 + + + 31 + + + cmbOutboundTag + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 6 + + + 84, 16 + + + 166, 21 + + + 30 + + + txtRemarks + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 7 + + + True + + + NoControl + + + 19, 20 + + + 47, 12 + + + 29 + + + Remarks + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 8 + + + Top + + + 0, 10 + + + 742, 111 + + + 8 + + + panel3 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + btnClose + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel4 + + + 0 + + + btnOK + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel4 + + + 1 + + + Bottom + + + 0, 516 + + + 742, 60 + + + 10 + + + panel4 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + NoControl + + + 504, 15 + + + 75, 23 + + + 4 + + + &Cancel + + + btnClose + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel4 + + + 0 + + + NoControl + + + 411, 15 + + + 75, 23 + + + 5 + + + &OK + + + btnOK + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel4 + + + 1 + + + groupBox2 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 0 + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 1 + + + Fill + + + 0, 121 + + + 742, 395 + + + 11 + + + panel2 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + txtIP + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox2 + + + 0 + + + Fill + + + 392, 0 + + + 350, 395 + + + 4 + + + IP + + + groupBox2 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 0 + + + Fill + + + 3, 17 + + + True + + + 344, 375 + + + 25 + + + txtIP + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox2 + + + 0 + + + txtDomain + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + Left + + + 0, 0 + + + 392, 395 + + + 3 + + + Domain + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 1 + + + Fill + + + 3, 17 + + + True + + + 386, 375 + + + 24 + + + txtDomain + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + True + + 6, 12 + + + 742, 576 + + + RoutingSettingDetailsForm + + + RoutingSettingDetailsForm + + + v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/RoutingSettingForm.cs b/v2rayN/v2rayN/Forms/RoutingSettingForm.cs index e63d4ed8..b51d56d6 100644 --- a/v2rayN/v2rayN/Forms/RoutingSettingForm.cs +++ b/v2rayN/v2rayN/Forms/RoutingSettingForm.cs @@ -42,8 +42,9 @@ namespace v2rayN.Forms lvRoutings.Columns.Add(UIRes.I18N("LvAlias"), 100); lvRoutings.Columns.Add("outboundTag", 80); lvRoutings.Columns.Add("port", 80); - lvRoutings.Columns.Add("domain", 200); - lvRoutings.Columns.Add("ip", 200); + lvRoutings.Columns.Add("protocol", 100); + lvRoutings.Columns.Add("domain", 160); + lvRoutings.Columns.Add("ip", 160); lvRoutings.EndUpdate(); } @@ -61,6 +62,7 @@ namespace v2rayN.Forms Utils.AddSubItem(lvItem, "remarks", item.remarks); Utils.AddSubItem(lvItem, "outboundTag", item.outboundTag); Utils.AddSubItem(lvItem, "port", item.port); + Utils.AddSubItem(lvItem, "protocol", Utils.List2String(item.protocol)); Utils.AddSubItem(lvItem, "domain", Utils.List2String(item.domain)); Utils.AddSubItem(lvItem, "ip", Utils.List2String(item.ip)); diff --git a/v2rayN/v2rayN/Forms/RoutingSettingForm.resx b/v2rayN/v2rayN/Forms/RoutingSettingForm.resx index ae3fa1eb..b773ce33 100644 --- a/v2rayN/v2rayN/Forms/RoutingSettingForm.resx +++ b/v2rayN/v2rayN/Forms/RoutingSettingForm.resx @@ -147,21 +147,6 @@ 0 - - NoControl - - - 475, 17 - - - 75, 23 - - - 5 - - - &OK - btnOK @@ -198,6 +183,81 @@ 3 + + NoControl + + + 475, 17 + + + 75, 23 + + + 5 + + + &OK + + + btnOK + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 1 + + + linkLabelRoutingDoc + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 0 + + + cmbdomainStrategy + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 1 + + + Top + + + 0, 25 + + + 765, 51 + + + 11 + + + panel1 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + True @@ -261,33 +321,59 @@ 1 - - Top - - - 0, 25 - - - 765, 51 - - - 11 - - - panel1 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - 17, 17 + + 203, 186 + + + cmsLv + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Fill + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0 + ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu + PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA + BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5 + bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp + bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAD/////Bfv///8UU3lz + dGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAA + CgAAAAAAAAAAGAABAAAJBgAAAAH5////+////woAAAAAAAAAABoAAQABBQYAAAATU3lzdGVtLkRyYXdp + bmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5Gb250U3R5 + bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAG5a6L5L2TAAAQQQX3 + ////GFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQEAAAAHdmFsdWVfXwAIAwAAAAAAAAAF9v///xtTeXN0 + ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw== + + + + 3, 3 + + + 751, 505 + + + 12 + + + lvRoutings + + + v2rayN.Base.ListViewFlickerFree, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + tabPage2 + + + 0 + 202, 22 @@ -339,77 +425,12 @@ Move to bottom (B) - - 203, 186 - - - cmsLv - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Fill - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkMAwAAAFFTeXN0 - ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu - PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACFTeXN0ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0l0ZW0HAAAA - BFRleHQKSW1hZ2VJbmRleAlCYWNrQ29sb3IHQ2hlY2tlZARGb250CUZvcmVDb2xvchdVc2VJdGVtU3R5 - bGVGb3JTdWJJdGVtcwEABAAEBAAIFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAAAAETU3lzdGVtLkRyYXdp - bmcuRm9udAMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAAQIAAAAGBAAAAAD/////Bfv///8UU3lz - dGVtLkRyYXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAA - CgAAAAAAAAAAGAABAAAJBgAAAAH5////+////woAAAAAAAAAABoAAQABBQYAAAATU3lzdGVtLkRyYXdp - bmcuRm9udAQAAAAETmFtZQRTaXplBVN0eWxlBFVuaXQBAAQECxhTeXN0ZW0uRHJhd2luZy5Gb250U3R5 - bGUDAAAAG1N5c3RlbS5EcmF3aW5nLkdyYXBoaWNzVW5pdAMAAAADAAAABggAAAAG5a6L5L2TAAAQQQX3 - ////GFN5c3RlbS5EcmF3aW5nLkZvbnRTdHlsZQEAAAAHdmFsdWVfXwAIAwAAAAAAAAAF9v///xtTeXN0 - ZW0uRHJhd2luZy5HcmFwaGljc1VuaXQBAAAAB3ZhbHVlX18ACAMAAAADAAAACw== - - - - 3, 3 - - - 751, 505 - - - 12 - - - lvRoutings - - - v2rayN.Base.ListViewFlickerFree, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tabPage2 - - - 0 - 120, 21 Edit and Function - - 4, 22 - - - 3, 3, 3, 3 - - - 757, 511 - - - 0 - - - RuleList - tabPage2 @@ -446,6 +467,33 @@ 1 + + 4, 22 + + + 3, 3, 3, 3 + + + 757, 511 + + + 0 + + + RuleList + + + tabPage2 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControl2 + + + 0 + 139, 17 diff --git a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs index 596a95b3..473400c3 100644 --- a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs @@ -214,16 +214,37 @@ namespace v2rayN.Handler { return 0; } + if (Utils.IsNullOrEmpty(rules.port)) + { + rules.port = null; + } + if (rules.domain != null && rules.domain.Count == 0) + { + rules.domain = null; + } + if (rules.ip != null && rules.ip.Count == 0) + { + rules.ip = null; + } + if (rules.protocol != null && rules.protocol.Count == 0) + { + rules.protocol = null; + } + var hasDomainIp = false; if (rules.domain != null && rules.domain.Count > 0) { var it = Utils.DeepCopy(rules); it.ip = null; it.type = "field"; - if (Utils.IsNullOrEmpty(rules.port)) - { - it.port = null; - } + //if (Utils.IsNullOrEmpty(it.port)) + //{ + // it.port = null; + //} + //if (it.protocol != null && it.protocol.Count == 0) + //{ + // it.protocol = null; + //} v2rayConfig.routing.rules.Add(it); hasDomainIp = true; } @@ -232,20 +253,43 @@ namespace v2rayN.Handler var it = Utils.DeepCopy(rules); it.domain = null; it.type = "field"; - if (Utils.IsNullOrEmpty(rules.port)) - { - it.port = null; - } + //if (Utils.IsNullOrEmpty(it.port)) + //{ + // it.port = null; + //} + //if (it.protocol != null && it.protocol.Count == 0) + //{ + // it.protocol = null; + //} v2rayConfig.routing.rules.Add(it); hasDomainIp = true; } - if (!hasDomainIp && !Utils.IsNullOrEmpty(rules.port)) + if (!hasDomainIp) { - var it = Utils.DeepCopy(rules); - it.domain = null; - it.ip = null; - it.type = "field"; - v2rayConfig.routing.rules.Add(it); + if (!Utils.IsNullOrEmpty(rules.port)) + { + var it = Utils.DeepCopy(rules); + //it.domain = null; + //it.ip = null; + //if (it.protocol != null && it.protocol.Count == 0) + //{ + // it.protocol = null; + //} + it.type = "field"; + v2rayConfig.routing.rules.Add(it); + } + else if (rules.protocol != null && rules.protocol.Count > 0) + { + var it = Utils.DeepCopy(rules); + //it.domain = null; + //it.ip = null; + //if (Utils.IsNullOrEmpty(it.port)) + //{ + // it.port = null; + //} + it.type = "field"; + v2rayConfig.routing.rules.Add(it); + } } } catch diff --git a/v2rayN/v2rayN/Mode/RulesItem.cs b/v2rayN/v2rayN/Mode/RulesItem.cs index a4ae121e..bb3a85e4 100644 --- a/v2rayN/v2rayN/Mode/RulesItem.cs +++ b/v2rayN/v2rayN/Mode/RulesItem.cs @@ -6,31 +6,22 @@ namespace v2rayN.Mode [Serializable] public class RulesItem { - public string remarks { get; set; } - /// - /// - /// + public string remarks { get; set; } + public string type { get; set; } - /// - /// - /// + public string port { get; set; } public List inboundTag { get; set; } - /// - /// - /// + public string outboundTag { get; set; } - - /// - /// - /// + public List ip { get; set; } - - /// - /// - /// + public List domain { get; set; } + + public List protocol { get; set; } + } } diff --git a/v2rayN/v2rayN/Resx/Resx.zip b/v2rayN/v2rayN/Resx/Resx.zip deleted file mode 100644 index 0cb38db96976257ee5c256c7f490c4a730acd46c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7367 zcmZ{pbyQuwn#OV0;;x5MC~|OjDMbngcXxLvE(dpaw}ZR8yB2rXVufObPQUxjojY@9 zCVTB9du2awvXVdYThFT~3k!z=^;eNsmzDoV=RYf=KP|}ASyhJls|C|1Lpx_?2~%fF zb30QfW@Bf?KQi1uKOjM|tI5j$&MDR}LxzHqp@o8a_rGLLrp_LVTIw|mthm0?d%|f# zy{O!#u@x{zK`S~XSeSNJ7L?(U*|Ye;gCP^`7hMk@DSy5JIV?T*SR8ELTYi{e>IlPl zdGt1a;*Z(guW(OC28>9ZBk$w8jueLwi-W>i>83O<&m2E&YcF!raTnAm$>O zBDlCxJ;K!Rri{^-RtPl4U7MDTOyVF`w4L~bgQ7x+#4|z(4v`sHC;BR*)Rb+UCDf@{ z>>V2;*bu#tx;=3X*GnXWv0JhN-^QPlaxDVc?mc5*?#Zu*M*2!tQ6H$h*ojWg1ykj0f}l2M2UPDj$IOHg%-4lF{Nyl`M(%N5+U-dvq|(w zk9eB=;9Y7cLL;`@d|(E#FtTC~#3A93w-t)G@NNK$8P{ea=`e@c72rxaKAyMAId~UU zdDvggUZ0kzL<17Dy^El(6`T509D$ry#A}G(T!ntUn8xploiW@SNNs8zKi|$4p;&a8 zNjJj*d8xt*Yg_1WvKU@=0GLR(#I2rE)hY>kN2B(wjY?2!9;=GbL9a})S9n?jF zg~b7!bfSebhCmgW#I-WE)+owW)Adf7AE_$gw~h2LNi^`g91lee2$^I<}({!=xg8KGc&Yhzy;o%{pk$S`daF zYORm`DVpbYYI3i&KDoO>U_HZ++Y5~gl1WnEy}!o|H13)hDK22y1Yodx&M>-^E({sX z(PMDaYiE;lnT#qr?x;vVXsqlOkoDf=w#6H5A(;?x)Y!$HgFxjYQfeA8l$xtN9?+Qw zjBzkbf-V;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