Skip to content

Commit

Permalink
Embed R8/ProGuard rules in JAR.
Browse files Browse the repository at this point in the history
Note that Android specific rules remain in the Android AAR.
  • Loading branch information
greenrobot-team committed Jun 9, 2020
1 parent 02fa97a commit 92f3cd5
Showing 1 changed file with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# When editing this file, also look at consumer-proguard-rules.pro of objectbox-android.

-keepattributes *Annotation*

# Native methods
-keepclasseswithmembernames class io.objectbox.** {
native <methods>;
}

# For __boxStore field in entities
-keep class io.objectbox.BoxStore

-keep class * extends io.objectbox.Cursor {
<init>(...);
}

# Native code expects names to match
-keep class io.objectbox.relation.ToOne {
void setTargetId(long);
}
-keep class io.objectbox.relation.ToMany

-keep @interface io.objectbox.annotation.Entity

# Keep entity constructors
-keep @io.objectbox.annotation.Entity class * { <init>(...); }

# For relation ID fields
-keepclassmembers @io.objectbox.annotation.Entity class * {
<fields>;
}

-keep interface io.objectbox.converter.PropertyConverter {*;}
-keep class * implements io.objectbox.converter.PropertyConverter {*;}

-keep class io.objectbox.exception.DbException {*;}
-keep class * extends io.objectbox.exception.DbException {*;}

-keep class io.objectbox.exception.DbExceptionListener {*;}
-keep class * implements io.objectbox.exception.DbExceptionListener {*;}

# for essentials
-dontwarn sun.misc.Unsafe

0 comments on commit 92f3cd5

Please sign in to comment.