From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- mobile/android/config/proguard/proguard.cfg | 165 ++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 mobile/android/config/proguard/proguard.cfg (limited to 'mobile/android/config/proguard/proguard.cfg') 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 ; +} + +-keepclasseswithmembers class * { + public (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 (android.content.Context); + public (android.content.Context, android.util.AttributeSet); + public (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 (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 ; +} + +# 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 ; +} + +# +# 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 ; +} +-keepclasseswithmembers class * { + @org.mozilla.gecko.annotation.RobocopTarget ; +} + +-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" -- cgit v1.2.3