Skip to content

C# migration. With a bunch of fixes and new tweaks with focus on security and privacy.#10

Merged
26zl merged 8 commits into
mainfrom
csharp-migration
Apr 18, 2026
Merged

C# migration. With a bunch of fixes and new tweaks with focus on security and privacy.#10
26zl merged 8 commits into
mainfrom
csharp-migration

Conversation

@26zl
Copy link
Copy Markdown
Owner

@26zl 26zl commented Apr 18, 2026

No description provided.

@26zl 26zl requested a review from Copilot April 18, 2026 19:44
@26zl 26zl self-assigned this Apr 18, 2026
@26zl
Copy link
Copy Markdown
Owner Author

26zl commented Apr 18, 2026

@copilot resolve the merge conflicts in this pull request

Copy link
Copy Markdown

Copilot AI commented Apr 18, 2026

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in commit 8b69c87. The conflict in .github/workflows/build.yml was between the C# migration's build-app job and the Hardening commit on main. Resolution:

  • Kept the .NET 9 build steps (dropped the obsolete Set up Liberica NIK Java step that main had pinned)
  • Retained egress-policy: audit for the Harden Runner step (both sides added it)
  • Kept the if: steps.version.outputs.release == 'true' conditionals on the artifact download and release steps
  • README.md changes from main (badge removal) were auto-merged cleanly

Copilot finished work on behalf of 26zl April 18, 2026 19:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates PleaseTweakWindows from the previous JavaFX/Maven codebase to a .NET 9 WPF (MVVM) application, while updating the PowerShell script layer with additional security hardening (signature checks, safer registry changes) and new tweak actions.

Changes:

  • Replatform UI and app architecture to WPF + CommunityToolkit.Mvvm with DI-backed services (script execution, dialogs, restore-point guard, update checks).
  • Embed scripts into the .NET assembly and extract to a locked-down temp directory at runtime; update build/test tooling to dotnet.
  • Harden PowerShell workflows (Authenticode verification for dynamic downloads, registry backup helpers) and extend tweak coverage (e.g., “set all networks to Public”).

Reviewed changes

