From f343872a8d2bdca768c32326aa3c56db2e6dd210 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 23 Jan 2019 15:57:21 +0000 Subject: [PATCH] Align jar file after calling merge-zips when dex is uncompressed. Noticed this while changing a some dex build rules. Test: m Change-Id: I9838e81e0e98be49d34554041a5a942b64259aaa --- java/java.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/java/java.go b/java/java.go index 89b09d10b..a76cde54f 100644 --- a/java/java.go +++ b/java/java.go @@ -1244,7 +1244,13 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path combinedJar := android.PathForModuleOut(ctx, "dex-withres", jarName) TransformJarsToJar(ctx, combinedJar, "for dex resources", jars, android.OptionalPath{}, false, nil, nil) - dexOutputFile = combinedJar + if j.deviceProperties.UncompressDex { + combinedAlignedJar := android.PathForModuleOut(ctx, "dex-withres-aligned", jarName) + TransformZipAlign(ctx, combinedAlignedJar, combinedJar) + dexOutputFile = combinedAlignedJar + } else { + dexOutputFile = combinedJar + } } j.dexJarFile = dexOutputFile