Skip to content

Instantly share code, notes, and snippets.

@PaNaVTEC
Last active May 17, 2018 22:02
Show Gist options
  • Save PaNaVTEC/799875aa59ae8965d90b to your computer and use it in GitHub Desktop.
Save PaNaVTEC/799875aa59ae8965d90b to your computer and use it in GitHub Desktop.
Proguard config
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/panavtec/Documents/android-sdk-macosx/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-dontobfuscate
-dontwarn
-optimizationpasses 5
#When not preverifing in a case-insensitive filing system, such as Windows. Because this tool unpacks your processed jars, you should then use:
-dontusemixedcaseclassnames
#Specifies not to ignore non-public library classes. As of version 4.5, this is the default setting
-dontskipnonpubliclibraryclasses
#Preverification is irrelevant for the dex compiler and the Dalvik VM, so we can switch it off with the -dontpreverify option.
-dontpreverify
#Specifies to write out some more information during processing. If the program terminates with an exception, this option will print out the entire stack trace, instead of just the exception message.
-verbose
#The -optimizations option disables some arithmetic simplifications that Dalvik 1.0 and 1.5 can't handle. Note that the Dalvik VM also can't handle aggressive overloading (of static fields).
#To understand or change this check http://proguard.sourceforge.net/index.html#/manual/optimizations.html
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*,!code/allocation/variable
#Annotations for greendao and LineNumber for reports in play store
-keepattributes *Annotation*, LineNumberTable
#To repackage classes on a single package
#-repackageclasses ''
#related with Logs.
#-dontobfuscate
#-forceprocessing
#Keep classes that are referenced on the AndroidManifest
-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
# Serializables
-keepnames class * implements java.io.Serializable
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
!static !transient <fields>;
!private <fields>;
!private <methods>;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
# support v4
-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
#Maintain java native methods
-keepclasseswithmembernames class * {
native <methods>;
}
#To maintain custom components names that are used on layouts XML:
-keep public class * extends android.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
#Maintain enums
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
#Keep the R
-keepclassmembers class **.R$* {
public static <fields>;
}
#To keep parcelable classes (to serialize - deserialize objects to sent through Intents)
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
# To keep JS interfaces in webview
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
#Flurry related
-keep class com.flurry.** { *; }
-dontwarn com.flurry.**
#crittercism
-keep public class com.crittercism.**
-keepclassmembers public class com.crittercism.* { *; }
#facebook
-keep class com.facebook.** { *; }
-keepattributes Signature
# Picasso
-dontwarn com.squareup.okhttp.**
# Gson
-keep class com.google.gson.** { *; }
# Butterknife
-dontwarn butterknife.internal.**
-keep class **$$ViewInjector { *; }
-keepnames class * { @butterknife.InjectView *;}
# Retrofit
-dontwarn javax.naming.**
-dontwarn retrofit.appengine.**
-keep class com.google.inject.** { *; }
-keep class org.apache.http.** { *; }
-keep class org.apache.james.mime4j.** { *; }
-keep class javax.inject.** { *; }
-keep class retrofit.** { *; }
# Amazon AWS
-dontwarn com.amazonaws.**
-dontwarn com.fasterxml.jackson.databind.**
-dontwarn org.slf4j.**
-dontwarn org.bouncycastle.**
-keep class org.apache.commons.logging.** { *; }
-keep class com.amazonaws.services.sqs.QueueUrlHandler { *; }
-keep class com.amazonaws.javax.xml.transform.sax.* { public *; }
-keep class com.amazonaws.javax.xml.stream.** { *; }
-keep class com.amazonaws.services.**.model.*Exception* { *; }
-keep class org.codehaus.** { *; }
-keep class com.amazonaws.internal.** { *; }
-keepattributes Signature,*Annotation*,EnclosingMethod
-keepnames class com.fasterxml.jackson.** { *; }
-keepnames class com.amazonaws.** { *; }
-dontwarn javax.xml.stream.events.**
-dontwarn org.codehaus.jackson.**
-dontwarn org.apache.commons.logging.impl.**
-dontwarn org.apache.http.conn.scheme.**
#Greendao
-keep class de.greenrobot.dao.** { *; }
-keep class com.selltag.persistence.** {
public static <fields>;
}
# Bakingcode ara-twitter
-keep class org.apache.commons.codec.** { *; }
-keep class oauth.signpost.** { *; }
-keep class com.bakingcode.io.twitter.** { *; }
-keepclassmembers public class com.bakingcode.io.twitter.** { *; }
#Algolia search
-dontwarn com.algolia.**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment