mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 06:05:44 +00:00
73d0e38845
We use a Maven repository and the (misleadingly named!) uploadArchives task because this is the best way to make Android Studio download and recognize the Javadoc and sources. With this, it's automatic; with a single AAR file, it's a nightmare of point-and-click configuration. This patch does a bunch of Gradle hacking to make -javadoc and -sources JARs; there's nothing special or particularly likely to break here. This patch also adds Proguard declarations to the :geckoview library project. That involves moving a good part of the Proguard configuration into mobile/android/geckoview. (I also expand upon the existing configuration.) This should be only a re-arrangement, and the resulting file is included in the original, so nothing should be changed. MozReview-Commit-ID: BGNW1v92J0k --HG-- extra : rebase_source : 94633d27e8ae6bafa3d6823996355c22d2e2e6eb
176 lines
5.2 KiB
Plaintext
176 lines
5.2 KiB
Plaintext
# Modified from https://robotsandpencils.com/blog/use-proguard-android-library/.
|
|
|
|
# Preserve all annotations.
|
|
|
|
-keepattributes *Annotation*
|
|
|
|
# Preserve all public classes, and their public and protected fields and
|
|
# methods.
|
|
|
|
-keep public class * {
|
|
public protected *;
|
|
}
|
|
|
|
# Preserve all .class method names.
|
|
|
|
-keepclassmembernames class * {
|
|
java.lang.Class class$(java.lang.String);
|
|
java.lang.Class class$(java.lang.String, boolean);
|
|
}
|
|
|
|
# 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 library 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();
|
|
}
|
|
|
|
# Preserve all View implementations and their special context constructors.
|
|
|
|
-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*(...);
|
|
}
|
|
|
|
# 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 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>;
|
|
}
|
|
|
|
# GeckoView specific rules.
|
|
|
|
# Keep classes, and all their contents, compiled before annotation.*.
|
|
-keep class org.mozilla.gecko.AppConstants {
|
|
*;
|
|
}
|
|
-keep class org.mozilla.gecko.AppConstants$Versions {
|
|
*;
|
|
}
|
|
-keep class org.mozilla.gecko.SysInfo {
|
|
*;
|
|
}
|
|
|
|
# Keep the annotation.
|
|
-keep @interface org.mozilla.gecko.annotation.JNITarget
|
|
|
|
# Keep classes tagged with the annotation.
|
|
-keep @org.mozilla.gecko.annotation.JNITarget class *
|
|
|
|
# Keep all members of an annotated class.
|
|
-keepclassmembers @org.mozilla.gecko.annotation.JNITarget class * {
|
|
*;
|
|
}
|
|
|
|
# Keep annotated members of any class.
|
|
-keepclassmembers class * {
|
|
@org.mozilla.gecko.annotation.JNITarget *;
|
|
}
|
|
|
|
# Keep classes which contain at least one annotated element. Split over two directives
|
|
# because, according to the developer of ProGuard, "the option -keepclasseswithmembers
|
|
# doesn't combine well with the '*' wildcard" (And, indeed, using it causes things to
|
|
# be deleted that we want to keep.)
|
|
-keepclasseswithmembers class * {
|
|
@org.mozilla.gecko.annotation.JNITarget <methods>;
|
|
}
|
|
-keepclasseswithmembers class * {
|
|
@org.mozilla.gecko.annotation.JNITarget <fields>;
|
|
}
|
|
|
|
# Keep WebRTC targets.
|
|
-keep @interface org.mozilla.gecko.annotation.WebRTCJNITarget
|
|
-keep @org.mozilla.gecko.annotation.WebRTCJNITarget class *
|
|
-keepclassmembers class * {
|
|
@org.mozilla.gecko.annotation.WebRTCJNITarget *;
|
|
}
|
|
-keepclassmembers @org.mozilla.gecko.annotation.WebRTCJNITarget class * {
|
|
*;
|
|
}
|
|
-keepclasseswithmembers class * {
|
|
@org.mozilla.gecko.annotation.WebRTCJNITarget <methods>;
|
|
}
|
|
-keepclasseswithmembers class * {
|
|
@org.mozilla.gecko.annotation.WebRTCJNITarget <fields>;
|
|
}
|
|
|
|
# Keep generator-targeted entry points.
|
|
-keep @interface org.mozilla.gecko.annotation.WrapForJNI
|
|
-keep @org.mozilla.gecko.annotation.WrapForJNI class *
|
|
-keepclassmembers class * {
|
|
@org.mozilla.gecko.annotation.WrapForJNI *;
|
|
}
|
|
-keepclasseswithmembers class * {
|
|
@org.mozilla.gecko.annotation.WrapForJNI <methods>;
|
|
}
|
|
-keepclasseswithmembers class * {
|
|
@org.mozilla.gecko.annotation.WrapForJNI <fields>;
|
|
}
|
|
|
|
# Keep all members of an annotated class.
|
|
-keepclassmembers @org.mozilla.gecko.annotation.WrapForJNI class * {
|
|
*;
|
|
}
|
|
|
|
# Keep Reflection targets.
|
|
-keep @interface org.mozilla.gecko.annotation.ReflectionTarget
|
|
-keep @org.mozilla.gecko.annotation.ReflectionTarget class *
|
|
-keepclassmembers class * {
|
|
@org.mozilla.gecko.annotation.ReflectionTarget *;
|
|
}
|
|
-keepclassmembers @org.mozilla.gecko.annotation.ReflectionTarget class * {
|
|
*;
|
|
}
|
|
-keepclasseswithmembers class * {
|
|
@org.mozilla.gecko.annotation.ReflectionTarget <methods>;
|
|
}
|
|
-keepclasseswithmembers class * {
|
|
@org.mozilla.gecko.annotation.ReflectionTarget <fields>;
|
|
}
|