:wastebasket:cleanup

This commit is contained in:
Amazing_DM
2020-04-23 14:56:12 +08:00
parent 6649a1fce9
commit f244212cdf
16 changed files with 19 additions and 86 deletions

View File

@@ -2,8 +2,6 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Threading;
namespace Netch.Controllers
{

View File

@@ -1,5 +1,4 @@
using System;
using Microsoft.Win32;
namespace Netch.Controllers
{

View File

@@ -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

View File

@@ -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";

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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;

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections;
using System.Net;
using System.Windows.Forms;
using TaskScheduler;

View File

@@ -1,5 +1,4 @@
using Netch.Models;
using System;
using System;
using System.Collections.Generic;
using System.Windows.Forms;

View File

@@ -1,7 +1,7 @@
namespace Netch.Models
{
public class Profile
{
{
public string ServerRemark;
public string ModeRemark;
public string ProfileName;
@@ -24,5 +24,5 @@
}
}
}
}

View File

@@ -178,6 +178,6 @@ namespace Netch.Models
/// ACL规则
/// </summary>
public string ACL = "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/banAD.acl";
}
}

View File

@@ -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" />

View File

@@ -1,6 +1,6 @@
using System.Reflection;
using Netch.Controllers;
using System.Reflection;
using System.Runtime.InteropServices;
using Netch.Controllers;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改

View File

@@ -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);
}
}
}

View File

@@ -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);

View File

@@ -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
{