首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

Android Tools研究研讨一:zipalign

2013-01-26 
Android Tools研究探讨一:zipalignThe adjustment is made by altering the size of the extra field in

Android Tools研究探讨一:zipalign

The adjustment is made by altering the size of the "extra" field in the zip Local File Header sections. Existing data in the "extra" fields may be altered by this process.

For more information about how to use zipalign when building your application, please read?Signing Your Application.

Usage

To align?infile.apk?and save it as?outfile.apk:

zipalign [-f][-v]<alignment> infile.apk outfile.apk

To confirm the alignment of?existing.apk:

zipalign -c -v <alignment> existing.apk

The?<alignment>?is an integer that defines the byte-alignment boundaries. This must always be 4 (which provides 32-bit alignment) or else it effectively does nothing.

Flags:

  • -f?: overwrite existing outfile.zip
  • -v?: verbose output
  • -c?: confirm the alignment of the given file

    ?

    刚认真研究发现一点:

    When using Eclipse with the ADT plugin, the Export Wizard will automatically zipalign your .apk after it signs it with your private key.

    也就是说用eclipse export打包的apk是已经zipalign过的了

    所以这东东是不是有点鸡肋呢。。。

    ?

热点排行