Update submodule

:sparkles:ssr添加rc4-md5-6加密支持
:sparkles:启动前清除dns
:art:增加启动成功率(:D
:globe_with_meridians:更新翻译文件
This commit is contained in:
Amazing_DM
2020-03-19 12:30:58 +08:00
parent 7998be0c74
commit e33cd6d2d2
7 changed files with 35 additions and 4 deletions

View File

@@ -1,12 +1,15 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
namespace Netch.Controllers
{
public class MainController
{
[DllImport("dnsapi", EntryPoint = "DnsFlushResolverCache")]
public static extern UInt32 FlushDNSResolverCache();
public static Process GetProcess()
{
var process = new Process();
@@ -65,6 +68,8 @@ namespace Netch.Controllers
/// <returns>是否启动成功</returns>
public bool Start(Models.Server server, Models.Mode mode)
{
FlushDNSResolverCache();
var result = false;
switch (server.Type)
{

View File

@@ -49,9 +49,26 @@ namespace Netch.Controllers
// 生成驱动文件路径
var driver = string.Format("{0}\\drivers\\netfilter2.sys", Environment.SystemDirectory);
// 检查驱动是否存在
if (!File.Exists(driver))
if (File.Exists(driver))
{
//为了防止小白一直问如何卸载老驱动核心,每次启动时卸载删除一次驱动,保证系统使用最新驱动核心(简单粗暴 但有效:D。增加启动成功率驱动在被其他加速器占用的情况下可能会导致启动失败
try
{
var service = new ServiceController("netfilter2");
if (service.Status == ServiceControllerStatus.Running)
{
service.Stop();
service.WaitForStatus(ServiceControllerStatus.Stopped);
}
nfapinet.NFAPI.nf_unRegisterDriver("netfilter2");
File.Delete(driver);
}
catch (Exception)
{
// 跳过
}
// 生成系统版本
var version = $"{Environment.OSVersion.Version.Major.ToString()}.{Environment.OSVersion.Version.Minor.ToString()}";
@@ -94,6 +111,10 @@ namespace Netch.Controllers
return false;
}
}
// 检查驱动是否存在
/*if (!File.Exists(driver))
{
}*/
try
{

View File

@@ -488,6 +488,7 @@ namespace Netch.Forms
if (Global.Settings.SubscribeLink.Count > 0)
{
StatusLabel.Text = $"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("Starting update subscription")}";
DeletePictureBox.Enabled = false;
UpdateServersFromSubscribeLinksToolStripMenuItem.Enabled = false;
@@ -571,6 +572,7 @@ namespace Netch.Forms
NatTypeStatusLabel.Text = "";
}
Utils.Configuration.Save();
StatusLabel.Text = $"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("Subscription updated")}";
}).ContinueWith(task =>
{
BeginInvoke(new Action(() =>

View File

@@ -56,6 +56,7 @@ namespace Netch
"table",
"rc4",
"rc4-md5",
"rc4-md5-6",
"aes-128-cfb",
"aes-192-cfb",
"aes-256-cfb",

View File

@@ -27,6 +27,8 @@
"Starting dns2tcp Service": "正在启动dns2tcp服务",
"SetupBypass": "设置绕行规则",
"Test failed": "测试失败",
"Starting update subscription": "正在更新订阅",
"Subscription updated": "订阅更新完毕",
"Server": "服务器",
"Import Servers From Clipboard": "从剪贴板导入服务器",

2
modes

Submodule modes updated: 8d6f98d43e...b1366d48be