Skip to content

Add ProGuard/R8 consumer rules #1192

@mjhoffmeister

Description

@mjhoffmeister

What feature are you requesting?

Add comprehensive ProGuard keep rules to consumer-rules.pro (or proguard-rules.pro) in the ACS UI Calling SDK so that R8 automatically preserves the classes and methods required by the native library (libskypert.so) when customers enable minification. The current file is empty.

What would be the benefit of adding this feature?

Currently, when customers enable minifyEnabled true in their release builds, the app crashes at runtime during CallClient initialization because R8 strips Java/Kotlin classes that the native library accesses via JNI reflection. This forces customers to either:

  1. Disable minification (not acceptable for enterprise apps with security/compliance requirements)
  2. Manually discover and add keep rules through trial-and-error (poor developer experience)
    Shipping consumer rules in the SDK would:

✅ Prevent runtime crashes out-of-the-box
✅ Allow customers to use minification/obfuscation for security
✅ Reduce support burden (this is a common issue)
✅ Align with Android best practices (most libraries ship consumer ProGuard rules)

What solution would be ideal for you?

Populate the consumer-rules.pro file in the ACS UI Calling module with rules that preserve all ACS SDK classes and members, native method entry points, trouter signaling classes, required attributes for JNI/reflection, and enums.

What alternatives have you considered?

  1. Document manual rules – Publish ProGuard rules in the docs for customers to copy/paste. (Worse DX; easy to miss or get wrong)
  2. Keep only minimal classes – Ship surgical rules that preserve only critical JNI entry points. (Better DEX size but requires deep analysis of native code to identify exactly what's accessed)
  3. Ship unobfuscated SDK – Don't support minification. (Not viable; enterprise customers require it for security/compliance)

Is there any additional information for your request?

  • Affected SDK versions: This impacts all versions (confirmed on 2.13.1 Calling SDK, 1.14.0 UI SDK)
  • Customer impact: Production blocker for enterprise customers with security policies requiring obfuscation
  • Current workaround: Customers must manually add broad keep rules, losing DEX shrinking benefits
  • Crash signature: Native abort in libskypert.so during JNI_OnLoad → CallClient.loadNativeLibraries → CallingSDKInitializer.setupCallClient
  • Similar libraries: Most Android SDKs with native components (Firebase, ExoPlayer, etc.) ship consumer ProGuard rules to prevent this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions