Browse Source

Enable R8 (Google's Proguard replacement) for smaller, faster (release) apks

pull/506/head
Eric Kok 6 years ago
parent
commit
efec00d965
  1. 7
      app/build.gradle
  2. 1
      app/proguard-rules.pro
  3. 2
      app/src/main/java/org/transdroid/core/gui/log/DatabaseHelper.java
  4. 1
      gradle.properties

7
app/build.gradle

@ -36,9 +36,14 @@ android {
} }
} }
buildTypes { buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
release { release {
signingConfig signingConfigs.releaseConfig signingConfig signingConfigs.releaseConfig
minifyEnabled false minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
} }
} }
flavorDimensions "version" flavorDimensions "version"

1
app/proguard-rules.pro vendored

@ -0,0 +1 @@
-dontobfuscate

2
app/src/main/java/org/transdroid/core/gui/log/DatabaseHelper.java

@ -20,6 +20,7 @@ import java.sql.SQLException;
import android.content.Context; import android.content.Context;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
import android.support.annotation.Keep;
import android.util.Log; import android.util.Log;
import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper; import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper;
@ -35,6 +36,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
private static final String DATABASE_NAME = "transdroid.db"; private static final String DATABASE_NAME = "transdroid.db";
private static final int DATABASE_VERSION = 1; private static final int DATABASE_VERSION = 1;
@Keep
public DatabaseHelper(Context context) { public DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION); super(context, DATABASE_NAME, null, DATABASE_VERSION);
} }

1
gradle.properties

@ -16,3 +16,4 @@
# This option should only be used with decoupled projects. More details, visit # This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true # org.gradle.parallel=true
android.enableR8=true

Loading…
Cancel
Save