Commit Graph

9 Commits

Author SHA1 Message Date
Andrew Gunnerson b351d47f28 Update dependencies and fix most pedantic clippy warnings
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-12-08 18:46:40 -05:00
Andrew Gunnerson c974ab5ec3 Use Rust conventional comment style for license headers
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-09-22 14:58:01 -04:00
Andrew Gunnerson e9638d25b0 Add support for packing and unpacking Android sparse images
This supports all features of Android sparse images, including holes,
and CRC32 (both full image checksum and CRC32 chunks).

Partial sparse images, like those included in GrapheneOS' new optimized
factory images, can also be packed and unpacked with these new commands,
unlike AOSP's simg2img and img2simg tools.

This new functionality is not relevant for avbroot's main use case, but
is useful for unpacking certain factory images for comparison with OTAs
during troubleshooting.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-09-01 02:14:11 -04:00
Andrew Gunnerson 13c910274e Add support for packing and unpacking logical partition images
This supports both empty and normal LP images, including those that span
multiple files/devices.

Currently, repacked files are semantically equivalent, but not exactly
identical. avbroot's data structure for the metadata does not preserve
the arbitrary partition ordering of the LP image. Instead, to make the
API a bit nicer, it only preserves the relative partition ordering
within partition groups.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-08-27 23:32:29 -04:00
Andrew Gunnerson 2e8e86766b Move reopen functionality to a new trait
This is still not the ideal API, but it makes the code quite a bit more
readable since we no longer have to pass around closures everywhere that
multithreaded reads and writes to the same file are needed.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2023-10-11 22:09:45 -04:00
Andrew Gunnerson 164274eb97 Add streaming CPIO reader and writer
The Magisk boot image patcher still reads all the entries into memory
for simplicity, but everything else now uses the streaming reader.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2023-09-29 18:47:37 -04:00
Andrew Gunnerson 2a57343094 Add fuzzer for FEC image parser
Issue: #160

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2023-09-28 18:41:47 -04:00
Andrew Gunnerson 0aba185c85 Add fuzzer for cpio
Issue: #160

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2023-09-27 23:21:04 -04:00
Andrew Gunnerson 5b22d7b603 Add initial honggfuzz fuzzing infrastructure
This initially includes fuzzers for the AVB and boot image parsers. The
initial input corpus are the same test files we use for the round trip
tests.

Issue: #160

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2023-09-27 19:15:42 -04:00