Skip to content

Commit

Permalink
Enable minification of release builds without obfuscation
Browse files Browse the repository at this point in the history
Obfuscation makes nearly no difference in size for this project. No
reason to make life harder for folks who want to inspect the compiled
binaries.

Signed-off-by: Andrew Gunnerson <[email protected]>
  • Loading branch information
chenxiaolong committed May 28, 2022
1 parent 1d132db commit c4d01fe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ android {
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")

signingConfig = signingConfigs.getByName("release")
Expand Down
4 changes: 4 additions & 0 deletions app/magisk/updates/release/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### Unreleased

* Enable minification (without obfuscation) to shrink the download size by ~64% (PR: #45, @chenxiaolong)

### Version 1.5

* Optionally add contact name to output filename if Contacts permission is granted (Android 11+) (Issue: #28, PR: #42, @chenxiaolong)
Expand Down
8 changes: 6 additions & 2 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

# Disable obfuscation completely for BCR. As an open source project,
# shrinking is the only goal of minification.
-dontobfuscate

0 comments on commit c4d01fe

Please sign in to comment.