From 332857745e98bd19ddaeb2c77197274c36047bd9 Mon Sep 17 00:00:00 2001 From: muzahidul-opti Date: Thu, 14 May 2026 23:25:13 +0600 Subject: [PATCH] [BUG-8620] Add ProGuard keep rules for Jackson naming strategy fields Prevents R8 from obfuscating PropertyNamingStrategies.SNAKE_CASE and PropertyNamingStrategy.SNAKE_CASE fields that the Java SDK's JacksonSerializer accesses via reflection. Without these rules, apps with Jackson on the classpath get NoClassDefFoundError in DefaultJsonSerializer. Defense-in-depth for BUG-8620 (primary fix is in java-sdk). Co-Authored-By: Claude Opus 4.6 (1M context) --- proguard-rules.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/proguard-rules.txt b/proguard-rules.txt index f0197f30..1feba254 100644 --- a/proguard-rules.txt +++ b/proguard-rules.txt @@ -38,6 +38,17 @@ # Safely ignore warnings about other libraries since we are using Gson -dontwarn com.fasterxml.jackson.** + +# Keep Jackson naming strategy fields used via reflection by the Java SDK serializer (BUG-8620). +# When Jackson is on the classpath, JacksonSerializer uses reflection to access SNAKE_CASE. +# Without these rules, R8 obfuscates the field names, causing NoSuchFieldException. +-keepclassmembers class com.fasterxml.jackson.databind.PropertyNamingStrategies { + public static *; +} +-keepclassmembers class com.fasterxml.jackson.databind.PropertyNamingStrategy { + public static *; +} + -dontwarn org.json.** # Annotations