From 2a8754ecfba4d3d9a12f7ffd19dd2d4ed385dc2b Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Tue, 14 Sep 2021 09:42:00 +0800 Subject: [PATCH] Update build --- Netch.sln | 4 ++-- Netch/Utils/SystemInfo.cs | 9 ++++++--- build.ps1 | 4 +++- scripts/download.ps1 | 4 ++-- scripts/download/cloak.ps1 | 2 +- scripts/download/xray-core.ps1 | 6 +++--- 6 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Netch.sln b/Netch.sln index fe35ecd3..912961af 100644 --- a/Netch.sln +++ b/Netch.sln @@ -29,8 +29,8 @@ Global {4B041B91-5790-4571-8C58-C63FFE4BC9F8}.Release|x64.Build.0 = Release|x64 {38240783-9AD2-4A01-84C1-1A3E5F05720F}.Debug|x64.ActiveCfg = Debug|x64 {38240783-9AD2-4A01-84C1-1A3E5F05720F}.Debug|x64.Build.0 = Debug|x64 - {38240783-9AD2-4A01-84C1-1A3E5F05720F}.Release|x64.ActiveCfg = Release|Any CPU - {38240783-9AD2-4A01-84C1-1A3E5F05720F}.Release|x64.Build.0 = Release|Any CPU + {38240783-9AD2-4A01-84C1-1A3E5F05720F}.Release|x64.ActiveCfg = Release|x64 + {38240783-9AD2-4A01-84C1-1A3E5F05720F}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Netch/Utils/SystemInfo.cs b/Netch/Utils/SystemInfo.cs index c1b071da..ed23ffaa 100644 --- a/Netch/Utils/SystemInfo.cs +++ b/Netch/Utils/SystemInfo.cs @@ -13,14 +13,14 @@ namespace Netch.Utils var mc = new ManagementClass("Win32_SystemDriver"); foreach (var obj in mc.GetInstances().Cast()) { - if (!(bool) obj["Started"]) + if (!(bool)obj["Started"]) continue; var path = obj["PathName"].ToString(); if (path == null) continue; - var vendorExclude = new[] {"microsoft", "intel", "amd", "nvidia", "realtek"}; + var vendorExclude = new[] { "microsoft", "intel", "amd", "nvidia", "realtek" }; var vendorName = FileVersionInfo.GetVersionInfo(path).LegalCopyright ?? string.Empty; if (!allDriver && vendorExclude.Any(s => vendorName.Contains(s, StringComparison.OrdinalIgnoreCase))) continue; @@ -32,6 +32,7 @@ namespace Netch.Utils public static IEnumerable Processes(bool mask) { var hashset = new HashSet(); + var windowsFolder = Environment.GetFolderPath(Environment.SpecialFolder.Windows); foreach (var process in Process.GetProcesses()) { try @@ -39,8 +40,10 @@ namespace Netch.Utils if (process.Id is 0 or 4) continue; - if (process.MainModule!.FileName!.StartsWith(Environment.GetFolderPath(Environment.SpecialFolder.Windows), StringComparison.OrdinalIgnoreCase)) + // ! NT Kernel & System + if (process.MainModule!.FileName!.StartsWith(windowsFolder, StringComparison.OrdinalIgnoreCase)) continue; + var path = process.MainModule.FileName; if (mask) diff --git a/build.ps1 b/build.ps1 index 8f5e029e..3728fb9c 100644 --- a/build.ps1 +++ b/build.ps1 @@ -22,7 +22,9 @@ param ( $PublishSingleFile = $True ) -# .\scripts\download.ps1 $OutputPath +Remove-Item -Recurse -Force $OutputPath + +.\scripts\download.ps1 $OutputPath # if ( -Not $? ) { # Exit 1 diff --git a/scripts/download.ps1 b/scripts/download.ps1 index 20464125..c515af3f 100644 --- a/scripts/download.ps1 +++ b/scripts/download.ps1 @@ -20,7 +20,7 @@ New-Item -ItemType Directory -Name bin | Out-Null New-Item -ItemType Directory -Name mode | Out-Null New-Item -ItemType Directory -Name i18n | Out-Null -Copy-Item -Recurse -Force .\netchdata-master\* .\bin +Copy-Item -Recurse -Force .\netchdata-master\* .\bin -Exclude @('tap2socks.bin') Copy-Item -Recurse -Force .\netchmode-master\mode\* .\mode Copy-Item -Recurse -Force .\netchi18n-master\i18n\* .\i18n @@ -31,7 +31,7 @@ Remove-Item -Force data.zip Remove-Item -Force mode.zip Remove-Item -Force i18n.zip -..\scripts\download\aiodns.ps1 -OutputPath bin +#..\scripts\download\aiodns.ps1 -OutputPath bin ..\scripts\download\cloak.ps1 -OutputPath bin ..\scripts\download\xray-core.ps1 -OutputPath bin diff --git a/scripts/download/cloak.ps1 b/scripts/download/cloak.ps1 index bf208128..306697d5 100644 --- a/scripts/download/cloak.ps1 +++ b/scripts/download/cloak.ps1 @@ -1,5 +1,5 @@ param([string]$OutputPath) -$address="https://github.com/cbeuw/Cloak/releases/download/v2.5.4/ck-client-windows-amd64-v2.5.4.exe" +$address="https://github.com/cbeuw/Cloak/releases/download/v2.5.5/ck-client-windows-amd64-v2.5.5.exe" Invoke-WebRequest -Uri $address -OutFile ck-client.exe diff --git a/scripts/download/xray-core.ps1 b/scripts/download/xray-core.ps1 index e65fd5ed..f50f2f5a 100644 --- a/scripts/download/xray-core.ps1 +++ b/scripts/download/xray-core.ps1 @@ -1,12 +1,12 @@ param([string]$OutputPath) -$address="https://github.com/XTLS/Xray-core/releases/download/v1.4.2/Xray-windows-64.zip" +$address="https://github.com/XTLS/Xray-core/releases/download/v1.4.3/Xray-windows-64.zip" Invoke-WebRequest -Uri $address -OutFile xray-core.zip Expand-Archive -Force -Path xray-core.zip -DestinationPath xray-core Move-Item -Force xray-core\xray.exe $OutputPath -Move-Item -Force xray-core\geoip.dat $OutputPath -Move-Item -Force xray-core\geosite.dat $OutputPath +# Move-Item -Force xray-core\geoip.dat $OutputPath +# Move-Item -Force xray-core\geosite.dat $OutputPath Remove-Item -Recurse -Force xray-core Remove-Item -Recurse -Force xray-core.zip