Skip to content

Commit

Permalink
Improved translation capability of AppControl Manager (#599)
Browse files Browse the repository at this point in the history
Further separation of strings from the XAML, improving the ability of the AppControl Manager to be translated into other languages and reducing the likelihood of having typos in the UI text.

Also cleaned up some extra empty lines and removed unnecessary using declarations from XAML pages.
  • Loading branch information
HotCakeX authored Feb 15, 2025
1 parent 5870d79 commit 8e40753
Show file tree
Hide file tree
Showing 30 changed files with 296 additions and 176 deletions.
1 change: 0 additions & 1 deletion AppControl Manager/Pages/AllowNewApps/AllowNewApps.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
xmlns:local="using:AppControlManager.Pages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="using:CommunityToolkit.WinUI"
mc:Ignorable="d">

<Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:ui="using:CommunityToolkit.WinUI"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:tk7controls="using:CommunityToolkit.WinUI.UI.Controls">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:ui="using:CommunityToolkit.WinUI"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:tk7controls="using:CommunityToolkit.WinUI.UI.Controls">

Expand Down
37 changes: 13 additions & 24 deletions AppControl Manager/Pages/AllowNewApps/AllowNewAppsStart.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
xmlns:local="using:AppControlManager.Pages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="using:CommunityToolkit.WinUI"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:tk7controls="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:animations="using:CommunityToolkit.WinUI.Animations"
xmlns:animatedvisuals="using:AnimatedVisuals"
mc:Ignorable="d">

Expand Down Expand Up @@ -39,11 +36,8 @@
<HyperlinkButton Margin="0,-8,0,8" x:Uid="GuideButtonAtTop" NavigateUri="https://github.com/HotCakeX/Harden-Windows-Security/wiki/Allow-New-Apps" />

<StackPanel Orientation="Horizontal" Spacing="15" Margin="0,-6,0,10">

<Button x:Name="ResetStepsButton" Click="ResetStepsButton_Click" Style="{StaticResource AccentButtonStyle}" Content="Reset Steps" ToolTipService.ToolTip="Will reset the steps and if the base policy is deployed in Audit mode, will redeploy it in Enforced mode." />

<Button x:Name="ResetStepsButton" Click="ResetStepsButton_Click" Style="{StaticResource AccentButtonStyle}" x:Uid="ResetStepsButton" />
<ProgressRing IsActive="False" x:Name="ResetProgressRing"/>

</StackPanel>

</controls:WrapPanel>
Expand All @@ -64,14 +58,14 @@
<ProgressRing x:Name="Step1ProgressRing" IsActive="False" Margin=" 0,0,15,0"/>
</controls:WrapPanel>

<TextBlock Text="Select the required info such as a deployed policy XML file and a name for the Supplemental policy that will be created" TextWrapping="WrapWholeWords" />
<TextBlock x:Uid="AllowNewAppsStep1Text" TextWrapping="WrapWholeWords" />
</controls:WrapPanel>

<controls:WrapPanel Grid.Row="1" Orientation="Horizontal" VerticalSpacing="15" HorizontalSpacing="15">

<TextBox x:Name="SupplementalPolicyNameTextBox" Header="Supplemental Policy Name" PlaceholderText="Enter a name for the Supplemental Policy" />
<Button x:Name="BrowseForXMLPolicyButton" Click="BrowseForXMLPolicyButton_Click" Margin="0,27,0,0"
RightTapped="BrowseForXMLPolicyButton_RightTapped" Holding="BrowseForXMLPolicyButton_Holding" ToolTipService.ToolTip="Click/Tap to choose a XML policy file from your device.">
RightTapped="BrowseForXMLPolicyButton_RightTapped" Holding="BrowseForXMLPolicyButton_Holding" ToolTipService.ToolTip="Click/Tap to choose a Base policy XML file from your device.">

<Button.Flyout>
<Flyout x:Name="BrowseForXMLPolicyButton_FlyOut">
Expand Down Expand Up @@ -100,20 +94,18 @@
</AnimatedIcon.Source>
</AnimatedIcon>

<TextBlock Text="Browse for a policy XML file" />
<TextBlock x:Uid="BrowseForBasePolicyTextBlock" />

</controls:WrapPanel>
</Button.Content>

</Button>


<NumberBox x:Name="LogSizeNumberBox"
Header="Enter a number for Log Size in MB"
SpinButtonPlacementMode="Inline"
SmallChange="1"
LargeChange="10" Minimum="2" Maximum="1000000" ValueChanged="LogSizeNumberBox_ValueChanged" ToolTipService.ToolTip="This is the Maximum Capacity of the Code Integrity Operational Log Size" />

x:Uid="LogSizeNumberBox"
SpinButtonPlacementMode="Inline"
SmallChange="1"
LargeChange="10" Minimum="2" Maximum="1000000" ValueChanged="LogSizeNumberBox_ValueChanged" />

<Button x:Name="GoToStep2Button" Click="GoToStep2Button_Click" Margin="0,27,0,0" Content="Go to step 2" ToolTipService.ToolTip="Start deploying the selected policy in Audit mode and go to step 2" Style="{StaticResource AccentButtonStyle}"/>

Expand All @@ -140,7 +132,7 @@ LargeChange="10" Minimum="2" Maximum="1000000" ValueChanged="LogSizeNumberBox_Va
<ProgressRing x:Name="Step2ProgressRing" IsActive="False" Margin=" 0,0,15,0"/>
</controls:WrapPanel>

<TextBlock Text="Now install your new app or run a pre-installed app that was being blocked. You can optionally browse for folders to scan such as the location where the app is installed. Once you're done, use the button below to go to Step 3." TextWrapping="WrapWholeWords" />
<TextBlock x:Uid="AllowNewAppsStep2Text" TextWrapping="WrapWholeWords" />
</controls:WrapPanel>

<controls:WrapPanel Grid.Row="1" Orientation="Horizontal" VerticalSpacing="8" HorizontalSpacing="8">
Expand Down Expand Up @@ -193,25 +185,22 @@ LargeChange="10" Minimum="2" Maximum="1000000" ValueChanged="LogSizeNumberBox_Va
<ProgressRing x:Name="Step3ProgressRing" IsActive="False" Margin=" 0,0,15,0"/>
</controls:WrapPanel>

<TextBlock Text="Use the Event logs and local files tab to confirm or select the detected files in order to include them in the final Supplemental policy." TextWrapping="WrapWholeWords" />
<TextBlock x:Uid="AllowNewAppsStep3Text" TextWrapping="WrapWholeWords" />
</controls:WrapPanel>

<controls:WrapPanel Grid.Row="1" Orientation="Horizontal" VerticalSpacing="8" HorizontalSpacing="8">

<ToggleButton x:Name="DeployToggleButton" Checked="DeployToggleButton_Checked" Unchecked="DeployToggleButton_Unchecked" ToolTipService.ToolTip="The Supplemental policy will be automatically deployed on the system after creation." IsChecked="True" Content="Deploy" />
<ToggleButton x:Name="DeployToggleButton" Checked="DeployToggleButton_Checked" Unchecked="DeployToggleButton_Unchecked" IsChecked="True" x:Uid="DeployAfterCreationButton" />

<ComboBox SelectedIndex="0" SelectionChanged="ScanLevelComboBox_SelectionChanged" x:Name="ScanLevelComboBox" ToolTipService.ToolTip="Pick a level based on which the selected logs and files will be scanned" Header="Scan level" Margin="0,0,0,27">
<ComboBox SelectedIndex="0" SelectionChanged="ScanLevelComboBox_SelectionChanged" x:Name="ScanLevelComboBox" x:Uid="ScanLevelComboBox" Header="Scan level" Margin="0,0,0,27">
<ComboBoxItem>FilePublisher</ComboBoxItem>
<ComboBoxItem>Publisher</ComboBoxItem>
<ComboBoxItem>Hash</ComboBoxItem>
</ComboBox>

<Button x:Name="CreatePolicyButton" Click="CreatePolicyButton_Click" ToolTipService.ToolTip="Start creating the policy with the logs and files you selected" Content="Create Policy" Style="{StaticResource AccentButtonStyle}"/>

<Button x:Name="CreatePolicyButton" Click="CreatePolicyButton_Click" x:Uid="AllowNewAppsCreatePolicyButton" Style="{StaticResource AccentButtonStyle}"/>
</controls:WrapPanel>

<InfoBar x:Name="Step3InfoBar" Severity="Informational" IsOpen="False" IsClosable='False' Margin="0,20,0,0" Grid.Row="2"/>

</Grid>
</Border>

Expand Down
1 change: 0 additions & 1 deletion AppControl Manager/Pages/BuildNewCertificate.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="using:CommunityToolkit.WinUI"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:tk7controls="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
mc:Ignorable="d">

Expand Down
6 changes: 3 additions & 3 deletions AppControl Manager/Pages/ConfigurePolicyRuleOptions.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@


<Button Grid.Row="1" Margin="0,0,0,20" x:Name="PickPolicyFileButton" Click="PickPolicyFileButton_Click"
HorizontalAlignment="Center" RightTapped="PickPolicyFileButton_RightTapped" Holding="PickPolicyFileButton_Holding"
ToolTipService.ToolTip="Click/Tap to choose a XML policy file from your device.">
HorizontalAlignment="Center" RightTapped="PickPolicyFileButton_RightTapped" Holding="PickPolicyFileButton_Holding"
x:Uid="PickPolicyFileButton">

<Button.Flyout>
<Flyout x:Name="PickPolicyFileButton_FlyOut">
Expand Down Expand Up @@ -65,7 +65,7 @@
</AnimatedIcon.Source>
</AnimatedIcon>

<TextBlock Text="Browse for a policy XML file" />
<TextBlock x:Uid="BrowseForPolicyTextBlock" />

</controls:WrapPanel>
</Button.Content>
Expand Down
3 changes: 1 addition & 2 deletions AppControl Manager/Pages/CreateDenyPolicy.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
xmlns:ui="using:CommunityToolkit.WinUI"
xmlns:others="using:AppControlManager.Others"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:tk7controls="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
mc:Ignorable="d">

Expand Down Expand Up @@ -185,7 +184,7 @@
<controls:SettingsCard Description="Select the level based on which the detected files will be scanned."
Header="Select Scan Level" Click="ScanLevelComboBoxSettingsCard_Click" x:Name="ScanLevelComboBoxSettingsCard" IsClickEnabled="True" IsActionIconVisible="False">

<ComboBox x:Name="ScanLevelComboBox" SelectionChanged="ScanLevelComboBox_SelectionChanged" ToolTipService.ToolTip="Pick a level based on which the selected files will be scanned"
<ComboBox x:Name="ScanLevelComboBox" SelectionChanged="ScanLevelComboBox_SelectionChanged" x:Uid="ScanLevelComboBox"
SelectedIndex="0">
<ComboBoxItem>File Publisher</ComboBoxItem>
<ComboBoxItem>Publisher</ComboBoxItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:ui="using:CommunityToolkit.WinUI"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:tk7controls="using:CommunityToolkit.WinUI.UI.Controls">

Expand Down
26 changes: 6 additions & 20 deletions AppControl Manager/Pages/CreatePolicy.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

</controls:WrapPanel>


<StackPanel HorizontalAlignment="Stretch" Spacing="{StaticResource SettingsCardSpacing}" Grid.Row="1" Margin="0,40,0,0">

<win:StackPanel.ChildrenTransitions>
Expand All @@ -43,7 +42,6 @@
</win:StackPanel.ChildrenTransitions>

<!-- Allow Microsoft -->

<controls:SettingsExpander x:Name="AllowMicrosoftSettings"
Description="This policy will allow any program and file that is signed by Microsoft certificates to be able to run and everything else will be blocked."
Header="Create Allow Microsoft Policy"
Expand All @@ -69,20 +67,19 @@
<controls:WrapPanel Orientation="Horizontal">

<NumberBox x:Name="AllowMicrosoftLogSizeInput"
Header="Enter a number for Log Size in MB"
x:Uid="LogSizeNumberBox"
Value="2"
SpinButtonPlacementMode="Inline"
SmallChange="1"
IsEnabled="False"
LargeChange="10" Minimum="2" Maximum="1000000" Margin="0,0,30,0" ToolTipService.ToolTip="This is the Maximum Capacity of the Code Integrity Operational Log Size" />
LargeChange="10" Minimum="2" Maximum="1000000" Margin="0,0,30,0" />

<ToggleSwitch x:Name="AllowMicrosoftLogSizeInputEnabled" IsEnabled="False" Toggled="AllowMicrosoftLogSizeInputEnabled_Toggled" />

</controls:WrapPanel>

</controls:SettingsCard>


<controls:SettingsCard x:Uid="RequireEVSignersRuleOption">
<ToggleSwitch x:Name="AllowMicrosoftRequireEVSigners" />
</controls:SettingsCard>
Expand All @@ -100,9 +97,7 @@
</controls:SettingsExpander>



<!-- Default Windows -->

<controls:SettingsExpander x:Name="DefaultWindowsSettings"
Description="This policy will allow files that come by default with Windows OS to run (including Office products) and everything else will be blocked."
Header="Create Default Windows Policy"
Expand All @@ -128,20 +123,19 @@
<controls:WrapPanel Orientation="Horizontal">

<NumberBox x:Name="DefaultWindowsLogSizeInput"
Header="Enter a number for Log Size in MB"
x:Uid="LogSizeNumberBox"
IsEnabled="False"
Value="2"
SpinButtonPlacementMode="Inline"
SmallChange="1"
LargeChange="10" Minimum="2" Maximum="1000000" Margin="0,0,30,0" ToolTipService.ToolTip="This is the Maximum Capacity of the Code Integrity Operational Log Size" />
LargeChange="10" Minimum="2" Maximum="1000000" Margin="0,0,30,0" />

<ToggleSwitch x:Name="DefaultWindowsLogSizeInputEnabled" IsEnabled="False" Toggled="DefaultWindowsLogSizeInputEnabled_Toggled" />

</controls:WrapPanel>

</controls:SettingsCard>


<controls:SettingsCard x:Uid="RequireEVSignersRuleOption">
<ToggleSwitch x:Name="DefaultWindowsRequireEVSigners" />
</controls:SettingsCard>
Expand All @@ -159,9 +153,7 @@
</controls:SettingsExpander>



<!-- Signed and Reputable -->

<controls:SettingsExpander x:Name="SignedAndReputableSettings"
Description="This policy will allow any program and file that is signed by Microsoft certificates to be able to run. It will also use the Global Intelligence of the Microsoft's Intelligent Security Graph to automatically authorize reputable and signed files to run. Anything else will be blocked."
Header="Create Signed And Reputable Policy"
Expand All @@ -176,7 +168,6 @@

</controls:WrapPanel>


<controls:SettingsExpander.Items>

<controls:SettingsCard x:Uid="AuditRuleOptionSettingsCard">
Expand All @@ -188,12 +179,12 @@
<controls:WrapPanel Orientation="Horizontal">

<NumberBox x:Name="SignedAndReputableLogSizeInput"
Header="Enter a number for Log Size in MB"
x:Uid="LogSizeNumberBox"
IsEnabled="False"
Value="2"
SpinButtonPlacementMode="Inline"
SmallChange="1"
LargeChange="10" Minimum="2" Maximum="1000000" Margin="0,0,30,0" ToolTipService.ToolTip="This is the Maximum Capacity of the Code Integrity Operational Log Size" />
LargeChange="10" Minimum="2" Maximum="1000000" Margin="0,0,30,0" />

<ToggleSwitch x:Name="SignedAndReputableLogSizeInputEnabled" IsEnabled="False" Toggled="SignedAndReputableLogSizeInputEnabled_Toggled" />

Expand All @@ -219,7 +210,6 @@


<!-- Microsoft Recommended Driver Block Rules -->

<controls:SettingsExpander x:Name="RecommendedDriverBlockRulesSettings"
Description="This policy will create the Microsoft Recommended Driver Block Rules."
Header="Create Microsoft Recommended Driver Block Rules"
Expand Down Expand Up @@ -259,9 +249,7 @@
</controls:SettingsExpander>



<!-- Microsoft Recommended User Mode Block Rules -->

<controls:SettingsCard x:Name="RecommendedUserModeBlockRulesSettings"
Description="This policy will create the Microsoft Recommended User Mode Block Rules."
Header="Create Microsoft Recommended User Mode Block Rules"
Expand All @@ -280,7 +268,6 @@


<!-- Strict Kernel-mode policy -->

<controls:SettingsExpander x:Name="StrictKernelModePolicySection"
Description="This policy will only enforce Kernel-mode files and has no effect on user-mode files"
Header="Create Strict Kernel-mode Policy"
Expand Down Expand Up @@ -329,6 +316,5 @@
</StackPanel>

</Grid>

</ScrollViewer>
</Page>
Loading

0 comments on commit 8e40753

Please sign in to comment.