Justin Klaassen | d770c05 | 2016-06-28 19:26:43 -0700 | [diff] [blame] | 1 | # This is a configuration file for ProGuard. |
| 2 | # http://proguard.sourceforge.net/index.html#manual/usage.html |
| 3 | |
Daisuke Miyakawa | c81adf5 | 2010-08-12 13:04:43 -0700 | [diff] [blame] | 4 | # Keep all Fragments in this package, which are used by reflection. |
Justin Klaassen | 478b5a8 | 2016-06-21 18:31:16 -0700 | [diff] [blame] | 5 | -keep public class com.android.settings.** extends android.app.Fragment |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 6 | |
Justin Klaassen | d770c05 | 2016-06-28 19:26:43 -0700 | [diff] [blame] | 7 | # We want to keep methods in Activity that could be used in the XML attribute onClick. |
Justin Klaassen | 478b5a8 | 2016-06-21 18:31:16 -0700 | [diff] [blame] | 8 | -keepclassmembers class * extends android.app.Activity { |
Justin Klaassen | ab70411 | 2016-08-01 16:16:40 -0700 | [diff] [blame] | 9 | public void *(android.view.View); |
| 10 | public void *(android.view.MenuItem); |
Jean Chalard | 0824d31 | 2011-12-02 17:47:09 +0900 | [diff] [blame] | 11 | } |
Udam Saini | 8ef4c62 | 2016-02-03 17:31:11 -0800 | [diff] [blame] | 12 | |
Justin Klaassen | d770c05 | 2016-06-28 19:26:43 -0700 | [diff] [blame] | 13 | # Keep setters in Views so that animations can still work. |
| 14 | -keep public class * extends android.view.View { |
| 15 | public <init>(android.content.Context); |
| 16 | public <init>(android.content.Context, android.util.AttributeSet); |
| 17 | public <init>(android.content.Context, android.util.AttributeSet, int); |
| 18 | |
| 19 | void set*(***); |
| 20 | *** get*(); |
| 21 | } |
| 22 | |
| 23 | # Keep classes that may be inflated from XML. |
Justin Klaassen | 478b5a8 | 2016-06-21 18:31:16 -0700 | [diff] [blame] | 24 | -keepclasseswithmembers class * { |
Udam Saini | 8ef4c62 | 2016-02-03 17:31:11 -0800 | [diff] [blame] | 25 | public <init>(android.content.Context, android.util.AttributeSet); |
Justin Klaassen | d770c05 | 2016-06-28 19:26:43 -0700 | [diff] [blame] | 26 | } |
| 27 | -keepclasseswithmembers class * { |
Justin Klaassen | 478b5a8 | 2016-06-21 18:31:16 -0700 | [diff] [blame] | 28 | public <init>(android.content.Context, android.util.AttributeSet, int); |
Anna Galusza | 16d58e7 | 2016-03-22 13:07:44 -0700 | [diff] [blame] | 29 | } |
Matthew Fritze | b277557 | 2017-12-05 10:46:47 -0800 | [diff] [blame^] | 30 | -keepclasseswithmembers class * { |
| 31 | public <init>(android.content.Context, android.util.AttributeSet, int, int); |
| 32 | } |
Justin Klaassen | ab70411 | 2016-08-01 16:16:40 -0700 | [diff] [blame] | 33 | |
| 34 | # Keep annotated classes or class members. |
| 35 | -keep @android.support.annotation.Keep class * |
| 36 | -keepclassmembers class * { |
| 37 | @android.support.annotation.Keep *; |
| 38 | } |
| 39 | |
| 40 | # Keep specific fields used via reflection. |
| 41 | -keepclassmembers class * { |
| 42 | public static ** SEARCH_INDEX_DATA_PROVIDER; |
| 43 | public static ** SUMMARY_PROVIDER_FACTORY; |
| 44 | } |
Tony Mantler | bd6fcdb | 2017-11-15 11:19:40 -0800 | [diff] [blame] | 45 | |
| 46 | # Keep classes, annotations and members used by Lifecycle |
| 47 | -keepattributes *Annotation* |
| 48 | |
| 49 | -keepclassmembers enum android.arch.lifecycle.Lifecycle$Event { |
| 50 | <fields>; |
| 51 | } |
| 52 | |
| 53 | -keep class * implements android.arch.lifecycle.LifecycleObserver { |
| 54 | } |
| 55 | |
| 56 | -keep class * implements android.arch.lifecycle.GeneratedAdapter { |
| 57 | <init>(...); |
| 58 | } |
| 59 | |
| 60 | -keepclassmembers class ** { |
| 61 | @android.arch.lifecycle.OnLifecycleEvent *; |
| 62 | } |