Closed klecko closed 8 months ago
🤦 thanks for the catch there. I will merge this shortly after.
What do you think of adding tests to prevent things like this? But, I don't feel like including test zip files into the repo would be a great idea, they'd make cloning slower.
Moved the above question to #10
The variable
shiftAmount
is a short. Previously, it was a sum of values between 1 andalignment
, which was usually 4. However, with .so aligning, it is now a sum between 1 and 4096, which is very easy to overflow, resulting in a corrupted ZIP file. I have attached a small zip with dummy .so files, that when zipaligned it results in an invalid ZIP file. I have also found this issue in real apks. UpgradingshiftAmount
to an int solves the issue.