Use this article to protect .NET MAUI applications with Dotfuscator Professional.
Dotfuscator Professional integrates with MAUI projects through MSBuild. After you integrate Dotfuscator into a MAUI project, Dotfuscator runs automatically when you build the project in Visual Studio, MSBuild, or another build system that supports MAUI.
Dotfuscator uses the same build integration approach for MAUI as other .NET platforms. However, MAUI applications can target multiple platforms, so you may need platform-specific protection settings for each target.
Supported MAUI Platforms
You can integrate Dotfuscator Professional into MAUI projects that produce apps for the following platforms:
- Android
- iOS
- WinUI 3
- Mac
- Tizen
For cross-platform MAUI apps, some protection settings may apply only to specific platforms. For example:
- Android apps may use Root Checks or Tamper Checks.
- iOS apps may require platform-specific Renaming exclusions.
- Different target platforms may require different build configurations or protection settings.
Choose Which Projects to Protect
Integrate Dotfuscator into MAUI output projects that produce application packages.
When Dotfuscator protects an output project, it also protects assemblies packaged as part of that project. You do not need to integrate Dotfuscator into library projects, such as .NET Standard libraries or Portable Class Libraries, if those libraries are packaged by the output project.
Choose Which Configurations to Protect
For each MAUI project that you integrate with Dotfuscator, decide which build configurations should run protection.
The default configuration protects common release-oriented configurations, such as:
- Release
- Ad-Hoc
- AppStore
The Ad-Hoc and AppStore configurations apply only to iOS projects.
You can use a single Dotfuscator configuration file for all targets, or you can create target-platform-specific configuration settings when each platform needs different protection behavior.
For more information, see Target Platform Specific Configuration.
Supported Build Environments
Dotfuscator Professional’s MAUI build integration runs on Windows and macOS build machines.
Cloud-based build services can also run Dotfuscator if their build agents use a supported operating system. Examples include:
- Azure DevOps Pipelines
- Visual Studio App Center
Dotfuscator must be installed and provisioned on each machine where the integrated MAUI project is built.
If you build an iOS app on a Windows machine connected to a macOS machine over SSH, install Dotfuscator on the Windows machine.
For CI/CD environments, see Set Up Dotfuscator on Build Agents.
Configure Protection on macOS
If you build MAUI applications on macOS, install Dotfuscator with the NuGet package.
After Dotfuscator is integrated into the project, customize protection by editing the Dotfuscator configuration file directly in a text editor.
If you prefer to use the Dotfuscator Config Editor, build and configure the project on Windows.
Integrate Dotfuscator into a MAUI Project
To integrate Dotfuscator into a MAUI project, follow the instructions in Configure Dotfuscator Build Integration.
For MAUI projects, use the guidance for .NET 5+, .NET Core, .NET Standard, and MAUI projects. This workflow updates the project file so that Dotfuscator runs through MSBuild.
Use Platform-Specific Configuration
By default, Dotfuscator can use a single configuration file for all MAUI targets.
If your MAUI app needs different protection settings for different target platforms, use target-platform-specific configuration.
Use platform-specific configuration when:
- Android and iOS require different Check settings.
- A Renaming exclusion is needed only for one platform.
- A specific platform needs different input, output, or protection behavior.
- You need different protection settings for Release, Ad-Hoc, or AppStore builds.
For more information, see Target Platform Specific Configuration.
.NET 8 Android Resource Designer Changes
.NET 8 replaces per-assembly Resource.designer.cs files with a single _Microsoft.Android.Resource.Designer assembly.
This change eliminates duplicate resource IDs, removes the runtime UpdateIdValues step, and lets the trimmer remove unused resources. This can result in smaller APKs and faster startup.
If you upgrade Dotfuscator from an earlier version to 7.2.3 and protect a .NET 8 Android target, you may need to add a User Defined Assembly Load Path so Dotfuscator can find the Resource Designer assembly in the following folder:
obj\Release\net8.0-androidThen move it to the following output folder:
bin\Release\net8.0-androidBefore You Release
Before releasing a protected MAUI application:
- Build the app in the intended release configuration.
- Test each target platform that you plan to release.
- Test any configured Checks, such as Root Checks or Tamper Checks.
- Verify platform-specific Renaming exclusions.
- Confirm that signing and packaging complete successfully.
- Archive Dotfuscator report files for the release build.
- Review the Release Checklist.