Mono for Android, code obfuscation

徘徊边缘 提交于 2020-01-10 19:43:26

问题


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


回答1:


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).



来源:https://stackoverflow.com/questions/13352440/mono-for-android-code-obfuscation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!