Skip to content

fix(mwa): use type-safe getParcelableExtra on Android 13+ - #292

Open
jrootcache wants to merge 1 commit into
magicblock-labs:mainfrom
jrootcache:fix/mwa-chooser-api33-parcelable
Open

jrootcache wants to merge 1 commit into
magicblock-labs:mainfrom
jrootcache:fix/mwa-chooser-api33-parcelable

Conversation

@jrootcache

@jrootcache jrootcache commented Sep 27, 2026 •

Copy link
Copy Markdown

Summary of Changes

  • Added compatibility fallback in MwaChooserHelper.java for Android 13+ (API level 33+) using the type-safe overload intent.getParcelableExtra(Intent.EXTRA_CHOSEN_COMPONENT, ComponentName.class).
  • Ensures sChosenPackage is reliably extracted when handling ACTION_CHOSEN broadcasts on modern Android versions where legacy untyped getParcelableExtra is deprecated and may return null.

Summary by CodeRabbit

  • Bug Fixes
    • Improved app selection detection on Android 13 and later when returning from the Solana wallet chooser.

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: a8858615-d829-456a-a885-ee064749ab57

📥 Commits

Reviewing files that changed from the base of the PR and between bd0d30f and a985649.

📒 Files selected for processing (1)
  • Runtime/Plugins/SolanaMobileStack/Android/MwaChooserHelper.java

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.


Walkthrough

onReceive now retries the chosen-component lookup with the typed ComponentName overload on Android API 33 and later when the untyped lookup returns null.

Changes

Chooser component lookup

Layer / File(s) Summary
Typed chosen-component fallback
Runtime/Plugins/SolanaMobileStack/Android/MwaChooserHelper.java
When the untyped lookup returns null on Android API 33 or later, onReceive retries the lookup with the typed ComponentName overload.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to a9856

The chooser fallback has no confirmed merge-blocking issue. Confirm that the Android build compiles against API 33 or later during normal build checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to a9856

The change restores wallet selection on Android 13 and later without changing the broadcast checks or wallet authorization flow. Its downstream effect on cached wallet routing merits review, but no new security bypass was established.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The affected selection is an app-local wallet package, but a cached selection can determine which wallet receives a later targeted association request.

Trust Boundaries and Controls

  • observed — The fallback does not bypass nonce validation. The known adapter login paths also use an exclusivity gate before starting wallet operations.

Resilience and Maintainability Implications

  • observed — The helper's nonce and chosen-package slots are process-global, while association cleanup does not clear them. This state lifecycle predates the fallback; the available evidence does not establish a newly reachable security failure.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description summarizes the code change, but it omits most required template sections, including the status table, Problem, Solution, Before & After Screenshots, Other changes, and Deploy Notes. Complete the required template sections. Include the PR status, change type, issue link, problem, solution, screenshot status or screenshots, other changes, and deployment notes for scripts and dependencies.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the MWA fix and the Android 13+ type-safe getParcelableExtra change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant