MAUI & Xamarin Protection
Shield provides specialized protection for .NET MAUI and Xamarin applications, securing your cross-platform mobile and desktop applications across all deployment targets.
Understanding MAUI & Xamarin Security Challenges
Cross-platform mobile and desktop applications built with .NET MAUI and Xamarin face unique security challenges:
- Applications run on the client's device in potentially untrusted environments
- Each platform (iOS, Android, macOS, Windows) has different security considerations
- Shared code must be protected across multiple platforms
- Mobile applications are especially vulnerable to reverse engineering and tampering
Shield addresses these challenges with specialized protections designed specifically for .NET MAUI and Xamarin applications.
Protection Strategy for MAUI & Xamarin
Shield employs a comprehensive approach to securing cross-platform applications:
- Core Library Protection: Secures shared business logic and models
- Platform-Specific Protection: Applies optimized protection for each target platform
- Resource Protection: Secures embedded resources, images, and assets
- Native Integration Protection: Secures the bridge between managed and native code
- Platform-Adaptive Techniques: Automatically adjusts protection based on build targets
Key Protection Areas
Shared Code Libraries
The shared code in your .NET MAUI or Xamarin application often contains your most valuable intellectual property. Shield applies multiple layers of protection to this code:
- Name obfuscation
- Control flow obfuscation
- Constant and string encryption
- Method reference hiding
Platform-Specific Code
Shield automatically applies the appropriate protections to platform-specific code:
- Android-specific optimizations
- iOS security enhancements
- Desktop platform protections
Resources and Assets
Shield protects your application's resources:
- Image and media file encryption
- Resource compression
- Asset reference obfuscation
Getting Started
Shield seamlessly integrates with .NET MAUI and Xamarin development workflows:
- Install Shield in your solution
- Configure protections using
shield.config.json
- Build your application with Shield enabled
For platform-specific considerations, see:
- Mobile Considerations - Important information for iOS and Android targets
- Cross-platform Strategy - Best practices for protecting cross-platform code
Recommended Configuration
Below is a recommended starting configuration for .NET MAUI and Xamarin applications:
{
"preset": "custom",
"protections": {
"rename": {
"rename_public": false,
"rename_arguments": true,
"flatten_namespaces": true
},
"control_flow_advance": {
"intensity": 7
},
"reference_proxy": {},
"constants_encryption": {},
"resources": {
"compress": true,
"encrypt": true
},
"anti_debug": {}
},
"mobile": {
"enableAndroidOptimizations": true,
"enableIOSOptimizations": true,
"enableAntiTampering": true
}
}
The mobile
section contains MAUI and Xamarin-specific settings that optimize protection for mobile platforms.
Testing Protected Applications
After applying Shield protection to your MAUI or Xamarin application:
- Test on all target platforms (iOS, Android, Windows, macOS)
- Verify startup performance and memory usage
- Test all platform-specific features
- Verify third-party library integration
Learn More
For more detailed information about protecting .NET MAUI and Xamarin applications:
Mobile Considerations
Learn about iOS and Android-specific protection considerations
Cross-platform Strategy
Best practices for protecting cross-platform code bases