You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
file.seek(0);
if (neededAlignments.size() == 0) {
// there is no needed alignment, stream it all!
byte[] buffer = new byte[8192];
while (file.read(buffer) != -1) out.write(buffer);
return;
}
should be:
file.seek(0);
if (neededAlignments.size() == 0) {
// there is no needed alignment, stream it all!
byte[] buffer = new byte[8192];
int len;
while (-1 != (len = file.read(buffer))){
out.write(buffer, 0, len);
}
return;
}
Original code would write extra data at the end in the most cases, except when file_size % 8192 == 0, which would cause apksigner to fail with Malformed APK: not a ZIP archive
The text was updated successfully, but these errors were encountered:
You're welcome. I think it is easier if you fix it directly in the code. If you prefer that I do PR, I can do it, but it is such a minor fix that it is not even worth considering it as a contribution 😃
Error is in the code here:
should be:
Original code would write extra data at the end in the most cases, except when
file_size % 8192 == 0
, which would cause apksigner to fail with Malformed APK: not a ZIP archiveThe text was updated successfully, but these errors were encountered: