Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
577f69f33e | ||
|
|
d17a216fe3 | ||
|
|
8a75b86e95 | ||
|
|
04b18239d1 | ||
|
|
debfa76ea2 | ||
|
|
f71b319741 | ||
|
|
37f29128f1 | ||
|
|
dc4251c48f | ||
|
|
4a4dcd1537 | ||
|
|
48e3d6ee60 | ||
|
|
4d4bc0f050 | ||
|
|
d09700b54a | ||
|
|
427e1bba80 | ||
|
|
01d0ffcdc9 | ||
|
|
ae095ba99a | ||
|
|
3e3c41e7f9 | ||
|
|
edae4bd9d5 | ||
|
|
415baea580 | ||
|
|
bc98a9cd42 | ||
|
|
2d22608d48 | ||
|
|
5df2b77ec0 | ||
|
|
1bc7ea95eb | ||
|
|
f240dc9da8 | ||
|
|
338170f10b | ||
|
|
f02c9151de | ||
|
|
a711ee4f3f | ||
|
|
1c628492e8 | ||
|
|
045eb9e751 | ||
|
|
445013af99 | ||
|
|
156686bc98 | ||
|
|
47b611d350 | ||
|
|
b615119dcd | ||
|
|
fea60efa45 | ||
|
|
2da11beb7a | ||
|
|
9aafefad37 | ||
|
|
e8879379c9 | ||
|
|
2585c3967f | ||
|
|
2914a2d9dc | ||
|
|
f62bf91857 |
6
.github/workflows/build.yml
vendored
@@ -47,10 +47,10 @@ jobs:
|
||||
C:\builtfiles\Netch.zip
|
||||
body: |
|
||||
[](https://t.me/Netch) [](https://t.me/Netch_Discuss_Group)
|
||||
|
||||
## 更新日志:
|
||||
|
||||
## 更新日志
|
||||
* 这是 GitHub Action 自动化部署,更新日志应该很快会手动更新
|
||||
|
||||
|
||||
## 校验和
|
||||
| 文件名 | SHA256 |
|
||||
| :- | :- |
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Netch.Controllers
|
||||
{
|
||||
System.Diagnostics.Process.Start("https://netch.org/#/?id=%e4%be%9d%e8%b5%96");
|
||||
}
|
||||
Utils.Logging.Info("设置系统代理失败"+e.ToString());
|
||||
Utils.Logging.Info("设置系统代理失败" + e.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,17 +139,15 @@ namespace Netch.Controllers
|
||||
result = pNFController.Start(server, mode, false);
|
||||
if (!result)
|
||||
{
|
||||
MainForm.Instance.StatusText($"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("ReStarting Redirector")}");
|
||||
MainForm.Instance.StatusText($"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("Restarting Redirector")}");
|
||||
Utils.Logging.Info("正常启动失败后尝试停止驱动服务再重新启动");
|
||||
//正常启动失败后尝试停止驱动服务再重新启动
|
||||
result = pNFController.Start(server, mode, true);
|
||||
}
|
||||
if (result)
|
||||
Task.Run(() =>
|
||||
{
|
||||
pNTTController.Start();
|
||||
});
|
||||
|
||||
else
|
||||
{
|
||||
Task.Run(() => pNTTController.Start());
|
||||
}
|
||||
}
|
||||
else if (mode.Type == 1)
|
||||
{
|
||||
@@ -164,10 +162,9 @@ namespace Netch.Controllers
|
||||
// TUN/TAP 黑名单代理模式,启动 TUN/TAP 控制器
|
||||
result = pTUNTAPController.Start(server, mode);
|
||||
if (result)
|
||||
Task.Run(() =>
|
||||
{
|
||||
pNTTController.Start();
|
||||
});
|
||||
{
|
||||
Task.Run(() => pNTTController.Start());
|
||||
}
|
||||
}
|
||||
else if (mode.Type == 2)
|
||||
{
|
||||
@@ -182,10 +179,9 @@ namespace Netch.Controllers
|
||||
// TUN/TAP 白名单代理模式,启动 TUN/TAP 控制器
|
||||
result = pTUNTAPController.Start(server, mode);
|
||||
if (result)
|
||||
Task.Run(() =>
|
||||
{
|
||||
pNTTController.Start();
|
||||
});
|
||||
{
|
||||
Task.Run(() => pNTTController.Start());
|
||||
}
|
||||
}
|
||||
else if (mode.Type == 3 || mode.Type == 5)
|
||||
{
|
||||
|
||||
@@ -47,6 +47,11 @@ namespace Netch.Controllers
|
||||
if (!StopServiceAndRestart)
|
||||
MainForm.Instance.StatusText($"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("Starting Redirector")}");
|
||||
|
||||
if (!File.Exists("bin\\Redirector.exe"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// 检查驱动是否存在
|
||||
if (File.Exists(driverPath))
|
||||
{
|
||||
@@ -72,14 +77,14 @@ namespace Netch.Controllers
|
||||
return false;
|
||||
}
|
||||
|
||||
//检查驱动版本号
|
||||
// 检查驱动版本号
|
||||
FileVersionInfo SystemfileVerInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(driverPath);
|
||||
FileVersionInfo BinFileVerInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(string.Format("bin\\{0}", driverName));
|
||||
|
||||
if (!SystemfileVerInfo.FileVersion.Equals(BinFileVerInfo.FileVersion))
|
||||
{
|
||||
Utils.Logging.Info("开始更新驱动");
|
||||
//需要更新驱动
|
||||
// 需要更新驱动
|
||||
try
|
||||
{
|
||||
var service = new ServiceController("netfilter2");
|
||||
@@ -108,16 +113,18 @@ namespace Netch.Controllers
|
||||
else
|
||||
{
|
||||
if (!InstallDriver())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
//启动驱动服务
|
||||
// 启动驱动服务
|
||||
var service = new ServiceController("netfilter2");
|
||||
if (service.Status == ServiceControllerStatus.Running && StopServiceAndRestart)
|
||||
{
|
||||
//防止其他程序占用 重置NF百万ID限制
|
||||
// 防止其他程序占用 重置 NF 百万连接数限制
|
||||
service.Stop();
|
||||
service.WaitForStatus(ServiceControllerStatus.Stopped);
|
||||
MainForm.Instance.StatusText($"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("Starting netfilter2 Service")}");
|
||||
@@ -142,105 +149,43 @@ namespace Netch.Controllers
|
||||
}
|
||||
|
||||
var processes = "";
|
||||
|
||||
//开启进程白名单模式
|
||||
if (!Global.Settings.ProcessBypassMode)
|
||||
{
|
||||
processes += "NTT.exe,";
|
||||
}
|
||||
|
||||
foreach (var proc in mode.Rule)
|
||||
{
|
||||
processes += proc;
|
||||
processes += ",";
|
||||
}
|
||||
processes = processes.Substring(0, processes.Length - 1);
|
||||
processes += "NTT.exe";
|
||||
|
||||
Instance = MainController.GetProcess();
|
||||
var fallback = "";
|
||||
Instance.StartInfo.FileName = "bin\\Redirector.exe";
|
||||
Instance.StartInfo.Arguments = "";
|
||||
|
||||
if (Global.Settings.UseRedirector2)
|
||||
if (server.Type != "Socks5")
|
||||
{
|
||||
if (!File.Exists("bin\\Redirector2.exe"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Instance.StartInfo.FileName = "bin\\Redirector2.exe";
|
||||
|
||||
|
||||
if (server.Type != "Socks5")
|
||||
{
|
||||
fallback += $" 127.0.0.1:{Global.Settings.Socks5LocalPort}";
|
||||
fallback += $" \"{processes}\"";
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = Utils.DNS.Lookup(server.Hostname);
|
||||
if (result == null)
|
||||
{
|
||||
Utils.Logging.Info("无法解析服务器 IP 地址");
|
||||
return false;
|
||||
}
|
||||
|
||||
fallback += $" {result}:{server.Port}";
|
||||
fallback += $" \"{processes}\"";
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(server.Username) && !string.IsNullOrWhiteSpace(server.Password))
|
||||
{
|
||||
fallback += $" \"{server.Username}\"";
|
||||
fallback += $" \"{server.Password}\"";
|
||||
}
|
||||
}
|
||||
Instance.StartInfo.Arguments += $"-r 127.0.0.1:{Global.Settings.Socks5LocalPort} -p \"{processes}\"";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!File.Exists("bin\\Redirector.exe"))
|
||||
var result = Utils.DNS.Lookup(server.Hostname);
|
||||
if (result == null)
|
||||
{
|
||||
Utils.Logging.Info("无法解析服务器 IP 地址");
|
||||
return false;
|
||||
}
|
||||
Instance.StartInfo.FileName = "bin\\Redirector.exe";
|
||||
|
||||
//开启进程白名单模式
|
||||
if (Global.Settings.ProcessBypassMode)
|
||||
Instance.StartInfo.Arguments += $"-r {result}:{server.Port} -p \"{processes}\"";
|
||||
if (!string.IsNullOrWhiteSpace(server.Username) && !string.IsNullOrWhiteSpace(server.Password))
|
||||
{
|
||||
processes += ",Shadowsocks.exe";
|
||||
processes += ",ShadowsocksR.exe";
|
||||
processes += ",Privoxy.exe";
|
||||
processes += ",simple-obfs.exe";
|
||||
processes += ",v2ray.exe,v2ctl.exe,v2ray-plugin.exe";
|
||||
fallback += " -bypass true ";
|
||||
}
|
||||
else
|
||||
{
|
||||
fallback += " -bypass false ";
|
||||
}
|
||||
|
||||
if (server.Type != "Socks5")
|
||||
{
|
||||
fallback += $"-r 127.0.0.1:{Global.Settings.Socks5LocalPort} -p \"{processes}\"";
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = Utils.DNS.Lookup(server.Hostname);
|
||||
if (result == null)
|
||||
{
|
||||
Utils.Logging.Info("无法解析服务器 IP 地址");
|
||||
return false;
|
||||
}
|
||||
|
||||
fallback += $"-r {result}:{server.Port} -p \"{processes}\"";
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(server.Username) && !string.IsNullOrWhiteSpace(server.Password))
|
||||
{
|
||||
fallback += $" -username \"{server.Username}\" -password \"{server.Password}\"";
|
||||
}
|
||||
Instance.StartInfo.Arguments += $" -username \"{server.Username}\" -password \"{server.Password}\"";
|
||||
}
|
||||
}
|
||||
|
||||
if (File.Exists("logging\\redirector.log"))
|
||||
File.Delete("logging\\redirector.log");
|
||||
{
|
||||
File.Delete("logging\\redirector.log");
|
||||
}
|
||||
|
||||
Instance.StartInfo.Arguments = fallback + $" -tcport {Global.Settings.RedirectorTCPPort}";
|
||||
Instance.StartInfo.Arguments += $" -t {Global.Settings.RedirectorTCPPort}";
|
||||
Utils.Logging.Info(Instance.StartInfo.Arguments);
|
||||
Instance.OutputDataReceived += OnOutputDataReceived;
|
||||
Instance.ErrorDataReceived += OnOutputDataReceived;
|
||||
@@ -255,13 +200,8 @@ namespace Netch.Controllers
|
||||
|
||||
if (State == Models.State.Started)
|
||||
{
|
||||
Utils.Logging.Info($"成功启动Redirector耗时:{i + 1}秒");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.Logging.Info($"Redirector启动中,已耗时:{i + 1}秒");
|
||||
}
|
||||
}
|
||||
|
||||
Utils.Logging.Info("NF 进程启动超时");
|
||||
@@ -347,7 +287,7 @@ namespace Netch.Controllers
|
||||
{
|
||||
State = Models.State.Stopped;
|
||||
}
|
||||
else if (e.Data.Contains("Start") || e.Data.Contains("Redirect to"))
|
||||
else if (e.Data.Contains("Started"))
|
||||
{
|
||||
State = Models.State.Started;
|
||||
}
|
||||
@@ -358,9 +298,9 @@ namespace Netch.Controllers
|
||||
}
|
||||
else if (State == Models.State.Started)
|
||||
{
|
||||
if (e.Data.StartsWith("[Application][Bandwidth]"))
|
||||
if (e.Data.StartsWith("[APP][Bandwidth]"))
|
||||
{
|
||||
var splited = e.Data.Replace("[Application][Bandwidth]", "").Trim().Split(',');
|
||||
var splited = e.Data.Replace("[APP][Bandwidth]", "").Trim().Split(',');
|
||||
if (splited.Length == 2)
|
||||
{
|
||||
var uploadSplited = splited[0].Split(':');
|
||||
|
||||
@@ -90,6 +90,7 @@ namespace Netch.Controllers
|
||||
{
|
||||
File.Delete("logging\\NTT.log");
|
||||
}
|
||||
|
||||
File.AppendAllText("logging\\NTT.log", $"{e.Data}\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,26 +137,33 @@ namespace Netch.Controllers
|
||||
|
||||
public void OnOutputDataReceived(object sender, DataReceivedEventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(e.Data))
|
||||
try
|
||||
{
|
||||
File.AppendAllText("logging\\shadowsocks.log", $"{e.Data}\r\n");
|
||||
|
||||
if (State == Models.State.Starting)
|
||||
if (!string.IsNullOrWhiteSpace(e.Data))
|
||||
{
|
||||
if (Instance.HasExited)
|
||||
File.AppendAllText("logging\\shadowsocks.log", $"{e.Data}\r\n");
|
||||
|
||||
if (State == Models.State.Starting)
|
||||
{
|
||||
State = Models.State.Stopped;
|
||||
}
|
||||
else if (e.Data.Contains("listening at"))
|
||||
{
|
||||
State = Models.State.Started;
|
||||
}
|
||||
else if (e.Data.Contains("Invalid config path") || e.Data.Contains("usage") || e.Data.Contains("plugin service exit unexpectedly"))
|
||||
{
|
||||
State = Models.State.Stopped;
|
||||
if (Instance.HasExited)
|
||||
{
|
||||
State = Models.State.Stopped;
|
||||
}
|
||||
else if (e.Data.Contains("listening at"))
|
||||
{
|
||||
State = Models.State.Started;
|
||||
}
|
||||
else if (e.Data.Contains("Invalid config path") || e.Data.Contains("usage") || e.Data.Contains("plugin service exit unexpectedly"))
|
||||
{
|
||||
State = Models.State.Stopped;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ec)
|
||||
{
|
||||
Logging.Info("写入Shadowsocks日志失败" + ec.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Netch.Controllers
|
||||
public bool SetupBypass()
|
||||
{
|
||||
MainForm.Instance.StatusText($"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("SetupBypass")}");
|
||||
Logging.Info("设置绕行规则->设置让服务器 IP 走直连");
|
||||
Logging.Info("设置绕行规则 → 设置让服务器 IP 走直连");
|
||||
// 让服务器 IP 走直连
|
||||
foreach (var address in ServerAddresses)
|
||||
{
|
||||
@@ -81,7 +81,7 @@ namespace Netch.Controllers
|
||||
// 处理模式的绕过中国
|
||||
if (SavedMode.BypassChina)
|
||||
{
|
||||
Logging.Info("设置绕行规则->处理模式的绕过中国");
|
||||
Logging.Info("设置绕行规则 → 处理模式的绕过中国");
|
||||
using (var sr = new StringReader(Encoding.UTF8.GetString(Properties.Resources.CNIP)))
|
||||
{
|
||||
string text;
|
||||
@@ -95,7 +95,7 @@ namespace Netch.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
Logging.Info("设置绕行规则->处理全局绕过 IP");
|
||||
Logging.Info("设置绕行规则 → 处理全局绕过 IP");
|
||||
// 处理全局绕过 IP
|
||||
foreach (var ip in Global.Settings.BypassIPs)
|
||||
{
|
||||
@@ -108,7 +108,7 @@ namespace Netch.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
Logging.Info("设置绕行规则->处理绕过局域网 IP");
|
||||
Logging.Info("设置绕行规则 → 处理绕过局域网 IP");
|
||||
// 处理绕过局域网 IP
|
||||
foreach (var ip in BypassLanIPs)
|
||||
{
|
||||
@@ -123,7 +123,7 @@ namespace Netch.Controllers
|
||||
|
||||
if (SavedMode.Type == 2) // 处理仅规则内走直连
|
||||
{
|
||||
Logging.Info("设置绕行规则->处理仅规则内走直连");
|
||||
Logging.Info("设置绕行规则 → 处理仅规则内走直连");
|
||||
// 将 TUN/TAP 网卡权重放到最高
|
||||
var instance = new Process
|
||||
{
|
||||
@@ -138,7 +138,7 @@ namespace Netch.Controllers
|
||||
};
|
||||
instance.Start();
|
||||
|
||||
Logging.Info("设置绕行规则->创建默认路由");
|
||||
Logging.Info("设置绕行规则 → 创建默认路由");
|
||||
// 创建默认路由
|
||||
if (!NativeMethods.CreateRoute("0.0.0.0", 0, Global.Settings.TUNTAP.Gateway, Global.TUNTAP.Index, 10))
|
||||
{
|
||||
@@ -152,7 +152,7 @@ namespace Netch.Controllers
|
||||
return false;
|
||||
}
|
||||
|
||||
Logging.Info("设置绕行规则->创建规则路由");
|
||||
Logging.Info("设置绕行规则 → 创建规则路由");
|
||||
// 创建规则路由
|
||||
foreach (var ip in SavedMode.Rule)
|
||||
{
|
||||
@@ -182,7 +182,7 @@ namespace Netch.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
//处理NAT类型检测,由于协议的原因,无法仅通过域名确定需要代理的IP,自己记录解析了返回的IP,仅支持默认检测服务器
|
||||
//处理 NAT 类型检测,由于协议的原因,无法仅通过域名确定需要代理的 IP,自己记录解析了返回的 IP,仅支持默认检测服务器
|
||||
if (Global.Settings.STUN_Server == "stun.stunprotocol.org")
|
||||
{
|
||||
try
|
||||
@@ -200,13 +200,13 @@ namespace Netch.Controllers
|
||||
}
|
||||
catch
|
||||
{
|
||||
Logging.Info("NAT类型测试域名解析失败,将不会被添加到代理列表。");
|
||||
Logging.Info("NAT 类型测试域名解析失败,将不会被添加到代理列表");
|
||||
}
|
||||
}
|
||||
//处理DNS代理
|
||||
if (Global.Settings.TUNTAP.ProxyDNS)
|
||||
{
|
||||
Logging.Info("设置绕行规则->处理自定义DNS代理");
|
||||
Logging.Info("设置绕行规则 → 处理自定义 DNS 代理");
|
||||
if (Global.Settings.TUNTAP.UseCustomDNS)
|
||||
{
|
||||
string dns = "";
|
||||
@@ -412,6 +412,8 @@ namespace Netch.Controllers
|
||||
Logging.Info($"tun2sock使用适配器:{adapterName}");
|
||||
|
||||
string dns;
|
||||
//V2ray使用Unbound本地DNS会导致查询异常缓慢故此V2ray不启动unbound而是使用自定义DNS
|
||||
//if (Global.Settings.TUNTAP.UseCustomDNS || server.Type.Equals("VMess"))
|
||||
if (Global.Settings.TUNTAP.UseCustomDNS)
|
||||
{
|
||||
dns = "";
|
||||
@@ -428,7 +430,6 @@ namespace Netch.Controllers
|
||||
{
|
||||
pDNSController.Start();
|
||||
dns = "127.0.0.1";
|
||||
//dns = "1.1.1.1,1.0.0.1";
|
||||
}
|
||||
if (Global.Settings.TUNTAP.UseFakeDNS)
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Netch.Controllers
|
||||
|
||||
public const string Name = @"Netch";
|
||||
public const string Copyright = @"Copyright © 2019 - 2020";
|
||||
public const string Version = @"1.4.6";
|
||||
public const string Version = @"1.4.8";
|
||||
|
||||
public async void Check(bool notifyNoFound, bool isPreRelease)
|
||||
{
|
||||
|
||||
@@ -126,6 +126,15 @@ namespace Netch.Controllers
|
||||
{
|
||||
enabled = server.UseMux
|
||||
}
|
||||
},
|
||||
(mode.Type==1||mode.Type==2) ? new Models.Information.VMess.Outbounds
|
||||
{
|
||||
tag = "TUNTAP",
|
||||
protocol = "freedom"
|
||||
}: new Models.Information.VMess.Outbounds
|
||||
{
|
||||
tag = "direct",
|
||||
protocol = "freedom"
|
||||
}
|
||||
},
|
||||
routing = new Models.Information.VMess.Routing
|
||||
|
||||
2
Netch/Forms/AboutForm.Designer.cs
generated
@@ -51,7 +51,7 @@
|
||||
// SponsorPictureBox
|
||||
//
|
||||
this.SponsorPictureBox.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.SponsorPictureBox.Image = global::Netch.Properties.Resources.N3RO;
|
||||
this.SponsorPictureBox.Image = global::Netch.Properties.Resources.Sponsor;
|
||||
this.SponsorPictureBox.Location = new System.Drawing.Point(6, 22);
|
||||
this.SponsorPictureBox.Name = "SponsorPictureBox";
|
||||
this.SponsorPictureBox.Size = new System.Drawing.Size(300, 200);
|
||||
|
||||
2
Netch/Forms/MainForm.Designer.cs
generated
@@ -279,7 +279,7 @@ namespace Netch.Forms
|
||||
//
|
||||
this.reinstallTapDriverToolStripMenuItem.Name = "reinstallTapDriverToolStripMenuItem";
|
||||
this.reinstallTapDriverToolStripMenuItem.Size = new System.Drawing.Size(209, 22);
|
||||
this.reinstallTapDriverToolStripMenuItem.Text = "Reinstall Tap driver";
|
||||
this.reinstallTapDriverToolStripMenuItem.Text = "Reinstall TUN/TAP driver";
|
||||
this.reinstallTapDriverToolStripMenuItem.Click += new System.EventHandler(this.reinstallTapDriverToolStripMenuItem_Click);
|
||||
//
|
||||
// AboutToolStripButton
|
||||
|
||||
@@ -255,7 +255,7 @@ namespace Netch.Forms
|
||||
private void SaveConfigs()
|
||||
{
|
||||
Global.Settings.ServerComboBoxSelectedIndex = ServerComboBox.SelectedIndex;
|
||||
if (ModeComboBox.SelectedItem != null)
|
||||
if (ModeComboBox.Items.Count!=0 && ModeComboBox.SelectedItem != null)
|
||||
{
|
||||
|
||||
if (ModeComboBox.Tag is object[] list)
|
||||
@@ -590,7 +590,6 @@ namespace Netch.Forms
|
||||
foreach (var x in result)
|
||||
{
|
||||
x.Group = item.Remark;
|
||||
x.Remark = "[" + item.Remark + "] " + x.Remark;
|
||||
}
|
||||
Global.Settings.Server.AddRange(result);
|
||||
NotifyIcon.ShowBalloonTip(5,
|
||||
@@ -1426,15 +1425,10 @@ namespace Netch.Forms
|
||||
NotifyIcon.ShowBalloonTip(5,
|
||||
UpdateChecker.Name, Utils.i18N.Translate("ACL updated successfully"),
|
||||
ToolTipIcon.Info);
|
||||
//MessageBox.Show(Utils.i18N.Translate("ACL updated successfully"));
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.Logging.Info("ACL更新失败!" + args.Error);
|
||||
/*NotifyIcon.ShowBalloonTip(5,
|
||||
UpdateChecker.Name,
|
||||
Utils.i18N.Translate("ACL update failed") + args.Error,
|
||||
ToolTipIcon.Error);*/
|
||||
Utils.Logging.Info("ACL 更新失败!" + args.Error);
|
||||
MessageBox.Show(Utils.i18N.Translate("ACL update failed") + "\n" + args.Error);
|
||||
}
|
||||
}
|
||||
@@ -1484,11 +1478,7 @@ namespace Netch.Forms
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Utils.Logging.Info("使用代理更新ACL失败!" + e.Message);
|
||||
/*NotifyIcon.ShowBalloonTip(5,
|
||||
UpdateChecker.Name,
|
||||
Utils.i18N.Translate("ACL update failed") + args.Error,
|
||||
ToolTipIcon.Error);*/
|
||||
Utils.Logging.Info("使用代理更新 ACL 失败!" + e.Message);
|
||||
MessageBox.Show(Utils.i18N.Translate("ACL update failed") + "\n" + e.Message);
|
||||
}
|
||||
finally
|
||||
@@ -1507,20 +1497,20 @@ namespace Netch.Forms
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
StatusText($"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("Reinstalling Tap driver")}");
|
||||
StatusText($"{Utils.i18N.Translate("Status")}{Utils.i18N.Translate(": ")}{Utils.i18N.Translate("Reinstalling TUN/TAP driver")}");
|
||||
Enabled = false;
|
||||
try
|
||||
{
|
||||
Configuration.deltapall();
|
||||
Configuration.addtap();
|
||||
NotifyIcon.ShowBalloonTip(5,
|
||||
UpdateChecker.Name, Utils.i18N.Translate("Reinstall Tap driver successfully"),
|
||||
UpdateChecker.Name, Utils.i18N.Translate("Reinstall TUN/TAP driver successfully"),
|
||||
ToolTipIcon.Info);
|
||||
}
|
||||
catch
|
||||
{
|
||||
NotifyIcon.ShowBalloonTip(5,
|
||||
UpdateChecker.Name, Utils.i18N.Translate("Reinstall Tap driver failed"),
|
||||
UpdateChecker.Name, Utils.i18N.Translate("Reinstall TUN/TAP driver failed"),
|
||||
ToolTipIcon.Error);
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -114,7 +114,8 @@ namespace Netch.Forms.Server
|
||||
Password = PasswordTextBox.Text,
|
||||
EncryptMethod = EncryptMethodComboBox.Text,
|
||||
Plugin = PluginTextBox.Text,
|
||||
PluginOption = PluginOptionsTextBox.Text
|
||||
PluginOption = PluginOptionsTextBox.Text,
|
||||
Country = null
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,8 @@ namespace Netch.Forms.Server
|
||||
Protocol = ProtocolComboBox.Text,
|
||||
ProtocolParam = ProtocolParamTextBox.Text,
|
||||
OBFS = OBFSComboBox.Text,
|
||||
OBFSParam = OBFSOptionParamTextBox.Text
|
||||
OBFSParam = OBFSOptionParamTextBox.Text,
|
||||
Country = null
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,8 @@ namespace Netch.Forms.Server
|
||||
Hostname = AddressTextBox.Text,
|
||||
Port = int.Parse(PortTextBox.Text),
|
||||
Username = UsernameTextBox.Text,
|
||||
Password = PasswordTextBox.Text
|
||||
Password = PasswordTextBox.Text,
|
||||
Country = null
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,8 @@ namespace Netch.Forms.Server
|
||||
Type = "Trojan",
|
||||
Hostname = AddressTextBox.Text,
|
||||
Port = int.Parse(PortTextBox.Text),
|
||||
Password = PasswordTextBox.Text
|
||||
Password = PasswordTextBox.Text,
|
||||
Country = null
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -155,7 +155,8 @@ namespace Netch.Forms.Server
|
||||
QUICSecure = QUICSecurityComboBox.Text,
|
||||
QUICSecret = QUICSecretTextBox.Text,
|
||||
TLSSecure = TLSSecureCheckBox.Checked,
|
||||
UseMux = UseMuxCheckBox.Checked
|
||||
UseMux = UseMuxCheckBox.Checked,
|
||||
Country = null
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
163
Netch/Forms/SettingForm.Designer.cs
generated
@@ -39,8 +39,8 @@
|
||||
this.Socks5PortTextBox = new System.Windows.Forms.TextBox();
|
||||
this.TUNTAPGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.UseFakeDNSCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.TUNTAPProxyDNSCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.TUNTAPUseCustomDNSCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.ProxyDNSCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.UseCustomDNSCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.TUNTAPDNSLabel = new System.Windows.Forms.Label();
|
||||
this.TUNTAPDNSTextBox = new System.Windows.Forms.TextBox();
|
||||
this.TUNTAPGatewayLabel = new System.Windows.Forms.Label();
|
||||
@@ -59,12 +59,9 @@
|
||||
this.DetectionInterval_TextBox = new System.Windows.Forms.TextBox();
|
||||
this.EnableStartedTcping_CheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.DelayTestAfterStartup_Label = new System.Windows.Forms.Label();
|
||||
this.BypassModeCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.Redirector2checkBox = new System.Windows.Forms.CheckBox();
|
||||
this.ExperimentalFunction_Label = new System.Windows.Forms.Label();
|
||||
this.STUN_ServerPortTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.STUNServerPortLabel = new System.Windows.Forms.Label();
|
||||
this.STUNServerLabel = new System.Windows.Forms.Label();
|
||||
this.RunAtStartup = new System.Windows.Forms.CheckBox();
|
||||
this.STUN_ServerTextBox = new System.Windows.Forms.TextBox();
|
||||
this.MinimizeWhenStartedCheckBox = new System.Windows.Forms.CheckBox();
|
||||
@@ -160,8 +157,8 @@
|
||||
// TUNTAPGroupBox
|
||||
//
|
||||
this.TUNTAPGroupBox.Controls.Add(this.UseFakeDNSCheckBox);
|
||||
this.TUNTAPGroupBox.Controls.Add(this.TUNTAPProxyDNSCheckBox);
|
||||
this.TUNTAPGroupBox.Controls.Add(this.TUNTAPUseCustomDNSCheckBox);
|
||||
this.TUNTAPGroupBox.Controls.Add(this.ProxyDNSCheckBox);
|
||||
this.TUNTAPGroupBox.Controls.Add(this.UseCustomDNSCheckBox);
|
||||
this.TUNTAPGroupBox.Controls.Add(this.TUNTAPDNSLabel);
|
||||
this.TUNTAPGroupBox.Controls.Add(this.TUNTAPDNSTextBox);
|
||||
this.TUNTAPGroupBox.Controls.Add(this.TUNTAPGatewayLabel);
|
||||
@@ -182,31 +179,31 @@
|
||||
this.UseFakeDNSCheckBox.AutoSize = true;
|
||||
this.UseFakeDNSCheckBox.Location = new System.Drawing.Point(10, 160);
|
||||
this.UseFakeDNSCheckBox.Name = "UseFakeDNSCheckBox";
|
||||
this.UseFakeDNSCheckBox.Size = new System.Drawing.Size(316, 21);
|
||||
this.UseFakeDNSCheckBox.Size = new System.Drawing.Size(110, 21);
|
||||
this.UseFakeDNSCheckBox.TabIndex = 11;
|
||||
this.UseFakeDNSCheckBox.Text = "Use Fake DNS (Suggest open if NTT is Udpblock)";
|
||||
this.UseFakeDNSCheckBox.Text = "Use Fake DNS";
|
||||
this.UseFakeDNSCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// TUNTAPProxyDNSCheckBox
|
||||
// ProxyDNSCheckBox
|
||||
//
|
||||
this.TUNTAPProxyDNSCheckBox.AutoSize = true;
|
||||
this.TUNTAPProxyDNSCheckBox.Location = new System.Drawing.Point(261, 139);
|
||||
this.TUNTAPProxyDNSCheckBox.Name = "TUNTAPProxyDNSCheckBox";
|
||||
this.TUNTAPProxyDNSCheckBox.Size = new System.Drawing.Size(153, 21);
|
||||
this.TUNTAPProxyDNSCheckBox.TabIndex = 10;
|
||||
this.TUNTAPProxyDNSCheckBox.Text = "Proxy DNS in Mode 2";
|
||||
this.TUNTAPProxyDNSCheckBox.UseVisualStyleBackColor = true;
|
||||
this.ProxyDNSCheckBox.AutoSize = true;
|
||||
this.ProxyDNSCheckBox.Location = new System.Drawing.Point(261, 139);
|
||||
this.ProxyDNSCheckBox.Name = "ProxyDNSCheckBox";
|
||||
this.ProxyDNSCheckBox.Size = new System.Drawing.Size(153, 21);
|
||||
this.ProxyDNSCheckBox.TabIndex = 10;
|
||||
this.ProxyDNSCheckBox.Text = "Proxy DNS in Mode 2";
|
||||
this.ProxyDNSCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// TUNTAPUseCustomDNSCheckBox
|
||||
// UseCustomDNSCheckBox
|
||||
//
|
||||
this.TUNTAPUseCustomDNSCheckBox.AutoSize = true;
|
||||
this.TUNTAPUseCustomDNSCheckBox.Location = new System.Drawing.Point(10, 139);
|
||||
this.TUNTAPUseCustomDNSCheckBox.Name = "TUNTAPUseCustomDNSCheckBox";
|
||||
this.TUNTAPUseCustomDNSCheckBox.Size = new System.Drawing.Size(127, 21);
|
||||
this.TUNTAPUseCustomDNSCheckBox.TabIndex = 9;
|
||||
this.TUNTAPUseCustomDNSCheckBox.Text = "Use Custom DNS";
|
||||
this.TUNTAPUseCustomDNSCheckBox.UseVisualStyleBackColor = true;
|
||||
this.TUNTAPUseCustomDNSCheckBox.CheckedChanged += new System.EventHandler(this.TUNTAPUseCustomDNSCheckBox_CheckedChanged);
|
||||
this.UseCustomDNSCheckBox.AutoSize = true;
|
||||
this.UseCustomDNSCheckBox.Location = new System.Drawing.Point(10, 139);
|
||||
this.UseCustomDNSCheckBox.Name = "UseCustomDNSCheckBox";
|
||||
this.UseCustomDNSCheckBox.Size = new System.Drawing.Size(127, 21);
|
||||
this.UseCustomDNSCheckBox.TabIndex = 9;
|
||||
this.UseCustomDNSCheckBox.Text = "Use Custom DNS";
|
||||
this.UseCustomDNSCheckBox.UseVisualStyleBackColor = true;
|
||||
this.UseCustomDNSCheckBox.CheckedChanged += new System.EventHandler(this.TUNTAPUseCustomDNSCheckBox_CheckedChanged);
|
||||
//
|
||||
// TUNTAPDNSLabel
|
||||
//
|
||||
@@ -307,12 +304,9 @@
|
||||
this.BehaviorGroupBox.Controls.Add(this.DetectionInterval_TextBox);
|
||||
this.BehaviorGroupBox.Controls.Add(this.EnableStartedTcping_CheckBox);
|
||||
this.BehaviorGroupBox.Controls.Add(this.DelayTestAfterStartup_Label);
|
||||
this.BehaviorGroupBox.Controls.Add(this.BypassModeCheckBox);
|
||||
this.BehaviorGroupBox.Controls.Add(this.Redirector2checkBox);
|
||||
this.BehaviorGroupBox.Controls.Add(this.ExperimentalFunction_Label);
|
||||
this.BehaviorGroupBox.Controls.Add(this.STUN_ServerPortTextBox);
|
||||
this.BehaviorGroupBox.Controls.Add(this.label2);
|
||||
this.BehaviorGroupBox.Controls.Add(this.label1);
|
||||
this.BehaviorGroupBox.Controls.Add(this.STUNServerPortLabel);
|
||||
this.BehaviorGroupBox.Controls.Add(this.STUNServerLabel);
|
||||
this.BehaviorGroupBox.Controls.Add(this.RunAtStartup);
|
||||
this.BehaviorGroupBox.Controls.Add(this.STUN_ServerTextBox);
|
||||
this.BehaviorGroupBox.Controls.Add(this.MinimizeWhenStartedCheckBox);
|
||||
@@ -332,16 +326,16 @@
|
||||
// BootShadowsocksFromDLLCheckBox
|
||||
//
|
||||
this.BootShadowsocksFromDLLCheckBox.AutoSize = true;
|
||||
this.BootShadowsocksFromDLLCheckBox.Location = new System.Drawing.Point(12, 128);
|
||||
this.BootShadowsocksFromDLLCheckBox.Location = new System.Drawing.Point(12, 102);
|
||||
this.BootShadowsocksFromDLLCheckBox.Name = "BootShadowsocksFromDLLCheckBox";
|
||||
this.BootShadowsocksFromDLLCheckBox.Size = new System.Drawing.Size(297, 21);
|
||||
this.BootShadowsocksFromDLLCheckBox.Size = new System.Drawing.Size(321, 21);
|
||||
this.BootShadowsocksFromDLLCheckBox.TabIndex = 21;
|
||||
this.BootShadowsocksFromDLLCheckBox.Text = "Boot Shadowsocks from DLL(No support ACL)";
|
||||
this.BootShadowsocksFromDLLCheckBox.Text = "Start Shadowsocks from DLL (No support for ACL)";
|
||||
this.BootShadowsocksFromDLLCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// AclAddr
|
||||
//
|
||||
this.AclAddr.Location = new System.Drawing.Point(117, 274);
|
||||
this.AclAddr.Location = new System.Drawing.Point(120, 302);
|
||||
this.AclAddr.Name = "AclAddr";
|
||||
this.AclAddr.Size = new System.Drawing.Size(315, 23);
|
||||
this.AclAddr.TabIndex = 19;
|
||||
@@ -350,7 +344,7 @@
|
||||
// AclLabel
|
||||
//
|
||||
this.AclLabel.AutoSize = true;
|
||||
this.AclLabel.Location = new System.Drawing.Point(9, 277);
|
||||
this.AclLabel.Location = new System.Drawing.Point(12, 305);
|
||||
this.AclLabel.Name = "AclLabel";
|
||||
this.AclLabel.Size = new System.Drawing.Size(78, 17);
|
||||
this.AclLabel.TabIndex = 20;
|
||||
@@ -359,15 +353,15 @@
|
||||
// DetectionInterval_Label
|
||||
//
|
||||
this.DetectionInterval_Label.AutoSize = true;
|
||||
this.DetectionInterval_Label.Location = new System.Drawing.Point(230, 193);
|
||||
this.DetectionInterval_Label.Location = new System.Drawing.Point(229, 221);
|
||||
this.DetectionInterval_Label.Name = "DetectionInterval_Label";
|
||||
this.DetectionInterval_Label.Size = new System.Drawing.Size(128, 17);
|
||||
this.DetectionInterval_Label.Size = new System.Drawing.Size(136, 17);
|
||||
this.DetectionInterval_Label.TabIndex = 18;
|
||||
this.DetectionInterval_Label.Text = "Detection interval(/s)";
|
||||
this.DetectionInterval_Label.Text = "Detection interval(sec)";
|
||||
//
|
||||
// DetectionInterval_TextBox
|
||||
//
|
||||
this.DetectionInterval_TextBox.Location = new System.Drawing.Point(364, 190);
|
||||
this.DetectionInterval_TextBox.Location = new System.Drawing.Point(367, 218);
|
||||
this.DetectionInterval_TextBox.Name = "DetectionInterval_TextBox";
|
||||
this.DetectionInterval_TextBox.Size = new System.Drawing.Size(68, 23);
|
||||
this.DetectionInterval_TextBox.TabIndex = 17;
|
||||
@@ -376,7 +370,7 @@
|
||||
// EnableStartedTcping_CheckBox
|
||||
//
|
||||
this.EnableStartedTcping_CheckBox.AutoSize = true;
|
||||
this.EnableStartedTcping_CheckBox.Location = new System.Drawing.Point(152, 192);
|
||||
this.EnableStartedTcping_CheckBox.Location = new System.Drawing.Point(144, 220);
|
||||
this.EnableStartedTcping_CheckBox.Name = "EnableStartedTcping_CheckBox";
|
||||
this.EnableStartedTcping_CheckBox.Size = new System.Drawing.Size(66, 21);
|
||||
this.EnableStartedTcping_CheckBox.TabIndex = 15;
|
||||
@@ -386,67 +380,37 @@
|
||||
// DelayTestAfterStartup_Label
|
||||
//
|
||||
this.DelayTestAfterStartup_Label.AutoSize = true;
|
||||
this.DelayTestAfterStartup_Label.Location = new System.Drawing.Point(9, 193);
|
||||
this.DelayTestAfterStartup_Label.Location = new System.Drawing.Point(12, 221);
|
||||
this.DelayTestAfterStartup_Label.Name = "DelayTestAfterStartup_Label";
|
||||
this.DelayTestAfterStartup_Label.Size = new System.Drawing.Size(141, 17);
|
||||
this.DelayTestAfterStartup_Label.Size = new System.Drawing.Size(126, 17);
|
||||
this.DelayTestAfterStartup_Label.TabIndex = 16;
|
||||
this.DelayTestAfterStartup_Label.Text = "Delay test after startup";
|
||||
//
|
||||
// BypassModeCheckBox
|
||||
//
|
||||
this.BypassModeCheckBox.AutoSize = true;
|
||||
this.BypassModeCheckBox.Location = new System.Drawing.Point(12, 102);
|
||||
this.BypassModeCheckBox.Name = "BypassModeCheckBox";
|
||||
this.BypassModeCheckBox.Size = new System.Drawing.Size(160, 21);
|
||||
this.BypassModeCheckBox.TabIndex = 14;
|
||||
this.BypassModeCheckBox.Text = "Process whitelist mode";
|
||||
this.BypassModeCheckBox.UseVisualStyleBackColor = true;
|
||||
this.BypassModeCheckBox.CheckedChanged += new System.EventHandler(this.BypassModeCheckBox_CheckedChanged);
|
||||
//
|
||||
// Redirector2checkBox
|
||||
//
|
||||
this.Redirector2checkBox.AutoSize = true;
|
||||
this.Redirector2checkBox.Location = new System.Drawing.Point(148, 310);
|
||||
this.Redirector2checkBox.Name = "Redirector2checkBox";
|
||||
this.Redirector2checkBox.Size = new System.Drawing.Size(118, 21);
|
||||
this.Redirector2checkBox.TabIndex = 11;
|
||||
this.Redirector2checkBox.Text = "是否启用2号核心";
|
||||
this.Redirector2checkBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// ExperimentalFunction_Label
|
||||
//
|
||||
this.ExperimentalFunction_Label.AutoSize = true;
|
||||
this.ExperimentalFunction_Label.Location = new System.Drawing.Point(9, 310);
|
||||
this.ExperimentalFunction_Label.Name = "ExperimentalFunction_Label";
|
||||
this.ExperimentalFunction_Label.Size = new System.Drawing.Size(133, 17);
|
||||
this.ExperimentalFunction_Label.TabIndex = 13;
|
||||
this.ExperimentalFunction_Label.Text = "Experimental function";
|
||||
this.DelayTestAfterStartup_Label.Text = "Delay test after start";
|
||||
//
|
||||
// STUN_ServerPortTextBox
|
||||
//
|
||||
this.STUN_ServerPortTextBox.Location = new System.Drawing.Point(117, 245);
|
||||
this.STUN_ServerPortTextBox.Location = new System.Drawing.Point(120, 273);
|
||||
this.STUN_ServerPortTextBox.Name = "STUN_ServerPortTextBox";
|
||||
this.STUN_ServerPortTextBox.Size = new System.Drawing.Size(315, 23);
|
||||
this.STUN_ServerPortTextBox.TabIndex = 8;
|
||||
this.STUN_ServerPortTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// label2
|
||||
// STUNServerPortLabel
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(9, 248);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(110, 17);
|
||||
this.label2.TabIndex = 12;
|
||||
this.label2.Text = "STUN Server Port";
|
||||
this.STUNServerPortLabel.AutoSize = true;
|
||||
this.STUNServerPortLabel.Location = new System.Drawing.Point(12, 276);
|
||||
this.STUNServerPortLabel.Name = "STUNServerPortLabel";
|
||||
this.STUNServerPortLabel.Size = new System.Drawing.Size(110, 17);
|
||||
this.STUNServerPortLabel.TabIndex = 12;
|
||||
this.STUNServerPortLabel.Text = "STUN Server Port";
|
||||
//
|
||||
// label1
|
||||
// STUNServerLabel
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(9, 222);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(82, 17);
|
||||
this.label1.TabIndex = 10;
|
||||
this.label1.Text = "STUN Server";
|
||||
this.STUNServerLabel.AutoSize = true;
|
||||
this.STUNServerLabel.Location = new System.Drawing.Point(12, 250);
|
||||
this.STUNServerLabel.Name = "STUNServerLabel";
|
||||
this.STUNServerLabel.Size = new System.Drawing.Size(82, 17);
|
||||
this.STUNServerLabel.TabIndex = 10;
|
||||
this.STUNServerLabel.Text = "STUN Server";
|
||||
//
|
||||
// RunAtStartup
|
||||
//
|
||||
@@ -460,7 +424,7 @@
|
||||
//
|
||||
// STUN_ServerTextBox
|
||||
//
|
||||
this.STUN_ServerTextBox.Location = new System.Drawing.Point(117, 216);
|
||||
this.STUN_ServerTextBox.Location = new System.Drawing.Point(120, 244);
|
||||
this.STUN_ServerTextBox.Name = "STUN_ServerTextBox";
|
||||
this.STUN_ServerTextBox.Size = new System.Drawing.Size(315, 23);
|
||||
this.STUN_ServerTextBox.TabIndex = 11;
|
||||
@@ -479,7 +443,7 @@
|
||||
// ProfileCount_Label
|
||||
//
|
||||
this.ProfileCount_Label.AutoSize = true;
|
||||
this.ProfileCount_Label.Location = new System.Drawing.Point(9, 168);
|
||||
this.ProfileCount_Label.Location = new System.Drawing.Point(12, 196);
|
||||
this.ProfileCount_Label.Name = "ProfileCount_Label";
|
||||
this.ProfileCount_Label.Size = new System.Drawing.Size(79, 17);
|
||||
this.ProfileCount_Label.TabIndex = 8;
|
||||
@@ -487,7 +451,7 @@
|
||||
//
|
||||
// ProfileCount_TextBox
|
||||
//
|
||||
this.ProfileCount_TextBox.Location = new System.Drawing.Point(206, 165);
|
||||
this.ProfileCount_TextBox.Location = new System.Drawing.Point(209, 193);
|
||||
this.ProfileCount_TextBox.Name = "ProfileCount_TextBox";
|
||||
this.ProfileCount_TextBox.Size = new System.Drawing.Size(226, 23);
|
||||
this.ProfileCount_TextBox.TabIndex = 9;
|
||||
@@ -585,7 +549,7 @@
|
||||
private System.Windows.Forms.TextBox TUNTAPDNSTextBox;
|
||||
private System.Windows.Forms.Button ControlButton;
|
||||
private System.Windows.Forms.Button GlobalBypassIPsButton;
|
||||
private System.Windows.Forms.CheckBox TUNTAPUseCustomDNSCheckBox;
|
||||
private System.Windows.Forms.CheckBox UseCustomDNSCheckBox;
|
||||
private System.Windows.Forms.CheckBox AllowDevicesCheckBox;
|
||||
private System.Windows.Forms.GroupBox BehaviorGroupBox;
|
||||
private System.Windows.Forms.CheckBox ExitWhenClosedCheckBox;
|
||||
@@ -596,14 +560,11 @@
|
||||
private System.Windows.Forms.TextBox ProfileCount_TextBox;
|
||||
private System.Windows.Forms.CheckBox MinimizeWhenStartedCheckBox;
|
||||
private System.Windows.Forms.CheckBox RunAtStartup;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label STUNServerPortLabel;
|
||||
private System.Windows.Forms.Label STUNServerLabel;
|
||||
private System.Windows.Forms.TextBox STUN_ServerTextBox;
|
||||
private System.Windows.Forms.TextBox STUN_ServerPortTextBox;
|
||||
private System.Windows.Forms.CheckBox TUNTAPProxyDNSCheckBox;
|
||||
private System.Windows.Forms.CheckBox Redirector2checkBox;
|
||||
private System.Windows.Forms.Label ExperimentalFunction_Label;
|
||||
private System.Windows.Forms.CheckBox BypassModeCheckBox;
|
||||
private System.Windows.Forms.CheckBox ProxyDNSCheckBox;
|
||||
private System.Windows.Forms.TextBox DetectionInterval_TextBox;
|
||||
private System.Windows.Forms.CheckBox EnableStartedTcping_CheckBox;
|
||||
private System.Windows.Forms.Label DelayTestAfterStartup_Label;
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Netch.Forms
|
||||
|
||||
private void TUNTAPUseCustomDNSCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!TUNTAPUseCustomDNSCheckBox.Checked)
|
||||
if (!UseCustomDNSCheckBox.Checked)
|
||||
{
|
||||
TUNTAPDNSTextBox.Enabled = false;
|
||||
}
|
||||
@@ -50,12 +50,11 @@ namespace Netch.Forms
|
||||
TUNTAPAddressLabel.Text = Utils.i18N.Translate(TUNTAPAddressLabel.Text);
|
||||
TUNTAPNetmaskLabel.Text = Utils.i18N.Translate(TUNTAPNetmaskLabel.Text);
|
||||
TUNTAPGatewayLabel.Text = Utils.i18N.Translate(TUNTAPGatewayLabel.Text);
|
||||
TUNTAPUseCustomDNSCheckBox.Text = Utils.i18N.Translate(TUNTAPUseCustomDNSCheckBox.Text);
|
||||
TUNTAPProxyDNSCheckBox.Text = Utils.i18N.Translate(TUNTAPProxyDNSCheckBox.Text);
|
||||
UseCustomDNSCheckBox.Text = Utils.i18N.Translate(UseCustomDNSCheckBox.Text);
|
||||
ProxyDNSCheckBox.Text = Utils.i18N.Translate(ProxyDNSCheckBox.Text);
|
||||
UseFakeDNSCheckBox.Text = Utils.i18N.Translate(UseFakeDNSCheckBox.Text);
|
||||
GlobalBypassIPsButton.Text = Utils.i18N.Translate(GlobalBypassIPsButton.Text);
|
||||
ControlButton.Text = Utils.i18N.Translate(ControlButton.Text);
|
||||
BypassModeCheckBox.Text = Utils.i18N.Translate(BypassModeCheckBox.Text);
|
||||
BootShadowsocksFromDLLCheckBox.Text = Utils.i18N.Translate(BootShadowsocksFromDLLCheckBox.Text);
|
||||
|
||||
ExitWhenClosedCheckBox.Checked = Global.Settings.ExitWhenClosed;
|
||||
@@ -64,8 +63,6 @@ namespace Netch.Forms
|
||||
CheckUpdateWhenOpenedCheckBox.Checked = Global.Settings.CheckUpdateWhenOpened;
|
||||
MinimizeWhenStartedCheckBox.Checked = Global.Settings.MinimizeWhenStarted;
|
||||
RunAtStartup.Checked = Global.Settings.RunAtStartup;
|
||||
Redirector2checkBox.Checked = Global.Settings.UseRedirector2;
|
||||
BypassModeCheckBox.Checked = Global.Settings.ProcessBypassMode;
|
||||
EnableStartedTcping_CheckBox.Checked = Global.Settings.StartedTcping;
|
||||
DetectionInterval_TextBox.Text = Global.Settings.StartedTcping_Interval.ToString();
|
||||
BootShadowsocksFromDLLCheckBox.Checked = Global.Settings.BootShadowsocksFromDLL;
|
||||
@@ -78,8 +75,8 @@ namespace Netch.Forms
|
||||
TUNTAPNetmaskTextBox.Text = Global.Settings.TUNTAP.Netmask;
|
||||
TUNTAPGatewayTextBox.Text = Global.Settings.TUNTAP.Gateway;
|
||||
|
||||
TUNTAPUseCustomDNSCheckBox.Checked = Global.Settings.TUNTAP.UseCustomDNS;
|
||||
TUNTAPProxyDNSCheckBox.Checked = Global.Settings.TUNTAP.ProxyDNS;
|
||||
UseCustomDNSCheckBox.Checked = Global.Settings.TUNTAP.UseCustomDNS;
|
||||
ProxyDNSCheckBox.Checked = Global.Settings.TUNTAP.ProxyDNS;
|
||||
UseFakeDNSCheckBox.Checked = Global.Settings.TUNTAP.UseFakeDNS;
|
||||
|
||||
BehaviorGroupBox.Text = Utils.i18N.Translate(BehaviorGroupBox.Text);
|
||||
@@ -90,11 +87,12 @@ namespace Netch.Forms
|
||||
RunAtStartup.Text = Utils.i18N.Translate(RunAtStartup.Text);
|
||||
CheckUpdateWhenOpenedCheckBox.Text = Utils.i18N.Translate(CheckUpdateWhenOpenedCheckBox.Text);
|
||||
ProfileCount_Label.Text = Utils.i18N.Translate(ProfileCount_Label.Text);
|
||||
ExperimentalFunction_Label.Text = Utils.i18N.Translate(ExperimentalFunction_Label.Text);
|
||||
DelayTestAfterStartup_Label.Text = Utils.i18N.Translate(DelayTestAfterStartup_Label.Text);
|
||||
EnableStartedTcping_CheckBox.Text = Utils.i18N.Translate(EnableStartedTcping_CheckBox.Text);
|
||||
DetectionInterval_Label.Text = Utils.i18N.Translate(DetectionInterval_Label.Text);
|
||||
DelayTestAfterStartup_Label.Text = Utils.i18N.Translate(DelayTestAfterStartup_Label.Text);
|
||||
STUNServerLabel.Text = Utils.i18N.Translate(STUNServerLabel.Text);
|
||||
STUNServerPortLabel.Text = Utils.i18N.Translate(STUNServerPortLabel.Text);
|
||||
|
||||
ProfileCount_TextBox.Text = Global.Settings.ProfileCount.ToString();
|
||||
STUN_ServerTextBox.Text = Global.Settings.STUN_Server.ToString();
|
||||
@@ -121,7 +119,7 @@ namespace Netch.Forms
|
||||
TUNTAPDNSTextBox.Text = "1.1.1.1";
|
||||
}
|
||||
|
||||
if (!TUNTAPUseCustomDNSCheckBox.Checked)
|
||||
if (!UseCustomDNSCheckBox.Checked)
|
||||
{
|
||||
TUNTAPDNSTextBox.Enabled = false;
|
||||
}
|
||||
@@ -161,8 +159,6 @@ namespace Netch.Forms
|
||||
Global.Settings.CheckUpdateWhenOpened = CheckUpdateWhenOpenedCheckBox.Checked;
|
||||
Global.Settings.MinimizeWhenStarted = MinimizeWhenStartedCheckBox.Checked;
|
||||
Global.Settings.RunAtStartup = RunAtStartup.Checked;
|
||||
Global.Settings.UseRedirector2 = Redirector2checkBox.Checked;
|
||||
Global.Settings.ProcessBypassMode = BypassModeCheckBox.Checked;
|
||||
Global.Settings.BootShadowsocksFromDLL = BootShadowsocksFromDLLCheckBox.Checked;
|
||||
|
||||
|
||||
@@ -305,7 +301,7 @@ namespace Netch.Forms
|
||||
}
|
||||
DNS = DNS.Trim();
|
||||
TUNTAPDNSTextBox.Text = DNS.Substring(0, DNS.Length - 1);
|
||||
TUNTAPUseCustomDNSCheckBox.Checked = Global.Settings.TUNTAP.UseCustomDNS;
|
||||
UseCustomDNSCheckBox.Checked = Global.Settings.TUNTAP.UseCustomDNS;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -387,27 +383,13 @@ namespace Netch.Forms
|
||||
Global.Settings.TUNTAP.DNS.Add(ip);
|
||||
}
|
||||
|
||||
Global.Settings.TUNTAP.UseCustomDNS = TUNTAPUseCustomDNSCheckBox.Checked;
|
||||
Global.Settings.TUNTAP.ProxyDNS = TUNTAPProxyDNSCheckBox.Checked;
|
||||
Global.Settings.TUNTAP.UseCustomDNS = UseCustomDNSCheckBox.Checked;
|
||||
Global.Settings.TUNTAP.ProxyDNS = ProxyDNSCheckBox.Checked;
|
||||
Global.Settings.TUNTAP.UseFakeDNS = UseFakeDNSCheckBox.Checked;
|
||||
|
||||
Utils.Configuration.Save();
|
||||
MessageBox.Show(Utils.i18N.Translate("Saved"), Utils.i18N.Translate("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
Close();
|
||||
}
|
||||
|
||||
private void BypassModeCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (BypassModeCheckBox.Checked)
|
||||
{
|
||||
Redirector2checkBox.Checked = false;
|
||||
Redirector2checkBox.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Redirector2checkBox.Enabled = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,17 +134,16 @@ namespace Netch.Forms
|
||||
{
|
||||
if (!subitem.Remark.Equals(RemarkTextBox.Text))
|
||||
{
|
||||
//修改了订阅备注,删除旧订阅服务器
|
||||
//修改了订阅备注,修改旧订阅服务器
|
||||
Global.Settings.Server.ForEach((serverItem) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
//当前服务器组群组为订阅群组时批量修改备注
|
||||
if (serverItem.Group == subitem.Remark)
|
||||
{
|
||||
string OldServerRemark = "[" + serverItem.Group + "] ";
|
||||
Logging.Info(serverItem.Remark.Split(OldServerRemark.ToCharArray())[1]);
|
||||
serverItem.Remark = "[" + RemarkTextBox.Text + "] " + serverItem.Remark.Split(new string[] { OldServerRemark }, StringSplitOptions.None)[1];
|
||||
if (serverItem.Group == subitem.Remark) {
|
||||
|
||||
//serverItem.Group OldGroupRemark
|
||||
//RemarkTextBox.Text NewGroupRemark
|
||||
serverItem.Group = RemarkTextBox.Text;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,32 +42,7 @@ namespace Netch.Models
|
||||
/// <returns>备注</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
if (CultureInfo.CurrentCulture.Name == "zh-CN")
|
||||
{
|
||||
string Stype;
|
||||
if (Type == 0)
|
||||
{
|
||||
Stype = "[进程模式] ";
|
||||
}
|
||||
else if (Type == 1)
|
||||
{
|
||||
Stype = "[TUN/TAP 黑] ";
|
||||
}
|
||||
else if (Type == 2)
|
||||
{
|
||||
Stype = "[TUN/TAP 白] ";
|
||||
}
|
||||
else
|
||||
{
|
||||
Stype = "";
|
||||
}
|
||||
|
||||
return string.Format("{0}{1}", Stype, Remark);
|
||||
}
|
||||
else
|
||||
{
|
||||
return string.Format("[{0}] {1}", Type + 1, Remark);
|
||||
}
|
||||
return string.Format("[{0}] {1}", Type + 1, Remark);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using System;
|
||||
using MaxMind.GeoIP2;
|
||||
using Netch.Utils;
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Netch.Models
|
||||
@@ -135,6 +138,11 @@ namespace Netch.Models
|
||||
/// </summary>
|
||||
public int Delay = -1;
|
||||
|
||||
/// <summary>
|
||||
/// 地区
|
||||
/// </summary>
|
||||
public string Country;
|
||||
|
||||
/// <summary>
|
||||
/// 获取备注
|
||||
/// </summary>
|
||||
@@ -146,18 +154,50 @@ namespace Netch.Models
|
||||
Remark = $"{Hostname}:{Port}";
|
||||
}
|
||||
|
||||
if (Country == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var databaseReader = new DatabaseReader("bin\\GeoLite2-Country.mmdb");
|
||||
|
||||
if (IPAddress.TryParse(Hostname, out _) == true)
|
||||
{
|
||||
Country = databaseReader.Country(Hostname).Country.IsoCode;
|
||||
}
|
||||
else
|
||||
{
|
||||
var DnsResult = DNS.Lookup(Hostname);
|
||||
|
||||
if (DnsResult != null)
|
||||
{
|
||||
Country = databaseReader.Country(DnsResult).Country.IsoCode;
|
||||
}
|
||||
else
|
||||
{
|
||||
Country = "UN";
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Country = "UN";
|
||||
}
|
||||
}
|
||||
|
||||
Group = Group.Equals("None") ? Group.ToUpper() : Group;
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
case "Socks5":
|
||||
return $"[S5] {Remark}";
|
||||
return $"[S5][{Country}][{Group}] {Remark}";
|
||||
case "SS":
|
||||
return $"[SS] {Remark}";
|
||||
return $"[SS][{Country}][{Group}] {Remark}";
|
||||
case "SSR":
|
||||
return $"[SR] {Remark}";
|
||||
return $"[SR][{Country}][{Group}] {Remark}";
|
||||
case "VMess":
|
||||
return $"[V2] {Remark}";
|
||||
return $"[V2][{Country}][{Group}] {Remark}";
|
||||
case "Trojan":
|
||||
return $"[TR] {Remark}";
|
||||
return $"[TR][{Country}][{Group}] {Remark}";
|
||||
default:
|
||||
return "WTF";
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Netch.Models
|
||||
public bool UseCustomDNS = false;
|
||||
|
||||
/// <summary>
|
||||
/// 模式2下是否代理DNS
|
||||
/// 模式 2 下是否代理 DNS
|
||||
/// </summary>
|
||||
public bool ProxyDNS = false;
|
||||
|
||||
@@ -159,20 +159,10 @@ namespace Netch.Models
|
||||
/// </summary>
|
||||
public int STUN_Server_Port = 3478;
|
||||
|
||||
/// <summary>
|
||||
/// 是否切换为2号核心
|
||||
/// </summary>
|
||||
public bool UseRedirector2 = false;
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用进程代理白名单模式
|
||||
/// </summary>
|
||||
public bool ProcessBypassMode = false;
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用启动后延迟测试
|
||||
/// </summary>
|
||||
public bool StartedTcping = true;
|
||||
public bool StartedTcping = false;
|
||||
|
||||
/// <summary>
|
||||
/// 启动后延迟测试间隔/秒
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
@@ -122,8 +121,11 @@ namespace Netch
|
||||
|
||||
public static void Application_OnException(object sender, ThreadExceptionEventArgs e)
|
||||
{
|
||||
MessageBox.Show(e.Exception.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Application.Exit();
|
||||
if (!e.Exception.ToString().Contains("ComboBox"))
|
||||
{
|
||||
MessageBox.Show(e.Exception.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
//Application.Exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,8 +50,9 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ini-parser" Version="2.5.2" />
|
||||
<PackageReference Include="MaxMind.GeoIP2" Version="3.2.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="System.Buffers" Version="4.5.0" />
|
||||
<PackageReference Include="System.Buffers" Version="4.5.1" />
|
||||
<PackageReference Include="WindowsAPICodePack-Shell" Version="1.1.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
20
Netch/Properties/Resources.Designer.cs
generated
@@ -110,16 +110,6 @@ namespace Netch.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap N3RO {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("N3RO", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
@@ -140,6 +130,16 @@ namespace Netch.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Sponsor {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Sponsor", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Byte[] 类型的本地化资源。
|
||||
/// </summary>
|
||||
|
||||
@@ -139,8 +139,8 @@
|
||||
<data name="Netch" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Netch.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="N3RO" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\N3RO.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="Sponsor" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Sponsor.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="CopyLink" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\CopyLink.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
|
||||
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
@@ -91,14 +91,14 @@
|
||||
"Modes have been reload": "模式已重载",
|
||||
"Clean DNS Cache": "清理 DNS 缓存",
|
||||
"DNS cache cleanup succeeded": "DNS 缓存清理成功",
|
||||
"Update ACL": "更新ACL规则",
|
||||
"Update ACL": "更新 ACL 规则",
|
||||
"Update ACL with proxy": "使用代理更新 ACL 规则",
|
||||
"ACL updated successfully": "ACL 更新成功",
|
||||
"ACL update failed": "ACL更新失败",
|
||||
"Reinstall Tap driver": "重新安装 TUN/TAP 驱动",
|
||||
"Reinstall Tap driver successfully": "重装 TUN/TAP 驱动成功",
|
||||
"Reinstall Tap driver failed": "重装 TUN/TAP 驱动失败",
|
||||
"Reinstalling Tap driver": "正在重装 TUN/TAP 驱动",
|
||||
"ACL update failed": "ACL 更新失败",
|
||||
"Reinstall TUN/TAP driver": "重新安装 TUN/TAP 驱动",
|
||||
"Reinstall TUN/TAP driver successfully": "重装 TUN/TAP 驱动成功",
|
||||
"Reinstall TUN/TAP driver failed": "重装 TUN/TAP 驱动失败",
|
||||
"Reinstalling TUN/TAP driver": "正在重装 TUN/TAP 驱动",
|
||||
|
||||
"About": "关于",
|
||||
"Telegram Channel": "Telegram 频道",
|
||||
@@ -156,13 +156,14 @@
|
||||
"Gateway": "网关",
|
||||
"Use Custom DNS": "使用自定义 DNS",
|
||||
"Proxy DNS in Mode 2": "在模式 2 下代理 DNS",
|
||||
"Use Fake DNS (Suggest open if NTT is Udpblock)": "使用 Fake DNS (建议节点 NAT 测试为 UdpBlocked 时开启)",
|
||||
"Use Fake DNS": "使用 Fake DNS",
|
||||
"Behavior": "行为",
|
||||
"Exit when closed": "关闭时退出",
|
||||
"Stop when exited": "退出时停止",
|
||||
"Global Bypass IPs": "全局直连 IP",
|
||||
"Port value illegal. Try again.": "端口值非法。请重试。",
|
||||
"Check update when opened": "打开软件时检查更新",
|
||||
"Start Shadowsocks from DLL (No support for ACL)": "SS DLL(推荐使用,不支持 ACL)",
|
||||
"ProfileCount": "快捷配置数量(重启软件生效)",
|
||||
"ProfileCount value illegal. Try again.": "快捷配置数值非法。请重试。",
|
||||
"STUN_ServerPort value illegal. Try again.": "STUN 端口数值非法。请重试。",
|
||||
@@ -170,12 +171,12 @@
|
||||
"TUN/TAP driver is not detected. Is it installed now?": "未检测到 TUN/TAP 驱动,是否现在安装?",
|
||||
"Failed to set the system proxy, it may be caused by the lack of dependent programs. Do you want to jump to Netch's official website to download dependent programs?": "设置系统代理失败,可能是缺少依赖导致,是否跳转 Netch 官网下载依赖程序?",
|
||||
"Experimental function": "实验性功能",
|
||||
"Delay test after startup": "启动后延迟测试",
|
||||
"Delay test after start": "启动后延迟测试",
|
||||
"Enable": "启用",
|
||||
"Detection interval(/s)": "检测间隔(/秒)",
|
||||
"Detection interval(sec)": "检测间隔(秒)",
|
||||
"STUN Server": "STUN 服务器",
|
||||
"STUN Server Port": "STUN 服务器端口",
|
||||
"Custom ACL": "自定义 ACL 规则",
|
||||
"Process whitelist mode": "进程白名单模式",
|
||||
"Boot Shadowsocks from DLL(No support ACL)": "SS DLL(推荐使用,不支持 ACL)",
|
||||
|
||||
"Profile": "配置名",
|
||||
"Profiles": "配置",
|
||||
@@ -186,7 +187,7 @@
|
||||
|
||||
"Bypass LAN": "[网页代理] 绕过局域网",
|
||||
"Bypass LAN (Non System Proxy)": "[网页代理] 绕过局域网(不设置系统代理)",
|
||||
"Bypass LAN (TUN/TAP)": "[TAP/TAP] 绕过局域网",
|
||||
"Bypass LAN (TUN/TAP)": "[TUN/TAP] 绕过局域网",
|
||||
"Bypass LAN and China": "[网页代理] 绕过局域网和中国大陆",
|
||||
"Bypass LAN and China (Non System Proxy)": "[网页代理] 绕过局域网和中国大陆 (不设置系统代理)",
|
||||
"Bypass LAN and China (TUN/TAP)": "[TUN/TAP] 绕过局域网和中国大陆"
|
||||
|
||||
@@ -395,7 +395,7 @@ namespace Netch.Utils
|
||||
}
|
||||
|
||||
data.FakeType = vmess.type;
|
||||
if (!Global.FakeTypes.Contains(data.FakeType))
|
||||
if (data.FakeType.Length != 0 && !Global.FakeTypes.Contains(data.FakeType))
|
||||
{
|
||||
Logging.Info(string.Format("不支持的 VMess 伪装类型:{0}", data.FakeType));
|
||||
return null;
|
||||
@@ -516,6 +516,56 @@ namespace Netch.Utils
|
||||
}
|
||||
list.Add(NetchLink);
|
||||
}
|
||||
else if (text.StartsWith("trojan://"))
|
||||
{
|
||||
var data = new Server();
|
||||
data.Type = "Trojan";
|
||||
|
||||
text = text.Replace("/?", "?");
|
||||
try
|
||||
{
|
||||
if (text.Contains("#"))
|
||||
{
|
||||
data.Remark = HttpUtility.UrlDecode(text.Split('#')[1]);
|
||||
text = text.Split('#')[0];
|
||||
}
|
||||
if (text.Contains("?"))
|
||||
{
|
||||
var reg = new Regex(@"^(?<data>.+?)\?(.+)$");
|
||||
var regmatch = reg.Match(text);
|
||||
|
||||
if (regmatch.Success)
|
||||
{
|
||||
var peer = HttpUtility.UrlDecode(HttpUtility.ParseQueryString(new Uri(text).Query).Get("peer"));
|
||||
|
||||
if (peer != null)
|
||||
data.Host = peer;
|
||||
|
||||
text = regmatch.Groups["data"].Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new FormatException();
|
||||
}
|
||||
}
|
||||
var finder = new Regex(@"^trojan://(?<psk>.+?)@(?<server>.+):(?<port>\d+)");
|
||||
var match = finder.Match(text);
|
||||
if (!match.Success)
|
||||
{
|
||||
throw new FormatException();
|
||||
}
|
||||
|
||||
data.Password = match.Groups["psk"].Value;
|
||||
data.Hostname = match.Groups["server"].Value;
|
||||
data.Port = int.Parse(match.Groups["port"].Value);
|
||||
|
||||
list.Add(data);
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -523,6 +573,16 @@ namespace Netch.Utils
|
||||
return null;
|
||||
}
|
||||
|
||||
byte[] emoji_bytes = { 240, 159 };
|
||||
foreach (Server node in list)
|
||||
{
|
||||
var remark = Encoding.UTF8.GetBytes(node.Remark);
|
||||
int start_index = 0;
|
||||
while (remark.Length > start_index + 1 && remark[start_index] == emoji_bytes[0] && remark[start_index + 1] == emoji_bytes[1])
|
||||
start_index += 4;
|
||||
node.Remark = Encoding.UTF8.GetString(remark.Skip(start_index).ToArray()).Trim();
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
public static string UnBase64String(string value)
|
||||
|
||||
@@ -82,69 +82,76 @@ namespace System.Windows.Forms
|
||||
private object[] newList;
|
||||
private void ReevaluateCompletionList()
|
||||
{
|
||||
var currentSearchTerm = Text.ToLowerInvariant();
|
||||
if (currentSearchTerm == _previousSearchTerm) return;
|
||||
|
||||
_previousSearchTerm = currentSearchTerm;
|
||||
try
|
||||
{
|
||||
SuspendLayout();
|
||||
|
||||
var originalList = (object[])Tag;
|
||||
if (originalList == null)
|
||||
{
|
||||
Tag = originalList = Items.Cast<object>().ToArray();
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(currentSearchTerm))
|
||||
{
|
||||
if (Items.Count == originalList.Length) return;
|
||||
|
||||
newList = originalList;
|
||||
}
|
||||
else
|
||||
{
|
||||
newList = originalList.Where(x => x.ToString().ToLowerInvariant().Contains(currentSearchTerm)).ToArray();
|
||||
}
|
||||
var currentSearchTerm = Text.ToLowerInvariant();
|
||||
if (currentSearchTerm == _previousSearchTerm) return;
|
||||
|
||||
_previousSearchTerm = currentSearchTerm;
|
||||
try
|
||||
{
|
||||
while (Items.Count > 0)
|
||||
SuspendLayout();
|
||||
|
||||
var originalList = (object[])Tag;
|
||||
if (originalList == null)
|
||||
{
|
||||
Items.RemoveAt(0);
|
||||
Tag = originalList = Items.Cast<object>().ToArray();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
if (string.IsNullOrEmpty(currentSearchTerm))
|
||||
{
|
||||
if (Items.Count == originalList.Length) return;
|
||||
|
||||
newList = originalList;
|
||||
}
|
||||
else
|
||||
{
|
||||
newList = originalList.Where(x => x.ToString().ToLowerInvariant().Contains(currentSearchTerm)).ToArray();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Items.Clear();
|
||||
while (Items.Count > 0)
|
||||
{
|
||||
Items.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
try
|
||||
{
|
||||
Items.Clear();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Items.AddRange(newList.ToArray());
|
||||
Items.AddRange(newList.ToArray());
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (currentSearchTerm.Length >= 2 && !DroppedDown)
|
||||
{
|
||||
DroppedDown = true;
|
||||
Cursor.Current = Cursors.Default;
|
||||
Text = currentSearchTerm;
|
||||
Select(currentSearchTerm.Length, 0);
|
||||
}
|
||||
|
||||
if (Items.Count > 0)
|
||||
{
|
||||
DroppedDown = false;
|
||||
DroppedDown = true;
|
||||
}
|
||||
|
||||
ResumeLayout(true);
|
||||
}
|
||||
}
|
||||
finally
|
||||
catch
|
||||
{
|
||||
if (currentSearchTerm.Length >= 2 && !DroppedDown)
|
||||
{
|
||||
DroppedDown = true;
|
||||
Cursor.Current = Cursors.Default;
|
||||
Text = currentSearchTerm;
|
||||
Select(currentSearchTerm.Length, 0);
|
||||
}
|
||||
|
||||
if (Items.Count > 0)
|
||||
{
|
||||
DroppedDown = false;
|
||||
DroppedDown = true;
|
||||
}
|
||||
|
||||
ResumeLayout(true);
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ Game accelerator
|
||||
|
||||
[简体中文](docs/README.zh-CN.md) (此版本内容更丰富)
|
||||
|
||||
[Website](https://netch.org/)
|
||||
|
||||
## TOC
|
||||
- [Netch](#netch)
|
||||
- [TOC](#toc)
|
||||
|
||||
2
binaries
@@ -13,13 +13,13 @@
|
||||
|
||||
首先,点击`服务器`增加所需服务器
|
||||
|
||||
<img width="50%" height="50%" src="screenshots/Add-server.png">
|
||||
<img width="50%" height="50%" src="screenshots/addServer.zh-CN.png">
|
||||
|
||||
可手动添加单个服务器,或者通过剪切板链接添加单个服务器。也可通过订阅链接批量添加。
|
||||
|
||||
点击 `订阅` ` 管理订阅链接` 进入以下界面。
|
||||
|
||||
<img width="50%" height="50%" src="screenshots/Add-link.jpg">
|
||||
<img width="50%" height="50%" src="screenshots/addLink.zh-CN.png">
|
||||
|
||||
填写备注与链接,点击添加,然后保存。保存后点击 `订阅` ` 从订阅链接更新服务器`。完成服务器添加。添加完服务器后可对服务器进行修改,删除和测速。
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
游戏加速工具
|
||||
|
||||
[网站](https://netch.org/)
|
||||
|
||||
## TOC
|
||||
- [Netch](#Netch)
|
||||
- [TOC](#TOC)
|
||||
@@ -22,7 +24,7 @@ Netch 是一款 Windows 平台的开源游戏加速工具,Netch 可以实现
|
||||
- XMR *48ju3ELNZEa6wwPBMexCJ9G218BGY2XwhH6B6bmkFuJ3QgM4hPw2Pra35jPtuBZSc7SLNWeBpiWJZWjQeMAiLnTx2tH2Efx*
|
||||
|
||||
## 新手入门
|
||||
[新手入门教程](Basic-usage.md)
|
||||
[新手入门教程](Quickstart.zh-CN.md)
|
||||
|
||||
## 进阶用法
|
||||
[进阶教程](https://github.com/NormanBB/NetchMode/blob/master/docs/README.zh-CN.md)
|
||||
|
||||
|
Before Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 33 KiB |
BIN
docs/screenshots/addLink.zh-CN.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
docs/screenshots/addServer.zh-CN.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 18 KiB |