简体   繁体   English

Android Hilt 混淆规则混淆

[英]Android Hilt proguard-rules obfuscation

I've applied android Hilt to my project and everything works fine in debug mode.我已将 android Hilt 应用于我的项目,并且在调试模式下一切正常。

The issue here is when I set minifyEnabled to true in release mode, app crashed.这里的问题是当我在发布模式下将 minifyEnabled 设置为 true 时,应用程序崩溃了。 This is because my app package directories are obfuscated and Hilt can 't find proper classes at runtime.这是因为我的应用程序 package 目录被混淆了,并且 Hilt 无法在运行时找到合适的类。

If I set minifyEnabled to false, app works fine but all the classes in package directories can be shown in decompiling tools.如果我将 minifyEnabled 设置为 false,应用程序可以正常工作,但 package 目录中的所有类都可以在反编译工具中显示。

How do I obfuscate my source code while using android Hilt?如何在使用 android Hilt 时混淆我的源代码?

Guide me please.请指导我。 Thank you.谢谢你。

you need to add the Proguard rules for all the libraries you are using so that you can successfully obfuscate the code and have it all work correctly您需要为您正在使用的所有库添加 Proguard 规则,以便您可以成功混淆代码并使其全部正常工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM