混淆技术Xamarin项目 [英] Obfuscation in Xamarin Projects

查看:541
本文介绍了混淆技术Xamarin项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如你所知道Xamarin项目被编译成点网DLL程序集,它会打包成apk文件,并且可以通过像DotPeek反射很容易体现出来。

As you know Xamarin projects are compiled into dot net dll assembly and it'll be pack into apk file and can be easily reflected by reflectors like DotPeek.

我的第一个问题是:
我们如何保护我们的代码

My first question is: How can we protect our code?

我的第二个问题是:
执行混淆工具,如SmartAssembly在Xamarin项目可用或Xamarin项目将不支持他们呢?

My second question is: Do obfuscator tools like SmartAssembly are usable in Xamarin projects or Xamarin projects won't support them?

推荐答案

最好的办法保护你的.NET代码(.DLL文件)进行的APK是启用的的提前(AOT)编译:

The best way to protect your .NET code (.DLLS) for APKs is to enable Ahead Of Time (AOT) compilation:

AOT编译将编译应用程序的IL代码(.dll文件)成原生指令。被打包进APK最终的代码是那么X86,手臂等指令,而不是托管IL代码。

AOT compilation will compile your applications IL code (.dlls) into native instructions. The final code that is packaged into the APK is then X86, arm etc instructions rather than managed IL code.

AOT编译仅在企业版和更高的可用许可证

虽然AOT增加逆向工程的难度,它仍然不是100%傻瓜证明。最终的二进制文件仍然可以从一个根深蒂固的设备拉,并使用软件,如IDA Pro的逆向工程。这比使用DotPeek,但它仍然有可能要困难得多。

While AOT increases the difficulty of reverse engineering, it's still not 100% fool-proof. The final binaries can still be pulled from a rooted device and reverse engineered using software like IDA pro. It's a lot harder than using DotPeek but its still possible.

同样重要的是要注意使AOT编译的下侧。应用构建的需要编译的每通过您的应用程序所引用的组装时间,显著上升;我的经验表明,你应该期望在建倍-300%增长了200%,启用AOT时。

It is also important to note the down sides of enabling AOT compilation. Application builds times increase significantly as every assembly referenced by your app needs to be compiled; my experiences indicated that you should expect a 200%-300% increase in build times when AOT is enabled.

此外,AOT编译会增加最终的APK大小。

Additionally, AOT compilation will increase the final APK size.

这篇关于混淆技术Xamarin项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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