You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b73d003
Browse filesBrowse the repository at this point in the historyBrowse files
fix(android): classify the clipboard shell response, not its exit status
`clipboard read` answered `text: ""` and `clipboard write` answered "Clipboard
updated" — both `success: true` — on a build where adb never touched the
clipboard. Android 16 (API 36) answers every `adb shell cmd clipboard …` with
the framework default `Binder.handleShellCommand`: `No shell command
implementation.` on stderr and exit status 0. Both legs and the capability probe
consulted the exit status first, so the silence became an empty clipboard and a
false confirmation, and `capabilities` advertised `clipboard`.
The response is now classified per stream into one typed verdict owned by
`clipboard-shell-response.ts`. The service's own no-shell-command sentence is
evidence at every exit status — a service that never ran the command wrote no
payload, so a clean exit cannot discharge it — while stdout stays payload until
the call has failed, and the generic missing-subcommand wording never overrides a
clean exit because adb prints it about itself too. Both legs and the probe share
the verdict, and a build with no clipboard shell surface refuses with
`UNSUPPORTED_OPERATION` and a hint naming the device-side substitute.
Closes#2674
'This Android build ships no shell implementation for the clipboard service, so adb cannot read or write the clipboard on it. Verify a copy flow by pasting into a focused field and reading that field back.';
21
+
22
+
/**
23
+
* Classifies one clipboard shell call from what the device said about it.
24
+
*
25
+
* A zero exit status does not settle whether the clipboard service ran the command: a service that
26
+
* implements no shell command prints `No shell command implementation.` to its **err** descriptor
27
+
* and returns 0 (`Binder.handleShellCommand`'s framework default, which is what Android's
28
+
* `ClipboardService` falls back to). So that sentence is evidence at every exit status, and it wins
29
+
* even against a non-empty stdout, because a service that never ran the command produced no payload
30
+
* for stdout to hold.
31
+
*
32
+
* Nothing else about a clean exit is evidence of refusal. A read that ran answers on stdout with
33
+
* arbitrary user text, which may quote any of these phrases, and the generic missing-subcommand
34
+
* prose is adb's own wording too — it can describe the client, not this device — so both are read
0 commit comments