From c264108cf232748fe8b9b664a747b15f21595269 Mon Sep 17 00:00:00 2001 From: tuancoltech Date: Thu, 24 Oct 2024 12:46:08 +0700 Subject: [PATCH] * Enable R8 with custom proguard fules for resource shrinking/unused code removal without code obfuscation * Bug fix: Do not display text content preview for Voice/Graphics note --- app/build.gradle | 3 ++- app/proguard-rules.pro | 8 +++++++- .../arkbuilders/arkmemo/ui/adapters/NotesListAdapter.kt | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index cc6b2e6e..b0d71000 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -48,7 +48,8 @@ android { ] } release { - minifyEnabled false + minifyEnabled true + shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.testRelease manifestPlaceholders = [ diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 481bb434..5603fe90 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -18,4 +18,10 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile +-keep class dev.arkbuilders.arklib.** { *; } +-dontwarn javax.xml.stream.XMLResolver +-dontwarn org.slf4j.impl.StaticLoggerBinder +-dontobfuscate + +-keepattributes Signature \ No newline at end of file diff --git a/app/src/main/java/dev/arkbuilders/arkmemo/ui/adapters/NotesListAdapter.kt b/app/src/main/java/dev/arkbuilders/arkmemo/ui/adapters/NotesListAdapter.kt index 68abf9d3..65d5892d 100644 --- a/app/src/main/java/dev/arkbuilders/arkmemo/ui/adapters/NotesListAdapter.kt +++ b/app/src/main/java/dev/arkbuilders/arkmemo/ui/adapters/NotesListAdapter.kt @@ -72,6 +72,8 @@ class NotesListAdapter( if (note is TextNote) { holder.contentPreview.text = note.text + } else { + holder.contentPreview.text = "" } holder.layoutAudioView.root.gone() holder.ivGraphicThumb.gone()