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.0 is considered different from Nougat 7.1, however.

Android versions are specified using the androidversion array, using the number key to specify which version you are targeting. Any information for a file or app, respectively, can appear under the androidversion option. Anything outside of androidversion options serve as fallbacks for anything not specified under a specific version. This makes it easy to fulfill the requirement for having an androidversion set.

Examples:

TOML:

[[files]]
  name = "emojione"
  url = "https://raw.githubusercontent.com/emojione/emojione/master/extras/fonts/emojione-android.ttf"
  destination = "/system/fonts/NotoColorEmoji.ttf"
  [[files.androidversion]]
    number = "5.1"

JSON:

{
  "files": [
    {
      "name": "emojione",
      "url": "https://raw.githubusercontent.com/emojione/emojione/master/extras/fonts/emojione-android.ttf",
      "destination": "/system/fonts/NotoColorEmoji.ttf",
      "androidversion": [ { "number": "5.1" } ]
    }
  ]
}

You can also specify different information for different versions of Android. An example, this time with nonsense information:

[[files]]
  name = "example-file"
  destination = "/tmp/example.sh"
  [[files.androidversion]]
    number = "5.0"
    url = "https://example.com/download/android/5.0/example_file.sh"
  [[files.androidversion]]
    number = "6.0"
    url = "https://example.com/download/android/6.0/example_file.sh"
  [[files.androidversion]]
    number = "7.0"
    url = "https://example.com/download/android/7.0/example_file.sh"

What is not immediately apparent in the above example is that Android version 5.1 is assumed to use the same file as 5.0, and same for 7.1 with 7.0. If the information for 6.0 were not provided - if only 5.0 and 7.0 were specified - then 6.0 would also use the information from 5.0.

CPU Architectures

Some files are also specific to particular CPU architectures - a common example is the swipe libraries used to enable swipe capabilities on the AOSP keyboard. You can specify architecture-specific information as arch under an androidversion configuration, like below. Valid architectures are arm, arm64, x86, and x86_64.

Example:

[[files]]
  name = "kbdecoder"
  [[files.androidversion]]
    number = "6.0"
    [[files.androidversion.arch]]
        arch = "arm"
        url = "https://raw.githubusercontent.com/opengapps/arm/master/lib/23/libjni_keyboarddecoder.so"
        destination = "/system/lib/libjni_keyboarddecoder.so"
    [[files.androidversion.arch]]
        arch = "arm64"
        url = "https://raw.githubusercontent.com/opengapps/arm64/master/lib64/23/libjni_keyboarddecoder.so"
        destination = "/system/lib64/libjni_keyboarddecoder.so"
    [[files.androidversion.arch]]
        arch = "x86"
        url = "https://raw.githubusercontent.com/opengapps/x86/master/lib/23/libjni_keyboarddecoder.so"
        destination = "/system/lib/libjni_keyboarddecoder.so"
    [[files.androidversion.arch]]
        arch = "x86_64"
        url = "https://raw.githubusercontent.com/opengapps/x86_64/master/lib64/23/libjni_keyboarddecoder.so"
        destination = "/system/lib64/libjni_keyboarddecoder.so"