Autobuild for OrangeFoxRP
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
cloudy d3f151a84d docs: add readme with usage and config reference
Signed-off-by: cloudy <cloudy.nguyn@outlook.com>
2026-07-19 14:46:29 +07:00
example_vayu.json chore: support per-device json configs (<codename>.json) 2026-07-19 14:45:30 +07:00
LICENSE chore: initialize LICENSE file⁠ 2026-07-19 02:22:07 +07:00
ofox-build.sh build: add auto-build script for OrangeFox with json config 2026-07-19 14:44:07 +07:00
README.md docs: add readme with usage and config reference 2026-07-19 14:46:29 +07:00

ofox-build

Simple bash script to auto-build OrangeFox Recovery for any device. No more typing the same sync/lunch/mka commands every time — everything lives in a json config, one file per device.

Requirements

  • Linux (Ubuntu 20.04+ recommended, or any distro that can build AOSP)
  • Standard AOSP build dependencies + repo tool
  • jq and git
sudo apt install jq git

For the full AOSP deps, check the OrangeFox wiki.

Setup

  1. Clone/download this repo
  2. Create a json config for your device (see below), e.g. vayu.json
  3. Run it:
chmod +x ofox-build.sh
./ofox-build.sh vayu.json

If you only have one .json in the dir, you can just run ./ofox-build.sh and it will pick it up.

Usage

./ofox-build.sh [config.json]     full run: sync + clone tree + build
./ofox-build.sh -s [config.json]  sync fox sources only
./ofox-build.sh -c [config.json]  clone/update device tree only
./ofox-build.sh -b [config.json]  build only
./ofox-build.sh -h                help

First run takes a long time (syncing sources is ~40GB+). After that, -b alone is usually enough.

Config format

One json per device, named whatever you want (<codename>.json is a good habit):

{
  "fox": {
    "branch": "12.1",
    "sync_dir": "~/OrangeFox_sync",
    "build_dir": "~/fox_12.1"
  },
  "device": {
    "codename": "vayu",
    "vendor": "xiaomi",
    "tree_repo": "https://github.com/example/android_device_xiaomi_vayu.git",
    "tree_branch": "fox_12.1",
    "recovery_image": "vendor_boot"
  },
  "build": {
    "target": "recoveryimage",
    "jobs": 0,
    "ccache": true,
    "ccache_size": "50G",
    "clean_before_build": false
  },
  "env": {
    "ALLOW_MISSING_DEPENDENCIES": "true",
    "FOX_USE_BASH_SHELL": "1",
    "FOX_ASH_IS_BASH": "1",
    "FOX_USE_NANO_EDITOR": "1",
    "OF_MAINTAINER": "your_name"
  }
}

Fields

key what it does
fox.branch OrangeFox source branch (12.1, 11.0, ...)
fox.sync_dir where the fox sync scripts get cloned
fox.build_dir where the actual sources + build happen
device.codename your device codename, used for lunch twrp_<codename>-eng
device.vendor vendor name, tree goes to device/<vendor>/<codename>
device.tree_repo git url of your device tree
device.tree_branch branch of the tree (default: main)
build.target recoveryimage, bootimage or vendorbootimage depending on your device
build.jobs build threads, 0 = all cores
build.ccache use ccache (recommended, big speedup on rebuilds)
build.clean_before_build run make clean first
env any extra vars exported before building — put your OF_* / FOX_* flags here

Output

After a successful build, images/zips land in:

<build_dir>/out/target/product/<codename>/

Notes

  • The script tries lunch twrp_<codename>-eng first, then falls back to omni_<codename>-eng for older trees. If both fail, check your tree's makefile name.
  • If your device boots recovery from vendor_boot (most newer devices), set build.target to vendorbootimage.
  • Multiple devices? Just keep multiple configs: vayu.json, alioth.json, ... and pass the one you want.

License

MIT