summaryrefslogtreecommitdiff
path: root/java/builder.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2023-04-17 15:06:56 -0700
committer Cole Faust <colefaust@google.com> 2023-04-25 15:04:58 -0700
commit2f1da168abf133f1bb13febfecb15fe69fbf64de (patch)
tree93ffdfbe72b7382e72ef5ad39c09224db83f8e9f /java/builder.go
parentb611cf424050fbfe36f4e5be2593d6cff36740e5 (diff)
Expand preprocessed flag to work on android_app_imports
Setting the preprocessed flag will now also verify that the apk is zip-aligned and does not have compressed JNI libs or dex files. Bug: 185811447 Test: m nothing Change-Id: I01b7c25f390345b14385f6f9e1640f48a5d9dc93
Diffstat (limited to 'java/builder.go')
-rw-r--r--java/builder.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/java/builder.go b/java/builder.go
index 462626712..0c5773823 100644
--- a/java/builder.go
+++ b/java/builder.go
@@ -246,6 +246,19 @@ var (
CommandDeps: []string{"${config.ZipAlign}"},
},
)
+
+ checkZipAlignment = pctx.AndroidStaticRule("checkzipalign",
+ blueprint.RuleParams{
+ Command: "if ! ${config.ZipAlign} -c -p 4 $in > /dev/null; then " +
+ "echo $in: Improper package alignment >&2; " +
+ "exit 1; " +
+ "else " +
+ "touch $out; " +
+ "fi",
+ CommandDeps: []string{"${config.ZipAlign}"},
+ Description: "Check zip alignment",
+ },
+ )
)
func init() {