Skip to content

A deep link reaches an Android device whole (CHALLENGES 369) - #288

Merged
lana-20 merged 1 commit into
mainfrom
open-url-quoted
Oct 27, 2026
Merged

lana-20 merged 1 commit into
mainfrom
open-url-quoted

Conversation

@lana-20

@lana-20 lana-20 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

ADB.OpenURL passed a deep link to adb shell unquoted. The device's shell parses that line, so a query's & sent am start … -d <link up to the &> to the background and ran the rest as an assignment; am reported the intent delivered and open reported it opened. ;, |, $ and a space cut or changed a link the same way. Every Android link with a second query parameter has lost it since open was written.

Found by Morpho Match's two-player game: its link morphomatch://duo?player=A&server=http://10.0.2.2:8788 lost server=, and both devices played on the app's default port with nothing on screen to say so. CHALLENGES 369.

Fix: the link goes through shellQuote, as a notification's text has since CHALLENGES 52. One path: every Android driver's OpenURL calls ADB.OpenURL.

Test: a fake adb that parses its arguments as the device's shell does and prints what am was given. Without the fix it was given morphomatch://duo?player=A, and nothing for a link holding ; and $.

Measured: on the Android 15 emulator and the Meta Spatial Simulator, the game's server on 8788 was reached from both, and its four duo scripts pass in both orders (mobiumdev/morpho-match, next PR). make ci green.

ADB.OpenURL passed the link to adb shell unquoted, so the device's shell
cut it at the first & and sent am start to the background: Morpho Match's
duo link lost server= and every device played on the default port, while
open reported it opened. The link goes through shellQuote; a fake adb that
parses as the device's shell does is the test, and fails without the fix.
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