Repository navigation
fix(fs): address an app container by bundle id and a relative path - #484
Open
mobile-kevin wants to merge 1 commit into
Open
mobile-kevin wants to merge 1 commit into
mobile-kevin wants to merge 1 commit into
Conversation
|
Warning Review limit reached
This review includes 5 billable files and costs up to $1.25. Or wait 59 minutes for your next included review. View limit details
|
gmegidish
force-pushed
the
fix-app-container-fs
branch
from
November 13, 2026 10:48
8462a5b to
212c474
Compare
`fs ls/mkdir/rm <bundle-id> <path>` (the documented form, e.g. `fs ls com.example.app /Documents`) did not work on either platform: - Android ignored the bundle id and ran the path as-is, so `<bundle> /files` became `ls /files` at the device root and failed, and `<bundle>` with no path listed the device root instead of the container. - The iOS simulator only used the bundle id when no path was given; with a path it validated the raw path and rejected it as outside the device directory. Resolve (bundle, path) to the container up front: Android builds /data/user/0/<pkg>/<path> (which routes through run-as), and the simulator joins the path under the app's data container, cleaning the relative part so a ".." cannot climb out. An empty path lists the container root on both. Adds unit tests for the Android path builder and e2e tests on both platforms for the bundle+relative form (list/create/remove and a rejected "../" escape).
gmegidish
force-pushed
the
fix-app-container-fs
branch
from
November 13, 2026 11:57
212c474 to
278de08
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The documented per-container form
fs ls/mkdir/rm <bundle-id> <path>(help example:fs ls com.example.app /Documents) worked on neither platform:<bundle> /filesranls /filesat the device root and failed (ls failed: exit status 1), and<bundle>with no path listed the device root instead of the container.'/Documents' is outside the simulator device directory).So the only way to reach a container was the full absolute path, which the
[bundle-id]argument is meant to save you from.Fix
Resolve
(bundle, path)to the container before doing anything:/data/user/0/<pkg>/<path>, which makes the existingbuildShellCommandwrap the op inrun-as <pkg>.filepath.Clean("/"+path)) so a..can't climb out;validatePathstill guards the result.fs push/fs pullkeep their<local> <remote>signatures (no bundle slot), so container writes still use a full path; this PR fixes thels/mkdir/rmforms that take a bundle id.Tests
androidContainerPathbuilds the right/data/user/0/...path and routes throughrun-as.<bundle> <relpath>lists the same as the absolute path,<bundle>lists the container root (not the device root), create/remove through the bundle form works, a../relative path is rejected, and an unknown package errors.