Skip to content

A standalone apk/zip align library adapted from the Android SDK with zlib as the only external dependency

Notifications You must be signed in to change notification settings

animehunter/android-lib-zipalign

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A standalone apk/zip align library

... adapted from the Android SDK with zlib as the only external dependency

What is zipalign? see http://developer.android.com/tools/help/zipalign.html

Dependencies

  • Zlib (>= 1.2.3)

API

Unless specified, all functions below return 1 on success and 0 on failure.

int zipalign(const char *in_filename, const char *out_filename, int alignment, int force);
  • in_filename: the input zip/apk filename
  • out_filename: the output zip/apk filename
  • alignment: alignment in bytes, for example, 4 provides 32-bit alignment
  • force: if 1 is given and the target file exists, overwrite it. Use 0 if you do not wish to overwrite the target.
int zipalign_is_aligned(const char *filename, int alignment);
  • filename: the filename to check for alignment
  • alignment: alignment in bytes, for example, 4 provides 32-bit alignment

Build

CMake

$ mkdir -p build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
$ make
$ make install

Some useful CMake flags:

Flag Description Choices Default
CMAKE_BUILD_TYPE Chooses between build types -/Debug/Release -
CMAKE_INSTALL_PREFIX Installation path - -

Visual Studio 2010+

Open the solution file and click on build. Note: The Visual Studio project file is currently unavailable.

Platforms supported

  • Windows XP+
  • Linux (Not Tested, but should work)
  • Android (Not Tested, but should work)
  • Mac OS X (???)

License

  • Apache 2.0

If there are any errors in this document, please submit a pull request.

About

A standalone apk/zip align library adapted from the Android SDK with zlib as the only external dependency

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published