-
Notifications
You must be signed in to change notification settings - Fork 16
Proguard configuration
xcesco edited this page Jun 12, 2018
·
8 revisions
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
##############################
-keep class com.abubusoft.kripton.annotation.** { *; }
-keep class com.abubusoft.kripton.android.annotation.** { *; }
-keepclasseswithmembers @com.abubusoft.kripton.annotation.BindType class ** { *; }
-keepclasseswithmembers @com.abubusoft.kripton.annotation.BindXml class ** { *; }
-assumenosideeffects class com.abubusoft.kripton.android.Logger {
public static void verbose(...);
public static void info(...);
public static void warn(...);
public static void debug(...);
public static void error(...);
}
-dontwarn com.abubusoft.kripton.androidx.livedata.KriptonXLiveData
-dontwarn com.abubusoft.kripton.androidx.livedata.KriptonXComputableLiveData
-dontwarn com.abubusoft.kripton.androidx.livedata.KriptonXComputableLiveData*
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*
#
# https://stackoverflow.com/questions/33047806/proguard-duplicate-definition-of-library-class
#
-dontnote android.net.http.*
-dontnote org.apache.commons.codec.**
-dontnote org.apache.http.**
#
# https://github.com/square/okhttp/issues/3355
#
-dontwarn okio.**
-dontwarn com.squareup.okhttp3.**
-keep class com.squareup.okhttp3.** { *; }
-keep interface com.squareup.okhttp3.* { *; }
-dontwarn javax.annotation.Nullable
-dontwarn javax.annotation.ParametersAreNonnullByDefault
-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 { *; }
- Introduction
- Goals & Features
- Kotlin
- Immutable or Mutable Pojo
- Annotation Processor Args
- Credits
- Articles
- Benchmarks
- Setup
- Tutorial
- Usage
- Dependencies and inspirations
- Stackoverflow
- Documentation
- SQL logging
- Data source options
- Indices
- SQL Type adapter
- Global SQL Type adapter
- Constraints
- Live data: welcome Architectural components!!
- Paged Live data
- Dynamic parts
- Transactional and batch operations
- Async Transactional and batch operations
- Global transaction
- Support for immutable POJO
- Generate Content provider
- Generate Database schema generation
- Database migration
- BindSqlColumn
- BindContentProvider
- BindContentProviderEntry
- BindContentProviderPath
- BindDao
- BindDaoMany2Many
- BindDataSource
- BindDataSourceOptions
- BindDataSourceUpdateTask
- BindIndex
- BindSqlRelation
- BindSqlAdapter
- BindSqlChildSelect
- BindSqlDelete
- BindSqlDynamicOrderBy
- BindSqlDynamicWhere
- BindSqlDynamicWhereParams
- BindSqlInsert
- BindSqlPageSize
- BindSqlParam
- BindSqlSelect
- BindSqlUpdate
- BindSqlType
- BindSqlTransaction