From be18ed50d8e04261da1553662a768e7ce0f1dd8f Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Thu, 12 Sep 2024 23:04:25 -0300 Subject: [PATCH] fix(core): prevent Proguard from optimizing away custom ser/de classes (#10982) --- .changes/fix-android-proguard.md | 5 +++++ crates/tauri/mobile/android/proguard-rules.pro | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 .changes/fix-android-proguard.md diff --git a/.changes/fix-android-proguard.md b/.changes/fix-android-proguard.md new file mode 100644 index 000000000..f6e7dafae --- /dev/null +++ b/.changes/fix-android-proguard.md @@ -0,0 +1,5 @@ +--- +"tauri": patch:bug +--- + +Add a Proguard rule to prevent custom JSON deserializer and serializer classes from being optimized away. diff --git a/crates/tauri/mobile/android/proguard-rules.pro b/crates/tauri/mobile/android/proguard-rules.pro index ab4493362..e21b5beb4 100644 --- a/crates/tauri/mobile/android/proguard-rules.pro +++ b/crates/tauri/mobile/android/proguard-rules.pro @@ -28,4 +28,14 @@ *; } +-keep @com.fasterxml.jackson.databind.annotation.JsonDeserialize public class * { + *; +} + +-keep @com.fasterxml.jackson.databind.annotation.JsonSerialize public class * { + *; +} + -keep class * extends com.fasterxml.jackson.databind.JsonDeserializer { *; } + +-keep class * extends com.fasterxml.jackson.databind.JsonSerializer { *; }