diff --git a/core/build.gradle b/core/build.gradle index f57a3fd2c..3d5498770 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -17,9 +17,14 @@ android { versionNameSuffix '-INDEV' } release { + + //These lines enable R8, which is a code shrinker/optimizer/obfuscator. + //This makes release APKs smaller and more efficient, but also makes debugging trickier + //as the information produced in stack traces must be de-obfuscated. + //See here: https://developer.android.com/studio/build/shrink-code#decode-stack-trace shrinkResources true minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } } diff --git a/core/proguard-rules.pro b/core/proguard-rules.pro index 5ad72d735..ff58f8252 100644 --- a/core/proguard-rules.pro +++ b/core/proguard-rules.pro @@ -1,5 +1,8 @@ -# retain these to support class references and meaningful stack traces +# retain these to support class references for the bundling and translation systems -keepnames class com.shatteredpixel.** { *; } -keepnames class com.watabou.** { *; } --keep class com.shatteredpixel.shatteredpixeldungeon { *; } --keep class com.watabou.noosa.game { *; } \ No newline at end of file + +# retained to support meaningful stack traces +# note that the mapping file must be referenced in order to make sense of line numbers +# mapping file can be found in core/build/outputs/mapping after running a release build +-keepattributes SourceFile,LineNumberTable \ No newline at end of file