Proguard rules - Zalizyaka-Ney/handy.storage GitHub Wiki
If you use Proguard, add the following to your Proguard config:
-keepattributes *Annotation*, AnnotationDefault
-keep class * extends handy.storage.api.Model {
!private static final java.lang.String *; #you can comment this line if you don't use enforceColumnNameConstants option
@handy.storage.annotation.Column <fields>;
<init>(...);
}
-keepclassmembers enum * {
public static <fields>;
public static **[] values();
public static ** valueOf(java.lang.String);
}
-optimizations !class/unboxing/enum #this line can be commented if you don't enable the database schema changes checking
Note that some rules are not needed and can be removed if you don't use the corresponding functionality.
The framework uses gson library, so the Proguard rules for it must be added as well:
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature
# Gson specific classes
-keep class sun.misc.Unsafe { *; }