Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #12 from reinerh/master
Browse files Browse the repository at this point in the history
Write reproducible zip archives
  • Loading branch information
Storyyeller committed Nov 12, 2015
2 parents ff815da + 2479c30 commit bd05f5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions enjarify/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ def translate(data, opts, classes=None, errors=None):

def writeToJar(fname, classes):
with zipfile.ZipFile(fname, 'w') as out:
for unicode_name, data in classes.items():
for unicode_name, data in sorted(classes.items()):
# Don't bother compressing small files
compress_type = zipfile.ZIP_DEFLATED if len(data) > 10000 else zipfile.ZIP_STORED
out.writestr(unicode_name, data, compress_type=compress_type)
out.writestr(zipfile.ZipInfo(unicode_name), data, compress_type=compress_type)

def main():
parser = argparse.ArgumentParser(prog='enjarify', description='Translates Dalvik bytecode (.dex or .apk) to Java bytecode (.jar)')
Expand Down

0 comments on commit bd05f5c

Please sign in to comment.