ColdWindScholar / MIO-KITCHEN-SOURCE

An Android Rom Tool in python
GNU Affero General Public License v3.0
41 stars 15 forks source link

[BugFix] [Tool] Fix Unpack UI freezes on some zero filled files #82

Closed yui-onanii closed 2 months ago

yui-onanii commented 2 months ago

the first 4096 bytes in a super.img is always reserved according to liblp code, the next 4096 contains primary geometry and start with the magic, for example lpunpack refuse to run if it can't find the magic at offset 4096.

a tar consists of 512 bytes zero padded blocks, somehow, a fully zero filled file could be a semantically valid TAR archive (WHAT), avoid using tarfile.is_tarfile() for these files bcs its very slow if the file is large.

yui-onanii commented 2 months ago

our tester on Windows says this helps with the probem yay