Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between proguard-rules.pro and proguard.cfg

I am learning and implementing proguard for very first time. I have seen some examples and add following code in proguard-rules.pro file, but there is also 1 more file named proguard.cfg.

I have tried to google this but unable to understand the difference between proguard.cfg and proguard-rules.pro file.

I have added following in proguard-rules.pro file but what should i add in proguard.cfg file

#---------------TEST

-dontwarn javax.annotation.**

-keep class com.google.**
-dontwarn com.google.**

-keep class com.conviva.**
-dontwarn com.conviva.**

-keep class com.loopj.android.http.**
-keep class org.apache.http.**
-keep class rx.internal.util.**
-keep class com.algolia.search.**

-dontwarn com.loopj.android.http.**
-dontwarn org.apache.http.**
-dontwarn rx.internal.util.**
-dontwarn com.algolia.search.**

-keep public class android.net.http.SslError
-keep public class android.webkit.WebViewClient

-dontwarn android.webkit.WebView
-dontwarn android.net.http.SslError
-dontwarn android.webkit.WebViewClient


-assumenosideeffects class android.util.Log {
    public static boolean isLoggable(java.lang.String, int);
    public static int v(...);
    public static int i(...);
    public static int w(...);
    public static int d(...);
    public static int e(...);
}


#---------------TEST
like image 358
dev90 Avatar asked Apr 07 '17 11:04

dev90


1 Answers

You have to write your proguard commands inside proguard-rules.pro. You can find this file inside your project as

YourProject -> app -> src-> proguard-rules.pro

Inside another file proguard.cfg you have to-do nothing.

like image 81
Rahul Sharma Avatar answered Sep 25 '22 01:09

Rahul Sharma