From 91ad3374fe9a517bf2cd3d7e066a8f1b093517ae Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Sat, 2 Nov 2024 11:09:17 -0700 Subject: [PATCH] Fix obfuscation crashes --- .gitignore | 5 ++++- android/proguard-rules.pro | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7877ffcd1..120b7612d 100644 --- a/.gitignore +++ b/.gitignore @@ -54,4 +54,7 @@ wix311/ play_config.json fastlane/report.xml fastlane/README.md -.kotlin \ No newline at end of file +.kotlin + +# Release artifacts +/android/release/ diff --git a/android/proguard-rules.pro b/android/proguard-rules.pro index 117175002..83b6795eb 100644 --- a/android/proguard-rules.pro +++ b/android/proguard-rules.pro @@ -1,5 +1,7 @@ -dontobfuscate +-keep class io.github.aakira.napier.** { *; } + # Keep `Companion` object fields of serializable classes. # This avoids serializer lookup through `getDeclaredClasses` as done for named companion objects. -if @kotlinx.serialization.Serializable class ** @@ -27,7 +29,11 @@ # @Serializable and @Polymorphic are used at runtime for polymorphic serialization. -keepattributes RuntimeVisibleAnnotations,AnnotationDefault --dontwarn org.slf4j.impl.StaticLoggerBinder +-dontwarn org.slf4j.** +-assumenosideeffects class org.slf4j.Logger { + public void trace(...); + public void debug(...); +} # Serializer for classes with named companion objects are retrieved using `getDeclaredClasses`. # If you have any, uncomment and replace classes with those containing named companion objects.