From 1c027f395ef777d099155c0142dd7eff1b7c2f2c Mon Sep 17 00:00:00 2001 From: wmdngngng Date: Thu, 23 Sep 2021 15:34:59 +0000 Subject: [PATCH] cmd/gomobile: fix header padding computation in apk generation fix file data align to 4 Change-Id: Ie88c46521e216b3f83a8dc3495591cd19bce83c6 GitHub-Last-Rev: aebf3cd7ff0d77050659e9269f7eddaeff364eff GitHub-Pull-Request: golang/mobile#73 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/351789 Reviewed-by: Hyang-Ah Hana Kim Reviewed-by: Hajime Hoshi Trust: Hyang-Ah Hana Kim Run-TryBot: Hyang-Ah Hana Kim TryBot-Result: Go Bot --- cmd/gomobile/writer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/gomobile/writer.go b/cmd/gomobile/writer.go index 0f3c29b..8801041 100644 --- a/cmd/gomobile/writer.go +++ b/cmd/gomobile/writer.go @@ -115,7 +115,7 @@ func (w *Writer) create(name string) (io.Writer, error) { } const fileHeaderLen = 30 // + filename + extra start := w.offset + fileHeaderLen + len(name) - extra := start % 4 + extra := (-start) & 3 zipfw, err := w.w.CreateHeader(&zip.FileHeader{ Name: name,