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. 3
      gradle.properties

7
app/build.gradle

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

1
app/proguard-rules.pro vendored

@ -0,0 +1 @@ @@ -0,0 +1 @@
-dontobfuscate

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

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

3
gradle.properties

@ -15,4 +15,5 @@ @@ -15,4 +15,5 @@
# When configured, Gradle will run in incubating parallel mode.
# 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
# org.gradle.parallel=true
# org.gradle.parallel=true
android.enableR8=true

Loading…
Cancel
Save