Skip to content
Snippets Groups Projects
Commit cf2225df authored by Adrien Béraud's avatar Adrien Béraud
Browse files

proguard: fix release build

Prevents obfuscation of some symbols
to fix release builds by adding a custom proguard
configuration, based on Android optimised defaults.

* protect AIDL and SWIG symbols
* protect support library (uses reflexion)
* protect OrmLite (uses reflexion)

Tuleap: #128
Change-Id: Ie1fe8fa6af1a6968ca0889f8fe343e58a35071b6
parent f3c6af49
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,7 @@ android { ...@@ -43,6 +43,7 @@ android {
buildTypes { buildTypes {
release { release {
minifyEnabled true minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
} }
} }
signingConfigs { signingConfigs {
......
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-keepclassmembers class * {
public <init>(android.content.Context);
}
-keep class cx.ring.service.**
-keepclassmembers class cx.ring.service.** { *; }
#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.** { *; }
# Keep the helper class and its constructor
-keep class * extends com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper
# Keep all model classes that are used by OrmLite
# Also keep their field names and the constructor
-keep @com.j256.ormlite.table.DatabaseTable class * {
@com.j256.ormlite.field.DatabaseField <fields>;
@com.j256.ormlite.field.ForeignCollectionField <fields>;
<init>();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment