Skip to content

Commit 3328577

Browse files
[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) <noreply@anthropic.com>
1 parent bb99641 commit 3328577

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

proguard-rules.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@
3838

3939
# Safely ignore warnings about other libraries since we are using Gson
4040
-dontwarn com.fasterxml.jackson.**
41+
42+
# Keep Jackson naming strategy fields used via reflection by the Java SDK serializer (BUG-8620).
43+
# When Jackson is on the classpath, JacksonSerializer uses reflection to access SNAKE_CASE.
44+
# Without these rules, R8 obfuscates the field names, causing NoSuchFieldException.
45+
-keepclassmembers class com.fasterxml.jackson.databind.PropertyNamingStrategies {
46+
public static *;
47+
}
48+
-keepclassmembers class com.fasterxml.jackson.databind.PropertyNamingStrategy {
49+
public static *;
50+
}
51+
4152
-dontwarn org.json.**
4253

4354
# Annotations

0 commit comments

Comments
 (0)