最終更新:2016-06-03 (金) 17:19:33 (2876d)  

zipalign
Top / zipalign

zip archive alignment tool

  • The purpose of zipalign is to ensure that all uncompressed data starts with a particular alignment relative to the start of the file. This allows those portions to be accessed directly with mmap() even if they contain binary data with alignment restrictions.

概要

  • zipalign はアーカイブを整列するツールで、Android アプリケーション ( .apk ) で重要な最適化を提供します。すべての未圧縮データが、ファイルの開始位置から相対的な特定の位置合わせで始まることを保証することがこのツールの目的です。具体的には、.apk 内のイメージや生のファイルといった未圧縮データを 4 バイトバウンダリに整列させるようにします。これにより位置合わせの制限があるバイナリデータを含んでいたとしても、すべての位置に対して mmap() を使用したダイレクトアクセスが可能となるのです。これによりアプリケーション実行時の RAM の総使用量を減らすことができるというメリットがあります。

使い方

  • Zip alignment utility
    Copyright (C) 2009 The Android Open Source Project
    
    Usage: zipalign [-f] [-p] [-v] [-z] <align> infile.zip outfile.zip
           zipalign -c [-v] <align> infile.zip
    
      <align>: alignment in bytes, e.g. '4' provides 32-bit alignment
      -c: check alignment only (does not modify file)
      -f: overwrite existing outfile.zip
      -p: page align stored shared object files
      -v: verbose output
      -z: recompress using Zopfli

メモ

  • 整列済みのパッケージに変更を加えないでください
  • エクスポートウィザードが自動的でプライベートキーで署名が終わった .apkzipalignを実行します
  • .apkファイルがプライベートキーで署名された 後 でのみ、実行される必要があります

参考

場所

ソースコード

  • AOSP/build/tools/zipalign?

関連