Copilot reviewed 100 out of 115 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/test/java/com/zl/pleasetweakwindows/UpdateCheckerTest.java Removed Java tests as part of migration
src/test/java/com/zl/pleasetweakwindows/TweakTest.java Removed Java tests as part of migration
src/test/java/com/zl/pleasetweakwindows/TweakControllerTest.java Removed Java tests as part of migration
src/test/java/com/zl/pleasetweakwindows/TweakControllerPathTest.java Removed Java tests as part of migration
src/test/java/com/zl/pleasetweakwindows/SubTweakTest.java Removed Java tests as part of migration
src/test/java/com/zl/pleasetweakwindows/RestorePointGuardTest.java Removed Java tests as part of migration
src/test/java/com/zl/pleasetweakwindows/ResourceExtractorTest.java Removed Java tests as part of migration
src/test/java/com/zl/pleasetweakwindows/ResourceExtractorCleanupTest.java Removed Java tests as part of migration
src/test/java/com/zl/pleasetweakwindows/ExecutorTest.java Removed Java tests as part of migration
src/test/java/com/zl/pleasetweakwindows/ExecutorIntegrationTest.java Removed Java tests as part of migration
src/test/java/com/zl/pleasetweakwindows/ExecutorCommandBuildTest.java Removed Java tests as part of migration
src/test/java/com/zl/pleasetweakwindows/ExecutorCancellationTest.java Removed Java tests as part of migration
src/test/java/com/zl/pleasetweakwindows/DialogUtilsTest.java Removed Java tests as part of migration
src/test/java/com/zl/pleasetweakwindows/ActionIdConsistencyTest.java Removed Java tests as part of migration
src/main/resources/scripts/file-checksums.json Removed old embedded checksum manifest location
src/main/resources/native/app.rc Removed Java/Graal native resource script
src/main/resources/logback.xml Removed Logback config (moved to Serilog)
src/main/resources/images/daemonIcon.png Asset update as part of UI migration
src/main/resources/images/daemon.png Asset update as part of UI migration
src/main/resources/com/zl/pleasetweakwindows/application.css Removed JavaFX CSS theme
src/main/java/module-info.java Removed JPMS module definition
src/main/java/com/zl/pleasetweakwindows/UpdateChecker.java Removed Java update checker
src/main/java/com/zl/pleasetweakwindows/UiLogic.java Removed JavaFX UI logic
src/main/java/com/zl/pleasetweakwindows/Tweak.java Removed Java model
src/main/java/com/zl/pleasetweakwindows/SubTweak.java Removed Java model
src/main/java/com/zl/pleasetweakwindows/RestorePointGuard.java Removed Java restore point guard
src/main/java/com/zl/pleasetweakwindows/ResourceExtractor.java Removed Java resource extractor
src/main/java/com/zl/pleasetweakwindows/ProcessRunnerFactory.java Removed Java process abstraction
src/main/java/com/zl/pleasetweakwindows/ProcessRunner.java Removed Java process abstraction
src/main/java/com/zl/pleasetweakwindows/DialogUtils.java Removed Java dialog utilities
src/PleaseTweakWindows/app.manifest Adds UAC elevation + DPI settings for WPF app
src/PleaseTweakWindows/Views/TweakCategoryView.xaml.cs Category header interaction / accordion behavior
src/PleaseTweakWindows/Views/TweakCategoryView.xaml Category UI layout for tweaks/subtweaks
src/PleaseTweakWindows/Views/SubTweakView.xaml.cs Subtweak view code-behind bootstrap
src/PleaseTweakWindows/Views/SubTweakView.xaml Subtweak UI (apply/revert/progress)
src/PleaseTweakWindows/Views/MainWindow.xaml.cs Window chrome + close handling integration
src/PleaseTweakWindows/Views/MainWindow.xaml Main WPF layout (search, banner, panels)
src/PleaseTweakWindows/Views/LogPanelView.xaml.cs Auto-scroll behavior on log updates
src/PleaseTweakWindows/Views/LogPanelView.xaml Log panel UI
src/PleaseTweakWindows/Views/Dialogs/ConfirmationDialog.xaml.cs Custom confirmation dialog behavior
src/PleaseTweakWindows/Views/Dialogs/ConfirmationDialog.xaml Custom modal dialog UI
src/PleaseTweakWindows/ViewModels/ViewModelBase.cs MVVM base using ObservableObject
src/PleaseTweakWindows/ViewModels/UiDispatcher.cs Centralized UI-thread dispatch helper
src/PleaseTweakWindows/ViewModels/TweakCategoryViewModel.cs Category VM logic including “Run All”
src/PleaseTweakWindows/ViewModels/SubTweakViewModel.cs Per-subtweak execution + running state
src/PleaseTweakWindows/ViewModels/ScriptRunner.cs Shared restore-point/confirm/run pipeline
src/PleaseTweakWindows/ViewModels/MainWindowViewModel.cs App init, update banner, global running state
src/PleaseTweakWindows/ViewModels/LogPanelViewModel.cs Log buffer + clear command
src/PleaseTweakWindows/Services/UpdateChecker.cs GitHub releases update check + dismiss persistence
src/PleaseTweakWindows/Services/RestorePointGuard.cs Restore-point decision caching + enforcement
src/PleaseTweakWindows/Services/ResourceExtractor.cs Extract embedded scripts to locked temp dir
src/PleaseTweakWindows/Services/ProcessRunner.cs Process starter abstraction implementation
src/PleaseTweakWindows/Services/IUpdateChecker.cs Update checker abstraction + UpdateInfo record
src/PleaseTweakWindows/Services/ITweakRegistry.cs Tweak registry abstraction
src/PleaseTweakWindows/Services/IScriptExecutor.cs Script execution abstraction
src/PleaseTweakWindows/Services/IRestorePointGuard.cs Restore point guard abstraction
src/PleaseTweakWindows/Services/IResourceExtractor.cs Resource extractor abstraction
src/PleaseTweakWindows/Services/IProcessRunner.cs Process runner abstraction
src/PleaseTweakWindows/Services/IDialogService.cs Dialog service abstraction + decision enum
src/PleaseTweakWindows/Services/DialogService.cs Destructive/high-risk classification + dialogs
src/PleaseTweakWindows/Services/AdminChecker.cs Administrator elevation check
src/PleaseTweakWindows/PleaseTweakWindows.csproj New .NET WPF project + embedded scripts
src/PleaseTweakWindows/Models/Tweak.cs Immutable tweak model record
src/PleaseTweakWindows/Models/SubTweakType.cs Subtweak type enum
src/PleaseTweakWindows/Models/SubTweak.cs Immutable subtweak model record
src/PleaseTweakWindows/GlobalUsings.cs Project-wide usings
src/PleaseTweakWindows/Converters/BoolToVisibilityConverter.cs Shared XAML converters
src/PleaseTweakWindows/App.xaml.cs DI container + Serilog + lifecycle cleanup
src/PleaseTweakWindows/App.xaml Resource dictionaries + converter resources
src/PleaseTweakWindows.Tests/UpdateCheckerTests.cs Migrated update checker tests to xUnit
src/PleaseTweakWindows.Tests/TweakRegistryTests.cs Migrated tweak registry tests to xUnit
src/PleaseTweakWindows.Tests/ScriptExecutorTests.cs Migrated script executor tests to xUnit
src/PleaseTweakWindows.Tests/RestorePointGuardTests.cs Migrated restore point guard tests to xUnit
src/PleaseTweakWindows.Tests/DialogServiceTests.cs Migrated dialog logic tests to xUnit
src/PleaseTweakWindows.Tests/PleaseTweakWindows.Tests.csproj New .NET test project definition
scripts/index.txt Script embedding manifest for extractor
scripts/file-checksums.json Updated checksum manifest location/content
scripts/create_restore_point.ps1 Restore point creation script (embedded)
scripts/Services management/revert-services.ps1 Output formatting tweaks
scripts/Services management/Services-Management.ps1 Consolidated dispatcher for services actions
scripts/Privacy Security/revert-privacy.ps1 Safer Copilot restore behavior
scripts/Privacy Security/privacy.ps1 Safer Explorer folder hiding + signature checks
scripts/Network optimizations/revert-network.ps1 Added/updated network revert script
scripts/Network optimizations/Network-Optimizations.ps1 Added network profile public/private actions
scripts/General Tweaks/revert-general.ps1 Restores hidserv defensively
scripts/General Tweaks/General-Tweaks.ps1 Signature checks + registry backup + safer lockscreen restore
scripts/Gaming optimizations/revert-gaming.ps1 Signature checks for dynamic downloads
scripts/Gaming optimizations/reg/nvidia_profile.xml Added NVIDIA profile payload
scripts/Gaming optimizations/Gaming-Optimizations.ps1 Removed controller OC tweak; added signature verification
scripts/CommonFunctions.ps1 Added Authenticode verification + registry backup helper
pom.xml Removed Maven build (C# migration)
logs/README.txt Removed old logs README (log strategy changed)
Test.bat Removed old Java test runner script
Cleanup.bat Removed old Java cleanup script
README.md Updated docs for WPF/.NET build & behavior
PleaseTweakWindows.sln Added Visual Studio solution for .NET projects
Build.bat Reworked build to dotnet test/build/publish+zip
.gitignore Updated ignores for .NET outputs + logs
.gitattributes Normalized EOL rules + binary handling
CONTRIBUTING.md Updated contributor guidance for .NET/WPF

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/PleaseTweakWindows/Services/ScriptExecutor.cs Outdated
Comment thread src/PleaseTweakWindows/Services/DialogService.cs
Comment thread src/PleaseTweakWindows/ViewModels/LogPanelViewModel.cs
Comment thread src/PleaseTweakWindows/Services/UpdateChecker.cs
Comment thread src/PleaseTweakWindows/ViewModels/MainWindowViewModel.cs Outdated
main's Hardening commit SHA-pinned existing actions and added Harden Runner
to the old Java build jobs. The csharp-migration version already has all of
those (pinned actions + Harden Runner on all 5 .NET jobs) so the resolution
keeps the .NET workflow unchanged and drops the Liberica/Maven steps main
still had.
@26zl 26zl force-pushed the csharp-migration branch from 8b69c87 to 95ab4b2 Compare April 18, 2026 19:51
26zl added 2 commits April 18, 2026 21:53
Matches the required status check name in the repository ruleset
(required_status_checks: validate-scripts, security-scan, functional-testing,
build-exe). Without this rename the ruleset waits indefinitely for a
'build-exe' check that never reports, blocking PR merges.
The security-scan job flagged 'Set-MpPreference -DisableBlockAtFirstSeen $false'
in revert-security.ps1 as a security feature disabling pattern. That call
re-enables Block At First Sight (cmdlet is boolean-negated: Disable* = $true
disables, $false enables). The loose pattern matched regardless of the value.

Tightened all nine Defender-specific patterns to require '.*$true' so only
actual disabling (Disable* = $true) trips the scanner, not resets-to-default
(Disable* = $false).
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 100 out of 115 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/PleaseTweakWindows/Views/TweakCategoryView.xaml Outdated
Comment thread src/PleaseTweakWindows/ViewModels/TweakCategoryViewModel.cs
Comment thread src/PleaseTweakWindows/Services/UpdateChecker.cs
Comment thread src/PleaseTweakWindows/Services/UpdateChecker.cs Outdated
Comment thread src/PleaseTweakWindows/Services/ScriptExecutor.cs
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 100 out of 115 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@26zl 26zl merged commit a05354a into main Apr 18, 2026
10 checks passed
@26zl 26zl deleted the csharp-migration branch April 18, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants