I am new in proguard
and shrink code and resource. I have some problems in this topic and searched but can't find any resources. I want to add proguard
to my application then i added below code to my gradle
. In my application, i have a login page that get username and password and sent to server with gson
and JsonObject
. after add proguard
, i can't connect to server and failed without any errors. what? What is my problem? I check the value returns from server in debug mode, shows, a.b.c.d , i think that convert to obfuscation class but not recognized.
my gradle:
buildTypes{ /* release{ minifyEnabled true shrinkResources true *//* proguardFiles getIsDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'*//* }*/ debug{ minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile( 'proguard-android-optimize.txt'), 'proguard.cfg' } }
I add some parts to proguard
configs, because before i had some errors. The proguard.cfg
:
-keep class org.apache.http.** { *; }
-dontwarn org.apache.http.**
##---------------Begin: proguard configuration for Gson ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature
# For using GSON @Expose annotation
-keepattributes *Annotation*
# Gson specific classes
-keep class sun.misc.Unsafe { *; }
#-keep class com.google.gson.stream.** { *; }
# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { *; }
##---------------End: proguard configuration for Gson ----------