diff --git a/.gitignore b/.gitignore index b5d8031c..afeea2ed 100644 --- a/.gitignore +++ b/.gitignore @@ -5,10 +5,9 @@ /v2rayN/.vs/ /v2rayN/v2rayN/bin/Debug/app.publish /v2rayN/v2rayN/bin/Debug -/v2rayN/v2rayN/obj/Debug -/v2rayN/.vs/v2rayN/DesignTimeBuild /v2rayN/v2rayN/bin/Release -/v2rayN/v2rayN/obj/Release +/v2rayN/v2rayN/obj/ +/v2rayN/.vs/v2rayN/DesignTimeBuild /v2rayN/packages .vs/ProjectSettings.json .vs/slnx.sqlite diff --git a/v2rayN/v2rayN/Forms/MainForm.cs b/v2rayN/v2rayN/Forms/MainForm.cs index d4291c8b..0e8902f6 100644 --- a/v2rayN/v2rayN/Forms/MainForm.cs +++ b/v2rayN/v2rayN/Forms/MainForm.cs @@ -193,8 +193,12 @@ namespace v2rayN.Forms VmessItem item = config.vmess[k]; - ListViewItem lvItem = null; - if (statistics != null && statistics.Enable) + void _addSubItem(ListViewItem i, string name, string text) + { + i.SubItems.Add(new ListViewItem.ListViewSubItem() { Name = name, Text = text }); + } + bool stats = statistics != null && statistics.Enable; + if (stats) { ServerStatItem sItem = statistics.Statistic.Find(item_ => item_.itemId == item.getItemId()); if (sItem != null) @@ -204,43 +208,27 @@ namespace v2rayN.Forms todayUp = Utils.HumanFy(sItem.todayUp); todayDown = Utils.HumanFy(sItem.todayDown); } - - lvItem = new ListViewItem(new string[] - { - def, - ((EConfigType)item.configType).ToString(), - item.remarks, - item.address, - item.port.ToString(), - //item.id, - //item.alterId.ToString(), - item.security, - item.network, - item.getSubRemarks(config), - item.testResult, - todayDown, - todayUp, - totalDown, - totalUp - }); } - else + ListViewItem lvItem = new ListViewItem(); + _addSubItem(lvItem, "enabled", def); + _addSubItem(lvItem, "type", ((EConfigType)item.configType).ToString()); + _addSubItem(lvItem, "remarks", item.remarks); + _addSubItem(lvItem, "address", item.address); + _addSubItem(lvItem, "port", item.port.ToString()); + //_addSubItem(lvItem, "id", item.id); + //_addSubItem(lvItem, "alterId", item.alterId.ToString()); + _addSubItem(lvItem, "security", item.security); + _addSubItem(lvItem, "network", item.network); + _addSubItem(lvItem, "SubRemarks", item.getSubRemarks(config)); + _addSubItem(lvItem, "testResult", item.testResult); + if (stats) { - lvItem = new ListViewItem(new string[] - { - def, - ((EConfigType)item.configType).ToString(), - item.remarks, - item.address, - item.port.ToString(), - //item.id, - //item.alterId.ToString(), - item.security, - item.network, - item.getSubRemarks(config), - item.testResult - }); + _addSubItem(lvItem, "todayDown", todayDown); + _addSubItem(lvItem, "todayUp", todayUp); + _addSubItem(lvItem, "totalDown", totalDown); + _addSubItem(lvItem, "totalUp", totalUp); } + if (k % 2 == 1) // 隔行着色 { lvItem.BackColor = Color.WhiteSmoke; @@ -1021,7 +1009,7 @@ namespace v2rayN.Forms private void SetTestResult(int k, string txt) { config.vmess[k].testResult = txt; - lvServers.Items[k].SubItems[8].Text = txt; + lvServers.Items[k].SubItems["testResult"].Text = txt; } private void ClearTestResult() { @@ -1060,11 +1048,10 @@ namespace v2rayN.Forms { lvServers.SuspendLayout(); - int indexStart = 9; - lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].todayDown); - lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].todayUp); - lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].totalDown); - lvServers.Items[i].SubItems[indexStart++].Text = Utils.HumanFy(statistics[index].totalUp); + lvServers.Items[i].SubItems["todayDown"].Text = Utils.HumanFy(statistics[index].todayDown); + lvServers.Items[i].SubItems["todayUp"].Text = Utils.HumanFy(statistics[index].todayUp); + lvServers.Items[i].SubItems["totalDown"].Text = Utils.HumanFy(statistics[index].totalDown); + lvServers.Items[i].SubItems["totalUp"].Text = Utils.HumanFy(statistics[index].totalUp); lvServers.ResumeLayout(); }); diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs b/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs index 4d9c7130..e2f01813 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs @@ -65,10 +65,10 @@ this.tabPage8 = new System.Windows.Forms.TabPage(); this.cmbroutingMode = new System.Windows.Forms.ComboBox(); this.panel3 = new System.Windows.Forms.Panel(); + this.linkLabelRoutingDoc = new System.Windows.Forms.LinkLabel(); this.btnSetDefRountingRule = new System.Windows.Forms.Button(); this.labRoutingTips = new System.Windows.Forms.Label(); this.cmbdomainStrategy = new System.Windows.Forms.ComboBox(); - this.label15 = new System.Windows.Forms.Label(); this.tabPage6 = new System.Windows.Forms.TabPage(); this.chkKcpcongestion = new System.Windows.Forms.CheckBox(); this.txtKcpwriteBufferSize = new System.Windows.Forms.TextBox(); @@ -119,33 +119,32 @@ // // 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); // // tabControl1 // - resources.ApplyResources(this.tabControl1, "tabControl1"); this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Controls.Add(this.tabPage6); this.tabControl1.Controls.Add(this.tabPage7); this.tabControl1.Controls.Add(this.tabPage9); + resources.ApplyResources(this.tabControl1, "tabControl1"); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; // // tabPage1 // - resources.ApplyResources(this.tabPage1, "tabPage1"); this.tabPage1.Controls.Add(this.groupBox1); + resources.ApplyResources(this.tabPage1, "tabPage1"); this.tabPage1.Name = "tabPage1"; this.tabPage1.UseVisualStyleBackColor = true; // // groupBox1 // - resources.ApplyResources(this.groupBox1, "groupBox1"); this.groupBox1.Controls.Add(this.label16); this.groupBox1.Controls.Add(this.cmblistenerType); this.groupBox1.Controls.Add(this.chksniffingEnabled2); @@ -166,6 +165,7 @@ this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.txtlocalPort); this.groupBox1.Controls.Add(this.label2); + resources.ApplyResources(this.groupBox1, "groupBox1"); this.groupBox1.Name = "groupBox1"; this.groupBox1.TabStop = false; // @@ -176,7 +176,6 @@ // // cmblistenerType // - resources.ApplyResources(this.cmblistenerType, "cmblistenerType"); this.cmblistenerType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmblistenerType.FormattingEnabled = true; this.cmblistenerType.Items.AddRange(new object[] { @@ -189,6 +188,7 @@ resources.GetString("cmblistenerType.Items6"), resources.GetString("cmblistenerType.Items7"), resources.GetString("cmblistenerType.Items8")}); + resources.ApplyResources(this.cmblistenerType, "cmblistenerType"); this.cmblistenerType.Name = "cmblistenerType"; // // chksniffingEnabled2 @@ -234,12 +234,12 @@ // // cmbprotocol2 // - resources.ApplyResources(this.cmbprotocol2, "cmbprotocol2"); this.cmbprotocol2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbprotocol2.FormattingEnabled = true; this.cmbprotocol2.Items.AddRange(new object[] { resources.GetString("cmbprotocol2.Items"), resources.GetString("cmbprotocol2.Items1")}); + resources.ApplyResources(this.cmbprotocol2, "cmbprotocol2"); this.cmbprotocol2.Name = "cmbprotocol2"; // // label3 @@ -254,8 +254,8 @@ // // cmbprotocol // - resources.ApplyResources(this.cmbprotocol, "cmbprotocol"); this.cmbprotocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + resources.ApplyResources(this.cmbprotocol, "cmbprotocol"); this.cmbprotocol.FormattingEnabled = true; this.cmbprotocol.Items.AddRange(new object[] { resources.GetString("cmbprotocol.Items"), @@ -281,7 +281,6 @@ // // cmbloglevel // - resources.ApplyResources(this.cmbloglevel, "cmbloglevel"); this.cmbloglevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbloglevel.FormattingEnabled = true; this.cmbloglevel.Items.AddRange(new object[] { @@ -290,6 +289,7 @@ resources.GetString("cmbloglevel.Items2"), resources.GetString("cmbloglevel.Items3"), resources.GetString("cmbloglevel.Items4")}); + resources.ApplyResources(this.cmbloglevel, "cmbloglevel"); this.cmbloglevel.Name = "cmbloglevel"; // // label5 @@ -309,33 +309,33 @@ // // tabPage2 // - resources.ApplyResources(this.tabPage2, "tabPage2"); this.tabPage2.Controls.Add(this.groupBox2); + resources.ApplyResources(this.tabPage2, "tabPage2"); this.tabPage2.Name = "tabPage2"; this.tabPage2.UseVisualStyleBackColor = true; // // groupBox2 // - resources.ApplyResources(this.groupBox2, "groupBox2"); this.groupBox2.Controls.Add(this.tabControl2); this.groupBox2.Controls.Add(this.panel3); + resources.ApplyResources(this.groupBox2, "groupBox2"); this.groupBox2.Name = "groupBox2"; this.groupBox2.TabStop = false; // // tabControl2 // - resources.ApplyResources(this.tabControl2, "tabControl2"); this.tabControl2.Controls.Add(this.tabPage3); this.tabControl2.Controls.Add(this.tabPage4); this.tabControl2.Controls.Add(this.tabPage5); this.tabControl2.Controls.Add(this.tabPage8); + resources.ApplyResources(this.tabControl2, "tabControl2"); this.tabControl2.Name = "tabControl2"; this.tabControl2.SelectedIndex = 0; // // tabPage3 // - resources.ApplyResources(this.tabPage3, "tabPage3"); this.tabPage3.Controls.Add(this.txtUseragent); + resources.ApplyResources(this.tabPage3, "tabPage3"); this.tabPage3.Name = "tabPage3"; this.tabPage3.UseVisualStyleBackColor = true; // @@ -346,8 +346,8 @@ // // tabPage4 // - resources.ApplyResources(this.tabPage4, "tabPage4"); this.tabPage4.Controls.Add(this.txtUserdirect); + resources.ApplyResources(this.tabPage4, "tabPage4"); this.tabPage4.Name = "tabPage4"; this.tabPage4.UseVisualStyleBackColor = true; // @@ -358,8 +358,8 @@ // // tabPage5 // - resources.ApplyResources(this.tabPage5, "tabPage5"); this.tabPage5.Controls.Add(this.txtUserblock); + resources.ApplyResources(this.tabPage5, "tabPage5"); this.tabPage5.Name = "tabPage5"; this.tabPage5.UseVisualStyleBackColor = true; // @@ -370,14 +370,13 @@ // // tabPage8 // - resources.ApplyResources(this.tabPage8, "tabPage8"); this.tabPage8.Controls.Add(this.cmbroutingMode); + resources.ApplyResources(this.tabPage8, "tabPage8"); this.tabPage8.Name = "tabPage8"; this.tabPage8.UseVisualStyleBackColor = true; // // cmbroutingMode // - resources.ApplyResources(this.cmbroutingMode, "cmbroutingMode"); this.cmbroutingMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbroutingMode.FormattingEnabled = true; this.cmbroutingMode.Items.AddRange(new object[] { @@ -385,17 +384,25 @@ resources.GetString("cmbroutingMode.Items1"), resources.GetString("cmbroutingMode.Items2"), resources.GetString("cmbroutingMode.Items3")}); + resources.ApplyResources(this.cmbroutingMode, "cmbroutingMode"); this.cmbroutingMode.Name = "cmbroutingMode"; // // panel3 // - resources.ApplyResources(this.panel3, "panel3"); + this.panel3.Controls.Add(this.linkLabelRoutingDoc); this.panel3.Controls.Add(this.btnSetDefRountingRule); this.panel3.Controls.Add(this.labRoutingTips); this.panel3.Controls.Add(this.cmbdomainStrategy); - this.panel3.Controls.Add(this.label15); + resources.ApplyResources(this.panel3, "panel3"); this.panel3.Name = "panel3"; // + // linkLabelRoutingDoc + // + resources.ApplyResources(this.linkLabelRoutingDoc, "linkLabelRoutingDoc"); + this.linkLabelRoutingDoc.Name = "linkLabelRoutingDoc"; + this.linkLabelRoutingDoc.TabStop = true; + this.linkLabelRoutingDoc.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelRoutingDoc_LinkClicked); + // // btnSetDefRountingRule // resources.ApplyResources(this.btnSetDefRountingRule, "btnSetDefRountingRule"); @@ -405,29 +412,23 @@ // // labRoutingTips // - resources.ApplyResources(this.labRoutingTips, "labRoutingTips"); this.labRoutingTips.ForeColor = System.Drawing.Color.Brown; + resources.ApplyResources(this.labRoutingTips, "labRoutingTips"); this.labRoutingTips.Name = "labRoutingTips"; // // cmbdomainStrategy // - resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy"); this.cmbdomainStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbdomainStrategy.FormattingEnabled = true; this.cmbdomainStrategy.Items.AddRange(new object[] { resources.GetString("cmbdomainStrategy.Items"), resources.GetString("cmbdomainStrategy.Items1"), resources.GetString("cmbdomainStrategy.Items2")}); + resources.ApplyResources(this.cmbdomainStrategy, "cmbdomainStrategy"); this.cmbdomainStrategy.Name = "cmbdomainStrategy"; // - // label15 - // - resources.ApplyResources(this.label15, "label15"); - this.label15.Name = "label15"; - // // tabPage6 // - resources.ApplyResources(this.tabPage6, "tabPage6"); this.tabPage6.Controls.Add(this.chkKcpcongestion); this.tabPage6.Controls.Add(this.txtKcpwriteBufferSize); this.tabPage6.Controls.Add(this.label10); @@ -441,6 +442,7 @@ this.tabPage6.Controls.Add(this.label7); this.tabPage6.Controls.Add(this.txtKcpmtu); this.tabPage6.Controls.Add(this.label6); + resources.ApplyResources(this.tabPage6, "tabPage6"); this.tabPage6.Name = "tabPage6"; this.tabPage6.UseVisualStyleBackColor = true; // @@ -512,7 +514,6 @@ // // tabPage7 // - resources.ApplyResources(this.tabPage7, "tabPage7"); this.tabPage7.Controls.Add(this.chkKeepOlderDedupl); this.tabPage7.Controls.Add(this.cbFreshrate); this.tabPage7.Controls.Add(this.lbFreshrate); @@ -521,6 +522,7 @@ this.tabPage7.Controls.Add(this.txturlGFWList); this.tabPage7.Controls.Add(this.label13); this.tabPage7.Controls.Add(this.chkAutoRun); + resources.ApplyResources(this.tabPage7, "tabPage7"); this.tabPage7.Name = "tabPage7"; this.tabPage7.UseVisualStyleBackColor = true; // @@ -532,9 +534,9 @@ // // cbFreshrate // - resources.ApplyResources(this.cbFreshrate, "cbFreshrate"); this.cbFreshrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbFreshrate.FormattingEnabled = true; + resources.ApplyResources(this.cbFreshrate, "cbFreshrate"); this.cbFreshrate.Name = "cbFreshrate"; // // lbFreshrate @@ -572,9 +574,9 @@ // // tabPage9 // - resources.ApplyResources(this.tabPage9, "tabPage9"); this.tabPage9.Controls.Add(this.txtuserPacRule); this.tabPage9.Controls.Add(this.panel4); + resources.ApplyResources(this.tabPage9, "tabPage9"); this.tabPage9.Name = "tabPage9"; this.tabPage9.UseVisualStyleBackColor = true; // @@ -585,21 +587,21 @@ // // panel4 // - resources.ApplyResources(this.panel4, "panel4"); this.panel4.Controls.Add(this.label4); + resources.ApplyResources(this.panel4, "panel4"); this.panel4.Name = "panel4"; // // label4 // - resources.ApplyResources(this.label4, "label4"); this.label4.ForeColor = System.Drawing.Color.Brown; + resources.ApplyResources(this.label4, "label4"); this.label4.Name = "label4"; // // panel2 // - resources.ApplyResources(this.panel2, "panel2"); this.panel2.Controls.Add(this.btnClose); this.panel2.Controls.Add(this.btnOK); + resources.ApplyResources(this.panel2, "panel2"); this.panel2.Name = "panel2"; // // btnOK @@ -709,7 +711,6 @@ private System.Windows.Forms.Label label14; private System.Windows.Forms.Panel panel3; private System.Windows.Forms.ComboBox cmbdomainStrategy; - private System.Windows.Forms.Label label15; private System.Windows.Forms.ComboBox cmbroutingMode; private System.Windows.Forms.CheckBox chksniffingEnabled; private System.Windows.Forms.CheckBox chksniffingEnabled2; @@ -725,5 +726,6 @@ private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Label label4; private System.Windows.Forms.CheckBox chkKeepOlderDedupl; + private System.Windows.Forms.LinkLabel linkLabelRoutingDoc; } } \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.cs b/v2rayN/v2rayN/Forms/OptionSettingForm.cs index 079d2b92..32378eea 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.cs +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.cs @@ -440,6 +440,11 @@ namespace v2rayN.Forms { labRoutingTips.Text = text; } + + private void linkLabelRoutingDoc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + System.Diagnostics.Process.Start("https://www.v2ray.com/chapter_02/03_routing.html#routingobject"); + } } class ComboItem diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.resx b/v2rayN/v2rayN/Forms/OptionSettingForm.resx index a6426af3..8a951883 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.resx +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.resx @@ -117,8 +117,8 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 6, 12 @@ -159,6 +159,12 @@ &OK + + Top, Right + + + True + 322, 10 @@ -220,7 +226,7 @@ 15, 16 - 132, 16 + 246, 16 23 @@ -238,7 +244,7 @@ 15, 62 - 558, 16 + 576, 16 29 @@ -615,24 +621,6 @@ Custom DNS (multiple, separated by commas (,)) - - True - - - NoControl - - - 5, 14 - - - 95, 12 - - - 17 - - - Domain strategy - True @@ -804,6 +792,24 @@ Statistics freshrate + + True + + + 5, 14 + + + 0, 0, 0, 0 + + + 95, 12 + + + 19 + + + Domain strategy + Top diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx b/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx index b330571e..1ab6b8e2 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx @@ -117,9 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 参数设置 @@ -129,9 +126,11 @@ 确定(&O) + NoControl + 351, 14 @@ -201,12 +200,6 @@ 开启UDP - - 81, 14 - - - 186, 20 - 关闭Http代理 @@ -273,9 +266,6 @@ 53, 12 - - 域名策略 - 53, 12 @@ -303,6 +293,7 @@ 日志等级 + True @@ -321,6 +312,9 @@ 统计刷新频率 + + 域名解析策略 + 642, 72 diff --git a/v2rayN/v2rayN/Handler/SpeedtestHandler.cs b/v2rayN/v2rayN/Handler/SpeedtestHandler.cs index 5acad82f..19773c0f 100644 --- a/v2rayN/v2rayN/Handler/SpeedtestHandler.cs +++ b/v2rayN/v2rayN/Handler/SpeedtestHandler.cs @@ -109,17 +109,14 @@ namespace v2rayN.Handler //Thread.Sleep(5000); int httpPort = _config.GetLocalPort("speedtest"); - Task[] tasks = new Task[_selecteds.Count]; - int i = -1; + List tasks = new List(); foreach (int itemIndex in _selecteds) { if (_config.vmess[itemIndex].configType == (int)EConfigType.Custom) { continue; } - - i++; - tasks[i] = Task.Run(() => + tasks.Add(Task.Run(() => { try { @@ -133,12 +130,10 @@ namespace v2rayN.Handler { Utils.SaveLog(ex.Message, ex); } - }); + })); //Thread.Sleep(100); } - Task.WaitAll(tasks); - - Thread.Sleep(100); + Task.WaitAll(tasks.ToArray()); } catch (Exception ex) { diff --git a/v2rayN/v2rayN/Handler/V2rayHandler.cs b/v2rayN/v2rayN/Handler/V2rayHandler.cs index 0ccdb651..99efa90f 100644 --- a/v2rayN/v2rayN/Handler/V2rayHandler.cs +++ b/v2rayN/v2rayN/Handler/V2rayHandler.cs @@ -200,6 +200,7 @@ namespace v2rayN.Handler WorkingDirectory = Utils.StartupPath(), UseShellExecute = false, RedirectStandardOutput = true, + RedirectStandardError = true, CreateNoWindow = true, StandardOutputEncoding = Encoding.UTF8 } @@ -217,6 +218,11 @@ namespace v2rayN.Handler //processId = p.Id; _process = p; + if (p.WaitForExit(1000)) + { + throw new Exception(p.StandardError.ReadToEnd()); + } + Global.processJob.AddProcess(p.Handle); } catch (Exception ex) @@ -248,6 +254,7 @@ namespace v2rayN.Handler UseShellExecute = false, RedirectStandardInput = true, RedirectStandardOutput = true, + RedirectStandardError = true, CreateNoWindow = true, StandardOutputEncoding = Encoding.UTF8 } @@ -266,6 +273,11 @@ namespace v2rayN.Handler p.StandardInput.Write(configStr); p.StandardInput.Close(); + if (p.WaitForExit(1000)) + { + throw new Exception(p.StandardError.ReadToEnd()); + } + Global.processJob.AddProcess(p.Handle); return p.Id; } @@ -273,7 +285,7 @@ namespace v2rayN.Handler { Utils.SaveLog(ex.Message, ex); string msg = ex.Message; - ShowMsg(true, msg); + ShowMsg(false, msg); return -1; } } diff --git a/v2rayN/v2rayN/LIB/Google.Protobuf.dll b/v2rayN/v2rayN/LIB/Google.Protobuf.dll deleted file mode 100644 index 596878f0..00000000 Binary files a/v2rayN/v2rayN/LIB/Google.Protobuf.dll and /dev/null differ diff --git a/v2rayN/v2rayN/LIB/Grpc.Core.Api.dll b/v2rayN/v2rayN/LIB/Grpc.Core.Api.dll deleted file mode 100644 index c2dfadc2..00000000 Binary files a/v2rayN/v2rayN/LIB/Grpc.Core.Api.dll and /dev/null differ diff --git a/v2rayN/v2rayN/LIB/Grpc.Core.dll b/v2rayN/v2rayN/LIB/Grpc.Core.dll deleted file mode 100644 index 9413b6e5..00000000 Binary files a/v2rayN/v2rayN/LIB/Grpc.Core.dll and /dev/null differ diff --git a/v2rayN/v2rayN/LIB/Newtonsoft.Json.dll b/v2rayN/v2rayN/LIB/Newtonsoft.Json.dll deleted file mode 100644 index 71ae7e6c..00000000 Binary files a/v2rayN/v2rayN/LIB/Newtonsoft.Json.dll and /dev/null differ diff --git a/v2rayN/v2rayN/LIB/System.Buffers.dll b/v2rayN/v2rayN/LIB/System.Buffers.dll deleted file mode 100644 index b6d9c778..00000000 Binary files a/v2rayN/v2rayN/LIB/System.Buffers.dll and /dev/null differ diff --git a/v2rayN/v2rayN/LIB/System.Memory.dll b/v2rayN/v2rayN/LIB/System.Memory.dll deleted file mode 100644 index bdfc501e..00000000 Binary files a/v2rayN/v2rayN/LIB/System.Memory.dll and /dev/null differ diff --git a/v2rayN/v2rayN/LIB/System.Runtime.CompilerServices.Unsafe.dll b/v2rayN/v2rayN/LIB/System.Runtime.CompilerServices.Unsafe.dll deleted file mode 100644 index 31562392..00000000 Binary files a/v2rayN/v2rayN/LIB/System.Runtime.CompilerServices.Unsafe.dll and /dev/null differ diff --git a/v2rayN/v2rayN/LIB/grpc_csharp_ext.x64.dll b/v2rayN/v2rayN/LIB/grpc_csharp_ext.x64.dll deleted file mode 100644 index 8c10df69..00000000 Binary files a/v2rayN/v2rayN/LIB/grpc_csharp_ext.x64.dll and /dev/null differ diff --git a/v2rayN/v2rayN/LIB/grpc_csharp_ext.x86.dll b/v2rayN/v2rayN/LIB/grpc_csharp_ext.x86.dll deleted file mode 100644 index dd3876df..00000000 Binary files a/v2rayN/v2rayN/LIB/grpc_csharp_ext.x86.dll and /dev/null differ diff --git a/v2rayN/v2rayN/LIB/libs.zip b/v2rayN/v2rayN/LIB/libs.zip deleted file mode 100644 index 55723493..00000000 Binary files a/v2rayN/v2rayN/LIB/libs.zip and /dev/null differ diff --git a/v2rayN/v2rayN/LIB/netstandard.dll b/v2rayN/v2rayN/LIB/netstandard.dll deleted file mode 100644 index 1f1ab22c..00000000 Binary files a/v2rayN/v2rayN/LIB/netstandard.dll and /dev/null differ diff --git a/v2rayN/v2rayN/LIB/zxing.dll b/v2rayN/v2rayN/LIB/zxing.dll deleted file mode 100644 index 7b99de64..00000000 Binary files a/v2rayN/v2rayN/LIB/zxing.dll and /dev/null differ diff --git a/v2rayN/v2rayN/LIB/zxing.presentation.dll b/v2rayN/v2rayN/LIB/zxing.presentation.dll deleted file mode 100644 index 8ad3f9bf..00000000 Binary files a/v2rayN/v2rayN/LIB/zxing.presentation.dll and /dev/null differ diff --git a/v2rayN/v2rayN/Program.cs b/v2rayN/v2rayN/Program.cs index 133e2108..cd3e1559 100644 --- a/v2rayN/v2rayN/Program.cs +++ b/v2rayN/v2rayN/Program.cs @@ -33,11 +33,6 @@ namespace v2rayN if (!IsDuplicateInstance()) { - if (!UnzipLibs()) - { - UI.ShowError($"Error preparing the environment(准备运行环境出错)"); - return; - } Utils.SaveLog("v2rayN start up " + Utils.GetVersion()); @@ -100,21 +95,5 @@ namespace v2rayN { Utils.SaveLog("CurrentDomain_UnhandledException", (Exception)e.ExceptionObject); } - - static bool UnzipLibs() - { - string fileName = Utils.GetPath("libs.zip"); - if (!FileManager.ByteArrayToFile(fileName, Resources.libs)) - { - return false; - } - - if (!FileManager.ZipExtractToFile(fileName)) - { - return false; - } - - return true; - } } } diff --git a/v2rayN/v2rayN/Properties/Resources.Designer.cs b/v2rayN/v2rayN/Properties/Resources.Designer.cs index be8f6a6d..fb420525 100644 --- a/v2rayN/v2rayN/Properties/Resources.Designer.cs +++ b/v2rayN/v2rayN/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace v2rayN.Properties { // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen // (以 /str 作为命令选项),或重新生成 VS 项目。 - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -100,16 +100,6 @@ namespace v2rayN.Properties { } } - /// - /// 查找 System.Byte[] 类型的本地化资源。 - /// - internal static byte[] libs { - get { - object obj = ResourceManager.GetObject("libs", resourceCulture); - return ((byte[])(obj)); - } - } - /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// diff --git a/v2rayN/v2rayN/Properties/Resources.resx b/v2rayN/v2rayN/Properties/Resources.resx index cd38282a..38dc1d7e 100644 --- a/v2rayN/v2rayN/Properties/Resources.resx +++ b/v2rayN/v2rayN/Properties/Resources.resx @@ -130,9 +130,6 @@ ..\resources\help.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\lib\libs.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\Resources\minimize.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/v2rayN/v2rayN/packages.config b/v2rayN/v2rayN/packages.config deleted file mode 100644 index 7e993a0a..00000000 --- a/v2rayN/v2rayN/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/v2rayN/v2rayN/v2rayN.csproj b/v2rayN/v2rayN/v2rayN.csproj index ff7e5c38..514779ff 100644 --- a/v2rayN/v2rayN/v2rayN.csproj +++ b/v2rayN/v2rayN/v2rayN.csproj @@ -1,6 +1,5 @@  - Debug @@ -45,7 +44,7 @@ AnyCPU - pdbonly + none true bin\Release\ TRACE @@ -74,33 +73,14 @@ + + v2rayN.Program + + + true + - - False - LIB\Google.Protobuf.dll - False - - - False - LIB\Grpc.Core.dll - False - - - False - LIB\Grpc.Core.Api.dll - False - - - False - LIB\Newtonsoft.Json.dll - False - - - False - LIB\System.Buffers.dll - False - @@ -109,32 +89,12 @@ - - False - LIB\System.Memory.dll - False - - - False - LIB\System.Runtime.CompilerServices.Unsafe.dll - False - - - False - LIB\zxing.dll - False - - - False - LIB\zxing.presentation.dll - False - @@ -332,8 +292,6 @@ Designer - - SettingsSingleFileGenerator Settings.Designer.cs @@ -416,36 +374,37 @@ - - - - - - - - - - - - + + + 3.11.4 + + + 2.27.0 + + + 2.27.0 + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + 12.0.3 + + + 0.16.5 + + - - + copy /y $(SolutionDir)v2rayUpgrade\$(OutDir)* $(TargetDir) + +del $(TargetDir)*.xml $(TargetDir)*.so $(TargetDir)*.dylib +if not "$(ConfigurationName)" == "Debug" del $(TargetDir)*.pdb - - - 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 - - - - -