Skip to content

Proguard configuration

xcesco edited this page Jan 20, 2017 · 8 revisions

Configure proguard

To obfuscate your code with Kripton, usually you have to modify proguard-rules.pro file to configure proguard for you project. For Kripton persistence library you have just to add this lines:

##############################
# Kripton Persistence Library
##############################
-keepnames @com.abubusoft.kripton.annotation.BindType class *
-keepnames @com.abubusoft.kripton.annotation.BindTypeXml class *
-keepclassmembernames class * { @com.abubusoft.kripton.annotation.Bind *; }
-keepclassmembernames class * { @com.abubusoft.kripton.annotation.BindXml *; }
-dontwarn okio.**

If project uses Retrofit, you need to configure proguard for Retrofit:

##############################
# Retrofit
##############################
-dontwarn retrofit2.**
-dontwarn org.codehaus.mojo.**
-keep class retrofit2.** { *; }
-keepattributes Signature
-keepattributes Exceptions
-keepattributes *Annotation*

-keepattributes RuntimeVisibleAnnotations
-keepattributes RuntimeInvisibleAnnotations
-keepattributes RuntimeVisibleParameterAnnotations
-keepattributes RuntimeInvisibleParameterAnnotations

-keepattributes EnclosingMethod

-keepclasseswithmembers class * {
    @retrofit2.* <methods>;
}

-keepclasseswithmembers interface * {
    @retrofit2.* <methods>;
}

-keepclasseswithmembers class * {
    @retrofit2.http.* <methods>;
}

If project uses Glide, you need to configure proguard for Glide:

##############################
# Glide
##############################

-keep class com.abubusoft.kripton.quickstart.network.okhttp3.OkHttpGlideModule { *; }

Table of Contents

Query definition

Features

Relations

Multithread supports

Modularization

Annotations for data convertion

Annotations for SQLite ORM

Annotations for shared preferences

Clone this wiki locally