fix(lint): restrict data-plan detector to known event builder types - #817
nickolas-dimitrakas wants to merge 3 commits into
Conversation
…ents DataplanDetector resolved MPEvent.Builder/CommerceEvent.Builder chains via unrestricted reflection (Class.forName/newInstance/invoke) driven by class and method names found in the analyzed project's own source, including anything reachable through a local variable's initializer chain. Restrict resolution to an explicit allowlist of the mParticle DTO/builder types this detector actually needs, and bound expression resolution depth so an unrelated failure mode can't escape the existing exception handling as a stack overflow. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
PR SummaryLow Risk Overview Adds depth protection to expression resolution. Call chain evaluations in Reviewed by Cursor Bugbot for commit 67937d6. Bugbot is set up for automated code reviews on this repo. Configure here. |
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Nickolas Dimitrakas <nickolas.dimitrakas@rokt.com>
📦 SDK Size Impact ReportWhat the SDK adds to a minified release APK. 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. mParticle Core SDK
➡️ SDK size impact change is minimal. Raw measurementsTarget branch: {"baseline_dex_bytes": 0, "baseline_download_bytes": 2513, "baseline_install_bytes": 7529, "core_dex_bytes": 218884, "core_download_bytes": 122911, "core_install_bytes": 130161}This PR: {"baseline_dex_bytes": 0, "baseline_download_bytes": 2517, "baseline_install_bytes": 7534, "core_dex_bytes": 218884, "core_download_bytes": 122908, "core_install_bytes": 130159} |
Background
The Data Plan lint detector evaluates
MPEvent.Builder/CommerceEvent.Buildercalls found in analyzed source to check them against a data plan. This change tightens what it's allowed to touch while doing that evaluation.What Has Changed
Screenshots/Video
N/A — lint tooling change, no UI.
Checklist
Additional Notes
./gradlew :tooling:custom-lint-rules:testand:tooling:custom-lint-rules:ktlintCheckpass.DataplanDetectorTestconfirm the allowlist is enforced and that a normal builder chain still resolves as before.🤖 Generated with Claude Code