Portable Tool for an Ideal Windows Setup
C# activatorbloatware-removalcsharpdebloatdebloaterdisable-servicesmonitoring-systemportableprivacy-toolsregistry-tweakssystem-tuningsystem-utilitytelemetrytweakerwindows-10windows-11windows-debloatwindows-defenderwindows-optimizationwindows-tweaks
-retaining rights and returning to full-time WD & fix rem folder Edge
Greedeks7c591604dfa2
diff --git a/.Source/GTweak/GTweak.csproj b/.Source/GTweak/GTweak.csprojindex 0bae2091..4d434b1e 100644--- a/.Source/GTweak/GTweak.csproj+++ b/.Source/GTweak/GTweak.csproj@@ -284,6 +284,7 @@<Compile Include="Utilities\Control\ViewNotification.cs" /><Compile Include="Utilities\Helpers\TrustedInstaller.cs" /><Compile Include="Utilities\Tweaks\ConfidentialityTweaks.cs" />+ <Compile Include="Utilities\Tweaks\DefenderManager\BackupRights.cs" /><Compile Include="Utilities\Tweaks\Firewall.cs" /><Compile Include="Utilities\Tweaks\InterfaceTweaks.cs" /><Compile Include="Utilities\Tweaks\ServicesTweaks.cs" />@@ -291,7 +292,7 @@<Compile Include="Utilities\Tweaks\SystemTweaks.cs" /><Compile Include="Utilities\Helpers\Storage\TaskStorage.cs" /><Compile Include="Utilities\Tweaks\UninstallingPakages.cs" />- <Compile Include="Utilities\Tweaks\WindowsDefender.cs" />+ <Compile Include="Utilities\Tweaks\DefenderManager\WindowsDefender.cs" /><Compile Include="Utilities\Tweaks\WindowsLicense.cs" /><Compile Include="Utilities\Helpers\Animation\TypewriterAnimation.cs" /><Compile Include="Core\ViewModel\OtherContextVM.cs" />diff --git a/.Source/GTweak/Utilities/Helpers/Storage/TaskStorage.cs b/.Source/GTweak/Utilities/Helpers/Storage/TaskStorage.csindex 7311ea70..b3726cda 100644--- a/.Source/GTweak/Utilities/Helpers/Storage/TaskStorage.cs+++ b/.Source/GTweak/Utilities/Helpers/Storage/TaskStorage.cs@@ -57,5 +57,13 @@@"MicrosoftEdgeUpdateTaskMachineCore*",@"MicrosoftEdgeUpdateTaskMachineUA*",@"MicrosoftEdgeUpdateTaskUser*" };++ internal static readonly string[] WinDefenderTasks = {+ @"Microsoft\Windows\ExploitGuard\ExploitGuard MDM policy Refresh",+ @"Microsoft\Windows\Windows Defender\Windows Defender Cache Maintenance",+ @"Microsoft\Windows\Windows Defender\Windows Defender Cleanup",+ @"Microsoft\Windows\Windows Defender\Windows Defender Scheduled Scan",+ @"Microsoft\Windows\Windows Defender\Windows Defender Verification",+ };}}diff --git a/.Source/GTweak/Utilities/Tweaks/DefenderManager/BackupRights.cs b/.Source/GTweak/Utilities/Tweaks/DefenderManager/BackupRights.csnew file mode 100644index 00000000..e2257885--- /dev/null+++ b/.Source/GTweak/Utilities/Tweaks/DefenderManager/BackupRights.cs@@ -0,0 +1,117 @@+using GTweak.Utilities.Control;+using GTweak.Utilities.Helpers;+using Microsoft.Win32;+using Newtonsoft.Json;+using System;+using System.Collections.Generic;+using System.Diagnostics;+using System.IO;+using System.Security.AccessControl;++namespace GTweak.Utilities.Tweaks.DefenderManager+{+ internal class BackupRights : TaskSchedulerManager+ {+ private static readonly Dictionary<string, RegistryKey> registryPaths = new Dictionary<string, RegistryKey>+ {+ { @"SYSTEM\CurrentControlSet\Services\WinDefend", Registry.LocalMachine },+ { @"SYSTEM\CurrentControlSet\Services\SecurityHealthService", Registry.LocalMachine },+ { @"SOFTWARE\Microsoft\Windows Defender\Features", Registry.LocalMachine },+ { @"SYSTEM\CurrentControlSet\Services\WdNisSvc", Registry.LocalMachine },+ { @"SYSTEM\CurrentControlSet\Services\Sense", Registry.LocalMachine },+ { @"SYSTEM\CurrentControlSet\Services\WdFilter", Registry.LocalMachine },+ { @"SYSTEM\CurrentControlSet\Services\WdBoot", Registry.LocalMachine },+ { @"SYSTEM\CurrentControlSet\Services\WdNisDrv", Registry.LocalMachine },+ { @"SYSTEM\CurrentControlSet\Services\MDCoreSvc", Registry.LocalMachine },+ { @"Software\Policies\Microsoft\Windows Defender\Real-Time Protection", Registry.LocalMachine },+ { @"Software\Policies\Microsoft\Windows Defender\SpyNet", Registry.LocalMachine },+ { @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\Windows\System", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\MRT", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\Windows Defender\SmartScreen", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\Microsoft Antimalware", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", Registry.LocalMachine },+ { @"SOFTWARE\Microsoft\Security Center", Registry.LocalMachine },+ };++ internal static readonly string jsonFilePath = Path.Combine(StoragePaths.SystemDisk, @"Windows\System32\Config", "backup_GTweak.json");+ internal static readonly string aclFilePath = Path.Combine(StoragePaths.SystemDisk, @"Windows\System32\Config", "backup_GTweak.acl");++ internal static void ExportRights()+ {+ try+ {+ if (File.Exists(jsonFilePath) && File.Exists(aclFilePath))+ {+ File.Delete(jsonFilePath);+ File.Delete(aclFilePath);+ }++ var allValues = new Dictionary<string, Dictionary<string, object>>();+ var aclDataDict = new Dictionary<string, string>();++ foreach (var entry in registryPaths)+ {+ string path = entry.Key;+ RegistryKey baseKey = entry.Value;++ using RegistryKey key = baseKey.OpenSubKey(path, false);+ if (key == null)+ continue;++ var values = new Dictionary<string, object>();+ foreach (string valueName in key.GetValueNames())+ values[valueName] = key.GetValue(valueName);++ allValues[path] = values;++ RegistrySecurity security = key.GetAccessControl();+ string aclData = security.GetSecurityDescriptorSddlForm(AccessControlSections.All);+ aclDataDict[path] = aclData;+ }++ File.WriteAllText(jsonFilePath, JsonConvert.SerializeObject(allValues, Formatting.Indented));+ File.WriteAllText(aclFilePath, JsonConvert.SerializeObject(aclDataDict, Formatting.Indented));+ }+ catch (Exception ex) { Debug.WriteLine(ex.Message); }+ }++ internal static void ImportRights()+ {+ try+ {+ var allValues = JsonConvert.DeserializeObject<Dictionary<string, Dictionary<string, object>>>(File.ReadAllText(jsonFilePath));+ var aclDataDict = JsonConvert.DeserializeObject<Dictionary<string, string>>(File.ReadAllText(aclFilePath));++ foreach (var entry in registryPaths)+ {+ string path = entry.Key;+ RegistryKey baseKey = entry.Value;++ using RegistryKey key = baseKey.OpenSubKey(path, true) ?? baseKey.CreateSubKey(path);+ if (key == null)+ continue;++ if (allValues.ContainsKey(path))+ {+ foreach (var pair in allValues[path])+ key.SetValue(pair.Key, pair.Value);+ }++ if (aclDataDict.ContainsKey(path))+ {+ string aclData = aclDataDict[path];+ RegistrySecurity security = new RegistrySecurity();+ security.SetSecurityDescriptorSddlForm(aclData);+ key.SetAccessControl(security);+ }+ }++ File.Delete(jsonFilePath);+ File.Delete(aclFilePath);+ }+ catch (Exception ex) { Debug.WriteLine(ex.Message); }+ }+ }+}\ No newline at end of filediff --git a/.Source/GTweak/Utilities/Tweaks/WindowsDefender.cs b/.Source/GTweak/Utilities/Tweaks/DefenderManager/WindowsDefender.cssimilarity index 80%rename from .Source/GTweak/Utilities/Tweaks/WindowsDefender.csrename to .Source/GTweak/Utilities/Tweaks/DefenderManager/WindowsDefender.csindex e0d60c71..de96974a 100644--- a/.Source/GTweak/Utilities/Tweaks/WindowsDefender.cs+++ b/.Source/GTweak/Utilities/Tweaks/DefenderManager/WindowsDefender.cs@@ -1,17 +1,33 @@using GTweak.Utilities.Control;using GTweak.Utilities.Helpers;+using GTweak.Windows;using Microsoft.Win32;using System;using System.Diagnostics;using System.IO;using System.Text;-using System.Threading.Tasks;-namespace GTweak.Utilities.Tweaks+namespace GTweak.Utilities.Tweaks.DefenderManager{- internal class WindowsDefender+ internal class WindowsDefender : BackupRights{- internal void Enable()+ internal async void SetState(bool isState)+ {+ WaitingWindow waitingWindow = new WaitingWindow();+ waitingWindow.Show();+ BackgroundQueue backgroundQueue = new BackgroundQueue();+ await backgroundQueue.QueueTask(delegate+ {+ if (isState)+ Disable();+ else+ Enable();+ });+ await backgroundQueue.QueueTask(delegate { SystemTweaks.isTweakWorkingAntivirus = false; new ViewNotification(300).Show("restart"); });+ waitingWindow.Close();+ }++ private void Enable(){TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, "cmd.exe /c reg delete HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\AppHost /v EnableWebContentEvaluation /f & " +"reg delete HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer /v SmartScreenEnabled /f & " +@@ -43,11 +59,11 @@ namespace GTweak.Utilities.Tweaks"reg delete HKLM\\SYSTEM\\CurrentControlSet\\Services\\WinDefend /t REG_DWORD /v AutorunsDisabled /f & " +"reg add HKLM\\SYSTEM\\CurrentControlSet\\Services\\WdNisSvc /t REG_DWORD /v Start /d 3 /f");- TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"cmd.exe /c \"rename \"" + Path.Combine(StoragePaths.SystemDisk, @"Windows\System32\BlockSS.exe") + "\" smartscreen.exe\"");- TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"cmd.exe /c \"rename \"" + Path.Combine(StoragePaths.SystemDisk, @"Program Files\Windows Defender\BlockAntimalware.exe") + "\" MsMpEng.exe\"");- TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"cmd.exe /c \"rename \"" + Path.Combine(StoragePaths.SystemDisk, @"Program Files\Windows Defender\BlockAntimalwareCore.exe") + "\" MpDefenderCoreService.exe\"");- TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"cmd.exe /c for /d %D in (\"{Path.Combine(StoragePaths.SystemDisk, @"ProgramData\Microsoft\Windows Defender\Platform\*")}\") do if exist \"%D\\BlockAntimalware.exe\" ren \"%D\\BlockAntimalware.exe\" MsMpEng.exe");- TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"cmd.exe /c for /d %D in (\"{Path.Combine(StoragePaths.SystemDisk, @"ProgramData\Microsoft\Windows Defender\Platform\*")}\") do if exist \"%D\\BlockAntimalwareCore.exe\" ren \"%D\\BlockAntimalwareCore.exe\" MpDefenderCoreService.exe");+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"{Path.Combine(Environment.SystemDirectory, "WindowsPowerShell\\v1.0\\powershell.exe")} -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command \"Rename-Item -Path '{Path.Combine(StoragePaths.SystemDisk, @"Windows\System32\BlockSS.exe")}' -NewName 'smartscreen.exe'\"");+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"{Path.Combine(Environment.SystemDirectory, "WindowsPowerShell\\v1.0\\powershell.exe")} -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command \"Rename-Item -Path '{Path.Combine(StoragePaths.SystemDisk, @"Program Files\Windows Defender\BlockAntimalware.exe")}' -NewName 'MsMpEng.exe'\"");+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"{Path.Combine(Environment.SystemDirectory, "WindowsPowerShell\\v1.0\\powershell.exe")} -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command \"Rename-Item -Path '{Path.Combine(StoragePaths.SystemDisk, @"Program Files\Windows Defender\BlockAntimalwareCore.exe")}' -NewName 'MpDefenderCoreService.exe'\"");+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"{Path.Combine(Environment.SystemDirectory, "WindowsPowerShell\\v1.0\\powershell.exe")} -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command \"Get-ChildItem -Path '{Path.Combine(StoragePaths.SystemDisk, @"ProgramData\Microsoft\Windows Defender\Platform\*")}' -Directory | ForEach-Object {{ if (Test-Path -Path \"$_\\BlockAntimalware.exe\") {{ Rename-Item -Path \"$_\\BlockAntimalware.exe\" -NewName 'MsMpEng.exe' }} }}\"");+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"{Path.Combine(Environment.SystemDirectory, "WindowsPowerShell\\v1.0\\powershell.exe")} -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command \"Get-ChildItem -Path '{Path.Combine(StoragePaths.SystemDisk, @"ProgramData\Microsoft\Windows Defender\Platform\*")}' -Directory | ForEach-Object {{ if (Test-Path -Path \"$_\\BlockAntimalwareCore.exe\") {{ Rename-Item -Path \"$_\\BlockAntimalwareCore.exe\" -NewName 'MpDefenderCoreService.exe' }} }}\"");RunCmdCommand("sc start WinDefend");RunPowerShellCommand("Start-Service -Name WinDefend; Set-Service -Name WinDefend -StartupType Automatic");@@ -64,6 +80,11 @@ namespace GTweak.Utilities.TweaksRegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\SpyNet");RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\UX Configuration");RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender Security Center");+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Microsoft Antimalware");+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates");+ RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Microsoft\Security Center", "FirstRunDisabled");+ RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Microsoft\Security Center", "AntiVirusOverride");+ RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Microsoft\Security Center", "FirewallOverride");RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows Defender", "PUAProtection", 2, RegistryValueKind.DWord);RunPowerShellCommand("Set-MpPreference -DisableIOAVProtection $false");@@ -91,12 +112,6 @@ namespace GTweak.Utilities.TweaksRegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender Security Center");RegistryHelp.DeleteFolderTree(Registry.CurrentUser, @"SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge");- EnableTask("Microsoft\\Windows\\ExploitGuard\\ExploitGuard MDM policy Refresh");- EnableTask("Microsoft\\Windows\\Windows Defender\\Windows Defender Cache Maintenance");- EnableTask("Microsoft\\Windows\\Windows Defender\\Windows Defender Cleanup");- EnableTask("Microsoft\\Windows\\Windows Defender\\Windows Defender Scheduled Scan");- EnableTask("Microsoft\\Windows\\Windows Defender\\Windows Defender Verification");-RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter");RegistryHelp.CreateFolder(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\CI\Config");RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\CI\Config", "VulnerableDriverBlocklistEnable", 1, RegistryValueKind.DWord);@@ -119,7 +134,6 @@ namespace GTweak.Utilities.TweaksRegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run", "SecurityHealth", new byte[] { 0002, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 }, RegistryValueKind.Binary);RegistryHelp.Write(Registry.CurrentUser, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "Windows Defender", "\"%ProgramFiles%\\Windows Defender\\MSASCui.exe\"-runkey", RegistryValueKind.String);- RunProcess(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Windows Defender\MpCmdRun.exe", "-SignatureUpdate");RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\WinDefend", "Start", "2", RegistryValueKind.DWord, true);RegistryHelp.DeleteValue(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\WinDefend", "AutorunsDisabled");@@ -132,8 +146,8 @@ namespace GTweak.Utilities.TweaksRegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\WdNisDrv", "Start", "3", RegistryValueKind.DWord, true);RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\MDCoreSvc", "Start", "3", RegistryValueKind.DWord);- CloseDefenderSettings();-+ SetTaskState(true, WinDefenderTasks);+ KillProcess("SecHealthUI");RunPowerShellCommand(@"Get-AppXpackage Microsoft.WindowsDefender | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register ""$($_.InstallLocation)\AppXManifest.xml""}");RegistryHelp.Write(Registry.ClassesRoot, @"*\shellex\ContextMenuHandlers\EPP", "", "{09A47860-11B0-4DA5-AFA5-26D86198A780}", RegistryValueKind.String);@@ -142,14 +156,16 @@ namespace GTweak.Utilities.TweaksRegistryHelp.Write(Registry.ClassesRoot, @"CLSID\{09A47860-11B0-4DA5-AFA5-26D86198A780}\InprocServer32", "", StoragePaths.SystemDisk + @"Program Files\Windows Defender\shellext.dll", RegistryValueKind.String);RegistryHelp.Write(Registry.ClassesRoot, @"CLSID\{09A47860-11B0-4DA5-AFA5-26D86198A780}\InprocServer32", "ThreadingModel", "Apartment", RegistryValueKind.String);- RunProcess(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Windows Defender\MpCmdRun.exe", "-SignatureUpdate");+ ImportRights();}- internal async void Disable()+ internal void Disable(){KillProcess("smartscreen");KillProcess("MsMpEng");+ ExportRights();+RegistryHelp.CreateFolder(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer");RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer", "SmartScreenEnabled", "Off", RegistryValueKind.String);RegistryHelp.CreateFolder(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\System");@@ -207,7 +223,6 @@ namespace GTweak.Utilities.TweaksRegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\MpEngine", "MpEnablePus", 0, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\MpEngine", "DisableGradualRelease", 1, RegistryValueKind.DWord);- RegistryHelp.CreateFolder(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\Real-Time Protection");RegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\Real-Time Protection", "LocalSettingOverrideDisableOnAccessProtection", 0, RegistryValueKind.DWord, true);RegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\Real-Time Protection", "LocalSettingOverrideRealtimeScanDirection", 0, RegistryValueKind.DWord, true);RegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\Real-Time Protection", "LocalSettingOverrideDisableIOAVProtection", 0, RegistryValueKind.DWord, true);@@ -223,7 +238,28 @@ namespace GTweak.Utilities.TweaksRegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\Real-Time Protection", "DisableScriptScanning", 1, RegistryValueKind.DWord, true);RegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\Real-Time Protection", "DisableRawWriteNotification", 1, RegistryValueKind.DWord, true);- RegistryHelp.CreateFolder(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\UX Configuration");+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Microsoft Antimalware", "ServiceKeepAlive", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Microsoft Antimalware", "AllowFastServiceStartup", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Microsoft Antimalware", "DisableRoutinelyTakingAction", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Microsoft Antimalware", "DisableAntiSpyware", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Microsoft Antimalware", "DisableAntiVirus", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Microsoft Antimalware\SpyNet", "SpyNetReporting", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Microsoft Antimalware\SpyNet", "LocalSettingOverrideSpyNetReporting", 0, RegistryValueKind.DWord);++ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", "SignatureDisableNotification", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", "RealtimeSignatureDelivery", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", "ForceUpdateFromMU", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", "DisableScheduledSignatureUpdateOnBattery", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", "UpdateOnStartUp", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", "SignatureUpdateCatchupInterval", 2, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", "DisableUpdateOnStartupWithoutEngine", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", "DisableScanOnUpdate", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", "ScheduleTime", 5184, RegistryValueKind.DWord);++ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Security Center", "FirstRunDisabled", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Security Center", "AntiVirusOverride", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Security Center", "FirewallOverride", 1, RegistryValueKind.DWord);+RegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\UX Configuration", "Notification_Suppress", 1, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\UX Configuration", "SuppressRebootNotification", 1, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\UX Configuration", "UILockdown", 1, RegistryValueKind.DWord);@@ -234,35 +270,23 @@ namespace GTweak.Utilities.TweaksRegistryHelp.CreateFolder(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\Reportin");RegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\Reportin", "DisableEnhancedNotifications", 1, RegistryValueKind.DWord);- RunProcess(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Windows Defender\MpCmdRun.exe", "-RemoveDefinitions -All");-RunPowerShellCommand(@"Set-ExecutionPolicy UnRestricted; Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows Defender\Features -Name TamperProtection -Value 0x00000000");- RegistryHelp.CreateFolder(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\SpyNet");RegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\SpyNet", "DisableBlockAtFirstSeen", 1, RegistryValueKind.DWord, true);RegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\SpyNet", "SpynetReporting", 0, RegistryValueKind.DWord, true);RegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\SpyNet", "SubmitSamplesConsent", 2, RegistryValueKind.DWord, true);- RegistryHelp.CreateFolder(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\CI\Config");+ RegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\SpyNet", "LocalSettingOverrideSpynetReporting", 0, RegistryValueKind.DWord, true);RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\CI\Config", "EnabledV9", 0, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\CI\Config", "VulnerableDriverBlocklistEnable", 0, RegistryValueKind.DWord);- RegistryHelp.CreateFolder(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity");RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity", "Enabled", 0, RegistryValueKind.DWord);- RegistryHelp.CreateFolder(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\WTDS\Components");RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\WTDS\Components", "ServiceEnabled", "0", RegistryValueKind.DWord);- RegistryHelp.CreateFolder(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter");RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter", "EnabledV9", "0", RegistryValueKind.DWord);- RegistryHelp.CreateFolder(Registry.LocalMachine, @"Software\Microsoft\Windows\CurrentVersion\AppHost");RegistryHelp.Write(Registry.LocalMachine, @"Software\Microsoft\Windows\CurrentVersion\AppHost", "EnableWebContentEvaluation", 0, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"Software\Microsoft\Windows\CurrentVersion\AppHost", "PreventOverride", 0, RegistryValueKind.DWord);- RegistryHelp.CreateFolder(Registry.CurrentUser, @"SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge");RegistryHelp.Write(Registry.CurrentUser, @"SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge", "EnabledV9", 0, RegistryValueKind.DWord);RegistryHelp.Write(Registry.CurrentUser, @"SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge", "PreventOverride", 0, RegistryValueKind.DWord);- DisableTask("Microsoft\\Windows\\ExploitGuard\\ExploitGuard MDM policy Refresh");- DisableTask("Microsoft\\Windows\\Windows Defender\\Windows Defender Cache Maintenance");- DisableTask("Microsoft\\Windows\\Windows Defender\\Windows Defender Cleanup");- DisableTask("Microsoft\\Windows\\Windows Defender\\Windows Defender Scheduled Scan");- DisableTask("Microsoft\\Windows\\Windows Defender\\Windows Defender Verification");+ SetTaskState(false, WinDefenderTasks);RunPowerShellCommand(@"Set-ExecutionPolicy UnRestricted; Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\WinDefend -Name Start -Value 0x00000004");RunPowerShellCommand(@"Set-ExecutionPolicy UnRestricted; Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows Defender\Real-Time Protection' -Name DisableBehaviorMonitoring -Value 0x00000001");@@ -278,18 +302,7 @@ namespace GTweak.Utilities.TweaksRegistryHelp.DeleteValue(Registry.CurrentUser, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "Windows Defender");RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "SecurityHealth");- CloseDefenderSettings();-- string defenderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), @"Microsoft\Windows Defender");-- if (Directory.Exists(defenderPath))- {- string defenderScansPath = Path.Combine(defenderPath, @"Scans");-- if (Directory.Exists(defenderScansPath)) DeleteDir(defenderScansPath);- }-- await Task.Delay(1000);+ KillProcess("SecHealthUI");TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, "cmd.exe /c taskkill /f /im MsMpEng.exe & reg add HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\AppHost /t REG_DWORD /v EnableWebContentEvaluation /d 0 /f & " +"reg add HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer /t REG_SZ /v SmartScreenEnabled /d \"off\" /f & " +@@ -341,24 +354,18 @@ namespace GTweak.Utilities.TweaksRegistryHelp.DeleteFolderTree(Registry.ClassesRoot, @"CLSID\{09A47860-11B0-4DA5-AFA5-26D86198A780}\InprocServer32");KillProcess("smartscreen");- TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"cmd.exe /c \"rename \"" + Path.Combine(StoragePaths.SystemDisk, @"Windows\System32\smartscreen.exe") + "\" BlockSS.exe\"");- KillProcess("MsMpEng");- TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"cmd.exe /c \"rename \"" + Path.Combine(StoragePaths.SystemDisk, @"Program Files\Windows Defender\MsMpEng.exe") + "\" BlockAntimalware.exe\"");- TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"cmd.exe /c for /d %D in (\"{Path.Combine(StoragePaths.SystemDisk, @"ProgramData\Microsoft\Windows Defender\Platform\*")}\") do if exist \"%D\\MsMpEng.exe\" ren \"%D\\MsMpEng.exe\" BlockAntimalware.exe");KillProcess("MpDefenderCoreService");- TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"cmd.exe /c \"rename \"" + Path.Combine(StoragePaths.SystemDisk, @"Program Files\Windows Defender\MpDefenderCoreService.exe") + "\" BlockAntimalwareCore.exe\"");- TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"cmd.exe /c for /d %D in (\"{Path.Combine(StoragePaths.SystemDisk, @"ProgramData\Microsoft\Windows Defender\Platform\*")}\") do if exist \"%D\\MpDefenderCoreService.exe\" ren \"%D\\MpDefenderCoreService.exe\" BlockAntimalwareCore.exe");- }+ KillProcess("MsMpEng");- private void KillProcess(string getName)- {- foreach (Process process in Process.GetProcessesByName(getName))- {- try { process.Kill(); }- catch (Exception ex) { Debug.WriteLine(ex.Message); }- }+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"{Path.Combine(Environment.SystemDirectory, "WindowsPowerShell\\v1.0\\powershell.exe")} -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command \"Rename-Item -Path '{Path.Combine(StoragePaths.SystemDisk, @"Windows\System32\smartscreen.exe")}' -NewName 'BlockSS.exe'\"");+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"{Path.Combine(Environment.SystemDirectory, "WindowsPowerShell\\v1.0\\powershell.exe")} -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command \"Rename-Item -Path '{Path.Combine(StoragePaths.SystemDisk, @"Program Files\Windows Defender\MsMpEng.exe")}' -NewName 'BlockAntimalware.exe'\"");+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"{Path.Combine(Environment.SystemDirectory, "WindowsPowerShell\\v1.0\\powershell.exe")} -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command \"Rename-Item -Path '{Path.Combine(StoragePaths.SystemDisk, @"Program Files\Windows Defender\MpDefenderCoreService.exe")}' -NewName 'BlockAntimalwareCore.exe'\"");+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"{Path.Combine(Environment.SystemDirectory, "WindowsPowerShell\\v1.0\\powershell.exe")} -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command \"Get-ChildItem -Path '{Path.Combine(StoragePaths.SystemDisk, @"ProgramData\Microsoft\Windows Defender\Platform\*")}' -Directory | ForEach-Object {{ if (Test-Path -Path \"$_\\MsMpEng.exe\") {{ Rename-Item -Path \"$_\\MsMpEng.exe\" -NewName 'BlockAntimalware.exe' }} }}\"");+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"{Path.Combine(Environment.SystemDirectory, "WindowsPowerShell\\v1.0\\powershell.exe")} -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command \"Get-ChildItem -Path '{Path.Combine(StoragePaths.SystemDisk, @"ProgramData\Microsoft\Windows Defender\Platform\*")}' -Directory | ForEach-Object {{ if (Test-Path -Path \"$_\\MpDefenderCoreService.exe\") {{ Rename-Item -Path \"$_\\MpDefenderCoreService.exe\" -NewName 'BlockAntimalwareCore.exe' }} }}\"");}+ private void KillProcess(string name) => TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"{Path.Combine(Environment.SystemDirectory, "WindowsPowerShell\\v1.0\\powershell.exe")} -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command \"Stop-Process -Name {name} -Force\"");+private void RunPowerShellCommand(string command){RunProcess(Path.Combine(Environment.SystemDirectory, @"WindowsPowerShell\v1.0\powershell.exe"),@@ -366,7 +373,7 @@ namespace GTweak.Utilities.TweaksConvert.ToBase64String(Encoding.Unicode.GetBytes(command)) + "\"");}- private void RunCmdCommand(string command) => RunProcess(Path.Combine(Environment.SystemDirectory, "Cmd.exe"), "/d /q /c " + command);+ private void RunCmdCommand(string command) => RunProcess(Path.Combine(Environment.SystemDirectory, "cmd.exe"), "/d /q /c " + command);private void RunProcess(string path, string arguments){@@ -386,31 +393,6 @@ namespace GTweak.Utilities.Tweaks}catch (Exception ex) { Debug.WriteLine(ex.Message); }}-- private void EnableTask(string path) => SetTask(path, "/Enable");-- private void DisableTask(string path) => SetTask(path, "/Disable");-- private void SetTask(string path, string param) => RunProcess(Path.Combine(Environment.SystemDirectory, @"schtasks.exe"), "/Change /TN \"" + path + "\" " + param);-- private void CloseDefenderSettings() => KillProcess("SecHealthUI");-- private void DeleteDir(string path)- {- DirectoryInfo dir = new DirectoryInfo(path);-- foreach (FileInfo file in dir.GetFiles())- {- try { file.Delete(); }- catch (Exception ex) { Debug.WriteLine(ex.Message); }- }-- foreach (DirectoryInfo subDir in dir.GetDirectories())- {- try { subDir.Delete(true); }- catch { DeleteDir(subDir.FullName); }- }- }}}diff --git a/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs b/.Source/GTweak/Utilities/Tweaks/SystemTweaks.csindex cd7655d5..b7845832 100644--- a/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs+++ b/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs@@ -1,9 +1,9 @@using GTweak.Utilities.Control;using GTweak.Utilities.Helpers;+using GTweak.Utilities.Tweaks.DefenderManager;using GTweak.View;using Microsoft.Win32;using System;-using System.ComponentModel;using System.Diagnostics;using System.IO;using System.Linq;@@ -88,13 +88,7 @@ namespace GTweak.Utilities.Tweakscatch (Exception ex) { Debug.WriteLine(ex.Message); }if (!isTweakWorkingAntivirus)- {- systemV.TglButton8.StateNA = File.Exists(Path.Combine(StoragePaths.SystemDisk, @"Windows\System32\smartscreen.exe")) ||- RegistryHelp.CheckValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection", "DisallowExploitProtectionOverride", "0") ||- RegistryHelp.CheckValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection", "UILockdown", "1") ||- RegistryHelp.CheckValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Real-Time Protection", "DisableBehaviorMonitoring", "1") ||- RegistryHelp.CheckValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Real-Time Protection", "DisableRealtimeMonitoring", "1");- }+ systemV.TglButton8.StateNA = File.Exists(Path.Combine(StoragePaths.SystemDisk, @"Windows\System32\smartscreen.exe"));systemV.TglButton9.StateNA =RegistryHelp.CheckValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "PromptOnSecureDesktop", "0") ||@@ -261,16 +255,7 @@ namespace GTweak.Utilities.Tweakscatch (Exception ex) { Debug.WriteLine(ex.Message); }break;case "TglButton8":- BackgroundWorker backgroundWorker = new BackgroundWorker();- backgroundWorker.DoWork += delegate- {- if (isChoose)- new WindowsDefender().Disable();- else- new WindowsDefender().Enable();- };- backgroundWorker.RunWorkerCompleted += delegate { isTweakWorkingAntivirus = false; new ViewNotification(300).Show("restart"); };- backgroundWorker.RunWorkerAsync();+ new WindowsDefender().SetState(isChoose);BlockWDefender(isChoose);break;case "TglButton9":@@ -301,8 +286,7 @@ namespace GTweak.Utilities.TweaksSetTaskState(!isChoose, memoryDiagTasks);break;case "TglButton13":- string argStateNetsh = string.Empty, argStateNetshSecond = string.Empty;-+ string argStateNetshSecond, argStateNetsh;if (isChoose){isNetshState = false;diff --git a/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs b/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.csindex ba38ae4a..762edb05 100644--- a/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs+++ b/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs@@ -278,7 +278,7 @@ namespace GTweak.Utilities.TweaksTakingOwnership.GrantAdministratorsAccess(path, TakingOwnership.SE_OBJECT_TYPE.SE_FILE_OBJECT);await Task.Delay(1000);- TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $@"cmd.exe /c rmdir /s /q ""{path}""");+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"{Path.Combine(Environment.SystemDirectory, "WindowsPowerShell\\v1.0\\powershell.exe")} -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command \"Remove-Item -Path '{path}' -Recurse -Force\"");}try@@ -295,7 +295,7 @@ namespace GTweak.Utilities.Tweakspath = path.Replace(@"\AppxManifest.xml", "").Trim();TakingOwnership.GrantAdministratorsAccess(path, TakingOwnership.SE_OBJECT_TYPE.SE_FILE_OBJECT);- TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $@"cmd.exe /c rmdir /s /q ""{path}""");+ TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, $"{Path.Combine(Environment.SystemDirectory, "WindowsPowerShell\\v1.0\\powershell.exe")} -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command \"Remove-Item -Path '{path}' -Recurse -Force\"");key.DeleteSubKey(subKey);return;}diff --git a/.Source/GTweak/View/PakagesView.xaml.cs b/.Source/GTweak/View/PakagesView.xaml.csindex a2e9c808..ce64b825 100644--- a/.Source/GTweak/View/PakagesView.xaml.cs+++ b/.Source/GTweak/View/PakagesView.xaml.cs@@ -75,19 +75,19 @@ namespace GTweak.Viewvoid DeleteHandler(object sender, RoutedEventArgs args){tcs.TrySetResult(true);- BtnDelete.PreviewMouseLeftButtonUp -= DeleteHandler;- BtnCancel.PreviewMouseLeftButtonUp -= CancelHandler;+ BtnDelete.PreviewMouseLeftButtonDown -= DeleteHandler;+ BtnCancel.PreviewMouseLeftButtonDown -= CancelHandler;}void CancelHandler(object sender, RoutedEventArgs args){tcs.TrySetResult(false);- BtnDelete.PreviewMouseLeftButtonUp -= DeleteHandler;- BtnCancel.PreviewMouseLeftButtonUp -= CancelHandler;+ BtnDelete.PreviewMouseLeftButtonDown -= DeleteHandler;+ BtnCancel.PreviewMouseLeftButtonDown -= CancelHandler;}- BtnDelete.PreviewMouseLeftButtonUp += DeleteHandler;- BtnCancel.PreviewMouseLeftButtonUp += CancelHandler;+ BtnDelete.PreviewMouseLeftButtonDown += DeleteHandler;+ BtnCancel.PreviewMouseLeftButtonDown += CancelHandler;isWebViewRemoval = await tcs.Task;