Skip to content

Commit

Permalink
Fixed proguard config.
Browse files Browse the repository at this point in the history
  • Loading branch information
samidhtalsania committed Apr 26, 2015
1 parent dec6944 commit a5c33f1
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 4 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ android {
applicationId "com.bluealeaf.dota2ticker"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionCode 2
versionName "1.0"
}
buildTypes {
Expand Down
116 changes: 114 additions & 2 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,125 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
##---------------Begin: proguard configuration common for all Android apps ----------
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
-dump class_files.txt
-printseeds seeds.txt
-printusage unused.txt
-printmapping mapping.txt
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-allowaccessmodification
-keepattributes *Annotation*
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
-repackageclasses ''

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-dontnote com.android.vending.licensing.ILicensingService

# Explicitly preserve all serialization members. The Serializable interface
# is only a marker interface, so it wouldn't save them.
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}

# Preserve all native method names and the names of their classes.
-keepclasseswithmembernames class * {
native <methods>;
}

-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}

# Preserve static fields of inner classes of R classes that might be accessed
# through introspection.
-keepclassmembers class **.R$* {
public static <fields>;
}

# Preserve the special static methods that are required in all enumeration classes.
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

-keep public class * {
public protected *;
}

-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
##---------------End: proguard configuration common for all Android apps ----------

##---------------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.bluealeaf.dota2ticker.models.** { *; }

##---------------End: proguard configuration for Gson ----------


##---------------Begin: proguard configuration for GreenDAO ----------
-keepclassmembers class * extends de.greenrobot.dao.AbstractDao {
public static java.lang.String TABLENAME;
}
##---------------End: proguard configuration for GreenDAO ----------


-keep class **$Properties

-dontwarn com.squareup.**
-dontwarn okio.**

-keep class org.apache.http.** { *; }
-keep class retrofit.** { *; }
-keep class okio.** { *; }
-keep class org.joda.time.** { *; }
-keep class com.squareup.okhttp.** { *; }
-keep class com.bluealeaf.dota2ticker.models.** { *; }
-keepclassmembers class ** {
@com.squareup.otto.Subscribe public *;
@com.squareup.otto.Produce public *;
}
-keepclasseswithmembers class * {
@retrofit.http.* <methods>;
}

-keepattributes Exception

-dontwarn retrofit.**
-dontwarn org.joda.time.**
-dontwarn okio.**
-dontwarn com.squareup.**
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void getMatchesList(long id){

RestAdapter restAdapter = new RestAdapter.Builder()
.setEndpoint(Endpoints.GET_MATCHES_ENDPOINT)
.setLogLevel(RestAdapter.LogLevel.NONE)
.setLogLevel(RestAdapter.LogLevel.FULL)
.setConverter(new GsonConverter(gson))
.setClient(new OkClient(BusProvider.getClientInstance()))
.build();
Expand Down

0 comments on commit a5c33f1

Please sign in to comment.