Mono for Android, code obfuscation

前端 未结 1 1537
清酒与你
清酒与你 2021-01-02 20:59

As everybody knows, piracy becomes a very serious issue on Android. Does Mono for Android provide code obfuscation when compiling to native code?

相关标签:
1条回答
  • 2021-01-02 21:46

    Mono for Android does not provide this functionality, however you can still use a third-party tool for obfuscation. As Mono for Android produces CIL assemblies that are JITed by the Mono runtime on the Android device you need to obfuscate these .NET assemblies. Therefore tools like the Android obfuscator Proguard will not help you. The below .NET obfuscators have been reported to work with Mono for Android.

    • Xenocode Postbuild
    • CryptoObfuscator

    If you use Xenocode Postbuild then make sure you disable "metadata reduction" so that Class names remain valid in Java.

    Update

    Xamarin.Android allows you to package APK files without the need for the compiled .NET DLLs. This means you do not need to apply obfuscation from a .NET point of view. I can extract my release APK file and find that only the classes.dex file and the .so library files are included. To enable this tick the box "Embed assemblies in native code" (this may only be available for Enterprise subscribers).

    0 讨论(0)
提交回复
热议问题