summaryrefslogtreecommitdiff
path: root/apexer/apexer.py
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2018-09-11 11:00:26 +0200
committerMartijn Coenen <maco@google.com>2018-09-11 11:00:26 +0200
commit09c106c7df5bd9ef9dce6df735ef06915475f8ee (patch)
tree81de4d5c857dfbd39c210a639175a323333f950f /apexer/apexer.py
parenta51530715ff3e8959c20b4e7d414c42e23f33526 (diff)
Don't deflate any input files.
Even when passing '-L 0' to soong_zip, it can still decide to store files as deflated (but without any actual compression). This in turn throws off the zipalign tool, which doesn't align any compressed files, eg: $ zipalign -v -c 4096 apex.zip Verifying alignment of apex.zip (4096)... 39 image.img (OK - compressed) Instead, use the '-s' argument for soong_zip, to make sure the files get stored without any compression. This issue wasn't triggered earlier because deflation isn't used for small files. Test: tests pass, lare Change-Id: Ic71aa70af09b6b54621bd2d3de721237112a1add
Diffstat (limited to 'apexer/apexer.py')
-rw-r--r--apexer/apexer.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/apexer/apexer.py b/apexer/apexer.py
index c7c81c9..3032535 100644
--- a/apexer/apexer.py
+++ b/apexer/apexer.py
@@ -253,7 +253,9 @@ def CreateApex(args, work_dir):
cmd.append('-d') # include directories
cmd.extend(['-C', content_dir]) # relative root
cmd.extend(['-D', content_dir]) # input dir
- cmd.extend(['-L', '0']) # don't compress
+ for file_ in os.listdir(content_dir):
+ if os.path.isfile(os.path.join(content_dir, file_)):
+ cmd.extend(['-s', file_]) # don't compress any files
cmd.extend(['-o', zip_file])
RunCommand(cmd, args.verbose)