apk3: broken adb with files over 1073741811 bytes
The following code:
struct adb_block blk = adb_block_init(ADB_BLOCK_DATA, size + hdr.len);
size_t padding = adb_block_padding(&blk);
int r;
Using files of sizes larger than 1073741811 bytes will result in a block of type ADB_BLOCK_DATAX
, as the file will have spilled into the block's type bits. That will result in errors about bad ADB block when trying to check or extract the files.
It should be very easy to reproduce, the solution should probably using some kind of chunked approach for files whose size including the header does not fit in 30 bits.