summaryrefslogtreecommitdiffstats
path: root/mobile/android/config/proguard
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /mobile/android/config/proguard
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mobile/android/config/proguard')
-rw-r--r--mobile/android/config/proguard/adjust-keeps.cfg20
-rw-r--r--mobile/android/config/proguard/appcompat-v7-keeps.cfg18
-rw-r--r--mobile/android/config/proguard/leakcanary-keeps.cfg7
-rw-r--r--mobile/android/config/proguard/play-services-keeps.cfg19
-rw-r--r--mobile/android/config/proguard/proguard-android.cfg78
-rw-r--r--mobile/android/config/proguard/proguard-leanplum.cfg347
-rw-r--r--mobile/android/config/proguard/proguard.cfg165
-rw-r--r--mobile/android/config/proguard/strip-libs.cfg41
8 files changed, 695 insertions, 0 deletions
diff --git a/mobile/android/config/proguard/adjust-keeps.cfg b/mobile/android/config/proguard/adjust-keeps.cfg
new file mode 100644
index 0000000000..0c0fc2158d
--- /dev/null
+++ b/mobile/android/config/proguard/adjust-keeps.cfg
@@ -0,0 +1,20 @@
+# Rules to make the Adjust install tracking library work.
+# via https://github.com/adjust/android_sdk#5-add-permissions
+
+-keep class com.adjust.sdk.plugin.MacAddressUtil {
+ java.lang.String getMacAddress(android.content.Context);
+}
+-keep class com.adjust.sdk.plugin.AndroidIdUtil {
+ java.lang.String getAndroidId(android.content.Context);
+}
+-keep class com.google.android.gms.common.ConnectionResult {
+ int SUCCESS;
+}
+-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {
+ com.google.android.gms.ads.identifier.AdvertisingIdClient$Info
+ getAdvertisingIdInfo (android.content.Context);
+}
+-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info {
+ java.lang.String getId ();
+ boolean isLimitAdTrackingEnabled();
+}
diff --git a/mobile/android/config/proguard/appcompat-v7-keeps.cfg b/mobile/android/config/proguard/appcompat-v7-keeps.cfg
new file mode 100644
index 0000000000..bde6f0fb74
--- /dev/null
+++ b/mobile/android/config/proguard/appcompat-v7-keeps.cfg
@@ -0,0 +1,18 @@
+# Avoid https://code.google.com/p/android/issues/detail?id=187611 and
+# http://stackoverflow.com/q/32813894 when building with Gradle. Why
+# these aren't defined in appcompat-v7.aar/proguard.txt is beyond me.
+
+-keep public class android.support.v7.widget.** { *; }
+-keep public class android.support.v7.internal.widget.** { *; }
+-keep public class android.support.v7.internal.view.menu.** { *; }
+
+-keep public class * extends android.support.v4.view.ActionProvider {
+ public <init>(android.content.Context);
+}
+
+-keepclassmembers class android.support.graphics.drawable.VectorDrawableCompat$* {
+ void set*(***);
+ *** get*();
+}
+
+-keepattributes LocalVariableTable
diff --git a/mobile/android/config/proguard/leakcanary-keeps.cfg b/mobile/android/config/proguard/leakcanary-keeps.cfg
new file mode 100644
index 0000000000..f9e5df87c1
--- /dev/null
+++ b/mobile/android/config/proguard/leakcanary-keeps.cfg
@@ -0,0 +1,7 @@
+# LeakCanary
+-keep class org.eclipse.mat.** { *; }
+-keep class com.squareup.leakcanary.** { *; }
+-keep class com.squareup.haha.** { *; }
+
+# With LeakCanary 1.4-beta1 this creates a pile of warnings
+-dontwarn com.squareup.haha.**
diff --git a/mobile/android/config/proguard/play-services-keeps.cfg b/mobile/android/config/proguard/play-services-keeps.cfg
new file mode 100644
index 0000000000..b3aaf80aa9
--- /dev/null
+++ b/mobile/android/config/proguard/play-services-keeps.cfg
@@ -0,0 +1,19 @@
+# Rules to prevent Google Play Services from exploding
+# (From http://developer.android.com/google/play-services/setup.html#Proguard
+# With the reference to "Object" changed so it'll actually *work*...)
+-keep class * extends java.util.ListResourceBundle {
+ protected java.lang.Object[][] getContents();
+}
+
+-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
+ public static final *** NULL;
+}
+
+-keepnames @com.google.android.gms.common.annotation.KeepName class *
+-keepclassmembernames class * {
+ @com.google.android.gms.common.annotation.KeepName *;
+}
+
+-keepnames class * implements android.os.Parcelable {
+ public static final ** CREATOR;
+}
diff --git a/mobile/android/config/proguard/proguard-android.cfg b/mobile/android/config/proguard/proguard-android.cfg
new file mode 100644
index 0000000000..93acf28d10
--- /dev/null
+++ b/mobile/android/config/proguard/proguard-android.cfg
@@ -0,0 +1,78 @@
+# This is a configuration file for ProGuard.
+# http://proguard.sourceforge.net/index.html#manual/usage.html
+#
+# Starting with version 2.2 of the Android plugin for Gradle, these files are no longer used. Newer
+# versions are distributed with the plugin and unpacked at build time. Files in this directory are
+# no longer maintained.
+
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-verbose
+
+# Optimization is turned off by default. Dex does not like code run
+# through the ProGuard optimize and preverify steps (and performs some
+# of these optimizations on its own).
+-dontoptimize
+-dontpreverify
+# Note that if you want to enable optimization, you cannot just
+# include optimization flags in your own project configuration file;
+# instead you will need to point to the
+# "proguard-android-optimize.txt" file instead of this one from your
+# project.properties file.
+
+-keepattributes *Annotation*
+-keep public class com.google.vending.licensing.ILicensingService
+-keep public class com.android.vending.licensing.ILicensingService
+
+# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
+-keepclasseswithmembernames class * {
+ native <methods>;
+}
+
+# keep setters in Views so that animations can still work.
+# see http://proguard.sourceforge.net/manual/examples.html#beans
+-keepclassmembers public class * extends android.view.View {
+ void set*(***);
+ *** get*();
+}
+
+# We want to keep methods in Activity that could be used in the XML attribute onClick
+-keepclassmembers class * extends android.app.Activity {
+ public void *(android.view.View);
+}
+
+# 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 {
+ public static final android.os.Parcelable$Creator CREATOR;
+}
+
+-keepclassmembers class **.R$* {
+ public static <fields>;
+}
+
+# The support library contains references to newer platform versions.
+# Don't warn about those in case this app is linking against an older
+# platform version. We know about them, and they are safe.
+-dontwarn android.support.**
+
+# Understand the @Keep support annotation.
+-keep class android.support.annotation.Keep
+
+-keep @android.support.annotation.Keep class * {*;}
+
+-keepclasseswithmembers class * {
+ @android.support.annotation.Keep <methods>;
+}
+
+-keepclasseswithmembers class * {
+ @android.support.annotation.Keep <fields>;
+}
+
+-keepclasseswithmembers class * {
+ @android.support.annotation.Keep <init>(...);
+}
diff --git a/mobile/android/config/proguard/proguard-leanplum.cfg b/mobile/android/config/proguard/proguard-leanplum.cfg
new file mode 100644
index 0000000000..9908cdcaa8
--- /dev/null
+++ b/mobile/android/config/proguard/proguard-leanplum.cfg
@@ -0,0 +1,347 @@
+-dontwarn com.actionbarsherlock.**
+
+-dontnote
+-keepparameternames
+-keepattributes EnclosingMethod
+
+# Keep - Library. Keep all public and protected classes, fields, and methods.
+-keep public class com.leanplum.*,
+ com.leanplum.activities.*,
+ com.leanplum.annotations.*,
+ com.leanplum.callbacks.*,
+ com.leanplum.messagetemplates.*,
+ com.leanplum.utils.*,
+ com.leanplum.views.*
+{
+ public protected <fields>;
+ public protected <methods>;
+}
+
+# Also keep - Enumerations. Keep the special static methods that are required in
+# enumeration classes.
+-keepclassmembers enum * {
+ public static **[] values();
+ public static ** valueOf(java.lang.String);
+}
+
+# Also keep - Database drivers. Keep all implementations of java.sql.Driver.
+-keep class * extends java.sql.Driver
+
+
+# Keep names - Native method names. Keep all native class/method names.
+-keepclasseswithmembers,allowshrinking class * {
+ native <methods>;
+}
+
+# Remove - System method calls. Remove all invocations of System
+# methods without side effects whose return values are not used.
+-assumenosideeffects public class java.lang.System {
+ public static long currentTimeMillis();
+ static java.lang.Class getCallerClass();
+ public static int identityHashCode(java.lang.Object);
+ public static java.lang.SecurityManager getSecurityManager();
+ public static java.util.Properties getProperties();
+ public static java.lang.String getProperty(java.lang.String);
+ public static java.lang.String getenv(java.lang.String);
+ public static java.lang.String mapLibraryName(java.lang.String);
+ public static java.lang.String getProperty(java.lang.String,java.lang.String);
+}
+
+# Remove - Math method calls. Remove all invocations of Math
+# methods without side effects whose return values are not used.
+-assumenosideeffects public class java.lang.Math {
+ public static double sin(double);
+ public static double cos(double);
+ public static double tan(double);
+ public static double asin(double);
+ public static double acos(double);
+ public static double atan(double);
+ public static double toRadians(double);
+ public static double toDegrees(double);
+ public static double exp(double);
+ public static double log(double);
+ public static double log10(double);
+ public static double sqrt(double);
+ public static double cbrt(double);
+ public static double IEEEremainder(double,double);
+ public static double ceil(double);
+ public static double floor(double);
+ public static double rint(double);
+ public static double atan2(double,double);
+ public static double pow(double,double);
+ public static int round(float);
+ public static long round(double);
+ public static double random();
+ public static int abs(int);
+ public static long abs(long);
+ public static float abs(float);
+ public static double abs(double);
+ public static int max(int,int);
+ public static long max(long,long);
+ public static float max(float,float);
+ public static double max(double,double);
+ public static int min(int,int);
+ public static long min(long,long);
+ public static float min(float,float);
+ public static double min(double,double);
+ public static double ulp(double);
+ public static float ulp(float);
+ public static double signum(double);
+ public static float signum(float);
+ public static double sinh(double);
+ public static double cosh(double);
+ public static double tanh(double);
+ public static double hypot(double,double);
+ public static double expm1(double);
+ public static double log1p(double);
+}
+
+# Remove - Number method calls. Remove all invocations of Number
+# methods without side effects whose return values are not used.
+-assumenosideeffects public class java.lang.* extends java.lang.Number {
+ public static java.lang.String toString(byte);
+ public static java.lang.Byte valueOf(byte);
+ public static byte parseByte(java.lang.String);
+ public static byte parseByte(java.lang.String,int);
+ public static java.lang.Byte valueOf(java.lang.String,int);
+ public static java.lang.Byte valueOf(java.lang.String);
+ public static java.lang.Byte decode(java.lang.String);
+ public int compareTo(java.lang.Byte);
+ public static java.lang.String toString(short);
+ public static short parseShort(java.lang.String);
+ public static short parseShort(java.lang.String,int);
+ public static java.lang.Short valueOf(java.lang.String,int);
+ public static java.lang.Short valueOf(java.lang.String);
+ public static java.lang.Short valueOf(short);
+ public static java.lang.Short decode(java.lang.String);
+ public static short reverseBytes(short);
+ public int compareTo(java.lang.Short);
+ public static java.lang.String toString(int,int);
+ public static java.lang.String toHexString(int);
+ public static java.lang.String toOctalString(int);
+ public static java.lang.String toBinaryString(int);
+ public static java.lang.String toString(int);
+ public static int parseInt(java.lang.String,int);
+ public static int parseInt(java.lang.String);
+ public static java.lang.Integer valueOf(java.lang.String,int);
+ public static java.lang.Integer valueOf(java.lang.String);
+ public static java.lang.Integer valueOf(int);
+ public static java.lang.Integer getInteger(java.lang.String);
+ public static java.lang.Integer getInteger(java.lang.String,int);
+ public static java.lang.Integer getInteger(java.lang.String,java.lang.Integer);
+ public static java.lang.Integer decode(java.lang.String);
+ public static int highestOneBit(int);
+ public static int lowestOneBit(int);
+ public static int numberOfLeadingZeros(int);
+ public static int numberOfTrailingZeros(int);
+ public static int bitCount(int);
+ public static int rotateLeft(int,int);
+ public static int rotateRight(int,int);
+ public static int reverse(int);
+ public static int signum(int);
+ public static int reverseBytes(int);
+ public int compareTo(java.lang.Integer);
+ public static java.lang.String toString(long,int);
+ public static java.lang.String toHexString(long);
+ public static java.lang.String toOctalString(long);
+ public static java.lang.String toBinaryString(long);
+ public static java.lang.String toString(long);
+ public static long parseLong(java.lang.String,int);
+ public static long parseLong(java.lang.String);
+ public static java.lang.Long valueOf(java.lang.String,int);
+ public static java.lang.Long valueOf(java.lang.String);
+ public static java.lang.Long valueOf(long);
+ public static java.lang.Long decode(java.lang.String);
+ public static java.lang.Long getLong(java.lang.String);
+ public static java.lang.Long getLong(java.lang.String,long);
+ public static java.lang.Long getLong(java.lang.String,java.lang.Long);
+ public static long highestOneBit(long);
+ public static long lowestOneBit(long);
+ public static int numberOfLeadingZeros(long);
+ public static int numberOfTrailingZeros(long);
+ public static int bitCount(long);
+ public static long rotateLeft(long,int);
+ public static long rotateRight(long,int);
+ public static long reverse(long);
+ public static int signum(long);
+ public static long reverseBytes(long);
+ public int compareTo(java.lang.Long);
+ public static java.lang.String toString(float);
+ public static java.lang.String toHexString(float);
+ public static java.lang.Float valueOf(java.lang.String);
+ public static java.lang.Float valueOf(float);
+ public static float parseFloat(java.lang.String);
+ public static boolean isNaN(float);
+ public static boolean isInfinite(float);
+ public static int floatToIntBits(float);
+ public static int floatToRawIntBits(float);
+ public static float intBitsToFloat(int);
+ public static int compare(float,float);
+ public boolean isNaN();
+ public boolean isInfinite();
+ public int compareTo(java.lang.Float);
+ public static java.lang.String toString(double);
+ public static java.lang.String toHexString(double);
+ public static java.lang.Double valueOf(java.lang.String);
+ public static java.lang.Double valueOf(double);
+ public static double parseDouble(java.lang.String);
+ public static boolean isNaN(double);
+ public static boolean isInfinite(double);
+ public static long doubleToLongBits(double);
+ public static long doubleToRawLongBits(double);
+ public static double longBitsToDouble(long);
+ public static int compare(double,double);
+ public boolean isNaN();
+ public boolean isInfinite();
+ public int compareTo(java.lang.Double);
+ public <init>(byte);
+ public <init>(short);
+ public <init>(int);
+ public <init>(long);
+ public <init>(float);
+ public <init>(double);
+ public <init>(java.lang.String);
+ public byte byteValue();
+ public short shortValue();
+ public int intValue();
+ public long longValue();
+ public float floatValue();
+ public double doubleValue();
+ public int compareTo(java.lang.Object);
+ public boolean equals(java.lang.Object);
+ public int hashCode();
+ public java.lang.String toString();
+}
+
+# Remove - String method calls. Remove all invocations of String
+# methods without side effects whose return values are not used.
+-assumenosideeffects public class java.lang.String {
+ public <init>();
+ public <init>(byte[]);
+ public <init>(byte[],int);
+ public <init>(byte[],int,int);
+ public <init>(byte[],int,int,int);
+ public <init>(byte[],int,int,java.lang.String);
+ public <init>(byte[],java.lang.String);
+ public <init>(char[]);
+ public <init>(char[],int,int);
+ public <init>(java.lang.String);
+ public <init>(java.lang.StringBuffer);
+ public static java.lang.String copyValueOf(char[]);
+ public static java.lang.String copyValueOf(char[],int,int);
+ public static java.lang.String valueOf(boolean);
+ public static java.lang.String valueOf(char);
+ public static java.lang.String valueOf(char[]);
+ public static java.lang.String valueOf(char[],int,int);
+ public static java.lang.String valueOf(double);
+ public static java.lang.String valueOf(float);
+ public static java.lang.String valueOf(int);
+ public static java.lang.String valueOf(java.lang.Object);
+ public static java.lang.String valueOf(long);
+ public boolean contentEquals(java.lang.StringBuffer);
+ public boolean endsWith(java.lang.String);
+ public boolean equalsIgnoreCase(java.lang.String);
+ public boolean equals(java.lang.Object);
+ public boolean matches(java.lang.String);
+ public boolean regionMatches(boolean,int,java.lang.String,int,int);
+ public boolean regionMatches(int,java.lang.String,int,int);
+ public boolean startsWith(java.lang.String);
+ public boolean startsWith(java.lang.String,int);
+ public byte[] getBytes();
+ public byte[] getBytes(java.lang.String);
+ public char charAt(int);
+ public char[] toCharArray();
+ public int compareToIgnoreCase(java.lang.String);
+ public int compareTo(java.lang.Object);
+ public int compareTo(java.lang.String);
+ public int hashCode();
+ public int indexOf(int);
+ public int indexOf(int,int);
+ public int indexOf(java.lang.String);
+ public int indexOf(java.lang.String,int);
+ public int lastIndexOf(int);
+ public int lastIndexOf(int,int);
+ public int lastIndexOf(java.lang.String);
+ public int lastIndexOf(java.lang.String,int);
+ public int length();
+ public java.lang.CharSequence subSequence(int,int);
+ public java.lang.String concat(java.lang.String);
+ public java.lang.String replaceAll(java.lang.String,java.lang.String);
+ public java.lang.String replace(char,char);
+ public java.lang.String replaceFirst(java.lang.String,java.lang.String);
+ public java.lang.String[] split(java.lang.String);
+ public java.lang.String[] split(java.lang.String,int);
+ public java.lang.String substring(int);
+ public java.lang.String substring(int,int);
+ public java.lang.String toLowerCase();
+ public java.lang.String toLowerCase(java.util.Locale);
+ public java.lang.String toString();
+ public java.lang.String toUpperCase();
+ public java.lang.String toUpperCase(java.util.Locale);
+ public java.lang.String trim();
+}
+
+# Remove - StringBuffer method calls. Remove all invocations of StringBuffer
+# methods without side effects whose return values are not used.
+-assumenosideeffects public class java.lang.StringBuffer {
+ public <init>();
+ public <init>(int);
+ public <init>(java.lang.String);
+ public <init>(java.lang.CharSequence);
+ public java.lang.String toString();
+ public char charAt(int);
+ public int capacity();
+ public int codePointAt(int);
+ public int codePointBefore(int);
+ public int indexOf(java.lang.String,int);
+ public int lastIndexOf(java.lang.String);
+ public int lastIndexOf(java.lang.String,int);
+ public int length();
+ public java.lang.String substring(int);
+ public java.lang.String substring(int,int);
+}
+
+# Remove - StringBuilder method calls. Remove all invocations of StringBuilder
+# methods without side effects whose return values are not used.
+-assumenosideeffects public class java.lang.StringBuilder {
+ public <init>();
+ public <init>(int);
+ public <init>(java.lang.String);
+ public <init>(java.lang.CharSequence);
+ public java.lang.String toString();
+ public char charAt(int);
+ public int capacity();
+ public int codePointAt(int);
+ public int codePointBefore(int);
+ public int indexOf(java.lang.String,int);
+ public int lastIndexOf(java.lang.String);
+ public int lastIndexOf(java.lang.String,int);
+ public int length();
+ public java.lang.String substring(int);
+ public java.lang.String substring(int,int);
+}
+
+-keepattributes *Annotation*
+-keepattributes Signature
+-keepattributes Exceptions
+
+-keep class com.leanplum.Leanplum {
+ static void reset();
+ static void setClient(java.lang.String, java.lang.String, java.lang.String);
+}
+
+-keep class com.leanplum.utils.BitmapUtil { public private protected *; }
+
+-keep class com.leanplum.LocationManagerImplementation { *; }
+
+-keep class com.leanplum.messagetemplates.BaseMessageOptions { *; }
+
+#-dontwarn android.support.v7.**
+-keep class android.support.v7.app.AppCompatActivity
+#-keep interface android.support.v7.** { *; }
+
+-printmapping out.map
+-renamesourcefileattribute SourceFile
+-keepattributes SourceFile,LineNumberTable
+
+-optimizations !code/allocation/variable
diff --git a/mobile/android/config/proguard/proguard.cfg b/mobile/android/config/proguard/proguard.cfg
new file mode 100644
index 0000000000..f9a21ed339
--- /dev/null
+++ b/mobile/android/config/proguard/proguard.cfg
@@ -0,0 +1,165 @@
+# Dalvik renders preverification unuseful (Would just slightly bloat the file).
+-dontpreverify
+
+# Uncomment to have Proguard list dead code detected during the run - useful for cleaning up the codebase.
+# -printusage
+
+-dontskipnonpubliclibraryclassmembers
+-verbose
+-allowaccessmodification
+
+# Preserve all fundamental application classes.
+-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.app.backup.BackupAgentHelper
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.preference.Preference
+-keep public class * extends org.mozilla.gecko.fxa.sync.FxAccountSyncAdapter
+-keep class org.mozilla.gecko.fxa.sync.FxAccountSyncAdapter
+
+# Preserve all native method names and the names of their classes.
+-keepclasseswithmembernames class * {
+ native <methods>;
+}
+
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers class * extends android.app.Activity {
+ public void *(android.view.View);
+}
+
+
+# Keep setters in Views so that animations can still work.
+# See http://proguard.sourceforge.net/manual/examples.html#beans
+# From tools/proguard/proguard-android.txt.
+-keepclassmembers public class * extends android.view.View {
+ void set*(***);
+ *** get*();
+}
+
+# Preserve enums. (For awful reasons, the runtime accesses them using introspection...)
+-keepclassmembers enum * {
+ *;
+}
+
+#
+# Rules from ProGuard's Android example:
+# http://proguard.sourceforge.net/manual/examples.html#androidapplication
+#
+
+# 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.
+
+-keepattributes *Annotation*
+
+# 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
+# constructors themselves.
+
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+# Preserve the special fields of all Parcelable implementations.
+
+-keepclassmembers class * implements android.os.Parcelable {
+ static android.os.Parcelable$Creator CREATOR;
+}
+
+# Preserve static fields of inner classes of R classes that might be accessed
+# through introspection.
+
+-keepclassmembers class **.R$* {
+ public static <fields>;
+}
+
+# Preserve the required interface from the License Verification Library
+# (but don't nag the developer if the library is not used at all).
+
+-keep public interface com.android.vending.licensing.ILicensingService
+
+-dontnote com.android.vending.licensing.ILicensingService
+
+# Preserve all native method names and the names of their classes.
+
+-keepclasseswithmembernames class * {
+ native <methods>;
+}
+
+#
+# Mozilla-specific rules
+#
+# Merging classes can generate dex warnings about anonymous inner classes.
+-optimizations !class/merging/horizontal
+-optimizations !class/merging/vertical
+
+# This optimisation causes corrupt bytecode if we run more than two passes.
+# Testing shows that running the extra passes of everything else saves us
+# more than this optimisation does, so bye bye!
+-optimizations !code/allocation/variable
+
+# Keep miscellaneous targets.
+
+# Keep Robocop targets. TODO: Can omit these from release builds. Also, Bug 916507.
+
+# Same formula as above...
+-keep @interface org.mozilla.gecko.annotation.RobocopTarget
+-keep @org.mozilla.gecko.annotation.RobocopTarget class *
+-keepclassmembers class * {
+ @org.mozilla.gecko.annotation.RobocopTarget *;
+}
+-keepclassmembers @org.mozilla.gecko.annotation.RobocopTarget class * {
+ *;
+}
+-keepclasseswithmembers class * {
+ @org.mozilla.gecko.annotation.RobocopTarget <methods>;
+}
+-keepclasseswithmembers class * {
+ @org.mozilla.gecko.annotation.RobocopTarget <fields>;
+}
+
+-keep class **.R$*
+
+# Disable obfuscation because it makes exception stack traces more difficult to read.
+-dontobfuscate
+
+# Suppress warnings about missing descriptor classes.
+#-dontnote **,!ch.boye.**,!org.mozilla.gecko.sync.**
+
+-include "play-services-keeps.cfg"
+
+# Don't warn when classes referenced by JaCoCo are missing when running the build from android-dependencies.
+-dontwarn java.lang.instrument.**
+-dontwarn java.lang.management.**
+-dontwarn javax.management.**
+
+-include "adjust-keeps.cfg"
+
+-include "leakcanary-keeps.cfg"
+
+-include "appcompat-v7-keeps.cfg"
+
+-include "proguard-android.cfg"
+
+-include "proguard-leanplum.cfg"
+
+-include "../../geckoview/proguard-rules.txt"
diff --git a/mobile/android/config/proguard/strip-libs.cfg b/mobile/android/config/proguard/strip-libs.cfg
new file mode 100644
index 0000000000..80a1f151c9
--- /dev/null
+++ b/mobile/android/config/proguard/strip-libs.cfg
@@ -0,0 +1,41 @@
+# Proguard step for stripping debug information.
+#
+# This is useful to work around a bug in the way Proguard handles debug information: it
+# sometimes corrupts it. Classes with corrupt debug information cannot be dexed, but
+# classes with *no* debug information can be. There's no way to configure Proguard to
+# delete debug information on a per-class basis, so we need this special extra step for
+# stripping debug information only from those classes for which the Proguard bug is
+# encountered.
+#
+# Currently, this pass is applied to all bundled library jars for which we are not
+# compiling the source. This is slightly more than is strictly necessary to work around
+# the Proguard bug, but such debug information is of negligible value and stripping it
+# too slightly simplifies the makefile and saves us a handful of kilobytes of binary size.
+#
+# Configuring Proguard to do nothing except strip metadata is done by having it run only
+# the obfuscation pass, but with a configuration that prevents it from renaming any classes.
+# It then attempts to delete class metadata, so we further configure it not to do so for
+# anything except the problematic debug information.
+
+# Run only the obfuscator.
+-dontoptimize
+-dontshrink
+-dontpreverify
+-verbose
+
+# Don't rename anything.
+-keeppackagenames
+
+# Seriously, don't rename anything.
+-keep class *
+-keepclassmembers class * {
+ *;
+}
+
+# Don't delete other useful metadata.
+-keepattributes Exceptions,InnerClasses,Signature,Deprecated,*Annotation*,EnclosingMethod
+
+# Don't print spurious warnings from the support library.
+# See: http://stackoverflow.com/questions/22441366/note-android-support-v4-text-icucompatics-cant-find-dynamically-referenced-cl
+-dontnote android.support.**
+-dontwarn android.support.**