Xamarin将“将程序集捆绑到本机代码中"和冒犯 [英] Xamarin Forms "Bundle assemblies into native code" and ofbuscation

查看:105
本文介绍了Xamarin将“将程序集捆绑到本机代码中"和冒犯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Xamarin Forms创建了Android应用.对于发行版,我使用选项将程序集捆绑到本机代码中". 我的apk大小为17 Mb,如果没有此选项,则为33 Mb.我需要对我的库使用混淆处理还是我的代码受到保护? 我进行了很多搜索-但没有找到确切的答案.

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.

推荐答案

启用此选项后,程序集将捆绑到本机共享库中.此选项可确保您的代码安全;它通过将托管程序集嵌入本机二进制文件中来保护它们.

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.

保持安全:

这些文件会将.dll文件捆绑到.so文件中,因此很难在有根设备上进行篡改.正如 BobFlora 所说:它将使用本地代码将IL代码移入binaries(.so file),因此黑客更难将其弄乱.这里没有性能问题.

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.

减小apk大小:

此选项将大大减少apk的大小,因为.so文件被压缩而dlls没有被压缩.

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?

它正在帮助增加代码混淆(特别是在Android上),还有其他提高安全性/加密技术的方法.如果您对安全性有更严格的要求,则可以使用此选项,具体取决于您的要求.

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.

这篇关于Xamarin将“将程序集捆绑到本机代码中"和冒犯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