mirror of
https://github.com/netchx/netch.git
synced 2026-05-11 23:45:06 +08:00
:wastebasket:cleanup
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
|
||||
namespace Netch.Controllers
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace Netch.Controllers
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@ using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Netch.Controllers
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Netch.Controllers
|
||||
{
|
||||
Instance.StartInfo.Arguments = $"-s {server.Hostname} -p {server.Port} -b {Global.Settings.LocalAddress} -l {Global.Settings.Socks5LocalPort} -m {server.EncryptMethod} -k \"{server.Password}\" -u";
|
||||
}
|
||||
|
||||
|
||||
if (mode.BypassChina)
|
||||
{
|
||||
Instance.StartInfo.Arguments += " --acl default.acl";
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
using System;
|
||||
using Netch.Forms;
|
||||
using Netch.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using Netch.Forms;
|
||||
using Netch.Utils;
|
||||
|
||||
namespace Netch.Controllers
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using Netch.Models.GitHubRelease;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Netch.Models.GitHubRelease;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Netch.Controllers
|
||||
{
|
||||
|
||||
@@ -6,7 +6,6 @@ using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.ServiceProcess;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Net;
|
||||
using System.Windows.Forms;
|
||||
using TaskScheduler;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Netch.Models;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Netch.Models
|
||||
{
|
||||
public class Profile
|
||||
{
|
||||
{
|
||||
public string ServerRemark;
|
||||
public string ModeRemark;
|
||||
public string ProfileName;
|
||||
@@ -24,5 +24,5 @@
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,6 +178,6 @@ namespace Netch.Models
|
||||
/// ACL规则
|
||||
/// </summary>
|
||||
public string ACL = "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/banAD.acl";
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,8 +65,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DNS" Version="5.0.0" />
|
||||
<PackageReference Include="DnsClient" Version="1.2.0" />
|
||||
<PackageReference Include="ini-parser" Version="2.5.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="System.Buffers" Version="4.5.0" />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Reflection;
|
||||
using Netch.Controllers;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using Netch.Controllers;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
using DNS.Protocol;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Netch
|
||||
{
|
||||
public class Resolver : DNS.Client.RequestResolver.IRequestResolver
|
||||
{
|
||||
public Task<IResponse> Resolve(IRequest request)
|
||||
{
|
||||
IResponse response = Response.FromRequest(request);
|
||||
|
||||
foreach (var question in response.Questions)
|
||||
{
|
||||
if (question.Type == RecordType.A)
|
||||
{
|
||||
var client = new DnsClient.LookupClient(DnsClient.NameServer.GooglePublicDns);
|
||||
client.UseTcpOnly = true;
|
||||
client.UseCache = true;
|
||||
|
||||
try
|
||||
{
|
||||
var result = client.Query(question.Name.ToString(), DnsClient.QueryType.A);
|
||||
foreach (var item in result.Answers.ARecords())
|
||||
{
|
||||
response.AnswerRecords.Add(new DNS.Protocol.ResourceRecords.IPAddressResourceRecord(question.Name, item.Address));
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// 跳过
|
||||
}
|
||||
}
|
||||
else if (question.Type == RecordType.AAAA)
|
||||
{
|
||||
var client = new DnsClient.LookupClient(DnsClient.NameServer.GooglePublicDns);
|
||||
client.UseTcpOnly = true;
|
||||
client.UseCache = true;
|
||||
|
||||
try
|
||||
{
|
||||
var result = client.Query(question.Name.ToString(), DnsClient.QueryType.AAAA);
|
||||
foreach (var item in result.Answers.AaaaRecords())
|
||||
{
|
||||
response.AnswerRecords.Add(new DNS.Protocol.ResourceRecords.IPAddressResourceRecord(question.Name, item.Address));
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// 跳过
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Task.FromResult(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,7 +175,8 @@ namespace Netch.Utils
|
||||
|
||||
Global.TUNTAP.ComponentID = TUNTAP.GetComponentID();
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//MessageBox.Show(i18N.Translate("Please install TAP-Windows and create an TUN/TAP adapter manually"), i18N.Translate("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
using System;
|
||||
using Netch.Models;
|
||||
using Netch.Models.SS;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using Netch.Models;
|
||||
using Netch.Models.SS;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Netch.Utils
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user