v0.7.2b: adjusted R8 rules and added comments explaining R8

This commit is contained in:
Evan Debenham 2019-04-20 14:50:41 -04:00
parent 647cab2306
commit c8e7a4bb42
2 changed files with 12 additions and 4 deletions

View File

@ -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'
}
}
}

View File

@ -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 { *; }
# 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