Skip to content

Commit 2fdbff5

Browse files
committed
build: enable app shrinking for release build type
1 parent efd0c83 commit 2fdbff5

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

app/build.gradle.kts

+6-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ android {
3838

3939
buildTypes {
4040
release {
41-
isMinifyEnabled = false
42-
// proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-android.txt"
41+
isMinifyEnabled = true
42+
isShrinkResources = true
43+
proguardFiles(
44+
getDefaultProguardFile("proguard-android-optimize.txt"),
45+
"proguard-rules.pro",
46+
)
4347
signingConfig =
4448
project.signKeyFile?.let {
4549
signingConfigs.create("release") {

app/proguard-rules.pro

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# disable obfuscation
9+
-dontobfuscate
10+
11+
# Keep JNI interface
12+
-keep class com.osfans.trime.core.* { *; }
13+
14+
# remove kotlin null checks
15+
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
16+
static void checkNotNull(...);
17+
static void checkExpressionValueIsNotNull(...);
18+
static void checkNotNullExpressionValue(...);
19+
static void checkReturnedValueIsNotNull(...);
20+
static void checkFieldIsNotNull(...);
21+
static void checkParameterIsNotNull(...);
22+
static void checkNotNullParameter(...);
23+
}
24+
25+
# Uncomment this to preserve the line number information for
26+
# debugging stack traces.
27+
-keepattributes SourceFile,LineNumberTable
28+
29+
# If you keep the line number information, uncomment this to
30+
# hide the original source file name.
31+
#-renamesourcefileattribute SourceFile

0 commit comments

Comments
 (0)