|
| 1 | +# Updating native binaries (aria2, proot, tar, …) |
| 2 | + |
| 3 | +The pinned native binaries are defined by **three** files that must always stay in sync. |
| 4 | +Update them **together, in the same commit** whenever you bump to a new binaries release. |
| 5 | + |
| 6 | +| File | Role | |
| 7 | +|------|------| |
| 8 | +| `controller/binary_version.txt` | The pinned release tag (e.g. `binaries-2026-07-05_05-38`). | |
| 9 | +| `controller/app/src/main/assets/ninja_manifest.json` | Expected SHA256 of every binary for that tag. The build audits against this. | |
| 10 | +| `controller/app/src/main/assets/cacert.pem` | CA bundle shipped with the release (update only if it changed). | |
| 11 | + |
| 12 | +## How to bump |
| 13 | + |
| 14 | +1. Set the new tag in `controller/binary_version.txt`. |
| 15 | +2. Run the sync so the manifest (and cacert) come from that exact release: |
| 16 | + ```bash |
| 17 | + cd controller && ./gradlew :app:syncNativeArtifacts |
| 18 | + ``` |
| 19 | +3. Commit the three files together: |
| 20 | + ```bash |
| 21 | + git add controller/binary_version.txt \ |
| 22 | + controller/app/src/main/assets/ninja_manifest.json \ |
| 23 | + controller/app/src/main/assets/cacert.pem |
| 24 | + git commit -m "chore: bump native binaries to <tag>" |
| 25 | + ``` |
| 26 | + |
| 27 | +## Why (background) |
| 28 | + |
| 29 | +`ninja_manifest.json` is the integrity source of truth and is **version-controlled on purpose** |
| 30 | +(supply-chain traceability). If `binary_version.txt` moves without the manifest, the on-disk |
| 31 | +binaries (gitignored) no longer match the committed manifest, and the SHA256 audit in |
| 32 | +`syncNativeArtifacts` fails on the next build (first offender is usually `libaria2c.so`), |
| 33 | +forcing a re-download. PR #150 bumped only `binary_version.txt`; this is the miss this doc |
| 34 | +prevents. The CI check `binary-bump-consistency` enforces it. |
0 commit comments