有没有办法将 ProGuard 与 MonoDroid 一起使用?

发布于 2024-12-25 05:48:29 字数 349 浏览 2 评论 0原文

我们的开发团队刚刚(大部分)在 Visual Studio 中使用 MonoDroid 完成了一个 Android 应用程序。因为它与银行业务有关,所以我们想尝试对其进行混淆,以增加一些安全性,防止任何人试图反编译它。最初,我认为我可以只使用 ProGuard,但似乎没有可以在 Visual Studio 中编辑的 project.properties 文件。谁能在这个问题上提供一些光辉的帮助,并告诉我是否可以将 ProGuard 与 Mono 一起使用,而我的新鲜感只是蒙蔽了我的视野?

(另一位开发人员尝试使用 Dotfuscator - 因为我们无法立即找到使用 ProGuard 的方法 - 但它失败并出现许多错误;Mono 运行时似乎给它带来了问题。)

Our development team just (mostly) finished an Android app using MonoDroid in Visual Studio. Because it has to do with banking, we wanted to try to obfuscate it in order to add some security against anyone trying to decompile it. Initially, I figured I could just use ProGuard, but there doesn't seem to be a project.properties file that I can edit in Visual Studio. Can anyone shine some glorious helping light on this subject and tell me if it is possible to use ProGuard with Mono and my newbishness is just clouding my vision?

(Another developer tried to use Dotfuscator -since we couldn't immediately find a way to use ProGuard- but it failed with numerous errors; the Mono runtime seems to give it issues.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

街角迷惘 2025-01-01 05:48:29

Mono for Android 工具链目前不支持运行 proguard。

然而,除了一个广泛的例外,缺乏 proguard 支持在很大程度上是没有意义的。 Proguard 仅在 Java 字节码上运行。 Mono for Android 架构 在进程中运行 Mono 运行时; .NET CIL 没有“编译”成 Java 字节码,CIL 是由 Mono 进行 JIT 处理的。唯一运行的 Java 代码是 Android Callable Wrappers,它允许 Java/Android调用托管代码。

因此,proguard 在 Mono for Android 应用程序中唯一要保护的是生成的 Android Callable Wrappers,它主要由一堆native 方法声明组成。 Android Callable Wrappers 中不会有任何需要反编译的业务逻辑。

相反,CIL 程序集未压缩地存储在 .apk 文件中。依次可以对程序集进行反编译以获得所有业务逻辑。这里的解决方案是在将程序集嵌入 .apk 之前对其进行混淆。有报告可以使用Xenocode的Postbuild 2010,尽管我不知道如何连接它的任何细节。

上面提到的异常与通过以下方式包含在 构建过程 AndroidJavaSourceAndroidJavaLibrary 构建操作,用于包含 AdMob 库等内容。对于这种情况,我们应该在构建过程中添加混淆器支持,尽管我没有关于何时添加混淆器支持的预计时间。

The Mono for Android toolchain doesn't have any support for running proguard at the moment.

However, with one broad exception, the lack of proguard support is largely moot. Proguard only runs on Java bytecode. The Mono for Android architecture has the Mono runtime running in the process; .NET CIL is not "compiled" into Java bytecode, the CIL is JITed by Mono. The only Java code running around is for Android Callable Wrappers, which allow Java/Android to call into managed code.

Thus the only thing proguard will protect in a Mono for Android app is the generated Android Callable Wrappers, which largely consists of a bunch of native method declarations. There won't be any business logic to decompile in the Android Callable Wrappers.

Instead, the CIL assemblies are stored uncompressed in the .apk file. The assemblies in turn can be decompiled to obtain all your business logic. The solution here is to obfuscate the assemblies before embedding them into the .apk. There are reports that Xenocode's Postbuild 2010 can be used, though I don't know any of the details on how to hook this up.

The exception mentioned above relates to any custom Java code included in the build proces via the AndroidJavaSource and AndroidJavaLibrary Build actions, which would be used to include such things as the AdMob library. For this scenario we should add proguard support to the build process, though I have no ETA on when proguard support will be added.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文