4 Commits
Author SHA1 Message Date
Alex Deymo 9bb4ddb047 Add missing newline at end of file.
Bug: None
Test: Still builds.
Change-Id: I26f9a3155315c3b7fb8104dc708df312a5860731
2018-02-14 16:37:20 +01:00
Tianjie Xu 18480eb706 Implement a simple logger for bsdiff
The logger supports LOG & PLOG. It also adds a std::endl at the end of
the stream so that we don't need to add it manually at the callsite.

Test: run bsdiff and check the logs.
Change-Id: Ice94902a501532ceaeb480c3576e752e435cab70
2017-11-30 12:28:06 -08:00
Tianjie Xu b4cba64184 Implement a new bsdiff format
Add a new BSDF2 format that allows compression of ctrl/diff/extra streams
with different algorithms. The compression algorithm supported for now is
bz2 and brotli. This new format is similar to the legacy "BSDIFF40" format
except for the magic headers.

File format:
0       8    magic header
8       8    X
16      8    Y
24      8    new_file_size
32      X    compressed control block
32+X    Y    compressed diff block
32+X+Y  ???  compressed extra block

The magic header for BSDF2 format:
0 5 BSDF2
5 1 compressed type for control stream
6 1 compressed type for diff stream
7 1 compressed type for extra stream

Bug: 34220646
Test: unittest pass
Change-Id: I6eb0867e88476dbc4a4b7be609783f8c8a0a41cd
2017-11-16 14:46:37 -08:00
Tianjie Xu 4d10c3efd7 Add a brotli decompressor in bsdiff
This CL implements the brotli decompressor used in PatchReader. Also
extract the CompressorType and patch's MagicHeader to a common header file.

Bug: 34220646
Test: Run bsdiff/bspatch with brotli compressor/decompressor over a list
of files from angler's system image.

Change-Id: I76e11168075c6481490ffbc025ec4ca81e828732
2017-11-14 14:36:55 -08:00