@@ -51,18 +51,16 @@ Virus and Threat Protections Status: ${_securityService.statusDefenderProtection
5151 exit (0 );
5252 }
5353
54- // TODO: Remove this whenever a new playbook gets released
55- final isAMETempAvailable = await Directory (ameTemp).exists ();
56- if (isAMETempAvailable) {
54+ if (! isProcessRunning ('explorer.exe' )) {
5755 await Process .run ('explorer.exe' , const []);
5856 await Future .delayed (const Duration (seconds: 5 ));
5957 }
60- //
6158
6259 stdout.writeln ('$tag Disabling Windows Defender...' );
6360
6461 stdout.writeln (
65- '$tag Checking if Virus and Threat Protections are enabled...' );
62+ '$tag Checking if Virus and Threat Protections are enabled...' ,
63+ );
6664 int count = 0 ;
6765 while (_securityService.statusDefenderProtections) {
6866 if (count > 10 ) {
@@ -72,7 +70,8 @@ Virus and Threat Protections Status: ${_securityService.statusDefenderProtection
7270
7371 if (! _securityService.statusDefenderProtectionTamper) {
7472 await _shell.run (
75- 'PowerShell -EP Unrestricted -NonInteractive -NoLogo -NoP Set-MpPreference -DisableRealtimeMonitoring \$ true' );
73+ 'PowerShell -EP Unrestricted -NonInteractive -NoLogo -NoP Set-MpPreference -DisableRealtimeMonitoring \$ true' ,
74+ );
7675 break ;
7776 }
7877
@@ -84,10 +83,6 @@ Virus and Threat Protections Status: ${_securityService.statusDefenderProtection
8483 }
8584 await Process .run ('taskkill' , ['/f' , '/im' , 'SecHealthUI.exe' ]);
8685
87- if (isAMETempAvailable) {
88- await Process .run ('taskkill' , ['/f' , '/im' , 'explorer.exe' ]);
89- }
90-
9186 try {
9287 await _securityService.disableDefender ();
9388 } on Exception catch (e) {
0 commit comments