Skip to content

[BUG-8620] Add ProGuard keep rules for Jackson naming strategy#531

Open
muzahidul-opti wants to merge 1 commit into
masterfrom
muzahidul/bug-8620-proguard-jackson
Open

[BUG-8620] Add ProGuard keep rules for Jackson naming strategy#531
muzahidul-opti wants to merge 1 commit into
masterfrom
muzahidul/bug-8620-proguard-jackson

Conversation

@muzahidul-opti
Copy link
Copy Markdown
Contributor

@muzahidul-opti muzahidul-opti commented May 14, 2026

Summary

  • Adds -keepclassmembers rules for PropertyNamingStrategies and PropertyNamingStrategy to prevent R8 from obfuscating the SNAKE_CASE field that JacksonSerializer.getSnakeCaseStrategy() accesses via reflection
  • These are consumer ProGuard rules (automatically applied to apps depending on the SDK)
  • Defense-in-depth: prevents the R8 obfuscation issue at the ProGuard level, complementing the primary fix in java-sdk

Context

PetSmart has Jackson on their classpath as a transitive dependency, with a keep rule preserving ObjectMapper class name but not PropertyNamingStrategies. R8 obfuscates the SNAKE_CASE field, causing NoSuchFieldExceptionRuntimeExceptionNoClassDefFoundError in DefaultJsonSerializer.

Same class of bug as ae380e9 ("R8: Keep name of Gson class (#493)").

Companion PR: optimizely/java-sdk#626 (primary resilience fix)

Test plan

  • Build test-app with minifyEnabled true and Jackson on classpath
  • Verify events dispatch successfully without custom EventHandler workaround

Issue

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant