[英]what is the difference between -keep class and -dontwarn
Hey I'm new with proGuard , I use it to protect my code from reverse engineering , but when I built my signed apk I got a lot of errors when I enabled proGuard ,I have googled my problem I've found answers that says use -dontwarn for the classes that showing in the error message but after seeing the documentation from proGuard it says 嘿,我是proGuard的新手,我使用它来保护我的代码免受逆向工程,但是当我构建我签名的apk时,我启用了proGuard时出现了很多错误,我已经搜索了我的问题我找到了说使用的答案-dontwarn用于在错误消息中显示的类,但在看到proGuard的文档后,它说
If you don't feel like filtering out the problematic classes, you can try your luck with the -ignorewarnings option, or even the -dontwarn option. 如果您不想过滤掉有问题的课程,可以尝试使用-ignorewarnings选项,甚至是-dontwarn选项。 Only use these options if you really know what you're doing though. 如果您真的知道自己在做什么,请仅使用这些选项 。
and I don't know what I'm doing and here is my proguard-rules.pro
file 我不知道我在做什么,这是我的proguard-rules.pro
文件
-dontwarn okio.**
-dontwarn org.apache.**
-dontwarn com.appodeal.**
-dontwarn com.parse.**
-dontwarn com.squareup.**
and I've seen some answers says use -keep class
我看到一些答案说使用-keep class
so can someone explain it 有人可以解释一下
-keep class
Preserve the specified classes and class members. -keep class
保留指定的类和类成员。
-dontwarn
Don't warn about unresolved references at all. -dontwarn
不要警告未解决的引用。
More info here http://proguard.sourceforge.net/manual/refcard.html 更多信息,请访问http://proguard.sourceforge.net/manual/refcard.html
-dontwarn
Specifies not to warn about unresolved references and other important problems at all. 指定不要警告未解决的引用和其他重要问题。 The optional filter is a regular expression; 可选过滤器是正则表达式; ProGuard doesn't print warnings about classes with matching names. ProGuard不会打印有关匹配名称的类的警告。 Ignoring warnings can be dangerous. 忽略警告可能很危险。 For instance, if the unresolved classes or class members are indeed required for processing, the processed code will not function properly. 例如,如果确实需要处理未解析的类或类成员,则处理的代码将无法正常运行。 Only use this option if you know what you're doing! 如果您知道自己在做什么,请仅使用此选项!
-keep class
Specifies classes and class members (fields and methods) to be preserved as entry points to your code. 指定要保留为代码入口点的类和类成员(字段和方法)。 For example, in order to keep an application, you can specify the main class along with its main method. 例如,为了保留应用程序,您可以指定主类及其主方法。 In order to process a library, you should specify all publicly accessible elements. 要处理库,您应指定所有可公开访问的元素。
Hope this Helps!! 希望这可以帮助!!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.