Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APK /sign/file can output unaligned ZIPs #154

Closed
g-k opened this issue Oct 9, 2018 · 2 comments
Closed

APK /sign/file can output unaligned ZIPs #154

g-k opened this issue Oct 9, 2018 · 2 comments
Labels

Comments

@g-k
Copy link
Contributor

g-k commented Oct 9, 2018

Summary of discussion from #148 (review) and our IRC channel.

The problem:

  • some APKs contain uncompressed media files, our JAR repacking (and go zipalign) compresses everything. This can break loading those files.
  • APK: add ZIP packing strategy #153 adds an option to not compress everything. However, the resulting ZIPs are still misaligned since it copies everything over

Possible solutions:

  • fix our alignment algorithm (see APK dont compress media #148 (comment))
  • don't align ZIPs in autograph; have callers run C++ zipalign
    • if callers zipalign after signing, this modifies the resulting file hashes which makes auditing usage of the resulting APKs harder
    • if callers zipalign before signing i.e. we only accept pre-aligned ZIPs and append signature files (compressed so alignment isn't affected), we still need to work around the golang stdlib not supporting appending to ZIPs
  • switch to /sign/hash provide gradle plugin for gpg and apk signing #149 to avoid the issue. This is also 1) the most forward facing (i.e. can add support for more signing algs), 2) avoids sending the whole APK over the wire, and 3) provides nicer tooling for our Android devs
@g-k g-k added the bug label Oct 9, 2018
@g-k
Copy link
Contributor Author

g-k commented Oct 16, 2018

@g-k
Copy link
Contributor Author

g-k commented Nov 14, 2018

Autograph should focus on signing, so we'll have clients run zipalign after signing (see also #149), deprecate the compress all and zip alignment with the goal of removing them eventually.

@g-k g-k closed this as completed Nov 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant