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.
Go to "Android Options" Uncheck: "Use Fast Deployment (debug mode only)"
To create the APK file, right-click the Xamarin. Android project in the Solution Explorer and select Archive... This will open the Archive manager and begin archiving the project, preparing to create the APK file.
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 :
Bundle Assemblies into Native Code
: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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With