OSDN Git Service

Fix bug in APK entry alignment.
authorAlex Klyubin <klyubin@google.com>
Wed, 23 Mar 2016 20:05:27 +0000 (13:05 -0700)
committerAlex Klyubin <klyubin@google.com>
Wed, 23 Mar 2016 20:09:42 +0000 (13:09 -0700)
commit37a0ecd32935685151f0cfb5a5466e6e360a0b8f
treee242450d66921aa008e00c0b933bb9a90ffd8dcb
parent37aa85e8bb0d86cae946d85a27b6ded593c425b7
Fix bug in APK entry alignment.

APK entry alignment logic assumes that input entries have zero-length
comment and extra fields. When the assumption is broken, the logic
silently breaks alignment of output entries. This happens, for
example, when the APK to be signed is already aligned and thus may
contain entries with non-empty extra fields.

Given that APKs are not supposed to use comment and extra fields for
anything useful and given that this signer already discards comment
and extra fields of compressed entries, this change makes the signer
discard comment and extra fields of STORED input entries as well.
This unbreaks the existing alignment logic.

Bug: 27814973
Change-Id: I8242b037e21ba7bcf45d0fe2afc8bfc47f1ec314
tools/signapk/src/com/android/signapk/SignApk.java