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

关于zipalign和安装包体积该选哪个? #300

Closed
ryanlijianchang opened this issue Dec 13, 2018 · 1 comment
Closed

关于zipalign和安装包体积该选哪个? #300

ryanlijianchang opened this issue Dec 13, 2018 · 1 comment

Comments

@ryanlijianchang
Copy link

我想说下为什么安卓默认png等资源不压缩打包,首先在zipalign的源码里面有句判断代码,如果资源被压缩过,就跳过,否则进行4k对齐。另外在aapt(印象中应该是)的源码中,定义了个字符串数组,用于存放那些不需要压缩的文件类型后缀,谷歌这么做自然有它的用意。如果图片都压缩了,zipalign就等于完全没用,zipalign就是为了资源文件能映射到内存中,如果压缩过就没法直接映射了。最后关于zipalign和安装包体积该选哪个我也不好说。

@simpleton
Copy link
Collaborator

这取决于你的需求,google假设所有app都要经过google play分发,但这在国内显然不是实际情况。可以参考一下这个issue中的讨论 #233

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants