Update proguard file

The build was giving an error so I redid the proguard file. This is the default optimized one with some additions for the used libraries.
multisite
Floens 10 years ago
parent 1a19303418
commit ea63fd16c8
  1. 7
      Clover/app/build.gradle
  2. 162
      Clover/app/proguard.cfg

@ -37,7 +37,8 @@ android {
if (doSign) { if (doSign) {
Properties props = new Properties() Properties props = new Properties()
props.load(new FileInputStream(f)) InputStream is = new FileInputStream(f)
props.load(is)
signingConfigs { signingConfigs {
release { release {
@ -47,6 +48,8 @@ android {
keyPassword props['keyPass'] keyPassword props['keyPass']
} }
} }
is.close()
} }
buildTypes { buildTypes {
@ -65,6 +68,8 @@ android {
debug { debug {
versionNameSuffix " Debug" versionNameSuffix " Debug"
// minifyEnabled true
// proguardFiles 'proguard.cfg'
} }
} }

@ -1,120 +1,68 @@
# Preverification is irrelevant for the dex compiler and the Dalvik VM. # This is a configuration file for ProGuard.
# http://proguard.sourceforge.net/index.html#manual/usage.html
-dontpreverify
# Optimizations: If you don't want to optimize, use the
# Reduce the size of the output some more. # proguard-android.txt configuration file instead of this one, which
# turns off the optimization flags. Adding optimization introduces
-repackageclasses '' # certain risks, since for example not all optimizations performed by
# ProGuard works on all versions of Dalvik. The following flags turn
# off various optimizations known to have issues, but the list may not
# be complete or up to date. (The "arithmetic" optimization can be
# used if you are only targeting Android 2.0 or later.) Make sure you
# test thoroughly if you go this route.
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
-optimizationpasses 5
-allowaccessmodification -allowaccessmodification
-dontpreverify
# Switch off some optimizations that trip older versions of the Dalvik VM. # The remainder of this file is identical to the non-optimized version
# of the Proguard configuration file (except that the other file has
-optimizations !code/simplification/arithmetic,!code/allocation/variable # flags to turn off optimization).
# Keep a fixed source file attribute and all line number tables to get line
# numbers in the stack traces.
# You can comment this out if you're not interested in stack traces.
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
# RemoteViews might need annotations. -dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose
-keepattributes *Annotation* -keepattributes *Annotation*
-keep public class com.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService
# Preserve all fundamental application classes. # For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * {
-keep public class * extends android.app.Activity native <methods>;
-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
# Preserve all View implementations, their special context constructors, and
# their setters.
-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*(...);
} }
# Preserve all classes that have special context constructors, and the # keep setters in Views so that animations can still work.
# constructors themselves. # see http://proguard.sourceforge.net/manual/examples.html#beans
-keepclassmembers public class * extends android.view.View {
-keepclasseswithmembers class * { void set*(***);
public <init>(android.content.Context, android.util.AttributeSet); *** get*();
} }
# Preserve all classes that have special context constructors, and the # We want to keep methods in Activity that could be used in the XML attribute onClick
# constructors themselves. -keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
} }
# Preserve the special fields of all Parcelable implementations. # For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keepclassmembers class * implements android.os.Parcelable { -keepclassmembers class * implements android.os.Parcelable {
static android.os.Parcelable$Creator CREATOR; public static final android.os.Parcelable$Creator CREATOR;
} }
# Preserve static fields of inner classes of R classes that might be accessed
# through introspection.
-keepclassmembers class **.R$* { -keepclassmembers class **.R$* {
public static <fields>; public static <fields>;
} }
# Preserve the required interface from the License Verification Library # The support library contains references to newer platform versions.
# (but don't nag the developer if the library is not used at all). # Don't warn about those in case this app is linking against an older
# platform version. We know about them, and they are safe.
-keep public interface com.android.vending.licensing.ILicensingService
-dontnote com.android.vending.licensing.ILicensingService
# The Android Compatibility library references some classes that may not be
# present in all versions of the API, but we know that's ok.
-dontwarn android.support.** -dontwarn android.support.**
# Preserve all native method names and the names of their classes.
-keepclasseswithmembernames class * {
native <methods>;
}
# Preserve the special static methods that are required in all enumeration
# classes.
-keepclassmembers class * extends java.lang.Enum {
public static **[] values();
public static ** valueOf(java.lang.String);
}
# Explicitly preserve all serialization members. The Serializable interface
# is only a marker interface, so it wouldn't save them.
# You can comment this out if your application doesn't use serialization.
# If your code contains serializable classes that have to be backward
# compatible, please refer to the manual.
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
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();
}
# Your application may contain more items that need to be preserved;
# typically classes that are dynamically created using Class.forName:
# -keep public class mypackage.MyClass
# -keep public interface mypackage.MyInterface
# -keep public class * implements mypackage.MyInterface
# OrmLite uses reflection # OrmLite uses reflection
-keep class com.j256.** -keep class com.j256.**
-keepclassmembers class com.j256.** { *; } -keepclassmembers class com.j256.** { *; }
@ -126,28 +74,30 @@
# Clover database models # Clover database models
-keep class org.floens.chan.core.model.** { *; } -keep class org.floens.chan.core.model.** { *; }
# Jsoup # Required for the gif library
-keep public class org.jsoup.** {
public *;
}
-keep public class pl.droidsonroids.gif.GifIOException{<init>(int);} -keep public class pl.droidsonroids.gif.GifIOException{<init>(int);}
-keep class pl.droidsonroids.gif.GifInfoHandle{<init>(long,int,int,int);} -keep class pl.droidsonroids.gif.GifInfoHandle{<init>(long,int,int,int);}
# OkHttp and LeakCanary
-dontwarn java.nio.** -dontwarn java.nio.**
-dontwarn org.codehaus.mojo.** -dontwarn org.codehaus.mojo.**
# LeakCanary uses removed method (checks the API level)
-dontwarn com.squareup.leakcanary.DisplayLeakService
# Jsoup
-keeppackagenames org.jsoup.nodes
-keep class org.floens.chan.ui.layout.CaptchaLayout$CaptchaInterface # JS interfaces
-keep class * implements org.floens.chan.ui.layout.CaptchaLayout$CaptchaInterface -keepclassmembers class * {
-keepclassmembers class org.floens.chan.ui.layout.CaptchaLayout$CaptchaInterface { @android.webkit.JavascriptInterface <methods>;
<methods>;
} }
-keepattributes JavascriptInterface
# EventBus
-keepclassmembers class ** { -keepclassmembers class ** {
public void onEvent*(**); public void onEvent*(**);
} }
-keep public class * extends android.support.design.** #-keep public class * extends android.support.design.**
# Some reflection is used on RecyclerView
-keep public class android.support.v7.widget.RecyclerView -keep public class android.support.v7.widget.RecyclerView

Loading…
Cancel
Save