Download the latest release from GitLab.

The Problem:

Making flashable zip files for Android devices can be… frustrating.

For those who have never tried, here are some of the more irritating aspects:

  • You use a very limited scripting language called edify to write your install scripts. So limited, that some people replace the binary (update-binary) used to parse the script (updater-script) with a normal shell script that performs the installation instead. What’s the point of having update-binary and updater-script, then?
  • Any app installed to /system/ with bundled libraries in the apk need to have those libraries extracted to be usable.
  • Various system files need to be created to grant certain permissions to apps by default, and you need to know the syntax of each one (usually some dialect of XML).
  • If the correct permissions are not set on an installed file, it can cause the system to bootloop.

The Solution:

I’ve created a program in Go that reads entries from a configuration file and builds a flashable zip for you, while taking care of the implementation for you. The name is simple: zip-builder.

Features:

  • Configuration files can be written in JSON, YAML, or TOML.
  • Automatic generation of updater-script and an addon.d persistence script.
  • Automatically extracts libraries from apps being installed under /system/.
  • Can specify different file or app sources for different versions of Android and/or CPU architectures. updater-script will only install the files for that particular system.
  • Validate downloaded files with md5, sha1, and/or sha256.
  • F-Droid interoperability: Specify the repo URL and app’s package name, and zip-builder automatically gets the rest of the app’s information from F-Droid’s repository, including a download link for the latest version of the app.
  • Remove any files you specify, e.g. apps that you are replacing with your own version or apps/files you just don’t want on your system.
  • Standalone binaries available for Mac OS X, Linux, and Windows. Android binaries (to use in a terminal app) coming soon.

Zip Builder: Intro

Create a file called build.ext where ext is one of json, yml, or toml. In that file, specify any number of apps or files and some information about them, and at least one zip file, though you can specify multiple. This guide uses TOML configurations as examples. For more complete examples, including configurations used to build the zips on the download page, see the GitLab repository. Command-line options: KeyDescriptionExample destination Destination folder to place the built zip files. [Read more...]

Zip Builder Config: Android Versions and CPU Architectures

Android Versions Files and apps require specifying a minimum Android version that the file or app is compatible with. It is assumed that the app or file supports any newer Android version as well, up to the next Android version specified. Android versions are specified using the first two numbers of their version number. For instance, Android Marshmallow would be specified as version 6.0, not the 6.0.1 bugfix release. Android Nougat 7. [Read more...]

Zip Builder Config: Files

A “file” is anything that you install to the file system of an Android device. While keeping in mind that all apps are files, any non-app file should be labeled a “file” while apps are labeled “app”. Basic Config # Replace [[files]] name = "example_file" url = "https://example.com/files/Example.ttf" destination = "/system/fonts/Example.ttf" [[files.androidversion]] number = "5.1" All File Parameters KeyDescriptionExample name Required. A unique identifier not used by other files. [Read more...]

Zip Builder Config: Apps

The Apps All apps are files and use the same key/value pairs as files plus the ones below. All required keys for a file apply to apps as well, plus any keys required specifically for apps. All App Parameters KeyDescriptionExample package_name Required. The package name of the app. "org.mozilla.firefox" is_fdroid_repo If the app’s URL is actually the root of an F-Droid repo where the app is hosted. [Read more...]

Zip Builder Config: Zips

The Zips Zips are the containers that hold everything you are installing. As such, most of the heavy configuration is found in the apps and files you are installing, though you can still specify a few things here: KeyDescriptionExample name Required. A unique identifier that will serve as the filename of the zip. If omitted or commented out, the zip will not be built. install-zip remove_files A list (array) of paths to delete when this zip is installed and when the system is updated. [Read more...]