fix(google): avoid r8 billing reflection - #309
Merged
Merged
Conversation
Use typed Play Billing APIs for product-level subscription replacement parameters so R8 can safely optimize release apps. Replace obsolete reflection-path tests with direct builder coverage. Closes #307
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe Android subscription replacement flow now uses typed Billing Library builders instead of reflection. Tests cover native parameter conversion for all replacement modes, and obsolete reflection-based class-path tests are removed. ChangesSubscription replacement conversion
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
SubscriptionProductReplacementParamsconstruction with typed Play Billing 9.1 API callsWhy
Minified Android release apps could have Billing classes or methods optimized in ways the name-based reflection path could not follow. Using typed calls lets R8 trace and rewrite those references without requiring a package-wide Billing keep rule. The change is isolated to the Play source set; Horizon and Amazon do not compile this code.
Verification
:openiap:test:openiap:lintPlayReleasebun audit:parity:Example:assemblePlayReleasewith R8; confirmed the merged configuration contains no broad-keep class com.android.billingclient.api.** { *; }workaroundA live Google Play Sandbox replacement purchase was not performed because it requires an active subscription and store-authorized test account. Reporter validation of the resulting snapshot is still recommended for the final store-backed runtime check.
Closes #307
Summary by CodeRabbit
Bug Fixes
Tests