diff --git a/.github/issue_template.md b/.github/issue_template.md index b538ab52..79efbbc9 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -1,4 +1,4 @@ -在提出问题前请先自行排除服务器端问题,同时也请通过搜索确认是否有人提出过相同问题。 +在提出问题前请先自行排除服务器端问题和升级到最新客户端,同时也请通过搜索确认是否有人提出过相同问题。 ### 预期行为 描述你认为应该发生什么 @@ -19,7 +19,7 @@ ``` -### 环境信息 +### 环境信息(客户端请升级至最新正式版) ### 额外信息(可选) diff --git a/.gitignore b/.gitignore index b416e378..b5d8031c 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,7 @@ .vs/ProjectSettings.json .vs/slnx.sqlite .vs/VSWorkspaceState.json +/v2rayN/v2rayUpgrade/bin/Debug +/v2rayN/v2rayUpgrade/obj/Debug +/v2rayN/v2rayUpgrade/bin/Release +/v2rayN/v2rayUpgrade/obj/Release \ No newline at end of file diff --git a/v2rayN/v2rayN.sln b/v2rayN/v2rayN.sln index 02f175e5..0b906d27 100644 --- a/v2rayN/v2rayN.sln +++ b/v2rayN/v2rayN.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.28010.2050 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "v2rayN", "v2rayN\v2rayN.csproj", "{0A9785E6-D256-4B73-9757-4EF59955FD1E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "v2rayUpgrade", "v2rayUpgrade\v2rayUpgrade.csproj", "{F82BE52A-155C-492C-9E0A-1E917EC62C78}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -20,6 +22,14 @@ Global {0A9785E6-D256-4B73-9757-4EF59955FD1E}.Release|Any CPU.ActiveCfg = Release|Any CPU {0A9785E6-D256-4B73-9757-4EF59955FD1E}.Release|Any CPU.Build.0 = Release|Any CPU {0A9785E6-D256-4B73-9757-4EF59955FD1E}.Release|x86.ActiveCfg = Release|Any CPU + {F82BE52A-155C-492C-9E0A-1E917EC62C78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F82BE52A-155C-492C-9E0A-1E917EC62C78}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F82BE52A-155C-492C-9E0A-1E917EC62C78}.Debug|x86.ActiveCfg = Debug|Any CPU + {F82BE52A-155C-492C-9E0A-1E917EC62C78}.Debug|x86.Build.0 = Debug|Any CPU + {F82BE52A-155C-492C-9E0A-1E917EC62C78}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F82BE52A-155C-492C-9E0A-1E917EC62C78}.Release|Any CPU.Build.0 = Release|Any CPU + {F82BE52A-155C-492C-9E0A-1E917EC62C78}.Release|x86.ActiveCfg = Release|Any CPU + {F82BE52A-155C-492C-9E0A-1E917EC62C78}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/v2rayN/v2rayN/Forms/MainForm.Designer.cs b/v2rayN/v2rayN/Forms/MainForm.Designer.cs index 13ce7b39..dd2ce2b2 100644 --- a/v2rayN/v2rayN/Forms/MainForm.Designer.cs +++ b/v2rayN/v2rayN/Forms/MainForm.Designer.cs @@ -117,6 +117,7 @@ this.tsbPromotion = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); this.tsbClose = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -659,6 +660,7 @@ this.tsbCheckUpdateN, this.tsbCheckUpdateCore, this.tsbCheckUpdatePACList, + this.toolStripSeparator13, this.tsbCheckClearPACList}); this.tsbCheckUpdate.Image = global::v2rayN.Properties.Resources.checkupdate; resources.ApplyResources(this.tsbCheckUpdate, "tsbCheckUpdate"); @@ -746,6 +748,11 @@ this.tsbClose.Name = "tsbClose"; this.tsbClose.Click += new System.EventHandler(this.tsbClose_Click); // + // toolStripSeparator13 + // + this.toolStripSeparator13.Name = "toolStripSeparator13"; + resources.ApplyResources(this.toolStripSeparator13, "toolStripSeparator13"); + // // MainForm // resources.ApplyResources(this, "$this"); @@ -869,6 +876,7 @@ private System.Windows.Forms.ToolStripMenuItem menuTcpingServer; private System.Windows.Forms.ToolStripMenuItem menuRealPingServer; private System.Windows.Forms.ToolStripMenuItem menuNotEnabledHttp; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator13; } } diff --git a/v2rayN/v2rayN/Forms/MainForm.cs b/v2rayN/v2rayN/Forms/MainForm.cs index bef32c86..8ab48a1d 100644 --- a/v2rayN/v2rayN/Forms/MainForm.cs +++ b/v2rayN/v2rayN/Forms/MainForm.cs @@ -9,14 +9,16 @@ using v2rayN.Handler; using v2rayN.HttpProxyHandler; using v2rayN.Mode; using v2rayN.Base; +using v2rayN.Tool; +using System.Diagnostics; +using v2rayN.Properties; +using Newtonsoft.Json; namespace v2rayN.Forms { public partial class MainForm : BaseForm { private V2rayHandler v2rayHandler; - private PACListHandle pacListHandle; - private DownloadHandle downloadHandle; private List lvSelecteds = new List(); private StatisticsHandler statistics = null; @@ -29,11 +31,10 @@ namespace v2rayN.Forms this.WindowState = FormWindowState.Minimized; HideForm(); this.Text = Utils.GetVersion(); + Global.processJob = new Job(); Application.ApplicationExit += (sender, args) => { - Utils.ClearTempPath(); - v2rayHandler.V2rayStop(); HttpProxyHandle.CloseHttpAgent(config); @@ -362,6 +363,8 @@ namespace v2rayN.Forms /// private void LoadV2ray() { + tsbReload.Enabled = false; + if (Global.reloadV2ray) { ClearMsg(); @@ -372,6 +375,8 @@ namespace v2rayN.Forms statistics?.SaveToFile(); ChangePACButtonStatus(config.listenerType); + + tsbReload.Enabled = true; } /// @@ -885,9 +890,9 @@ namespace v2rayN.Forms ClearMsg(); } this.txtMsgBox.AppendText(msg); - if (!msg.EndsWith("\r\n")) + if (!msg.EndsWith(Environment.NewLine)) { - this.txtMsgBox.AppendText("\r\n"); + this.txtMsgBox.AppendText(Environment.NewLine); } } @@ -965,9 +970,9 @@ namespace v2rayN.Forms } private void ClearTestResult() { - for (int k = 0; k < config.vmess.Count; k++) + for (int k = 0; k < lvSelecteds.Count; k++) { - SetTestResult(k, ""); + SetTestResult(lvSelecteds[k], ""); } } private void UpdateSpeedtestHandler(int index, string msg) @@ -1132,11 +1137,74 @@ namespace v2rayN.Forms private void tsbCheckUpdateN_Click(object sender, EventArgs e) { - System.Diagnostics.Process.Start(Global.UpdateUrl); + //System.Diagnostics.Process.Start(Global.UpdateUrl); + DownloadHandle downloadHandle = null; + if (downloadHandle == null) + { + downloadHandle = new DownloadHandle(); + downloadHandle.AbsoluteCompleted += (sender2, args) => + { + if (args.Success) + { + AppendText(false, UIRes.I18N("MsgParsingV2rayCoreSuccessfully")); + + string url = args.Msg; + this.Invoke((MethodInvoker)(delegate + { + + if (UI.ShowYesNo(string.Format(UIRes.I18N("DownloadYesNo"), url)) == DialogResult.No) + { + return; + } + else + { + downloadHandle.DownloadFileAsync(config, url, null, -1); + } + })); + } + else + { + AppendText(false, args.Msg); + } + }; + downloadHandle.UpdateCompleted += (sender2, args) => + { + if (args.Success) + { + AppendText(false, UIRes.I18N("MsgDownloadV2rayCoreSuccessfully")); + + try + { + var fileName = Utils.GetPath(downloadHandle.DownloadFileName); + var process = Process.Start("v2rayUpgrade.exe", fileName); + if (process.Id > 0) + { + menuExit_Click(null, null); + } + } + catch (Exception ex) + { + AppendText(false, ex.Message); + } + } + else + { + AppendText(false, args.Msg); + } + }; + downloadHandle.Error += (sender2, args) => + { + AppendText(true, args.GetException().Message); + }; + } + + AppendText(false, UIRes.I18N("MsgStartUpdatingV2rayCore")); + downloadHandle.AbsoluteV2rayN(config); } private void tsbCheckUpdateCore_Click(object sender, EventArgs e) { + DownloadHandle downloadHandle = null; if (downloadHandle == null) { downloadHandle = new DownloadHandle(); @@ -1178,15 +1246,8 @@ namespace v2rayN.Forms string fileName = downloadHandle.DownloadFileName; fileName = Utils.GetPath(fileName); - using (ZipArchive archive = ZipFile.OpenRead(fileName)) - { - foreach (ZipArchiveEntry entry in archive.Entries) - { - if (entry.Length == 0) - continue; - entry.ExtractToFile(Utils.GetPath(entry.Name), true); - } - } + FileManager.ZipExtractToFile(fileName); + AppendText(false, UIRes.I18N("MsgUpdateV2rayCoreSuccessfullyMore")); Global.reloadV2ray = true; @@ -1216,13 +1277,21 @@ namespace v2rayN.Forms private void tsbCheckUpdatePACList_Click(object sender, EventArgs e) { + DownloadHandle pacListHandle = null; if (pacListHandle == null) { - pacListHandle = new PACListHandle(); + pacListHandle = new DownloadHandle(); pacListHandle.UpdateCompleted += (sender2, args) => { if (args.Success) { + var result = args.Msg; + if (Utils.IsNullOrEmpty(result)) + { + return; + } + pacListHandle.GenPacFile(result); + AppendText(false, UIRes.I18N("MsgPACUpdateSuccessfully")); } else @@ -1236,7 +1305,7 @@ namespace v2rayN.Forms }; } AppendText(false, UIRes.I18N("MsgStartUpdatingPAC")); - pacListHandle.UpdatePACFromGFWList(config); + pacListHandle.WebDownloadString(config.urlGFWList); } private void tsbCheckClearPACList_Click(object sender, EventArgs e) @@ -1369,8 +1438,6 @@ namespace v2rayN.Forms downloadHandle3.WebDownloadString(url); AppendText(false, $"{hashCode}{UIRes.I18N("MsgStartGettingSubscriptions")}"); } - - } #endregion diff --git a/v2rayN/v2rayN/Forms/MainForm.resx b/v2rayN/v2rayN/Forms/MainForm.resx index 0045a460..cde6dfff 100644 --- a/v2rayN/v2rayN/Forms/MainForm.resx +++ b/v2rayN/v2rayN/Forms/MainForm.resx @@ -422,6 +422,27 @@ NoControl + + 265, 142 + + + cmsMain + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + v2rayN + + + True + + + 264, 22 + + + Http proxy + 547, 22 @@ -452,12 +473,6 @@ Only open PAC, do not automatically configure PAC - - 264, 22 - - - Http proxy - 264, 22 @@ -491,21 +506,6 @@ Exit - - 265, 142 - - - cmsMain - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - v2rayN - - - True - 498, 17 @@ -536,6 +536,60 @@ 2 + + 228, 18 + + + txtMsgBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox2 + + + 0 + + + ssMain + + + System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox2 + + + 1 + + + Bottom + + + 0, 417 + + + 952, 176 + + + 4 + + + Information + + + groupBox2 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + Fill @@ -572,6 +626,30 @@ 228, 18 + + 3, 151 + + + 946, 22 + + + 7 + + + statusStrip1 + + + ssMain + + + System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox2 + + + 1 + 微软雅黑, 8pt @@ -647,57 +725,6 @@ 0, 17 - - 3, 151 - - - 946, 22 - - - 7 - - - statusStrip1 - - - ssMain - - - System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 1 - - - Bottom - - - 0, 417 - - - 952, 176 - - - 4 - - - Information - - - groupBox2 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - Top @@ -728,18 +755,6 @@ 6, 56 - - 197, 22 - - - Subscription settings - - - 197, 22 - - - Update subscription - Magenta @@ -817,6 +832,9 @@ Check for updated PAC (requires Http proxy) + + 335, 6 + 338, 22 @@ -838,27 +856,6 @@ 6, 56 - - 187, 22 - - - About - - - 184, 6 - - - 187, 22 - - - Language-[English] - - - 187, 22 - - - 语言-[中文简体] - Magenta @@ -926,6 +923,39 @@ 5 + + 197, 22 + + + Subscription settings + + + 197, 22 + + + Update subscription + + + 187, 22 + + + About + + + 184, 6 + + + 187, 22 + + + Language-[English] + + + 187, 22 + + + 语言-[中文简体] + True @@ -1400,6 +1430,12 @@ System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + toolStripSeparator13 + + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + MainForm diff --git a/v2rayN/v2rayN/Forms/MainForm.zh-Hans.resx b/v2rayN/v2rayN/Forms/MainForm.zh-Hans.resx index d9fdbce0..1659d54e 100644 --- a/v2rayN/v2rayN/Forms/MainForm.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/MainForm.zh-Hans.resx @@ -432,7 +432,7 @@ 232, 22 - 检查更新PAC (需要Http代理) + 检查更新PAC 232, 22 diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs b/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs index 57488adc..5e00b7e5 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs @@ -91,6 +91,10 @@ this.txturlGFWList = new System.Windows.Forms.TextBox(); this.label13 = new System.Windows.Forms.Label(); this.chkAutoRun = new System.Windows.Forms.CheckBox(); + this.tabPage9 = new System.Windows.Forms.TabPage(); + this.txtuserPacRule = new System.Windows.Forms.TextBox(); + this.panel4 = new System.Windows.Forms.Panel(); + this.label4 = new System.Windows.Forms.Label(); this.panel2 = new System.Windows.Forms.Panel(); this.btnOK = new System.Windows.Forms.Button(); this.panel1 = new System.Windows.Forms.Panel(); @@ -107,6 +111,8 @@ this.panel3.SuspendLayout(); this.tabPage6.SuspendLayout(); this.tabPage7.SuspendLayout(); + this.tabPage9.SuspendLayout(); + this.panel4.SuspendLayout(); this.panel2.SuspendLayout(); this.SuspendLayout(); // @@ -124,6 +130,7 @@ 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; @@ -551,6 +558,31 @@ this.chkAutoRun.Name = "chkAutoRun"; this.chkAutoRun.UseVisualStyleBackColor = true; // + // tabPage9 + // + this.tabPage9.Controls.Add(this.txtuserPacRule); + this.tabPage9.Controls.Add(this.panel4); + resources.ApplyResources(this.tabPage9, "tabPage9"); + this.tabPage9.Name = "tabPage9"; + this.tabPage9.UseVisualStyleBackColor = true; + // + // txtuserPacRule + // + resources.ApplyResources(this.txtuserPacRule, "txtuserPacRule"); + this.txtuserPacRule.Name = "txtuserPacRule"; + // + // panel4 + // + this.panel4.Controls.Add(this.label4); + resources.ApplyResources(this.panel4, "panel4"); + this.panel4.Name = "panel4"; + // + // label4 + // + this.label4.ForeColor = System.Drawing.Color.Brown; + resources.ApplyResources(this.label4, "label4"); + this.label4.Name = "label4"; + // // panel2 // this.panel2.Controls.Add(this.btnClose); @@ -601,6 +633,9 @@ this.tabPage6.PerformLayout(); this.tabPage7.ResumeLayout(false); this.tabPage7.PerformLayout(); + this.tabPage9.ResumeLayout(false); + this.tabPage9.PerformLayout(); + this.panel4.ResumeLayout(false); this.panel2.ResumeLayout(false); this.ResumeLayout(false); @@ -673,5 +708,9 @@ private System.Windows.Forms.Label label16; private System.Windows.Forms.ComboBox cmblistenerType; private System.Windows.Forms.TabPage tabPage8; + private System.Windows.Forms.TabPage tabPage9; + private System.Windows.Forms.TextBox txtuserPacRule; + private System.Windows.Forms.Panel panel4; + private System.Windows.Forms.Label label4; } } \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.cs b/v2rayN/v2rayN/Forms/OptionSettingForm.cs index cefc211a..890041ab 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.cs +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.cs @@ -22,6 +22,8 @@ namespace v2rayN.Forms InitKCP(); InitGUI(); + + InitUserPAC(); } /// @@ -142,6 +144,11 @@ namespace v2rayN.Forms } + private void InitUserPAC() + { + txtuserPacRule.Text = Utils.List2String(config.userPacRule, true); + } + private void btnOK_Click(object sender, EventArgs e) { if (SaveBase() != 0) @@ -164,6 +171,11 @@ namespace v2rayN.Forms return; } + if (SaveUserPAC() != 0) + { + return; + } + if (ConfigHandler.SaveConfig(ref config) == 0) { this.DialogResult = DialogResult.OK; @@ -250,7 +262,7 @@ namespace v2rayN.Forms //remoteDNS config.remoteDNS = txtremoteDNS.Text.TrimEx(); - + config.listenerType = cmblistenerType.SelectedIndex; return 0; } @@ -344,6 +356,15 @@ namespace v2rayN.Forms return 0; } + private int SaveUserPAC() + { + string userPacRule = txtuserPacRule.Text.TrimEx(); + userPacRule = userPacRule.Replace("\"", ""); + + config.userPacRule = Utils.String2List(userPacRule); + + return 0; + } private void btnClose_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Cancel; diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.resx b/v2rayN/v2rayN/Forms/OptionSettingForm.resx index e2c26e28..d6938a98 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.resx +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.resx @@ -276,8 +276,11 @@ 33, 228 + + True + - 402, 21 + 555, 100 30 @@ -1665,8 +1668,11 @@ 32, 205 + + True + - 544, 21 + 541, 100 28 @@ -1764,6 +1770,117 @@ 3 + + Fill + + + 3, 40 + + + 0 + + + True + + + Vertical + + + 648, 536 + + + 21 + + + txtuserPacRule + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage9 + + + 0 + + + NoControl + + + 5, 11 + + + 598, 16 + + + 13 + + + *Set user pac rules, separated by commas (,) + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel4 + + + 0 + + + Top + + + 3, 3 + + + 648, 37 + + + 20 + + + panel4 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage9 + + + 1 + + + 4, 22 + + + 3, 3, 3, 3 + + + 654, 579 + + + 4 + + + User PAC settings + + + tabPage9 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControl1 + + + 4 + Fill diff --git a/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx b/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx index d1502a31..5c60abe0 100644 --- a/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx @@ -120,9 +120,6 @@ 取消(&C) - - Core:基础设置 - 53, 12 @@ -214,14 +211,11 @@ 本地监听端口 - - Core:路由设置 + + Core:基础设置 - - 3, 89 - - - 642, 481 + + 628, 449 634, 455 @@ -229,7 +223,7 @@ 1.代理的Domain或IP - + 628, 449 @@ -238,7 +232,7 @@ 2.直连的Domain或IP - + 628, 449 @@ -247,15 +241,6 @@ 3.阻止的Domain或IP - - 628, 449 - - - 634, 455 - - - 4.预定义规则 - 全局 @@ -274,8 +259,17 @@ 244, 20 - - 642, 72 + + 634, 455 + + + 4.预定义规则 + + + 3, 89 + + + 642, 481 @@ -315,24 +309,21 @@ 域名策略 + + 642, 72 + + + Core:路由设置 + Core:KCP设置 - - v2rayN设置 - 77, 12 统计刷新频率 - - 305, 12 - - - 缓存天数(0-30, 0关闭缓存单独每天的数据使用情况) - 384, 16 @@ -357,6 +348,15 @@ 开机自动启动(可能会不成功) + + v2rayN设置 + + + *设置用户PAC规则,用逗号(,)隔开 + + + 用户PAC设置 + 确定(&O) diff --git a/v2rayN/v2rayN/Global.cs b/v2rayN/v2rayN/Global.cs index 929d7624..f64cef38 100644 --- a/v2rayN/v2rayN/Global.cs +++ b/v2rayN/v2rayN/Global.cs @@ -26,7 +26,7 @@ namespace v2rayN /// /// PromotionUrl /// - public const string PromotionUrl = @"aHR0cHM6Ly8xLjIzNDQ1Ni54eXovYWRzLmh0bWw="; + public const string PromotionUrl = @"aHR0cHM6Ly8xLjIzNDQ1Ni54eXovYWJjLmh0bWw="; /// /// 本软件配置文件名 @@ -162,6 +162,8 @@ namespace v2rayN } public const string StatisticLogOverall = "StatisticLogOverall.json"; + public const string IEProxyExceptions = "localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*"; + #endregion #region 全局变量 @@ -214,6 +216,11 @@ namespace v2rayN get; set; } + public static Job processJob + { + get; set; + } + #endregion diff --git a/v2rayN/v2rayN/Handler/ConfigHandler.cs b/v2rayN/v2rayN/Handler/ConfigHandler.cs index 0437efcf..3db74a47 100644 --- a/v2rayN/v2rayN/Handler/ConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/ConfigHandler.cs @@ -131,6 +131,10 @@ namespace v2rayN.Handler { config.subItem = new List(); } + if (config.userPacRule == null) + { + config.userPacRule = new List(); + } if (config == null || config.index < 0 diff --git a/v2rayN/v2rayN/Handler/DownloadHandle.cs b/v2rayN/v2rayN/Handler/DownloadHandle.cs index 68f5d9db..cfbc9ab8 100644 --- a/v2rayN/v2rayN/Handler/DownloadHandle.cs +++ b/v2rayN/v2rayN/Handler/DownloadHandle.cs @@ -1,8 +1,13 @@ -using System; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Net; +using System.Text; using v2rayN.Base; using v2rayN.Mode; +using v2rayN.Properties; namespace v2rayN.Handler { @@ -37,17 +42,70 @@ namespace v2rayN.Handler } } - private string latestUrl = "https://github.com/v2ray/v2ray-core/releases/latest"; - private const string coreURL = "https://github.com/v2ray/v2ray-core/releases/download/{0}/v2ray-windows-{1}.zip"; private int progressPercentage = -1; private long totalBytesToReceive = 0; private DateTime totalDatetime = new DateTime(); private int DownloadTimeout = -1; + + + #region v2rayN + + private string nLatestUrl = "https://github.com/2dust/v2rayN/releases/latest"; + private const string nUrl = "https://github.com/2dust/v2rayN/releases/download/{0}/v2rayN.zip"; + + public void AbsoluteV2rayN(Config config) + { + Utils.SetSecurityProtocol(); + WebRequest request = WebRequest.Create(nLatestUrl); + request.BeginGetResponse(new AsyncCallback(OnResponseV2rayN), request); + } + + private void OnResponseV2rayN(IAsyncResult ar) + { + try + { + HttpWebRequest request = (HttpWebRequest)ar.AsyncState; + HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(ar); + string redirectUrl = response.ResponseUri.AbsoluteUri; + string version = redirectUrl.Substring(redirectUrl.LastIndexOf("/", StringComparison.Ordinal) + 1); + + var curVersion = FileVersionInfo.GetVersionInfo(Utils.GetExePath()).FileVersion.ToString(); + if (curVersion == version) + { + if (AbsoluteCompleted != null) + { + AbsoluteCompleted(this, new ResultEventArgs(false, "Already the latest version")); + } + return; + } + + string url = string.Format(nUrl, version); + if (AbsoluteCompleted != null) + { + AbsoluteCompleted(this, new ResultEventArgs(true, url)); + } + } + catch (Exception ex) + { + Utils.SaveLog(ex.Message, ex); + + if (Error != null) + Error(this, new ErrorEventArgs(ex)); + } + } + + #endregion + + #region Core + + private string coreLatestUrl = "https://github.com/v2ray/v2ray-core/releases/latest"; + private const string coreUrl = "https://github.com/v2ray/v2ray-core/releases/download/{0}/v2ray-windows-{1}.zip"; + public void AbsoluteV2rayCore(Config config) { - SetSecurityProtocol(); - WebRequest request = WebRequest.Create(latestUrl); + Utils.SetSecurityProtocol(); + WebRequest request = WebRequest.Create(coreLatestUrl); request.BeginGetResponse(new AsyncCallback(OnResponseV2rayCore), request); } @@ -69,7 +127,7 @@ namespace v2rayN.Handler { osBit = "32"; } - string url = string.Format(coreURL, version, osBit); + string url = string.Format(coreUrl, version, osBit); if (AbsoluteCompleted != null) { AbsoluteCompleted(this, new ResultEventArgs(true, url)); @@ -84,12 +142,15 @@ namespace v2rayN.Handler } } + #endregion + + #region Download public void DownloadFileAsync(Config config, string url, WebProxy webProxy, int downloadTimeout) { try { - SetSecurityProtocol(); + Utils.SetSecurityProtocol(); if (UpdateCompleted != null) { UpdateCompleted(this, new ResultEventArgs(false, "Downloading...")); @@ -107,7 +168,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(DownloadFileName)); } catch (Exception ex) { @@ -193,7 +254,7 @@ namespace v2rayN.Handler string source = string.Empty; try { - SetSecurityProtocol(); + Utils.SetSecurityProtocol(); WebClientEx ws = new WebClientEx(); ws.DownloadStringCompleted += Ws_DownloadStringCompleted; @@ -232,13 +293,47 @@ namespace v2rayN.Handler } } - private void SetSecurityProtocol() + #endregion + + #region PAC + + public string GenPacFile(string result) { - ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 - | SecurityProtocolType.Tls - | SecurityProtocolType.Tls11 - | SecurityProtocolType.Tls12; - ServicePointManager.DefaultConnectionLimit = 256; + try + { + File.WriteAllText(Utils.GetTempPath("gfwlist.txt"), result, Encoding.UTF8); + List lines = ParsePacResult(result); + string abpContent = Utils.UnGzip(Resources.abp_js); + abpContent = abpContent.Replace("__RULES__", JsonConvert.SerializeObject(lines, Formatting.Indented)); + File.WriteAllText(Utils.GetPath(Global.pacFILE), abpContent, Encoding.UTF8); + } + catch (Exception ex) + { + Utils.SaveLog(ex.Message, ex); + return ex.Message; + } + return string.Empty; } + + private List ParsePacResult(string response) + { + IEnumerable IgnoredLineBegins = new[] { '!', '[' }; + + byte[] bytes = Convert.FromBase64String(response); + string content = Encoding.UTF8.GetString(bytes); + List valid_lines = new List(); + using (var sr = new StringReader(content)) + { + foreach (var line in sr.NonWhiteSpaceLines()) + { + if (line.BeginWithAny(IgnoredLineBegins)) + continue; + valid_lines.Add(line); + } + } + return valid_lines; + } + + #endregion } } diff --git a/v2rayN/v2rayN/Handler/ProxySetting.cs b/v2rayN/v2rayN/Handler/ProxySetting.cs deleted file mode 100644 index ec43bce1..00000000 --- a/v2rayN/v2rayN/Handler/ProxySetting.cs +++ /dev/null @@ -1,190 +0,0 @@ -using System; -using Microsoft.Win32; -using System.Runtime.InteropServices; - -namespace v2rayN.Handler -{ - /// - /// 设置系统代理类 - /// - class ProxySetting - { - public static bool UnsetProxy() - { - return SetProxy(null, null); - } - public static bool SetProxy(string strProxy) - { - return SetProxy(strProxy, null); - } - - public static bool SetProxy(string strProxy, string exceptions) - { - InternetPerConnOptionList list = new InternetPerConnOptionList(); - - int optionCount = string.IsNullOrEmpty(strProxy) ? 1 : (string.IsNullOrEmpty(exceptions) ? 2 : 3); - InternetConnectionOption[] options = new InternetConnectionOption[optionCount]; - // USE a proxy server ... - options[0].m_Option = PerConnOption.INTERNET_PER_CONN_FLAGS; - options[0].m_Value.m_Int = (int)((optionCount < 2) ? PerConnFlags.PROXY_TYPE_DIRECT : (PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_PROXY)); - // use THIS proxy server - if (optionCount > 1) - { - options[1].m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_SERVER; - options[1].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(strProxy); - // except for these addresses ... - if (optionCount > 2) - { - options[2].m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_BYPASS; - options[2].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(exceptions); - } - } - - // default stuff - list.dwSize = Marshal.SizeOf(list); - list.szConnection = IntPtr.Zero; - list.dwOptionCount = options.Length; - list.dwOptionError = 0; - - - int optSize = Marshal.SizeOf(typeof(InternetConnectionOption)); - // make a pointer out of all that ... - IntPtr optionsPtr = Marshal.AllocCoTaskMem(optSize * options.Length); - // copy the array over into that spot in memory ... - for (int i = 0; i < options.Length; ++i) - { - IntPtr opt = new IntPtr(optionsPtr.ToInt32() + (i * optSize)); - Marshal.StructureToPtr(options[i], opt, false); - } - - list.options = optionsPtr; - - // and then make a pointer out of the whole list - IntPtr ipcoListPtr = Marshal.AllocCoTaskMem((Int32)list.dwSize); - Marshal.StructureToPtr(list, ipcoListPtr, false); - - // and finally, call the API method! - int returnvalue = NativeMethods.InternetSetOption(IntPtr.Zero, - InternetOption.INTERNET_OPTION_PER_CONNECTION_OPTION, - ipcoListPtr, list.dwSize) ? -1 : 0; - if (returnvalue == 0) - { // get the error codes, they might be helpful - returnvalue = Marshal.GetLastWin32Error(); - } - // FREE the data ASAP - Marshal.FreeCoTaskMem(optionsPtr); - Marshal.FreeCoTaskMem(ipcoListPtr); - if (returnvalue > 0) - { // throw the error codes, they might be helpful - //throw new Win32Exception(Marshal.GetLastWin32Error()); - } - - return (returnvalue < 0); - } - - - #region WinInet structures - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] - public struct InternetPerConnOptionList - { - public int dwSize; // size of the INTERNET_PER_CONN_OPTION_LIST struct - public IntPtr szConnection; // connection name to set/query options - public int dwOptionCount; // number of options to set/query - public int dwOptionError; // on error, which option failed - //[MarshalAs(UnmanagedType.)] - public IntPtr options; - }; - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] - public struct InternetConnectionOption - { - static readonly int Size; - public PerConnOption m_Option; - public InternetConnectionOptionValue m_Value; - static InternetConnectionOption() - { - InternetConnectionOption.Size = Marshal.SizeOf(typeof(InternetConnectionOption)); - } - - // Nested Types - [StructLayout(LayoutKind.Explicit)] - public struct InternetConnectionOptionValue - { - // Fields - [FieldOffset(0)] - public System.Runtime.InteropServices.ComTypes.FILETIME m_FileTime; - [FieldOffset(0)] - public int m_Int; - [FieldOffset(0)] - public IntPtr m_StringPtr; - } - } - #endregion - - #region WinInet enums - // - // options manifests for Internet{Query|Set}Option - // - public enum InternetOption : uint - { - INTERNET_OPTION_PER_CONNECTION_OPTION = 75 - } - - // - // Options used in INTERNET_PER_CONN_OPTON struct - // - public enum PerConnOption - { - INTERNET_PER_CONN_FLAGS = 1, // Sets or retrieves the connection type. The Value member will contain one or more of the values from PerConnFlags - INTERNET_PER_CONN_PROXY_SERVER = 2, // Sets or retrieves a string containing the proxy servers. - INTERNET_PER_CONN_PROXY_BYPASS = 3, // Sets or retrieves a string containing the URLs that do not use the proxy server. - INTERNET_PER_CONN_AUTOCONFIG_URL = 4//, // Sets or retrieves a string containing the URL to the automatic configuration script. - - } - - // - // PER_CONN_FLAGS - // - [Flags] - public enum PerConnFlags - { - PROXY_TYPE_DIRECT = 0x00000001, // direct to net - PROXY_TYPE_PROXY = 0x00000002, // via named proxy - PROXY_TYPE_AUTO_PROXY_URL = 0x00000004, // autoproxy URL - PROXY_TYPE_AUTO_DETECT = 0x00000008 // use autoproxy detection - } - #endregion - - internal static class NativeMethods - { - [DllImport("WinInet.dll", SetLastError = true, CharSet = CharSet.Auto)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool InternetSetOption(IntPtr hInternet, InternetOption dwOption, IntPtr lpBuffer, int dwBufferLength); - } - - //判断是否使用代理 - public static bool UsedProxy() - { - RegistryKey rk = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", true); - if (rk.GetValue("ProxyEnable").ToString() == "1") - { - rk.Close(); - return true; - } - else - { - rk.Close(); - return false; - } - } - //获得代理的IP和端口 - public static string GetProxyProxyServer() - { - RegistryKey rk = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", true); - string ProxyServer = rk.GetValue("ProxyServer").ToString(); - rk.Close(); - return ProxyServer; - - } - } -} diff --git a/v2rayN/v2rayN/Handler/RoutingRuleHandler.cs b/v2rayN/v2rayN/Handler/RoutingRuleHandler.cs deleted file mode 100644 index 57d4f564..00000000 --- a/v2rayN/v2rayN/Handler/RoutingRuleHandler.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Collections.Generic; -using System.Text.RegularExpressions; - -namespace v2rayN.Handler -{ - /// - /// 路由规则文件处理类 - /// - class RoutingRuleHandler - { - /// - /// Parse Pac to v2ray rule - /// - /// - /// - public static List ParsePac(string filePath) - { - string result = Utils.LoadResource(filePath); - if (Utils.IsNullOrEmpty(result)) - { - return null; - } - - //取得rule - string pattern = @"(?is)(?<=\[)(.*)(?=\])"; - Regex rgx = new Regex(pattern); - result = rgx.Match(result).Value; - int index = result.IndexOf("];"); - result = result.Substring(0, index); - if (Utils.IsNullOrEmpty(result)) - { - return null; - } - - string[] arrPac = result.Split(','); - List lstPac = new List(); - foreach (string str in arrPac) - { - //处理有效值 - if (Utils.IsNullOrEmpty(str) - || str.Length <= 3) - { - continue; - } - string value = str.Replace("\",", "").Replace("\"", "").Replace(",", "").Replace("\r\n", "").Replace(" ", ""); - lstPac.Add(value); - } - - return lstPac; - } - - } -} diff --git a/v2rayN/v2rayN/Handler/SpeedtestHandler.cs b/v2rayN/v2rayN/Handler/SpeedtestHandler.cs index cc157e52..295650b0 100644 --- a/v2rayN/v2rayN/Handler/SpeedtestHandler.cs +++ b/v2rayN/v2rayN/Handler/SpeedtestHandler.cs @@ -182,6 +182,7 @@ namespace v2rayN.Handler } } + private void RunSpeedTest() { if (_config.vmess.Count <= 0) @@ -244,7 +245,7 @@ namespace v2rayN.Handler testCounter++; var webProxy = new WebProxy(Global.Loopback, httpPort + index); - downloadHandle2.DownloadFileAsync(_config, url, webProxy, 30); + downloadHandle2.DownloadFileAsync(_config, url, webProxy, 20); return 0; } diff --git a/v2rayN/v2rayN/Handler/StatisticsHandler.cs b/v2rayN/v2rayN/Handler/StatisticsHandler.cs index 1827685a..8d5a3a24 100644 --- a/v2rayN/v2rayN/Handler/StatisticsHandler.cs +++ b/v2rayN/v2rayN/Handler/StatisticsHandler.cs @@ -43,22 +43,22 @@ namespace v2rayN.Handler public StatisticsHandler(Mode.Config config, Action> update) { - try - { - if (Environment.Is64BitOperatingSystem) - { - FileManager.UncompressFile(Utils.GetPath("grpc_csharp_ext.x64.dll"), Resources.grpc_csharp_ext_x64_dll); - } - else - { - FileManager.UncompressFile(Utils.GetPath("grpc_csharp_ext.x86.dll"), Resources.grpc_csharp_ext_x86_dll); - } - } - catch (IOException ex) - { - Utils.SaveLog(ex.Message, ex); + //try + //{ + // if (Environment.Is64BitOperatingSystem) + // { + // FileManager.UncompressFile(Utils.GetPath("grpc_csharp_ext.x64.dll"), Resources.grpc_csharp_ext_x64_dll); + // } + // else + // { + // FileManager.UncompressFile(Utils.GetPath("grpc_csharp_ext.x86.dll"), Resources.grpc_csharp_ext_x86_dll); + // } + //} + //catch (IOException ex) + //{ + // Utils.SaveLog(ex.Message, ex); - } + //} config_ = config; Enable = config.enableStatistics; diff --git a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs index fcf07549..a7b950d8 100644 --- a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs @@ -403,6 +403,8 @@ namespace v2rayN.Handler //远程服务器地址和端口 serversItem.address = config.address(); serversItem.port = config.port(); + serversItem.method = null; + serversItem.password = null; if (!Utils.IsNullOrEmpty(config.security()) && !Utils.IsNullOrEmpty(config.id())) @@ -1396,6 +1398,8 @@ namespace v2rayN.Handler msg = UIRes.I18N("InitialConfiguration"); + Config configCopy = Utils.DeepCopy(config); + string result = Utils.GetEmbedText(SampleClient); if (Utils.IsNullOrEmpty(result)) { @@ -1410,21 +1414,21 @@ namespace v2rayN.Handler return -1; } - log(config, ref v2rayConfig, false); + log(configCopy, ref v2rayConfig, false); //routing(config, ref v2rayConfig); - dns(config, ref v2rayConfig); + dns(configCopy, ref v2rayConfig); - var httpPort = config.GetLocalPort("speedtest"); + var httpPort = configCopy.GetLocalPort("speedtest"); for (int k = 0; k < selecteds.Count; k++) { int index = selecteds[k]; - if (config.vmess[index].configType == (int)EConfigType.Custom) + if (configCopy.vmess[index].configType == (int)EConfigType.Custom) { continue; } - config.index = index; + configCopy.index = index; var inbound = new Inbounds(); inbound.listen = Global.Loopback; @@ -1435,7 +1439,7 @@ namespace v2rayN.Handler var v2rayConfigCopy = Utils.FromJson(result); - outbound(config, ref v2rayConfigCopy); + outbound(configCopy, ref v2rayConfigCopy); v2rayConfigCopy.outbounds[0].tag = Global.agentTag + inbound.port.ToString(); v2rayConfig.outbounds.Add(v2rayConfigCopy.outbounds[0]); @@ -1448,7 +1452,7 @@ namespace v2rayN.Handler Utils.ToJsonFile(v2rayConfig, fileName); - msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary()); + msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), configCopy.getSummary()); } catch (Exception ex) { diff --git a/v2rayN/v2rayN/Handler/V2rayHandler.cs b/v2rayN/v2rayN/Handler/V2rayHandler.cs index a8209775..653efece 100644 --- a/v2rayN/v2rayN/Handler/V2rayHandler.cs +++ b/v2rayN/v2rayN/Handler/V2rayHandler.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Text; using v2rayN.Mode; namespace v2rayN.Handler @@ -22,7 +23,8 @@ namespace v2rayN.Handler private static string v2rayConfigRes = Global.v2rayConfigFileName; private List lstV2ray; public event ProcessDelegate ProcessEvent; - private int processId = 0; + //private int processId = 0; + private Process _process; public V2rayHandler() { @@ -89,27 +91,49 @@ namespace v2rayN.Handler { try { - bool blExist = true; - if (processId > 0) + if (_process != null) { - Process p1 = Process.GetProcessById(processId); - if (p1 != null) - { - p1.Kill(); - blExist = false; - } + KillProcess(_process); + _process.Dispose(); + _process = null; } - if (blExist) + else { foreach (string vName in lstV2ray) { - Process[] killPro = Process.GetProcessesByName(vName); - foreach (Process p in killPro) + Process[] existing = Process.GetProcessesByName(vName); + foreach (Process p in existing) { - p.Kill(); + var path = p.MainModule.FileName; + if (path == $"{Utils.GetPath(vName)}.exe") + { + KillProcess(p); + } } } } + + //bool blExist = true; + //if (processId > 0) + //{ + // Process p1 = Process.GetProcessById(processId); + // if (p1 != null) + // { + // p1.Kill(); + // blExist = false; + // } + //} + //if (blExist) + //{ + // foreach (string vName in lstV2ray) + // { + // Process[] killPro = Process.GetProcessesByName(vName); + // foreach (Process p in killPro) + // { + // p.Kill(); + // } + // } + //} } catch (Exception ex) { @@ -147,9 +171,11 @@ namespace v2rayN.Handler Process p = new Process(); p.StartInfo.FileName = fileName; + p.StartInfo.WorkingDirectory = Utils.StartupPath(); p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.CreateNoWindow = true; + p.StartInfo.StandardOutputEncoding = Encoding.UTF8; p.OutputDataReceived += new DataReceivedEventHandler((sender, e) => { if (!String.IsNullOrEmpty(e.Data)) @@ -160,7 +186,10 @@ namespace v2rayN.Handler }); p.Start(); p.BeginOutputReadLine(); - processId = p.Id; + //processId = p.Id; + _process = p; + + Global.processJob.AddProcess(p.Handle); } catch (Exception ex) { @@ -182,5 +211,23 @@ namespace v2rayN.Handler ProcessEvent(notify, msg); } } + + private void KillProcess(Process p) + { + try + { + p.CloseMainWindow(); + p.WaitForExit(100); + if (!p.HasExited) + { + p.Kill(); + p.WaitForExit(100); + } + } + catch (Exception ex) + { + Utils.SaveLog(ex.Message, ex); + } + } } } diff --git a/v2rayN/v2rayN/HttpProxyHandler/HttpProxyHandle.cs b/v2rayN/v2rayN/HttpProxyHandler/HttpProxyHandle.cs index 716d213e..a2e4e486 100644 --- a/v2rayN/v2rayN/HttpProxyHandler/HttpProxyHandle.cs +++ b/v2rayN/v2rayN/HttpProxyHandler/HttpProxyHandle.cs @@ -6,7 +6,7 @@ namespace v2rayN.HttpProxyHandler /// /// 系统代理(http)总处理 /// 启动privoxy提供http协议 - /// 使用SysProxy设置IE系统代理或者PAC模式 + /// 设置IE系统代理或者PAC模式 /// class HttpProxyHandle { @@ -31,31 +31,31 @@ namespace v2rayN.HttpProxyHandler if (type == 1) { //PACServerHandle.Stop(); - SysProxyHandle.SetIEProxy(true, true, $"{Global.Loopback}:{port}", null); + ProxySetting.SetProxy($"{Global.Loopback}:{port}", Global.IEProxyExceptions, 2); } else if (type == 2) { string pacUrl = GetPacUrl(); - SysProxyHandle.SetIEProxy(true, false, null, pacUrl); + ProxySetting.SetProxy(pacUrl, "", 4); //PACServerHandle.Stop(); PACServerHandle.Init(config); } else if (type == 3) { //PACServerHandle.Stop(); - SysProxyHandle.SetIEProxy(false, false, null, null); + ProxySetting.UnsetProxy(); } else if (type == 4) { string pacUrl = GetPacUrl(); - SysProxyHandle.SetIEProxy(false, false, null, null); + ProxySetting.UnsetProxy(); //PACServerHandle.Stop(); PACServerHandle.Init(config); } } else { - SysProxyHandle.SetIEProxy(false, false, null, null); + ProxySetting.UnsetProxy(); //PACServerHandle.Stop(); } } @@ -77,7 +77,7 @@ namespace v2rayN.HttpProxyHandler int localPort = config.GetLocalPort(Global.InboundSocks); if (localPort > 0) { - PrivoxyHandler.Instance.Start(localPort, config); + PrivoxyHandler.Instance.Restart(localPort, config); if (PrivoxyHandler.Instance.RunningPort > 0) { Global.sysAgent = true; diff --git a/v2rayN/v2rayN/HttpProxyHandler/PACListHandle.cs b/v2rayN/v2rayN/HttpProxyHandler/PACListHandle.cs deleted file mode 100644 index 85a53c14..00000000 --- a/v2rayN/v2rayN/HttpProxyHandler/PACListHandle.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Net; -using System.Text; -using Newtonsoft.Json; -using v2rayN.Base; -using v2rayN.Mode; -using v2rayN.Properties; - -namespace v2rayN.HttpProxyHandler -{ - /// - /// 提供PAC功能支持 - /// - class PACListHandle - { - public event EventHandler UpdateCompleted; - - public event ErrorEventHandler Error; - - public class ResultEventArgs : EventArgs - { - public bool Success; - - public ResultEventArgs(bool success) - { - this.Success = success; - } - } - - - - private static readonly IEnumerable IgnoredLineBegins = new[] { '!', '[' }; - - public void UpdatePACFromGFWList(Config config) - { - string url = Global.GFWLIST_URL; - if (!Utils.IsNullOrEmpty(config.urlGFWList)) - { - url = config.urlGFWList; - } - - //默认用户已开启系统代理 - //var httpProxy = config.inbound.FirstOrDefault(x => x.protocol=="http"); - //if (httpProxy == null) - //{ - // throw new Exception("未发现HTTP代理,无法设置代理更新"); - //} - var http = new WebClientEx(); - //http.Headers.Add("Connection", "Close"); - //http.Proxy = new WebProxy(IPAddress.Loopback.ToString(), httpProxy.localPort); - http.DownloadStringCompleted += http_DownloadStringCompleted; - http.DownloadStringAsync(new Uri(url)); - } - - private void http_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) - { - try - { - File.WriteAllText(Utils.GetTempPath("gfwlist.txt"), e.Result, Encoding.UTF8); - List lines = ParseResult(e.Result); - string abpContent = Utils.UnGzip(Resources.abp_js); - abpContent = abpContent.Replace("__RULES__", JsonConvert.SerializeObject(lines, Formatting.Indented)); - File.WriteAllText(Utils.GetPath(Global.pacFILE), abpContent, Encoding.UTF8); - if (UpdateCompleted != null) UpdateCompleted(this, new ResultEventArgs(true)); - } - catch (Exception ex) - { - Utils.SaveLog(ex.Message, ex); - - if (Error != null) Error(this, new ErrorEventArgs(ex)); - } - } - - public static List ParseResult(string response) - { - byte[] bytes = Convert.FromBase64String(response); - string content = Encoding.UTF8.GetString(bytes); - List valid_lines = new List(); - using (var sr = new StringReader(content)) - { - foreach (var line in sr.NonWhiteSpaceLines()) - { - if (line.BeginWithAny(IgnoredLineBegins)) - continue; - valid_lines.Add(line); - } - } - return valid_lines; - } - } -} diff --git a/v2rayN/v2rayN/HttpProxyHandler/PACServerHandle.cs b/v2rayN/v2rayN/HttpProxyHandler/PACServerHandle.cs index d3902d7f..7b47fc4f 100644 --- a/v2rayN/v2rayN/HttpProxyHandler/PACServerHandle.cs +++ b/v2rayN/v2rayN/HttpProxyHandler/PACServerHandle.cs @@ -17,6 +17,7 @@ namespace v2rayN.HttpProxyHandler private static int pacPort = 0; private static HttpWebServer server; private static HttpWebServerB serverB; + private static Config _config; public static bool IsRunning { @@ -28,6 +29,7 @@ namespace v2rayN.HttpProxyHandler public static void Init(Config config) { + _config = config; Global.pacPort = config.GetLocalPort("pac"); if (InitServer("*")) @@ -161,7 +163,6 @@ namespace v2rayN.HttpProxyHandler //} } - private static string GetPacList(string address) { var port = Global.httpPort; @@ -182,6 +183,18 @@ namespace v2rayN.HttpProxyHandler } var pac = File.ReadAllText(strPacfile, Encoding.UTF8); pac = pac.Replace("__PROXY__", proxy); + + if (_config.userPacRule.Count > 0) + { + var keyWords = "var rules = ["; + if (pac.IndexOf(keyWords) >= 0) + { + var userPac = string.Join($"\",{Environment.NewLine}\"", _config.userPacRule.ToArray()); + userPac = string.Format("\"{0}\",", userPac); + pac = pac.Replace(keyWords, keyWords + userPac); + } + } + return pac; } catch diff --git a/v2rayN/v2rayN/HttpProxyHandler/PrivoxyHandler.cs b/v2rayN/v2rayN/HttpProxyHandler/PrivoxyHandler.cs index baa9fa94..773bad53 100644 --- a/v2rayN/v2rayN/HttpProxyHandler/PrivoxyHandler.cs +++ b/v2rayN/v2rayN/HttpProxyHandler/PrivoxyHandler.cs @@ -22,18 +22,17 @@ namespace v2rayN.HttpProxyHandler private static int _uid; private static string _uniqueConfigFile; - private static Job _privoxyJob; private Process _process; + private static string _privoxyName = "v2ray_privoxy"; static PrivoxyHandler() { try { - _uid = Application.StartupPath.GetHashCode(); // Currently we use ss's StartupPath to identify different Privoxy instance. + _uid = Application.StartupPath.GetHashCode(); _uniqueConfigFile = string.Format("privoxy_{0}.conf", _uid); - _privoxyJob = new Job(); - FileManager.UncompressFile(Utils.GetTempPath("v2ray_privoxy.exe"), Resources.privoxy_exe); + FileManager.UncompressFile(Utils.GetTempPath($"{_privoxyName}.exe"), Resources.privoxy_exe); } catch (IOException ex) { @@ -41,11 +40,6 @@ namespace v2rayN.HttpProxyHandler } } - private PrivoxyHandler() - { - - } - /// /// 单例 /// @@ -66,17 +60,20 @@ namespace v2rayN.HttpProxyHandler get; set; } + public void Restart(int localPort, Config config) + { + Stop(); + Start(localPort, config); + } + + public void Start(int localPort, Config config) { try { if (_process == null) { - Process[] existingPrivoxy = Process.GetProcessesByName("v2ray_privoxy"); - foreach (Process p in existingPrivoxy.Where(IsChildProcess)) - { - KillProcess(p); - } + string privoxyConfig = Resources.privoxy_conf; RunningPort = config.GetLocalPort(Global.InboundHttp); privoxyConfig = privoxyConfig.Replace("__SOCKS_PORT__", localPort.ToString()); @@ -96,7 +93,7 @@ namespace v2rayN.HttpProxyHandler // Configure the process using the StartInfo properties. StartInfo = { - FileName = "v2ray_privoxy.exe", + FileName = $"{_privoxyName}.exe", Arguments = _uniqueConfigFile, WorkingDirectory = Utils.GetTempPath(), WindowStyle = ProcessWindowStyle.Hidden, @@ -110,12 +107,13 @@ namespace v2rayN.HttpProxyHandler * Add this process to job obj associated with this ss process, so that * when ss exit unexpectedly, this process will be forced killed by system. */ - _privoxyJob.AddProcess(_process.Handle); + Global.processJob.AddProcess(_process.Handle); } } catch (Exception ex) { + RunningPort = 0; Utils.SaveLog(ex.Message, ex); } } @@ -129,6 +127,14 @@ namespace v2rayN.HttpProxyHandler _process = null; RunningPort = 0; } + else + { + Process[] existingPrivoxy = Process.GetProcessesByName(_privoxyName); + foreach (Process p in existingPrivoxy.Where(IsChildProcess)) + { + KillProcess(p); + } + } } private static void KillProcess(Process p) @@ -140,7 +146,7 @@ namespace v2rayN.HttpProxyHandler if (!p.HasExited) { p.Kill(); - p.WaitForExit(); + p.WaitForExit(100); } } catch (Exception ex) @@ -168,7 +174,7 @@ namespace v2rayN.HttpProxyHandler */ var path = process.MainModule.FileName; - return Utils.GetTempPath("v2ray_privoxy.exe").Equals(path); + return Utils.GetTempPath($"{_privoxyName}.exe").Equals(path); } catch (Exception ex) diff --git a/v2rayN/v2rayN/HttpProxyHandler/ProxySetting.cs b/v2rayN/v2rayN/HttpProxyHandler/ProxySetting.cs index 638a1131..254bf115 100644 --- a/v2rayN/v2rayN/HttpProxyHandler/ProxySetting.cs +++ b/v2rayN/v2rayN/HttpProxyHandler/ProxySetting.cs @@ -8,26 +8,46 @@ namespace v2rayN.HttpProxyHandler { public static bool UnsetProxy() { - return SetProxy(null, null); - } - public static bool SetProxy(string strProxy) - { - return SetProxy(strProxy, null); + return SetProxy(null, null, 1); } - public static bool SetProxy(string strProxy, string exceptions) + public static bool SetProxy(string strProxy, string exceptions, int type) { InternetPerConnOptionList list = new InternetPerConnOptionList(); - int optionCount = Utils.IsNullOrEmpty(strProxy) ? 1 : (Utils.IsNullOrEmpty(exceptions) ? 2 : 3); + int optionCount = 1; + if (type == 1) + { + optionCount = 1; + } + else if (type == 2 || type == 4) + { + optionCount = Utils.IsNullOrEmpty(exceptions) ? 2 : 3; + } + + int m_Int = (int)PerConnFlags.PROXY_TYPE_DIRECT; + PerConnOption m_Option = PerConnOption.INTERNET_PER_CONN_FLAGS; + if (type == 2) + { + m_Int = (int)(PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_PROXY); + m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_SERVER; + } + else if (type == 4) + { + m_Int = (int)(PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_AUTO_PROXY_URL); + m_Option = PerConnOption.INTERNET_PER_CONN_AUTOCONFIG_URL; + } + + //int optionCount = Utils.IsNullOrEmpty(strProxy) ? 1 : (Utils.IsNullOrEmpty(exceptions) ? 2 : 3); InternetConnectionOption[] options = new InternetConnectionOption[optionCount]; // USE a proxy server ... options[0].m_Option = PerConnOption.INTERNET_PER_CONN_FLAGS; - options[0].m_Value.m_Int = (int)((optionCount < 2) ? PerConnFlags.PROXY_TYPE_DIRECT : (PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_PROXY)); + //options[0].m_Value.m_Int = (int)((optionCount < 2) ? PerConnFlags.PROXY_TYPE_DIRECT : (PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_PROXY)); + options[0].m_Value.m_Int = m_Int; // use THIS proxy server if (optionCount > 1) { - options[1].m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_SERVER; + options[1].m_Option = m_Option; options[1].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(strProxy); // except for these addresses ... if (optionCount > 2) @@ -50,14 +70,22 @@ namespace v2rayN.HttpProxyHandler // copy the array over into that spot in memory ... for (int i = 0; i < options.Length; ++i) { - IntPtr opt = new IntPtr(optionsPtr.ToInt32() + (i * optSize)); - Marshal.StructureToPtr(options[i], opt, false); + if (Environment.Is64BitOperatingSystem) + { + IntPtr opt = new IntPtr(optionsPtr.ToInt64() + (i * optSize)); + Marshal.StructureToPtr(options[i], opt, false); + } + else + { + IntPtr opt = new IntPtr(optionsPtr.ToInt32() + (i * optSize)); + Marshal.StructureToPtr(options[i], opt, false); + } } list.options = optionsPtr; // and then make a pointer out of the whole list - IntPtr ipcoListPtr = Marshal.AllocCoTaskMem((Int32)list.dwSize); + IntPtr ipcoListPtr = Marshal.AllocCoTaskMem((int)list.dwSize); Marshal.StructureToPtr(list, ipcoListPtr, false); // and finally, call the API method! @@ -181,7 +209,7 @@ namespace v2rayN.HttpProxyHandler string ProxyServer = rk.GetValue("ProxyServer").ToString(); rk.Close(); return ProxyServer; - + } } } diff --git a/v2rayN/v2rayN/HttpProxyHandler/SysProxyHandle.cs b/v2rayN/v2rayN/HttpProxyHandler/SysProxyHandle.cs deleted file mode 100644 index df06f21a..00000000 --- a/v2rayN/v2rayN/HttpProxyHandler/SysProxyHandle.cs +++ /dev/null @@ -1,185 +0,0 @@ -using Newtonsoft.Json; -using System; -using System.Diagnostics; -using System.IO; -using System.Text; -using v2rayN.Base; -using v2rayN.Mode; -using v2rayN.Properties; -using v2rayN.Tool; - -namespace v2rayN.HttpProxyHandler -{ - class SysProxyHandle - { - private const string _userWininetConfigFile = "user-wininet.json"; - - private static string _queryStr; - - // In general, this won't change - // format: - // - // - // - // - private static SysproxyConfig _userSettings = null; - - enum RET_ERRORS : int - { - RET_NO_ERROR = 0, - INVALID_FORMAT = 1, - NO_PERMISSION = 2, - SYSCALL_FAILED = 3, - NO_MEMORY = 4, - INVAILD_OPTION_COUNT = 5, - }; - - static SysProxyHandle() - { - try - { - FileManager.UncompressFile(Utils.GetTempPath("sysproxy.exe"), - Environment.Is64BitOperatingSystem ? Resources.sysproxy64_exe : Resources.sysproxy_exe); - } - catch (IOException ex) - { - Utils.SaveLog(ex.Message, ex); - - } - } - - public static void SetIEProxy(bool enable, bool global, string proxyServer, string pacURL) - { - //Read(); - - //if (!_userSettings.UserSettingsRecorded) - //{ - // // record user settings - // ExecSysproxy("query"); - // ParseQueryStr(_queryStr); - //} - - string arguments; - if (enable) - { - arguments = global - ? string.Format( - //"global {0} ;localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;172.32.*;192.168.*", - "global {0} ;localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;172.32.*", - proxyServer) - : string.Format("pac {0}", pacURL); - } - else - { - // restore user settings - //var flags = _userSettings.Flags; - //var proxy_server = _userSettings.ProxyServer ?? "-"; - //var bypass_list = _userSettings.BypassList ?? "-"; - //var pac_url = _userSettings.PacUrl ?? "-"; - ////arguments = string.Format("set {0} {1} {2} {3}", flags, proxy_server, bypass_list, pac_url); - //set null settings - arguments = string.Format("set {0} {1} {2} {3}", 1, "-", "", @"http://127.0.0.1"); - - // have to get new settings - //_userSettings.UserSettingsRecorded = false; - } - - //Save(); - ExecSysproxy(arguments); - } - - private static void ExecSysproxy(string arguments) - { - using (var process = new Process()) - { - // Configure the process using the StartInfo properties. - process.StartInfo.FileName = Utils.GetTempPath("sysproxy.exe"); - process.StartInfo.Arguments = arguments; - process.StartInfo.WorkingDirectory = Utils.GetTempPath(); - process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; - process.StartInfo.UseShellExecute = false; - process.StartInfo.RedirectStandardError = true; - process.StartInfo.RedirectStandardOutput = true; - - // Need to provide encoding info, or output/error strings we got will be wrong. - process.StartInfo.StandardOutputEncoding = Encoding.Unicode; - process.StartInfo.StandardErrorEncoding = Encoding.Unicode; - - process.StartInfo.CreateNoWindow = true; - process.Start(); - - var stderr = process.StandardError.ReadToEnd(); - var stdout = process.StandardOutput.ReadToEnd(); - - process.WaitForExit(); - - var exitCode = process.ExitCode; - if (exitCode != (int)RET_ERRORS.RET_NO_ERROR) - { - throw new Exception(stderr); - } - - if (arguments == "query") - { - if (stdout.IsNullOrWhiteSpace() || stdout.IsNullOrEmpty()) - { - // we cannot get user settings - throw new Exception("failed to query wininet settings"); - } - _queryStr = stdout; - } - } - } - - private static void Save() - { - try - { - using (StreamWriter sw = new StreamWriter(File.Open(Utils.GetPath(_userWininetConfigFile), FileMode.Create))) - { - string jsonString = JsonConvert.SerializeObject(_userSettings, Formatting.Indented); - sw.Write(jsonString); - sw.Flush(); - } - } - catch (IOException ex) - { - Utils.SaveLog(ex.Message, ex); - } - } - - private static void Read() - { - try - { - string configContent = File.ReadAllText(Utils.GetPath(_userWininetConfigFile)); - _userSettings = JsonConvert.DeserializeObject(configContent); - } - catch (Exception ex) - { - Utils.SaveLog(ex.Message, ex); - // Suppress all exceptions. finally block will initialize new user config settings. - } - finally - { - if (_userSettings == null) _userSettings = new SysproxyConfig(); - } - } - - private static void ParseQueryStr(string str) - { - string[] userSettingsArr = str.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); - _userSettings.Flags = userSettingsArr[0]; - - // handle output from WinINET - if (userSettingsArr[1] == "(null)") _userSettings.ProxyServer = null; - else _userSettings.ProxyServer = userSettingsArr[1]; - if (userSettingsArr[2] == "(null)") _userSettings.BypassList = null; - else _userSettings.BypassList = userSettingsArr[2]; - if (userSettingsArr[3] == "(null)") _userSettings.PacUrl = null; - else _userSettings.PacUrl = userSettingsArr[3]; - - _userSettings.UserSettingsRecorded = true; - } - } -} diff --git a/v2rayN/v2rayN/LIB/libs.zip b/v2rayN/v2rayN/LIB/libs.zip new file mode 100644 index 00000000..3b787743 Binary files /dev/null and b/v2rayN/v2rayN/LIB/libs.zip differ diff --git a/v2rayN/v2rayN/Mode/Config.cs b/v2rayN/v2rayN/Mode/Config.cs index e83d1c2c..40d20cf9 100644 --- a/v2rayN/v2rayN/Mode/Config.cs +++ b/v2rayN/v2rayN/Mode/Config.cs @@ -169,6 +169,11 @@ namespace v2rayN.Mode get; set; } + public List userPacRule + { + get; set; + } + #region 函数 public string address() diff --git a/v2rayN/v2rayN/Program.cs b/v2rayN/v2rayN/Program.cs index 0f32d796..36ffb2e8 100644 --- a/v2rayN/v2rayN/Program.cs +++ b/v2rayN/v2rayN/Program.cs @@ -3,6 +3,8 @@ using System.Diagnostics; using System.Reflection; using System.Windows.Forms; using v2rayN.Forms; +using v2rayN.Properties; +using v2rayN.Tool; namespace v2rayN { @@ -26,14 +28,20 @@ namespace v2rayN Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); - AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; - + + //AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; Process instance = RunningInstance(); if (instance == null) - { - Utils.SaveLog("v2rayN start up"); + { + if (!UnzipLibs()) + { + UI.Show($"Error preparing the environment(准备运行环境出错)"); + return; + } + Utils.SaveLog("v2rayN start up"); + //设置语言环境 string lang = Utils.RegReadValue(Global.MyRegPath, Global.MyRegKeyLanguage, "zh-Hans"); System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lang); @@ -48,27 +56,27 @@ namespace v2rayN } } - private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) - { - try - { - string resourceName = "v2rayN.LIB." + new AssemblyName(args.Name).Name + ".dll"; - using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName)) - { - if (stream == null) - { - return null; - } - byte[] assemblyData = new byte[stream.Length]; - stream.Read(assemblyData, 0, assemblyData.Length); - return Assembly.Load(assemblyData); - } - } - catch - { - return null; - } - } + //private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) + //{ + // try + // { + // string resourceName = "v2rayN.LIB." + new AssemblyName(args.Name).Name + ".dll"; + // using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName)) + // { + // if (stream == null) + // { + // return null; + // } + // byte[] assemblyData = new byte[stream.Length]; + // stream.Read(assemblyData, 0, assemblyData.Length); + // return Assembly.Load(assemblyData); + // } + // } + // catch + // { + // return null; + // } + //} /// /// 获取正在运行的实例,没有运行的实例返回null; @@ -100,5 +108,20 @@ namespace v2rayN Utils.SaveLog("CurrentDomain_UnhandledException", (Exception)e.ExceptionObject); } + static bool UnzipLibs() + { + var fileName = Utils.GetPath("libs.zip"); + if (!FileManager.ByteArrayToFile(fileName, Resources.libs)) + { + return false; + } + + if (!FileManager.ZipExtractToFile(fileName)) + { + return false; + } + + return true; + } } } diff --git a/v2rayN/v2rayN/Properties/AssemblyInfo.cs b/v2rayN/v2rayN/Properties/AssemblyInfo.cs index 545bcf93..abd9350d 100644 --- a/v2rayN/v2rayN/Properties/AssemblyInfo.cs +++ b/v2rayN/v2rayN/Properties/AssemblyInfo.cs @@ -33,4 +33,4 @@ using System.Runtime.InteropServices; // 方法是按如下所示使用“*”: //[assembly: AssemblyVersion("1.0.*")] //[assembly: AssemblyVersion("1.0.0")] -[assembly: AssemblyFileVersion("2.53")] +[assembly: AssemblyFileVersion("3.4")] diff --git a/v2rayN/v2rayN/Properties/Resources.Designer.cs b/v2rayN/v2rayN/Properties/Resources.Designer.cs index f2d8f030..ec86047f 100644 --- a/v2rayN/v2rayN/Properties/Resources.Designer.cs +++ b/v2rayN/v2rayN/Properties/Resources.Designer.cs @@ -90,26 +90,6 @@ namespace v2rayN.Properties { } } - /// - /// 查找 System.Byte[] 类型的本地化资源。 - /// - internal static byte[] grpc_csharp_ext_x64_dll { - get { - object obj = ResourceManager.GetObject("grpc_csharp_ext_x64_dll", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// 查找 System.Byte[] 类型的本地化资源。 - /// - internal static byte[] grpc_csharp_ext_x86_dll { - get { - object obj = ResourceManager.GetObject("grpc_csharp_ext_x86_dll", resourceCulture); - return ((byte[])(obj)); - } - } - /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// @@ -120,6 +100,16 @@ namespace v2rayN.Properties { } } + /// + /// 查找 System.Byte[] 类型的本地化资源。 + /// + internal static byte[] libs { + get { + object obj = ResourceManager.GetObject("libs", resourceCulture); + return ((byte[])(obj)); + } + } + /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// @@ -226,25 +216,5 @@ namespace v2rayN.Properties { return ((System.Drawing.Bitmap)(obj)); } } - - /// - /// 查找 System.Byte[] 类型的本地化资源。 - /// - internal static byte[] sysproxy_exe { - get { - object obj = ResourceManager.GetObject("sysproxy_exe", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// 查找 System.Byte[] 类型的本地化资源。 - /// - internal static byte[] sysproxy64_exe { - get { - object obj = ResourceManager.GetObject("sysproxy64_exe", resourceCulture); - return ((byte[])(obj)); - } - } } } diff --git a/v2rayN/v2rayN/Properties/Resources.resx b/v2rayN/v2rayN/Properties/Resources.resx index 2488ee55..72e8e12c 100644 --- a/v2rayN/v2rayN/Properties/Resources.resx +++ b/v2rayN/v2rayN/Properties/Resources.resx @@ -127,15 +127,12 @@ ..\resources\checkupdate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\resources\grpc_csharp_ext.x64.dll.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\resources\grpc_csharp_ext.x86.dll.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\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 @@ -166,10 +163,4 @@ ..\resources\sub.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\sysproxy64.exe.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\sysproxy.exe.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - \ No newline at end of file diff --git a/v2rayN/v2rayN/Resources/grpc_csharp_ext.x64.dll.gz b/v2rayN/v2rayN/Resources/grpc_csharp_ext.x64.dll.gz deleted file mode 100644 index b69a16bd..00000000 Binary files a/v2rayN/v2rayN/Resources/grpc_csharp_ext.x64.dll.gz and /dev/null differ diff --git a/v2rayN/v2rayN/Resources/grpc_csharp_ext.x86.dll.gz b/v2rayN/v2rayN/Resources/grpc_csharp_ext.x86.dll.gz deleted file mode 100644 index d56025ca..00000000 Binary files a/v2rayN/v2rayN/Resources/grpc_csharp_ext.x86.dll.gz and /dev/null differ diff --git a/v2rayN/v2rayN/Resources/pac.txt b/v2rayN/v2rayN/Resources/pac.txt index 4bed057c..6695b760 100644 --- a/v2rayN/v2rayN/Resources/pac.txt +++ b/v2rayN/v2rayN/Resources/pac.txt @@ -49,7 +49,7 @@ var rules = [ "|http://img.dlsite.jp/", "||dm530.net", "share.dmhy.org", - "@@|https://share.dmhy.org", + "||dmhy.org", "||dmm.co.jp", "|http://www.dmm.com/netgame", "||dnvod.tv", @@ -262,19 +262,25 @@ var rules = [ "||daum.net", "||depositphotos.com", "||disconnect.me", + "||documentingreality.com", "||doubibackup.com", "||doubmirror.cf", "||encyclopedia.com", "||fangeqiang.com", + "||fanqiangdang.com", "||cloud.feedly.com", + "||feedx.net", "||flyzy2005.com", "||foreignpolicy.com", "||free-ss.site", + "||freehongkong.org", "||blog.fuckgfw233.org", "||g0v.social", "||globalvoices.org", "||glorystar.me", "||goregrish.com", + "||guangnianvpn.com", + "||hanime.tv", "||hbo.com", "||spaces.hightail.com", "||hkgalden.com", @@ -288,6 +294,7 @@ var rules = [ "||joinmastodon.org", "||liangzhichuanmei.com", "||lighti.me", + "||lightyearvpn.com", "||lihkg.com", "||line-scdn.net", "||i.lithium.com", @@ -325,6 +332,7 @@ var rules = [ "||api.pureapk.com", "||quora.com", "||quoracdn.net", + "||qz.com", "||cdn.seatguru.com", "||secure.raxcdn.com", "||redd.it", @@ -368,6 +376,8 @@ var rules = [ "||steemit.com", "||taiwanjustice.net", "||tinc-vpn.org", + "||u15.info", + "||washingtonpost.com", "||wenzhao.ca", "||whatsonweibo.com", "||wire.com", @@ -375,6 +385,7 @@ var rules = [ "||xm.com", "||xuehua.us", "||yes-news.com", + "||yigeni.com", "||you-get.org", "||zzcloud.me", "||aex.com", @@ -697,459 +708,8 @@ var rules = [ "||thefacebook.com", "||whatsapp.com", "||whatsapp.net", - "|https://www.ftchinese.com", - ".ftchinese.com/channel/video", - ".ftchinese.com/premium/001081066", - ".ftchinese.com/story/00102753", - ".ftchinese.com/story/001026616", - ".ftchinese.com/story/001026749", - ".ftchinese.com/story/001026807", - ".ftchinese.com/story/001026808", - ".ftchinese.com/story/001026834", - ".ftchinese.com/story/001026880", - ".ftchinese.com/story/001027429", - ".ftchinese.com/story/001030341", - ".ftchinese.com/story/001030502", - ".ftchinese.com/story/001030803", - ".ftchinese.com/story/001031317", - ".ftchinese.com/story/001032617", - ".ftchinese.com/story/001032636", - ".ftchinese.com/story/001032692", - ".ftchinese.com/story/001032762", - ".ftchinese.com/story/001033138", - ".ftchinese.com/story/001034917", - ".ftchinese.com/story/001034926", - ".ftchinese.com/story/001034927", - ".ftchinese.com/story/001034928", - ".ftchinese.com/story/001034952", - ".ftchinese.com/story/001035890", - ".ftchinese.com/story/001035972", - ".ftchinese.com/story/001035993", - ".ftchinese.com/story/001036417", - ".ftchinese.com/story/001037090", - ".ftchinese.com/story/001037091", - ".ftchinese.com/story/001038178", - ".ftchinese.com/story/001038199", - ".ftchinese.com/story/001038220", - ".ftchinese.com/story/001038819", - ".ftchinese.com/story/001038862", - ".ftchinese.com/story/001039067", - ".ftchinese.com/story/001039178", - ".ftchinese.com/story/001039211", - ".ftchinese.com/story/001039271", - ".ftchinese.com/story/001039295", - ".ftchinese.com/story/001039369", - ".ftchinese.com/story/001039482", - ".ftchinese.com/story/001039534", - ".ftchinese.com/story/001039555", - ".ftchinese.com/story/001039576", - ".ftchinese.com/story/001039712", - ".ftchinese.com/story/001039779", - ".ftchinese.com/story/001039809", - ".ftchinese.com/story/001040134", - ".ftchinese.com/story/001040835", - ".ftchinese.com/story/001040890", - ".ftchinese.com/story/001040918", - ".ftchinese.com/story/001040992", - ".ftchinese.com/story/001041209", - ".ftchinese.com/story/001042100", - ".ftchinese.com/story/001042252", - ".ftchinese.com/story/001042272", - ".ftchinese.com/story/001042280", - ".ftchinese.com/story/001043029", - ".ftchinese.com/story/001043066", - ".ftchinese.com/story/001043096", - ".ftchinese.com/story/001043124", - ".ftchinese.com/story/001043152", - ".ftchinese.com/story/001043189", - ".ftchinese.com/story/001043428", - ".ftchinese.com/story/001043439", - ".ftchinese.com/story/001043534", - ".ftchinese.com/story/001043675", - ".ftchinese.com/story/001043680", - ".ftchinese.com/story/001043702", - ".ftchinese.com/story/001043849", - ".ftchinese.com/story/001044099", - ".ftchinese.com/story/001044776", - ".ftchinese.com/story/001044871", - ".ftchinese.com/story/001044897", - ".ftchinese.com/story/001045114", - ".ftchinese.com/story/001045139", - ".ftchinese.com/story/001045186", - ".ftchinese.com/story/001045755", - ".ftchinese.com/story/001046087", - ".ftchinese.com/story/001046105", - ".ftchinese.com/story/001046118", - ".ftchinese.com/story/001046132", - ".ftchinese.com/story/001046517", - ".ftchinese.com/story/001046822", - ".ftchinese.com/story/001046866", - ".ftchinese.com/story/001046942", - ".ftchinese.com/story/001047180", - ".ftchinese.com/story/001047206", - ".ftchinese.com/story/001047304", - ".ftchinese.com/story/001047317", - ".ftchinese.com/story/001047345", - ".ftchinese.com/story/001047358", - ".ftchinese.com/story/001047375", - ".ftchinese.com/story/001047381", - ".ftchinese.com/story/001047413", - ".ftchinese.com/story/001047456", - ".ftchinese.com/story/001047491", - ".ftchinese.com/story/001047545", - ".ftchinese.com/story/001047558", - ".ftchinese.com/story/001047568", - ".ftchinese.com/story/001047627", - ".ftchinese.com/story/001048293", - ".ftchinese.com/story/001048343", - ".ftchinese.com/story/001048710", - ".ftchinese.com/story/001049289", - ".ftchinese.com/story/001049360", - ".ftchinese.com/story/001049896", - ".ftchinese.com/story/001050152", - ".ftchinese.com/story/001051027", - ".ftchinese.com/story/001051161", - ".ftchinese.com/story/001051372", - ".ftchinese.com/story/001051479", - ".ftchinese.com/story/001052138", - ".ftchinese.com/story/001052161", - ".ftchinese.com/story/001052525", - ".ftchinese.com/story/001052549", - ".ftchinese.com/story/001052701", - ".ftchinese.com/story/001052965", - ".ftchinese.com/story/001053149", - ".ftchinese.com/story/001053150", - ".ftchinese.com/story/001053200", - ".ftchinese.com/story/001053425", - ".ftchinese.com/story/001053496", - ".ftchinese.com/story/001053526", - ".ftchinese.com/story/001053557", - ".ftchinese.com/story/001053906", - ".ftchinese.com/story/001054049", - ".ftchinese.com/story/001054103", - ".ftchinese.com/story/001054109", - ".ftchinese.com/story/001054119", - ".ftchinese.com/story/001054123", - ".ftchinese.com/story/001054139", - ".ftchinese.com/story/001054166", - ".ftchinese.com/story/001054168", - ".ftchinese.com/story/001054190", - ".ftchinese.com/story/001054437", - ".ftchinese.com/story/001054526", - ".ftchinese.com/story/001054607", - ".ftchinese.com/story/001054644", - ".ftchinese.com/story/001054786", - ".ftchinese.com/story/001054843", - ".ftchinese.com/story/001054925", - ".ftchinese.com/story/001054940", - ".ftchinese.com/story/001055051", - ".ftchinese.com/story/001055063", - ".ftchinese.com/story/001055069", - ".ftchinese.com/story/001055136", - ".ftchinese.com/story/001055170", - ".ftchinese.com/story/001055202", - ".ftchinese.com/story/001055242", - ".ftchinese.com/story/001055263", - ".ftchinese.com/story/001055274", - ".ftchinese.com/story/001055299", - ".ftchinese.com/story/001055480", - ".ftchinese.com/story/001055551", - ".ftchinese.com/story/001055559", - ".ftchinese.com/story/001055566", - ".ftchinese.com/story/001055840", - ".ftchinese.com/story/001056099", - ".ftchinese.com/story/001056108", - ".ftchinese.com/story/001056131", - ".ftchinese.com/story/001056375", - ".ftchinese.com/story/001056491", - ".ftchinese.com/story/001056529", - ".ftchinese.com/story/001056534", - ".ftchinese.com/story/001056538", - ".ftchinese.com/story/001056541", - ".ftchinese.com/story/001056554", - ".ftchinese.com/story/001056557", - ".ftchinese.com/story/001056560", - ".ftchinese.com/story/001056567", - ".ftchinese.com/story/001056574", - ".ftchinese.com/story/001056588", - ".ftchinese.com/story/001056594", - ".ftchinese.com/story/001056596", - ".ftchinese.com/story/001056684", - ".ftchinese.com/story/001056832", - ".ftchinese.com/story/001056833", - ".ftchinese.com/story/001056851", - ".ftchinese.com/story/001056874", - ".ftchinese.com/story/001056896", - ".ftchinese.com/story/001056927", - ".ftchinese.com/story/001057011", - ".ftchinese.com/story/001057018", - ".ftchinese.com/story/001057044", - ".ftchinese.com/story/001057162", - ".ftchinese.com/story/001057500", - ".ftchinese.com/story/001057504", - ".ftchinese.com/story/001057509", - ".ftchinese.com/story/001057518", - ".ftchinese.com/story/001057532", - ".ftchinese.com/story/001057533", - ".ftchinese.com/story/001057556", - ".ftchinese.com/story/001057580", - ".ftchinese.com/story/001057638", - ".ftchinese.com/story/001057644", - ".ftchinese.com/story/001057817", - ".ftchinese.com/story/001057875", - ".ftchinese.com/story/001058009", - ".ftchinese.com/story/001058056", - ".ftchinese.com/story/001058224", - ".ftchinese.com/story/001058257", - ".ftchinese.com/story/001058295", - ".ftchinese.com/story/001058328", - ".ftchinese.com/story/001058339", - ".ftchinese.com/story/001058344", - ".ftchinese.com/story/001058352", - ".ftchinese.com/story/001058413", - ".ftchinese.com/story/001058421", - ".ftchinese.com/story/001058440", - ".ftchinese.com/story/001058458", - ".ftchinese.com/story/001058468", - ".ftchinese.com/story/001058561", - ".ftchinese.com/story/001058566", - ".ftchinese.com/story/001058567", - ".ftchinese.com/story/001058585", - ".ftchinese.com/story/001058628", - ".ftchinese.com/story/001058656", - ".ftchinese.com/story/001058665", - ".ftchinese.com/story/001058678", - ".ftchinese.com/story/001058691", - ".ftchinese.com/story/001058721", - ".ftchinese.com/story/001058728", - ".ftchinese.com/story/001059464", - ".ftchinese.com/story/001059484", - ".ftchinese.com/story/001059537", - ".ftchinese.com/story/001059538", - ".ftchinese.com/story/001059551", - ".ftchinese.com/story/001059818", - ".ftchinese.com/story/001059914", - ".ftchinese.com/story/001059920", - ".ftchinese.com/story/001059957", - ".ftchinese.com/story/001060088", - ".ftchinese.com/story/001060156", - ".ftchinese.com/story/001060157", - ".ftchinese.com/story/001060160", - ".ftchinese.com/story/001060181", - ".ftchinese.com/story/001060185", - ".ftchinese.com/story/001060493", - ".ftchinese.com/story/001060495", - ".ftchinese.com/story/001060590", - ".ftchinese.com/story/001060846", - ".ftchinese.com/story/001060847", - ".ftchinese.com/story/001060875", - ".ftchinese.com/story/001060921", - ".ftchinese.com/story/001060946", - ".ftchinese.com/story/001061120", - ".ftchinese.com/story/001061474", - ".ftchinese.com/story/001061524", - ".ftchinese.com/story/001061642", - ".ftchinese.com/story/001062017", - ".ftchinese.com/story/001062020", - ".ftchinese.com/story/001062028", - ".ftchinese.com/story/001062092", - ".ftchinese.com/story/001062096", - ".ftchinese.com/story/001062147", - ".ftchinese.com/story/001062176", - ".ftchinese.com/story/001062188", - ".ftchinese.com/story/001062254", - ".ftchinese.com/story/001062374", - ".ftchinese.com/story/001062482", - ".ftchinese.com/story/001062496", - ".ftchinese.com/story/001062501", - ".ftchinese.com/story/001062508", - ".ftchinese.com/story/001062519", - ".ftchinese.com/story/001062554", - ".ftchinese.com/story/001062741", - ".ftchinese.com/story/001062794", - ".ftchinese.com/story/001063160", - ".ftchinese.com/story/001063359", - ".ftchinese.com/story/001063512", - ".ftchinese.com/story/001063668", - ".ftchinese.com/story/001063692", - ".ftchinese.com/story/001063763", - ".ftchinese.com/story/001063764", - ".ftchinese.com/story/001063826", - ".ftchinese.com/story/001064127", - ".ftchinese.com/story/001064312", - ".ftchinese.com/story/001064705", - ".ftchinese.com/story/001064807", - ".ftchinese.com/story/001065120", - ".ftchinese.com/story/001065168", - ".ftchinese.com/story/001065249", - ".ftchinese.com/story/001065287", - ".ftchinese.com/story/001065335", - ".ftchinese.com/story/001065337", - ".ftchinese.com/story/001065541", - ".ftchinese.com/story/001065715", - ".ftchinese.com/story/001065735", - ".ftchinese.com/story/001065756", - ".ftchinese.com/story/001065802", - ".ftchinese.com/story/001066112", - ".ftchinese.com/story/001066136", - ".ftchinese.com/story/001066140", - ".ftchinese.com/story/001066465", - ".ftchinese.com/story/001066881", - ".ftchinese.com/story/001066950", - ".ftchinese.com/story/001066959", - ".ftchinese.com/story/001067435", - "www.ftchinese.com/story/001067479", - ".ftchinese.com/story/001067528", - ".ftchinese.com/story/001067545", - ".ftchinese.com/story/001067572", - ".ftchinese.com/story/001067648", - ".ftchinese.com/story/001067650", - ".ftchinese.com/story/001067680", - ".ftchinese.com/story/001067692", - ".ftchinese.com/story/001067871", - ".ftchinese.com/story/001067923", - ".ftchinese.com/story/001068062", - ".ftchinese.com/story/001068248", - ".ftchinese.com/story/001068278", - ".ftchinese.com/story/001068379", - ".ftchinese.com/story/001068483", - ".ftchinese.com/story/001068506", - ".ftchinese.com/story/001068547", - ".ftchinese.com/story/001068616", - ".ftchinese.com/story/001068622", - ".ftchinese.com/story/001068707", - ".ftchinese.com/story/001069146", - ".ftchinese.com/story/001069373", - ".ftchinese.com/story/001069516", - ".ftchinese.com/story/001069517", - ".ftchinese.com/story/001069687", - ".ftchinese.com/story/001069741", - ".ftchinese.com/story/001069861", - ".ftchinese.com/story/001069952", - ".ftchinese.com/story/001070053", - ".ftchinese.com/story/001070177", - ".ftchinese.com/story/001070307", - ".ftchinese.com/story/001070809", - ".ftchinese.com/story/001070990", - ".ftchinese.com/story/001071042", - ".ftchinese.com/story/001071044", - ".ftchinese.com/story/001071106", - ".ftchinese.com/story/001071166", - ".ftchinese.com/story/001071181", - "ftchinese.com/story/001071200", - ".ftchinese.com/story/001071208", - ".ftchinese.com/story/001071238", - ".ftchinese.com/story/001071683", - ".ftchinese.com/story/001072271", - ".ftchinese.com/story/001072348", - ".ftchinese.com/story/001072677", - ".ftchinese.com/story/001072726", - ".ftchinese.com/story/001072794", - ".ftchinese.com/story/001072853", - ".ftchinese.com/story/001072895", - ".ftchinese.com/story/001072993", - ".ftchinese.com/story/001073043", - ".ftchinese.com/story/001073103", - ".ftchinese.com/story/001073157", - ".ftchinese.com/story/001073216", - ".ftchinese.com/story/001073246", - ".ftchinese.com/story/001073305", - ".ftchinese.com/story/001073307", - ".ftchinese.com/story/001073408", - ".ftchinese.com/story/001073537", - ".ftchinese.com/story/001073672", - ".ftchinese.com/story/001073849", - ".ftchinese.com/story/001073906", - ".ftchinese.com/story/001074089", - ".ftchinese.com/story/001074110", - ".ftchinese.com/story/001074128", - ".ftchinese.com/story/001074157", - ".ftchinese.com/story/001074246", - ".ftchinese.com/story/001074307", - ".ftchinese.com/story/001074347", - ".ftchinese.com/story/001074423", - ".ftchinese.com/story/001074454", - ".ftchinese.com/story/001074467", - ".ftchinese.com/story/001074493", - ".ftchinese.com/story/001074550", - ".ftchinese.com/story/001074562", - ".ftchinese.com/story/001074653", - ".ftchinese.com/story/001074693", - ".ftchinese.com/story/001074699", - ".ftchinese.com/story/001074712", - ".ftchinese.com/story/001074713", - ".ftchinese.com/story/001074768", - ".ftchinese.com/story/001074782", - ".ftchinese.com/story/001074794", - ".ftchinese.com/story/001074822", - ".ftchinese.com/story/001074874", - ".ftchinese.com/story/001074891", - ".ftchinese.com/story/001074918", - ".ftchinese.com/story/001075081", - ".ftchinese.com/story/001075134", - ".ftchinese.com/story/001075142", - ".ftchinese.com/story/001075216", - ".ftchinese.com/story/001075230", - ".ftchinese.com/story/001075238", - ".ftchinese.com/story/001075262", - ".ftchinese.com/story/001075269", - ".ftchinese.com/story/001075491", - ".ftchinese.com/story/001075500", - ".ftchinese.com/story/001075650", - ".ftchinese.com/story/001075678", - ".ftchinese.com/story/001075703", - ".ftchinese.com/story/001075739", - ".ftchinese.com/story/001076066", - ".ftchinese.com/story/001076142", - ".ftchinese.com/story/001076459", - ".ftchinese.com/story/001076470", - ".ftchinese.com/story/001076538", - ".ftchinese.com/story/001076573", - ".ftchinese.com/story/001076901", - ".ftchinese.com/story/001077067", - ".ftchinese.com/story/001077084", - ".ftchinese.com/story/001077235", - ".ftchinese.com/story/001077344", - ".ftchinese.com/story/001077390", - ".ftchinese.com/story/001077392", - ".ftchinese.com/story/001077465", - ".ftchinese.com/story/001077468", - ".ftchinese.com/story/001077492", - ".ftchinese.com/story/001077745", - ".ftchinese.com/story/001077768", - ".ftchinese.com/story/001077804", - ".ftchinese.com/story/001077852", - ".ftchinese.com/story/001078646", - ".ftchinese.com/story/001078928", - ".ftchinese.com/story/001078967", - ".ftchinese.com/story/001079559", - ".ftchinese.com/story/001079641", - ".ftchinese.com/story/001079909", - ".ftchinese.com/story/001079934", - ".ftchinese.com/story/001079992", - ".ftchinese.com/story/001080054", - ".ftchinese.com/story/001080109", - ".ftchinese.com/story/001080169", - ".ftchinese.com/story/001080226", - ".ftchinese.com/story/001080429", - ".ftchinese.com/story/001080471", - ".ftchinese.com/story/001080550", - ".ftchinese.com/story/001080581", - ".ftchinese.com/story/001080647", - ".ftchinese.com/story/001080778", - ".ftchinese.com/story/001080892", - ".ftchinese.com/story/001080915", - ".ftchinese.com/story/001080935", - ".ftchinese.com/story/001081059", - ".ftchinese.com/story/001081127", - ".ftchinese.com/tag/%E5%8D%81%E5%85%AB%E5%B1%8A%E4%B8%89%E4%B8%AD%E5%85%A8%E4%BC%9A", - ".ftchinese.com/tag/%E6%B8%A9%E5%AE%B6%E5%AE%9D", - ".ftchinese.com/tag/%E8%96%84%E7%86%99%E6%9D%A5", - ".ftchinese.com/video/1437", - ".ftchinese.com/video/1882", - ".ftchinese.com/video/2446", - ".ftchinese.com/video/2601", - ".ftchinese.com/comments", + ".ftchinese.com", + "||ftchinese.com", "||1e100.net", "||466453.com", "||abc.xyz", @@ -1595,6 +1155,7 @@ var rules = [ "||2008xianzhang.info", "||2017.hk", "21andy.com/blog", + ".21join.com", ".21pron.com", "21sextury.com", ".228.net.tw", @@ -1636,9 +1197,10 @@ var rules = [ "64wiki.com", ".66.ca", "666kb.com", - "6park.com", + ".6park.com", "||6park.com", "||6parker.com", + "||6parknews.com", "||7capture.com", ".7cow.com", ".8-d.com", @@ -1923,6 +1485,7 @@ var rules = [ ".avdb.tv", "||avdb.tv", ".avfantasy.com", + "||avg.com", ".avgle.com", "||avgle.com", "||avidemux.org", @@ -2716,6 +2279,8 @@ var rules = [ "delicious.com/GFWbookmark", ".democrats.org", "||democrats.org", + ".demosisto.hk", + "||demosisto.hk", "||desc.se", "||dessci.com", ".destroy-china.jp", @@ -3416,6 +2981,7 @@ var rules = [ "||toutyrater.github.io", "wsgzao.github.io", "|https://wsgzao.github.io", + "||raw.githubusercontent.com", ".gizlen.net", "||gizlen.net", ".gjczz.com", @@ -4390,7 +3956,7 @@ var rules = [ ".lsmradio.com/rad_archives", ".lsmwebcast.com", ".ltn.com.tw", - "|http://ltn.com.tw", + "||ltn.com.tw", ".luke54.com", ".luke54.org", ".lupm.org", @@ -4858,6 +4424,7 @@ var rules = [ "|http://nvtongzhisheng.org", ".nwtca.org", "|http://nyaa.eu", + "||nyaa.si", ".nydus.ca", "nylon-angel.com", "nylonstockingsonline.com", @@ -5321,6 +4888,7 @@ var rules = [ "||rapidmoviez.com", "rapidvpn.com", "||rapidvpn.com", + "||rarbgprx.org", ".raremovie.cc", "|http://raremovie.cc", ".raremovie.net", @@ -6861,7 +6429,7 @@ var rules = [ "||windscribe.com", "||community.windy.com", "||wingy.site", - "winning11.com", + ".winning11.com", "winwhispers.info", "||wiredbytes.com", "||wiredpen.com", diff --git a/v2rayN/v2rayN/Resources/pac.txt.gz b/v2rayN/v2rayN/Resources/pac.txt.gz index 4020d6a6..7f621cb7 100644 Binary files a/v2rayN/v2rayN/Resources/pac.txt.gz and b/v2rayN/v2rayN/Resources/pac.txt.gz differ diff --git a/v2rayN/v2rayN/Resources/sysproxy.exe.gz b/v2rayN/v2rayN/Resources/sysproxy.exe.gz deleted file mode 100644 index 980d304b..00000000 Binary files a/v2rayN/v2rayN/Resources/sysproxy.exe.gz and /dev/null differ diff --git a/v2rayN/v2rayN/Resources/sysproxy64.exe.gz b/v2rayN/v2rayN/Resources/sysproxy64.exe.gz deleted file mode 100644 index c5ff36af..00000000 Binary files a/v2rayN/v2rayN/Resources/sysproxy64.exe.gz and /dev/null differ diff --git a/v2rayN/v2rayN/Resx/ResUI.Designer.cs b/v2rayN/v2rayN/Resx/ResUI.Designer.cs index 58b42c18..e80f0555 100644 --- a/v2rayN/v2rayN/Resx/ResUI.Designer.cs +++ b/v2rayN/v2rayN/Resx/ResUI.Designer.cs @@ -394,7 +394,7 @@ namespace v2rayN.Resx { } /// - /// 查找类似 Download V2rayCore successfully 的本地化字符串。 + /// 查找类似 Download V2ray successfully 的本地化字符串。 /// internal static string MsgDownloadV2rayCoreSuccessfully { get { @@ -448,7 +448,7 @@ namespace v2rayN.Resx { } /// - /// 查找类似 Resolve V2rayCore successfully 的本地化字符串。 + /// 查找类似 Resolve V2ray successfully 的本地化字符串。 /// internal static string MsgParsingV2rayCoreSuccessfully { get { @@ -484,7 +484,7 @@ namespace v2rayN.Resx { } /// - /// 查找类似 Start updating V2rayCore... 的本地化字符串。 + /// 查找类似 Start updating V2ray... 的本地化字符串。 /// internal static string MsgStartUpdatingV2rayCore { get { diff --git a/v2rayN/v2rayN/Resx/ResUI.resx b/v2rayN/v2rayN/Resx/ResUI.resx index 9db82297..74280a36 100644 --- a/v2rayN/v2rayN/Resx/ResUI.resx +++ b/v2rayN/v2rayN/Resx/ResUI.resx @@ -269,7 +269,7 @@ Clear original subscription content - Download V2rayCore successfully + Download V2ray successfully Failed to import subscription content @@ -287,7 +287,7 @@ PAC update succeeded - Resolve V2rayCore successfully + Resolve V2ray successfully Simplify PAC Success @@ -299,7 +299,7 @@ Start updating PAC... - Start updating V2rayCore... + Start updating V2ray... Subscription content decoding failed (non-BASE64 code) diff --git a/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx b/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx index b775c152..cf7cab26 100644 --- a/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx @@ -269,7 +269,7 @@ 清除原订阅内容 - 下载V2rayCore成功 + 下载V2ray成功 导入订阅内容失败 @@ -287,7 +287,7 @@ PAC更新成功 - 解析V2rayCore成功 + 解析V2ray成功 简化PAC成功 @@ -299,7 +299,7 @@ 开始更新PAC... - 开始更新V2rayCore... + 开始更新V2ray... 订阅内容解码失败(非BASE64码) diff --git a/v2rayN/v2rayN/Tool/FileManager.cs b/v2rayN/v2rayN/Tool/FileManager.cs index 6df1a4bb..4bfc0830 100644 --- a/v2rayN/v2rayN/Tool/FileManager.cs +++ b/v2rayN/v2rayN/Tool/FileManager.cs @@ -24,20 +24,27 @@ namespace v2rayN.Tool public static void UncompressFile(string fileName, byte[] content) { - // Because the uncompressed size of the file is unknown, - // we are using an arbitrary buffer size. - byte[] buffer = new byte[4096]; - int n; - - using (var fs = File.Create(fileName)) - using (var input = new GZipStream(new MemoryStream(content), - CompressionMode.Decompress, false)) + try { - while ((n = input.Read(buffer, 0, buffer.Length)) > 0) + // Because the uncompressed size of the file is unknown, + // we are using an arbitrary buffer size. + byte[] buffer = new byte[4096]; + int n; + + using (var fs = File.Create(fileName)) + using (var input = new GZipStream(new MemoryStream(content), + CompressionMode.Decompress, false)) { - fs.Write(buffer, 0, n); + while ((n = input.Read(buffer, 0, buffer.Length)) > 0) + { + fs.Write(buffer, 0, n); + } } } + catch (Exception ex) + { + Utils.SaveLog(ex.Message, ex); + } } public static string NonExclusiveReadAllText(string path) @@ -61,5 +68,61 @@ namespace v2rayN.Tool throw ex; } } + public static bool ZipExtractToFile(string fileName) + { + try + { + using (ZipArchive archive = ZipFile.OpenRead(fileName)) + { + foreach (ZipArchiveEntry entry in archive.Entries) + { + if (entry.Length == 0) + { + continue; + } + try + { + entry.ExtractToFile(Utils.GetPath(entry.Name), true); + } + catch (IOException ex) + { + Utils.SaveLog(ex.Message, ex); + } + } + } + } + catch (Exception ex) + { + Utils.SaveLog(ex.Message, ex); + return false; + } + return true; + } + + public static bool ZipExtractToFullFile(string fileName) + { + try + { + using (ZipArchive archive = ZipFile.OpenRead(fileName)) + { + foreach (ZipArchiveEntry entry in archive.Entries) + { + if (entry.Length == 0) + continue; + + string entryOuputPath = Utils.GetPath(entry.FullName); + FileInfo fileInfo = new FileInfo(entryOuputPath); + fileInfo.Directory.Create(); + entry.ExtractToFile(entryOuputPath, true); + } + } + } + catch (Exception ex) + { + Utils.SaveLog(ex.Message, ex); + return false; + } + return true; + } } } diff --git a/v2rayN/v2rayN/Tool/Job.cs b/v2rayN/v2rayN/Tool/Job.cs index 64415589..daee62cf 100644 --- a/v2rayN/v2rayN/Tool/Job.cs +++ b/v2rayN/v2rayN/Tool/Job.cs @@ -54,7 +54,7 @@ namespace v2rayN if (!succ) { - //Logging.Error("Failed to call AssignProcessToJobObject! GetLastError=" + Marshal.GetLastWin32Error()); + Utils.SaveLog("Failed to call AssignProcessToJobObject! GetLastError=" + Marshal.GetLastWin32Error()); } return succ; diff --git a/v2rayN/v2rayN/Tool/Utils.cs b/v2rayN/v2rayN/Tool/Utils.cs index 46f1cec8..2e840ecd 100644 --- a/v2rayN/v2rayN/Tool/Utils.cs +++ b/v2rayN/v2rayN/Tool/Utils.cs @@ -155,7 +155,7 @@ namespace v2rayN { if (wrap) { - return string.Join(",\r\n", lst.ToArray()); + return string.Join("," + Environment.NewLine, lst.ToArray()); } else { @@ -176,7 +176,7 @@ namespace v2rayN { try { - str = str.Replace("\r\n", ""); + str = str.Replace(Environment.NewLine, ""); return new List(str.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries)); } catch @@ -214,8 +214,8 @@ namespace v2rayN try { plainText = plainText.TrimEx() + .Replace(Environment.NewLine, "") .Replace("\n", "") - .Replace("\r\n", "") .Replace("\r", "") .Replace(" ", ""); @@ -657,7 +657,14 @@ namespace v2rayN return lstIPAddress; } - + public static void SetSecurityProtocol() + { + ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 + | SecurityProtocolType.Tls + | SecurityProtocolType.Tls11 + | SecurityProtocolType.Tls12; + ServicePointManager.DefaultConnectionLimit = 256; + } #endregion #region 杂项 @@ -779,16 +786,13 @@ namespace v2rayN #region TempPath - private static string _tempPath = null; - // return path to store temporary files public static string GetTempPath() { - if (_tempPath == null) + string _tempPath = Path.Combine(StartupPath(), "v2ray_win_temp"); + if (!Directory.Exists(_tempPath)) { - Directory.CreateDirectory(Path.Combine(StartupPath(), "v2ray_win_temp")); - // don't use "/", it will fail when we call explorer /select xxx/ss_win_temp\xxx.log - _tempPath = Path.Combine(StartupPath(), "v2ray_win_temp"); + Directory.CreateDirectory(_tempPath); } return _tempPath; } @@ -796,13 +800,7 @@ namespace v2rayN public static string GetTempPath(string filename) { return Path.Combine(GetTempPath(), filename); - } - - public static void ClearTempPath() - { - //Directory.Delete(GetTempPath(), true); - //_tempPath = null; - } + } public static string UnGzip(byte[] buf) { @@ -854,7 +852,7 @@ namespace v2rayN SwWrite.WriteLine(string.Format("{0}{1}[{2}]{3}", "--------------------------------", strTitle, DateTime.Now.ToString("HH:mm:ss"), "--------------------------------")); SwWrite.Write(strContent); - SwWrite.WriteLine("\r\n"); + SwWrite.WriteLine(Environment.NewLine); SwWrite.WriteLine(" "); SwWrite.Flush(); SwWrite.Close(); diff --git a/v2rayN/v2rayN/v2rayN.csproj b/v2rayN/v2rayN/v2rayN.csproj index 302c50e0..b9bb5a70 100644 --- a/v2rayN/v2rayN/v2rayN.csproj +++ b/v2rayN/v2rayN/v2rayN.csproj @@ -187,10 +187,8 @@ - - Component @@ -231,7 +229,6 @@ - @@ -289,6 +286,7 @@ SubSettingControl.cs + Designer SubSettingControl.cs @@ -331,6 +329,7 @@ Designer + SettingsSingleFileGenerator @@ -346,11 +345,7 @@ - - - - @@ -416,16 +411,18 @@ - - - - - - - - - - + + + + + + + + + + + + diff --git a/v2rayN/v2rayUpgrade/App.config b/v2rayN/v2rayUpgrade/App.config new file mode 100644 index 00000000..2d2a12d8 --- /dev/null +++ b/v2rayN/v2rayUpgrade/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/v2rayN/v2rayUpgrade/MainForm.Designer.cs b/v2rayN/v2rayUpgrade/MainForm.Designer.cs new file mode 100644 index 00000000..f212a9a9 --- /dev/null +++ b/v2rayN/v2rayUpgrade/MainForm.Designer.cs @@ -0,0 +1,106 @@ +namespace v2rayUpgrade +{ + partial class MainForm + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows 窗体设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.btnClose = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // btnClose + // + this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnClose.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.btnClose.Location = new System.Drawing.Point(367, 118); + this.btnClose.Name = "btnClose"; + this.btnClose.Size = new System.Drawing.Size(184, 89); + this.btnClose.TabIndex = 6; + this.btnClose.Text = "&Exit(退出)"; + this.btnClose.UseVisualStyleBackColor = true; + this.btnClose.Click += new System.EventHandler(this.btnClose_Click); + // + // btnOK + // + this.btnOK.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.btnOK.Location = new System.Drawing.Point(81, 118); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(184, 89); + this.btnOK.TabIndex = 7; + this.btnOK.Text = "&Upgrade(升级)"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label1.Location = new System.Drawing.Point(79, 64); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(205, 15); + this.label1.TabIndex = 8; + this.label1.Text = "升级成功后将自动重启v2rayN"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label2.Location = new System.Drawing.Point(79, 37); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(471, 15); + this.label2.TabIndex = 9; + this.label2.Text = "v2rayN will restart automatically after successful upgrade"; + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(616, 284); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.btnClose); + this.Controls.Add(this.btnOK); + this.Name = "MainForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "v2rayUpgrade"; + this.Load += new System.EventHandler(this.MainForm_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btnClose; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + } +} + diff --git a/v2rayN/v2rayUpgrade/MainForm.cs b/v2rayN/v2rayUpgrade/MainForm.cs new file mode 100644 index 00000000..281f5d4b --- /dev/null +++ b/v2rayN/v2rayUpgrade/MainForm.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.IO.Compression; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace v2rayUpgrade +{ + public partial class MainForm : Form + { + private string[] _args; + + + public MainForm(string[] args) + { + InitializeComponent(); + _args = args; + } + + private void MainForm_Load(object sender, EventArgs e) + { + + } + + private void btnOK_Click(object sender, EventArgs e) + { + if (_args.Length <= 0) + { + return; + } + try + { + var fileName = _args[0]; + var startKey = "v2rayN/"; + + using (ZipArchive archive = ZipFile.OpenRead(fileName)) + { + foreach (ZipArchiveEntry entry in archive.Entries) + { + if (entry.Length == 0) + { + continue; + } + var fullName = entry.FullName; + if (fullName.StartsWith(startKey)) + { + fullName = fullName.Substring(startKey.Length, fullName.Length - startKey.Length); + } + + string entryOuputPath = GetPath(fullName); + + FileInfo fileInfo = new FileInfo(entryOuputPath); + fileInfo.Directory.Create(); + entry.ExtractToFile(entryOuputPath, true); + } + } + } + catch (Exception ex) + { + MessageBox.Show("Upgrade Failed(升级失败)." + ex.StackTrace); + return; + } + + MessageBox.Show("Upgrade successed(升级成功)"); + + try + { + Process.Start("v2rayN.exe"); + } + catch + { + } + Close(); + } + + private void btnClose_Click(object sender, EventArgs e) + { + Close(); + } + + public static string GetExePath() + { + return Application.ExecutablePath; + } + + public static string StartupPath() + { + try + { + string exePath = GetExePath(); + return exePath.Substring(0, exePath.LastIndexOf("\\", StringComparison.Ordinal)); + } + catch + { + return Application.StartupPath; + } + } + public static string GetPath(string fileName) + { + string startupPath = StartupPath(); + if (string.IsNullOrEmpty(fileName)) + { + return startupPath; + } + return Path.Combine(startupPath, fileName); + } + } +} diff --git a/v2rayN/v2rayUpgrade/MainForm.resx b/v2rayN/v2rayUpgrade/MainForm.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/v2rayN/v2rayUpgrade/MainForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/v2rayN/v2rayUpgrade/Program.cs b/v2rayN/v2rayUpgrade/Program.cs new file mode 100644 index 00000000..8d8d0633 --- /dev/null +++ b/v2rayN/v2rayUpgrade/Program.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace v2rayUpgrade +{ + static class Program + { + /// + /// 应用程序的主入口点。 + /// + [STAThread] + static void Main(string[] args) + { + if (args.Length <= 0) + { + MessageBox.Show("Please use v2rayN to upgrade(请用v2rayN升级)"); + return; + } + + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm(args)); + } + } +} diff --git a/v2rayN/v2rayUpgrade/Properties/AssemblyInfo.cs b/v2rayN/v2rayUpgrade/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..c32abbf1 --- /dev/null +++ b/v2rayN/v2rayUpgrade/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("v2rayUpgrade")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("v2rayUpgrade")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("f82be52a-155c-492c-9e0a-1e917ec62c78")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 +// 方法是按如下所示使用“*”: : +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/v2rayN/v2rayUpgrade/Properties/Resources.Designer.cs b/v2rayN/v2rayUpgrade/Properties/Resources.Designer.cs new file mode 100644 index 00000000..5ad1ac66 --- /dev/null +++ b/v2rayN/v2rayUpgrade/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace v2rayUpgrade.Properties { + using System; + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// 返回此类使用的缓存的 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("v2rayUpgrade.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 重写当前线程的 CurrentUICulture 属性 + /// 重写当前线程的 CurrentUICulture 属性。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/v2rayN/v2rayUpgrade/Properties/Resources.resx b/v2rayN/v2rayUpgrade/Properties/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/v2rayN/v2rayUpgrade/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/v2rayN/v2rayUpgrade/Properties/Settings.Designer.cs b/v2rayN/v2rayUpgrade/Properties/Settings.Designer.cs new file mode 100644 index 00000000..5656cdc6 --- /dev/null +++ b/v2rayN/v2rayUpgrade/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace v2rayUpgrade.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/v2rayN/v2rayUpgrade/Properties/Settings.settings b/v2rayN/v2rayUpgrade/Properties/Settings.settings new file mode 100644 index 00000000..39645652 --- /dev/null +++ b/v2rayN/v2rayUpgrade/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/v2rayN/v2rayUpgrade/v2rayUpgrade.csproj b/v2rayN/v2rayUpgrade/v2rayUpgrade.csproj new file mode 100644 index 00000000..f7879414 --- /dev/null +++ b/v2rayN/v2rayUpgrade/v2rayUpgrade.csproj @@ -0,0 +1,87 @@ + + + + + Debug + AnyCPU + {F82BE52A-155C-492C-9E0A-1E917EC62C78} + WinExe + v2rayUpgrade + v2rayUpgrade + v4.6 + 512 + true + true + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + Form + + + MainForm.cs + + + + + MainForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/v2rayN/v2rayUpgrade/v2rayUpgrade.csproj.user b/v2rayN/v2rayUpgrade/v2rayUpgrade.csproj.user new file mode 100644 index 00000000..60d6da27 --- /dev/null +++ b/v2rayN/v2rayUpgrade/v2rayUpgrade.csproj.user @@ -0,0 +1,6 @@ + + + + D:\Github\v2rayN\v2rayN\v2rayUpgrade\bin\Debug\v2ray-windows.zip + + \ No newline at end of file