Repository navigation
build(android SDK): keep PushRegistrationHelper$Companion - #1004
Conversation
Kotlin migration progressNo change to the Java left to convert.
Conversion progress: 31.5% (11,339 of 16,550 baseline Java LOC left to convert). 96 Java files and 72 Kotlin files in scope. |
Binary compatibility
Compares this branch with the last version published to Maven Central, both built without R8, over the public classes and members that release keeps under their own names. It also checks that this branch's release AAR still keeps them (see the script docstring). Full japicmp HTML/XML reports are attached as the |
📦 SDK Size Impact ReportWhat the SDK adds to a minified release APK. mParticle Core SDKMeasured against an empty baseline app. Unlike the Rokt kit, android-core ships no Compose and no resources, so there is nothing here that a host app would already provide.
mParticle Core + Rokt kitMeasured against a Compose + Material3 reference app, so these are the costs on top of an app that already ships Compose. The reference app's dependencies are a documented convention, not a measured average: see
Rokt SDK+ umbrella (adds the payment extension)
➡️ SDK size impact change is minimal. Raw measurementscore, Target branch: {"baseline_dex_bytes": 0, "baseline_download_bytes": 2516, "baseline_install_bytes": 7532, "core_dex_bytes": 223684, "core_download_bytes": 124583, "core_install_bytes": 131836}core, This PR: {"baseline_dex_bytes": 0, "baseline_download_bytes": 2513, "baseline_install_bytes": 7529, "core_dex_bytes": 223684, "core_download_bytes": 124586, "core_install_bytes": 131839}rokt, Target branch: {"baseline_dex_bytes": 1829108, "baseline_download_bytes": 1240062, "baseline_install_bytes": 1300934, "kit_dex_bytes": 4173692, "kit_download_bytes": 2548319, "kit_install_bytes": 2623275, "sdkplus_dex_bytes": 9297648, "sdkplus_download_bytes": 7987552, "sdkplus_install_bytes": 8165359}rokt, This PR: {"baseline_dex_bytes": 1829108, "baseline_download_bytes": 1240062, "baseline_install_bytes": 1300934, "kit_dex_bytes": 4173692, "kit_download_bytes": 2548319, "kit_install_bytes": 2623275, "sdkplus_dex_bytes": 9297648, "sdkplus_download_bytes": 7987547, "sdkplus_install_bytes": 8165359} |
Why
Converting
PushRegistrationHelperto Kotlin adds aPushRegistrationHelper$Companionclass. Theandroid-coreAAR is minified with R8, which renames that class and does not rewrite the Kotlin metadata, so Kotlin consumers can no longer resolve the companion. The migration playbook requires the keep rule to land in its own rules-only pull request before the conversion. This is that pull request; it is harmless while the class is still Java.Programme
Part of the Android SDK Java-to-Kotlin migration (see
docs/kotlin-migration/PLAYBOOK.md, "ProGuard protocol").What changes
Adds
-keep class com.mparticle.internal.PushRegistrationHelper$Companion { *; }toandroid-core/proguard.pro, beside the existingPushRegistrationHelperkeeps. Adds a call toPushRegistrationHelper.getLatestPushRegistration(context)to the Kotlin consumer fixture, so Kit Compatibility Test fails if Kotlin consumers lose the companion after the conversion. No other file changes.Evidence, from release AARs built with and without the rule:
classes.jaris byte-identical (same SHA-1) and the class list is identical (318 entries).javap -publiconPushRegistrationHelperandPushRegistrationHelper$PushRegistrationis identical.-printusageis identical;-printseedsis the same set of lines;-printconfigurationdiffers by exactly the added line.scripts/api_compat_report.py) against the published 6.1.10 reportsandroid-coreandandroid-kit-basecompatible.Linked work
Unblocks the pull request that converts
PushRegistrationHelperto Kotlin.Rollout
Merging changes no shipped artifact. Reverting is a single
git revert; ProGuard changes revert independently of code.Risks
Who
Written by an AI coding agent at a maintainer's request, and reviewed by an independent review agent before opening.
Size
8 lines added in 2 files: 1 in
proguard.pro, 7 in the Kotlin consumer fixture.