platform_build/core/proguard.flags

50 lines
1.7 KiB
Text
Raw Normal View History

# We have moved -dontobfuscate and -dontoptimize to the makefiles.
2010-02-01 18:51:23 +01:00
# dex does not like code run through proguard optimize and preverify steps.
# -dontoptimize
2010-02-01 18:51:23 +01:00
-dontpreverify
# Don't obfuscate. We only need dead code striping.
# -dontobfuscate
2010-02-01 18:51:23 +01:00
# Add this flag in your package's own configuration if it's needed.
#-flattenpackagehierarchy
# Keep classes and methods that have @VisibleForTesting annotations, except in
# intermediate libraries that export those annotations (e.g., androidx, guava).
# This avoids keeping library-specific test code that isn't actually needed
# for platform testing.
# TODO(b/239961360): Migrate away from androidx.annotation.VisibleForTesting
# and com.google.common.annotations.VisibleForTesting use in platform code.
-keep @**.VisibleForTesting class !androidx.**,!com.google.common.**,*
-keepclassmembers class !androidx.**,!com.google.common.**,* {
@**.VisibleForTesting *;
}
2010-02-01 18:51:23 +01:00
# Keep rule for members that are needed solely to keep alive downstream weak
# references, and could otherwise be removed after tree shaking optimizations.
-keepclassmembers,allowaccessmodification,allowobfuscation,allowshrinking class * {
@com.android.internal.annotations.KeepForWeakReference <fields>;
}
# Understand the common @Keep annotation from various Android packages:
# * android.support.annotation
# * androidx.annotation
# * com.android.internal.annotations
-keep class **android**.annotation*.Keep
-keep @**android**.annotation*.Keep class * { *; }
-keepclasseswithmembers class * {
@**android**.annotation*.Keep <methods>;
}
-keepclasseswithmembers class * {
@**android**.annotation*.Keep <fields>;
}
-keepclasseswithmembers class * {
@**android**.annotation*.Keep <init>(...);
}
-include proguard_basic_keeps.flags