Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code refactor, performance improvements, internalizing types in AppControl Manager #632

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

HotCakeX
Copy link
Owner

@HotCakeX HotCakeX commented Mar 2, 2025

What's New

  • Improved the file and folder picker experience by remembering the last used path when selecting multiple files/folders.

  • Sealed and internalized many methods and classes, reducing the public API surface area, improving security and performance.

  • Refactored multiple sections in the code.

  • Made it obvious in the project file which packages are primary and which ones are transitive.

  • Added progress ring to the auto driver detection in the Create Supplemental Policy page.

  • Security catalogs scan results are now cached, improving performance and speed of various features that rely on it such as local file scans and simulation. Also exposed a new option in the Settings page that lets you turn off/on this feature. It is enabled by default.

  • Areas where performance has been significantly improved by this PR: Local file scans, Simulation, Logging. The improvements are propagated to other interconnected components throughout the app.

# What's New

* Improved the file and folder picker experience by remembering the last used path when selecting multiple files/folders.

* Sealed and internalized many methods and classes, reducing the public API surface area, improving security and performance.

* Refactored multiple sections in the code.

* Made it obvious in the project file which packages are primary and which ones are transitive.

* All of the changes made in this PR resulted in noticeable reduction in the app package size.
@HotCakeX HotCakeX added the Enhancement 💯 New feature or request label Mar 2, 2025
@HotCakeX HotCakeX self-assigned this Mar 2, 2025
@Copilot Copilot bot review requested due to automatic review settings March 2, 2025 11:43

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR refactors several components of the AppControl Manager by internalizing numerous types and methods while also making formatting and access modifier improvements. Key changes include:

  • Internalizing public classes, methods, and properties to reduce the public API surface area.
  • Adding event subscription for UnobservedTaskException and refining exception handling in the UI.
  • Refactoring code formatting and consistency across multiple files.

Reviewed Changes

File Description
App.xaml.cs Added subscription for UnobservedTaskException and commented out FirstChanceException subscription for future use.
CustomUIElements/CustomPatternBasedFilePath.xaml.cs Changed field modifiers from public to internal.
IntelGathering/FileIdentity.cs Updated class and member access to internal.
IntelGathering/FileSignerInfo.cs Updated class and member access to internal.
IntelGathering/KernelUserVerdict.cs Updated required properties to internal.
IntelGathering/FileIdentityECCBasedHashSet.cs Changed constructor and member access to internal.
IntelGathering/OptimizeMDECSVData.cs Changed Optimize method access from public to internal.
IntelGathering/FileIdentitySignatureBasedHashSet.cs Changed constructor and member access to internal.
IntelGathering/FileIdentityTimeBasedHashSet.cs Changed constructor and member access to internal.
IntelGathering/EventAction.cs Changed enum access from public to internal.
IntelGathering/KernelModeDrivers.cs Updated struct members to internal.
IntelGathering/FileIdentityOrigin.cs Changed enum access from public to internal.
IntelGathering/GetEventLogsData.cs Modified control flow and access modifiers for event log processing methods.
IntelGathering/ScanLevels.cs Changed enum access to internal.
IntelGathering/LocalFilesScan.cs Minor cleanup of redundant newlines.
IntelGathering/FileSignerInfoComparer.cs Changed class access to internal.
IntelGathering/PrepareEmptyPolicy.cs Changed method access to internal.
IntelGathering/FileIdentityComparer.cs Changed class access to internal.
IntelGathering/MDEAdvancedHuntingData.cs Changed JSON converters from public to internal and maintained serialization logic.

Copilot reviewed 64 out of 64 changed files in this pull request and generated no comments.

Added progress ring to the auto driver detection in the Create Supplemental Policy page.

Security catalogs scan results are now cached, improving performance and speed of various features that rely on it. Also exposed a new option in the Settings page that lets you turn off/on this feature. It is enabled by default.

more performance improvements
@HotCakeX HotCakeX changed the title Code refactor and internalizing types in AppControl Manager Code refactor, performance improvements, internalizing types in AppControl Manager Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement 💯 New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant