What is the difference between the -keep and -dontwarn class

Hey, I'm new to 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 turned on proGuard, I had a problem with my error. I found answers that use -dontwarn for classes that appear in the error message, but after looking at the documentation from proGuard says

If you do not want to filter out problem classes, you can try your luck with the -ignorewarnings option or even with the -dontwarn option. Use these options only if you really know what you are doing .

and I don’t know what I’m doing and here is my proguard-rules.pro file

 -dontwarn okio.** -dontwarn org.apache.** -dontwarn com.appodeal.** -dontwarn com.parse.** -dontwarn com.squareup.** 

and I saw some answers: use -keep class

so can anyone explain this

+5
source share
2 answers

-keep class Save the specified classes and class members.

-dontwarn Do not warn about unresolved links at all.

Read more here http://proguard.sourceforge.net/manual/refcard.html

+5
source
 -dontwarn 

Indicates not to warn about unresolved links and other important issues in general. An optional filter is a regular expression; ProGuard does not print class warnings with the corresponding names. Ignoring warnings can be dangerous. For example, if unresolved classes or class members are really necessary for processing, the processed code will not function properly. Use this option only if you know what you are doing!

 -keep class 

Defines classes and class members (fields and methods) that should be stored as entry points into your code. For example, to save an application, you can specify the main class along with its main method. To process a library, you must specify all publicly available items.

Hope this helps!

+2
source

Source: https://habr.com/ru/post/1242531/


All Articles