Proguard with OrmLite on Android

前端 未结 8 2008
无人及你
无人及你 2020-11-27 17:46

How should I use proguard with ormlite library on Android?

Trying this:

-keep class com.j256.**
-keepclassmembers class com.j256.**
-keep enum com.j2         


        
相关标签:
8条回答
  • 2020-11-27 18:17

    Thank you a lot for posts like this that help us to advance step by step.

    I've came up with other solution after i have tried the last one without success:

    # OrmLite uses reflection
    -keep class com.j256.**
    -keepclassmembers class com.j256.** { *; }
    -keep enum com.j256.**
    -keepclassmembers enum com.j256.** { *; }
    -keep interface com.j256.**
    -keepclassmembers interface com.j256.** { *; }
    

    I hope it can help someone.

    0 讨论(0)
  • 2020-11-27 18:21

    A small addition to the configuration above - if you're trying to serialize / deserialize Joda's DateTime objects via ORMLite, you probably need this as well:

    -keepclassmembers class **DateTime {
        <init>(long);
        long getMillis();
    }
    

    ...since ORMLite's DateTimeType does everything via reflection.

    0 讨论(0)
提交回复
热议问题