Integrate Dotfuscator Professional into your Xamarin projects. Once integrated, Dotfuscator automatically protects the project whenever you build it in Visual Studio, MSBuild, or another build system which supports Xamarin. Integrating Dotfuscator this way creates an app with a proven, layered protection strategy, regardless of the device it runs on.
Dotfuscator Professional's build integration for Xamarin uses the same approach as other .NET platforms. However, there are some unique aspects to the Xamarin integration that you should understand before you begin.
Supported Project Types
Dotfuscator Professional supports Xamarin projects that produce apps for the following platforms:
- Android
- iOS
- Universal Windows Platform (UWP)
If you are developing a cross-platform Xamarin app (for example, with Xamarin.Forms), you need to integrate Dotfuscator into the app project for each platform you want to support. This allows for stronger protection. Additionally, Dotfuscator sometimes needs to have unique configuration settings for each platform (e.g. Root Checks and Tamper Checks on Android, or a renaming exclusion that is only necessary on iOS).
Dotfuscator only needs to be integrated into output projects that produce mobile app packages, such as an Android project that produces an APK. When Dotfuscator protects these output projects, it also automatically protects all 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 (PCLs), that are used by the output projects, because those libraries are automatically protected when packaged. For more information, see Choosing Which Projects to Protect.
For each output project you integrate Dotfuscator into, you also need to decide what build configurations you want the protection applied to. The default configuration provided in the instructions protects Release, Ad-Hoc, and AppStore configurations. The Ad-Hoc and AppStore configurations are only used by iOS projects. For more information, see Choosing Which Configurations to Protect.
Supported Build Environments
Dotfuscator Professional's build integration runs as part of builds on both Windows and macOS build machines. Cloud-based build services also support Dotfuscator if they use these operating systems for their build agents. Examples include Azure DevOps Pipelines and Visual Studio App Center.
You must install and provision Dotfuscator on each machine where the integrated project builds. When you build an iOS app using a Windows machine connected to a macOS machine over SSH, install Dotfuscator on the Windows machine. For details, see Build Agents.
Integration Instructions
To get started, follow the instructions on the Protect Your App page for one of your target platforms. Then repeat that process for each additional platform you wish to protect.
What Happened to the 'PreEmptive.Dotfuscator.Xamarin.targets' File?
Dotfuscator's Xamarin integration has improved dramatically since its initial introduction. The initial integration method required you to download a PreEmptive.Dotfuscator.Xamarin.targets file, and some external documentation and blog posts might still direct you to do so. However, as of Dotfuscator Professional v4.37, that is no longer necessary, and the integration is much easier to use.
Please follow the appropriate instructions for your version of Dotfuscator:
- For Dotfuscator Professional, please follow the instructions on the current page from the top.
- For Dotfuscator Community, see the latest integration instructions for Xamarin in the Dotfuscator Community documentation.