Xamarin Forms “Bundle assemblies into native code” and ofbuscation

前端 未结 1 1276
醉酒成梦
醉酒成梦 2021-01-05 13:29

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

1条回答
  •  礼貌的吻别
    2021-01-05 14:21

    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.

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