@W-15287195: Add ProGuard consumer rules to prevent logout failures#2849
Merged
wmathurin merged 1 commit intoforcedotcom:devfrom Mar 17, 2026
Merged
@W-15287195: Add ProGuard consumer rules to prevent logout failures#2849wmathurin merged 1 commit intoforcedotcom:devfrom
wmathurin merged 1 commit intoforcedotcom:devfrom
Conversation
Adds consumer-rules.pro files to SalesforceSDK, SmartStore, and MobileSync libraries to preserve classes instantiated via reflection. This fixes logout failures when consuming apps are built with ProGuard/R8 enabled. The issue occurred because: - PushService is instantiated via reflection in PushNotificationsRegistrationChangeWorker - Transform and AnalyticsPublisher are instantiated via reflection in SalesforceAnalyticsManager - LongOperation subclasses are instantiated via reflection in SmartStore - SyncUpTarget and SyncDownTarget are instantiated via reflection in MobileSync Without consumer rules, ProGuard/R8 removes or obfuscates these classes' constructors, causing reflection to fail at runtime. Changes: - Created libs/SalesforceSDK/consumer-rules.pro with rules for PushService, Transform, and AnalyticsPublisher - Created libs/SmartStore/consumer-rules.pro with rules for LongOperation - Created libs/MobileSync/consumer-rules.pro with rules for SyncUpTarget and SyncDownTarget - Updated build.gradle.kts files to include consumerProguardFiles() configuration Consumer rules are automatically packaged with the library and applied to consuming apps, eliminating the need for manual ProGuard configuration.
Generated by 🚫 Danger |
Generated by 🚫 Danger |
Generated by 🚫 Danger |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #2849 +/- ##
============================================
+ Coverage 64.90% 64.91% +0.01%
- Complexity 2963 2964 +1
============================================
Files 222 222
Lines 17394 17394
Branches 2478 2478
============================================
+ Hits 11289 11291 +2
+ Misses 4906 4905 -1
+ Partials 1199 1198 -1
🚀 New features to boost your workflow:
|
brandonpage
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds consumer-rules.pro files to SalesforceSDK, SmartStore, and MobileSync libraries to preserve classes instantiated via reflection. This fixes logout failures when consuming apps are built with ProGuard/R8 enabled.
The issue occurred because:
Without consumer rules, ProGuard/R8 removes or obfuscates these classes' constructors, causing reflection to fail at runtime.
Changes:
Consumer rules are automatically packaged with the library and applied to consuming apps, eliminating the need for manual ProGuard configuration.