Skip to content
This repository was archived by the owner on Oct 2, 2026. It is now read-only.

fix: quote media scan destination paths - #321

Merged
KazuCocoa merged 1 commit into
masterfrom
fix/quote-media-scan-path
Sep 26, 2026
Merged

KazuCocoa merged 1 commit into
masterfrom
fix/quote-media-scan-path

Conversation

@KazuCocoa

Copy link
Copy Markdown
Member

scanMedia passes the destination as a raw am broadcast --es path argument. Spaces split it, quotes can make the command invalid, and shell operators/newlines can truncate it. AndroidDriver uses this method after pushing files on Android API 29 and newer, so a successful push can still leave media scanning broken.

Quote the complete destination as a POSIX literal, including embedded apostrophes. Add regression coverage for the emitted extra and real POSIX-shell argument preservation.

Validation: JavaScript/TypeScript build, formatting, and lint pass (two existing unrelated lint warnings). Windows unit suite: 7 pass, 1 POSIX case skipped; all 8 pass when the generated test uses Git sh. With published io.appium.settings 8.0.9, appium-adb 16.0.8, and the real Settings APK on an API 30 emulator, 9 of 10 path cases fail before this fix and all 10 succeed afterward. Device logcat confirms the exact paths were scanned, including spaces, both quote types, operators, newline, Japanese/emoji, and an apostrophe plus !.

The API 28-and-earlier AndroidDriver broadcast path is fixed separately in appium/appium-android-driver#1102.

@KazuCocoa
KazuCocoa merged commit 71c90d0 into master Sep 26, 2026
15 of 17 checks passed
@KazuCocoa
KazuCocoa deleted the fix/quote-media-scan-path branch September 26, 2026 17:18
github-actions Bot pushed a commit that referenced this pull request Sep 26, 2026
## [8.0.10](v8.0.9...v8.0.10) (2026-09-26)

### Bug Fixes

* quote media scan destination paths ([#321](#321)) ([71c90d0](71c90d0))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 8.0.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants