Skip to content

Commit

Permalink
Add setting to disable SmartScreen #28
Browse files Browse the repository at this point in the history
  • Loading branch information
cschneegans committed Aug 16, 2024
1 parent 7fcc1a0 commit 355cad9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ public record class Configuration(
bool DisableDefenderPE,
bool DisableSac,
bool DisableUac,
bool DisableSmartScreen,
bool DisableSystemRestore,
bool DisableFastStartup,
bool TurnOffSystemSounds,
Expand Down Expand Up @@ -330,6 +331,7 @@ HideModes HideFiles
DisableDefenderPE: false,
DisableSac: false,
DisableUac: false,
DisableSmartScreen: false,
DisableFastStartup: false,
DisableSystemRestore: false,
TurnOffSystemSounds: false,
Expand Down
20 changes: 20 additions & 0 deletions modifier/Optimizations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,26 @@ IEnumerable<string> SetExplorerOptions(string rootKey, string subKey)
);
}

if (Configuration.DisableSmartScreen)
{
appender.Append([
CommandBuilder.RegistryCommand(@"add ""HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer"" /v SmartScreenEnabled /t REG_SZ /d ""Off"" /f"),
CommandBuilder.RegistryCommand(@"add ""HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WTDS\Components"" /v ServiceEnabled /t REG_DWORD /d 0 /f"),
CommandBuilder.RegistryCommand(@"add ""HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WTDS\Components"" /v NotifyMalicious /t REG_DWORD /d 0 /f"),
CommandBuilder.RegistryCommand(@"add ""HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WTDS\Components"" /v NotifyPasswordReuse /t REG_DWORD /d 0 /f"),
CommandBuilder.RegistryCommand(@"add ""HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WTDS\Components"" /v NotifyUnsafeApp /t REG_DWORD /d 0 /f"),
..CommandBuilder.RegistryDefaultUserCommand((rootKey, subKey) =>
{
return [
CommandBuilder.RegistryCommand(@$"add ""{rootKey}\{subKey}\Software\Microsoft\Edge\SmartScreenEnabled"" /ve /t REG_DWORD /d 0 /f"),
CommandBuilder.RegistryCommand(@$"add ""{rootKey}\{subKey}\Software\Microsoft\Edge\SmartScreenPuaEnabled"" /ve /t REG_DWORD /d 0 /f"),
CommandBuilder.RegistryCommand(@$"add ""{rootKey}\{subKey}\Software\Microsoft\Windows\CurrentVersion\AppHost"" /v EnableWebContentEvaluation /t REG_DWORD /d 0 /f"),
CommandBuilder.RegistryCommand(@$"add ""{rootKey}\{subKey}\Software\Microsoft\Windows\CurrentVersion\AppHost"" /v PreventOverride /t REG_DWORD /d 0 /f"),
];
})
]);
}

if (Configuration.DisableUac)
{
appender.Append(
Expand Down

0 comments on commit 355cad9

Please sign in to comment.