Skip to content

Ingest a full-file-system extraction zip as a source - #18

Merged
abrignoni merged 1 commit into
mainfrom
feat/archive-source
Sep 3, 2026
Merged

abrignoni merged 1 commit into
mainfrom
feat/archive-source

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

Adds a third source kind, archive, so a full-file-system extraction zip can be ingested directly: python gleapp.py -c case ingest EXTRACTION_FFS.zip, the same path through the web launcher. Before this a zip fell into the folder branch and was registered as one file.

  • gleapp/archive.py enumerates the central directory, strips the single root folder, sniffs every extension-less member from its first 16 bytes without extracting it, and stages media (or everything with include_other) under <case>/staged/ as <slug>/<2 hex>/<sha1 of member path>.<ext>. Flat and hashed because there is no Windows long-path handling here and members nest 20 levels deep, because case-variant names must not collide on a case-insensitive volume, and because names carrying control characters must never reach the filesystem.
  • path is the staged file, rel_path the device path with the root stripped, orig_path the member as stored. Timestamps use the zip's extended field when present and the DOS date otherwise; meta records which per source, plus the archive's SHA-256 when a UFED .ufd sidecar is beside it. Encrypted members are skipped and counted; __MACOSX is ignored everywhere.
  • Staged files are kept so the viewer can open them. Deleting the case folder deletes them; the zip is never written to.

Measured on registered images. Android, 14.2 GiB: 3,934 media registered in 6.0 s, only 1,085 of them media by extension, 463 MiB staged, every staged file byte-equal to its central-directory size, processed in 16 s. The 97 processing errors are all ExoPlayer .exo fragments, audio-only .m4a and empty cache files, labeled by the pipeline's existing messages. iOS, 12.1 GiB: 43,918 registered in 27.7 s, 3.3 GiB staged.

Tests build a synthetic zip covering the root strip, both timestamp sources, a case-variant pair, an extension-less image, a control-character name, a 300-character path, __MACOSX junk, a member flagged encrypted in the finished bytes, a .ufd sidecar, and include_other. The suite runs on Windows in CI, which is the proof for the flat layout.

Follow-ups, not here: tar and tar.gz through the same shape; a registered-but-unstaged mode; Android storage-view awareness in stacking; audio-only ISOBMFF sniffed as video, which predates this change.

🤖 Generated with Claude Code

Mobile extractions arrive as one zip holding the device filesystem under a
single root folder, tens of gigabytes, with a large minority of members
carrying no extension. Every step of the pipeline reads a file through a
filesystem path, so a member has to be on disk to be hashed, thumbnailed or
viewed. This adds a third Source kind, archive, detected by extension or
magic ahead of the folder branch, which had been registering a zip as one
file.

gleapp/archive.py enumerates the central directory, strips the single root
folder, sniffs every extension-less member from its first 16 bytes without
extracting it, and stages media (or everything, with include_other) under
<case>/staged/ as <slug>/<2 hex>/<sha1 of the member path>.<ext>. Flat and
hashed because the codebase has no Windows long-path handling and members
nest 20 levels deep, because case-variant names must not collide on a
case-insensitive volume, and because member names carrying control
characters must never reach the filesystem. path is the staged file,
rel_path the member path minus the root, orig_path the member as stored.
Timestamps come from the zip's extended field when present and the DOS
date otherwise, and the meta table records which, per source, with the
archive's own SHA-256 when a UFED .ufd sidecar is beside it. Encrypted
members are skipped and counted; __MACOSX entries are ignored everywhere,
including in the root computation.

Measured on registered images. Android, 14.2 GiB: 3,934 media registered
in 6.0 s, of which only 1,085 were media by extension, 463 MiB staged, all
timestamps from the extended field, every staged file byte-equal to its
central-directory size, processed in 16 s with 97 errors that are all
streaming-cache fragments the pipeline already labels. iOS, 12.1 GiB:
43,918 registered in 27.7 s, 3.3 GiB staged, all timestamps DOS.

Tests build a synthetic zip covering the root strip, both timestamp
sources, a case-variant pair, an extension-less image, a control-character
name, a 300-character path, __MACOSX junk, a member flagged encrypted in
the finished bytes, a .ufd sidecar, and include_other.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@abrignoni
abrignoni merged commit 8dc638a into main Sep 3, 2026
8 checks passed
@abrignoni
abrignoni deleted the feat/archive-source branch September 3, 2026 18:53
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