Xamarin Forms “Bundle assemblies into native code” and ofbuscation

北战南征 提交于 2020-05-08 04:10:09

问题


I created Android app with Xamarin Forms. For release I use option "Bundle assemblies into native code". My apk have size - 17 Mb, without this option 33 Mb. Do I need to use obfuscation for my libraries or my code is protected? I searched a lot - but I did not find an exact answer.


回答1:


Bundle Assemblies into Native Code means:

When this option is enabled, assemblies are bundled into a native shared library. This option keeps your code safe; it protects managed assemblies by embedding them in native binaries.

Keep it safe :

These will bundle the .dll files into a .so file so that they are harder to tamper with on a rooted device. As BobFlora said : it will be moving IL code in with the native binaries(.so file) so it's harder for hackers to mess with it. There's no performance issue here.

Reduce apk size :

This option will reduce apk size dramatically since .so files are compressed and dlls are not.

I create an empty project, we could find the difference when use this option :

  • Didn't use Bundle Assemblies into Native Code :

  • Use Bundle Assemblies into Native Code :

Do I need to use obfuscation for my libraries or my code is protected?

It is helping increase code obfuscation (specifically on Android), and there are other ways to increase security/cryptography. If you had tighter security requirements, you could use this option, it depends on your requirement.



来源:https://stackoverflow.com/questions/46260889/xamarin-forms-bundle-assemblies-into-native-code-and-ofbuscation

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