From 1a0d53ef8d1a3aa02f53e7e8a4e489803864d0c9 Mon Sep 17 00:00:00 2001 From: jacquarg Date: Fri, 7 Nov 2025 11:53:58 +0100 Subject: [PATCH] chore: minify to reduce apk size. --- app/build.gradle | 9 +++++++-- app/proguard-rules.pro | 13 +++++++++++++ gradle/libs.versions.toml | 2 ++ lint.xml | 1 + 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 app/proguard-rules.pro diff --git a/app/build.gradle b/app/build.gradle index d329c1f6..e0fcb86a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -59,9 +59,13 @@ android { buildTypes { release { - minifyEnabled false - shrinkResources false + minifyEnabled true + shrinkResources true debuggable false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) signingConfig = null } debug { @@ -135,6 +139,7 @@ dependencies { implementation(libs.dagger.hilt.android) ksp(libs.dagger.hilt.compiler) implementation(libs.eos.telemetry) + implementation(libs.timber) implementation(libs.androidx.lifecycle.runtime.compose) // AndroidX, The Basics diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 00000000..94a14870 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,13 @@ +-keep class com.google.gson.reflect.TypeToken { *; } +-keep class * extends com.google.gson.reflect.TypeToken + +# Optional. For using GSON @Expose annotation +-keepattributes AnnotationDefault,RuntimeVisibleAnnotations + +-keepattributes Signature +-keepclassmembers class * { + @com.google.gson.annotations.SerializedName ; +} +-keep class io.heckel.ntfy.msg.Message { *; } +-keep class io.heckel.ntfy.msg.MessageAttachment { *; } +-keep class io.heckel.ntfy.msg.MessageAction { *; } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2ff5ffc5..6f30733e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -16,6 +16,7 @@ kotlinx-coroutines = "1.10.2" kotlinx-serialization-json = "1.9.0" markwon = "4.6.2" markwon-compose = "0.5.7" +timber = "5.0.1" # Tests junit = "4.13.2" @@ -53,6 +54,7 @@ markwon = { group = "io.noties.markwon", name = "core", version.ref = "markwon" markwon-compose = { group = "com.github.jeziellago", name = "compose-markdown", version.ref = "markwon-compose" } markwon-html = {group = "io.noties.markwon", name = "html", version.ref = "markwon" } markwon-strikethrough = {group = "io.noties.markwon", name = "ext-strikethrough", version.ref = "markwon" } +timber = { group = "com.jakewharton.timber", name = "timber", version.ref = "timber" } # Test libraries junit = { group = "junit", name = "junit", version.ref = "junit" } diff --git a/lint.xml b/lint.xml index 71167c0b..cc45a7f7 100644 --- a/lint.xml +++ b/lint.xml @@ -5,6 +5,7 @@ + -- GitLab