Skip to content

build(android SDK): keep PushRegistrationHelper$Companion - #1004

Merged
thomson-t merged 1 commit into
mainfrom
build/keep-pushregistrationhelper-companion
Nov 10, 2026
Merged

thomson-t merged 1 commit into
mainfrom
build/keep-pushregistrationhelper-companion

Conversation

@nickolas-dimitrakas

Copy link
Copy Markdown
Contributor

Why

Converting PushRegistrationHelper to Kotlin adds a PushRegistrationHelper$Companion class. The android-core AAR 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 { *; } to android-core/proguard.pro, beside the existing PushRegistrationHelper keeps. Adds a call to PushRegistrationHelper.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.jar is byte-identical (same SHA-1) and the class list is identical (318 entries).
  • javap -public on PushRegistrationHelper and PushRegistrationHelper$PushRegistration is identical.
  • -printusage is identical; -printseeds is the same set of lines; -printconfiguration differs by exactly the added line.
  • japicmp (scripts/api_compat_report.py) against the published 6.1.10 reports android-core and android-kit-base compatible.
  • Published to Maven Local: both consumer fixtures assemble, and the kit unit tests pass.

Linked work

Unblocks the pull request that converts PushRegistrationHelper to Kotlin.

Rollout

Merging changes no shipped artifact. Reverting is a single git revert; ProGuard changes revert independently of code.

Risks

  • A ProGuard change could drop or rename something consumers link against → the AAR comparison shows no change and japicmp reports nothing no longer kept → Binary Compatibility and Kit Compatibility Test on this pull request.

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.

@github-actions

Copy link
Copy Markdown

Kotlin migration progress

No change to the Java left to convert.

Module Kotlin LOC Java LOC Java staying (facade) Java left to convert Kotlin share
android-core 8,640 17,301 9,716 7,585 33.3%
android-kit-base 601 5,405 1,651 3,754 10.0%
Total 9,241 22,706 11,367 11,339 28.9%

Conversion progress: 31.5% (11,339 of 16,550 baseline Java LOC left to convert). 96 Java files and 72 Kotlin files in scope.

@nickolas-dimitrakas nickolas-dimitrakas self-assigned this Nov 10, 2026
@nickolas-dimitrakas
nickolas-dimitrakas marked this pull request as ready for review November 10, 2026 20:40
@nickolas-dimitrakas
nickolas-dimitrakas requested a review from a team as a code owner November 10, 2026 20:40
@github-actions

Copy link
Copy Markdown

Binary compatibility

  • ✅ android-core is compatible with 6.1.10 (112 classes compared, 0 with additions only).
  • ✅ android-kit-base is compatible with 6.1.10 (37 classes compared, 0 with additions only).

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 api-compat-reports workflow artifact. This check is not in the required-check set yet, so a red result here does not block merging.

@github-actions

Copy link
Copy Markdown

📦 SDK Size Impact Report

What the SDK adds to a minified release APK.

mParticle Core SDK

Measured 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.

Metric Target branch This PR Change
APK size 121.39 KB 121.40 KB +6 bytes
Download size 119.21 KB 119.21 KB +6 bytes
Dex bytes 218.44 KB 218.44 KB 0 bytes

mParticle Core + Rokt kit

Measured 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 size-report-rokt/README.md.

Metric Target branch This PR Change
APK size 1.26 MB 1.26 MB 0 bytes
Download size 1.25 MB 1.25 MB 0 bytes
Dex bytes 2.24 MB 2.24 MB 0 bytes

Rokt SDK+ umbrella (adds the payment extension)

Metric Target branch This PR Change On top of mParticle Core + Rokt kit
APK size 6.55 MB 6.55 MB 0 bytes +5.29 MB
Download size 6.43 MB 6.43 MB -5 bytes +5.19 MB
Dex bytes 7.12 MB 7.12 MB 0 bytes +4.89 MB

➡️ SDK size impact change is minimal.

Raw measurements

core, 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}

Measured ae89899 merged into cc21fe7

@thomson-t
thomson-t merged commit a997a8e into main Nov 10, 2026
45 checks passed
@thomson-t
thomson-t deleted the build/keep-pushregistrationhelper-companion branch November 10, 2026 21:04
@jamesnrokt jamesnrokt added the promoted Opened from Rokt's internal review process label Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

promoted Opened from Rokt's internal review process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants