Skip to content

feat(remote): export ranged remote APFS reading as pkg/remote - #1410

Open
KishanBagaria wants to merge 2 commits into
blacktop:masterfrom
KishanBagaria:export-remote-apfs
Open

KishanBagaria wants to merge 2 commits into
blacktop:masterfrom
KishanBagaria:export-remote-apfs

Conversation

@KishanBagaria

Copy link
Copy Markdown
Contributor

Moves the ranged remote-volume reading added in #1408 and #1409 from internal/ to a public package, pkg/remote. The motivation is my ipswrun package, which reads files out of remote restore images the same way and carries its own copy of this code; with this exported it can import it and drop the copy.

  • NewRangeReader(url, *Config): the reader from internal/download/range_reader.go, moved with its tests.
  • OpenZipAPFS(remote, size, member, *AEAConfig): stored ZIP member, then AEA, UDIF and GPT when present, then go-apfs OpenReader. This is the first half of extractRemoteDMGRanged, moved as it was.
  • OpenAPFS(image, size, *AEAConfig): the same for image bytes that are not a ZIP member.
  • APFSPartition(source, size): moved from internal/commands/extract.

ipsw extract --ranged calls the package; its behavior is unchanged.

Testing

  • go build ./... passes.
  • go test -count=1 ./pkg/remote ./internal/commands/extract ./internal/download: all three ok.
  • New test: TestOpenAPFSImage opens the existing synthetic APFS fixture through OpenAPFS. The existing end-to-end tests (plain and AEA) go through OpenZipAPFS.

Not run: go test ./... in full, and a live run against an Apple restore image.

AI Assistance

Planned and written by Claude Fable 5.2. Reviewed manually.

🤖 Generated with Claude Code

KishanBagaria and others added 2 commits November 19, 2026 13:46
Move the HTTP range ReaderAt out of internal/download and the
ZIP member -> AEA -> UDIF -> GPT -> APFS chain out of
internal/commands/extract, so other modules can open a volume of a remote
IPSW without copying them. `ipsw extract --ranged` calls the new package;
its behavior is unchanged.

Co-Authored-By: Claude Fable 5.2 <[email protected]>

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