Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/native-source-libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,19 @@ jobs:
python-version: "3.11"

- name: Build Termux native runtime packages from source
run: bash scripts/build_android_runtime_native_debs.sh --setup --output-dir build/termux-debs
run: |
set -o pipefail
mkdir -p build
bash scripts/build_android_runtime_native_debs.sh --setup --output-dir build/termux-debs \
2>&1 | tee build/termux-build.log

# The script overrides the pinned commit's proot recipe with the lock-pinned 5.1.107.96 and
# adds the seccomp fork patch; fail if either did not take effect for both architectures.
- name: Verify the proot recipe override and fork patch
run: |
set -euo pipefail
test "$(ls build/termux-debs/*/proot_5.1.107.96_*.deb | wc -l)" -eq 2
test "$(grep -c 'Applying patch: proot-seccomp-fork-as-clone.patch' build/termux-build.log)" -eq 2

- name: Materialize native libraries from the source-built packages
run: |
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ jobs:
path: |
build/generated/runtime-assets
build/generated/runtime-jni
key: and-code-runtime-${{ runner.os }}-${{ hashFiles('runtime_tools/termux_assets.lock.json', 'runtime_tools/termux_assets.py', 'scripts/prepare_android_runtime_*.py') }}
# Separate key from the mirror-derived cache used by CI: this job generates the runtime
# assets from the source-built .deb files (see the build step below), and the source
# recipes/script are part of the key so a cached mirror-derived payload is never reused.
key: and-code-runtime-source-${{ runner.os }}-${{ hashFiles('runtime_tools/termux_assets.lock.json', 'runtime_tools/termux_assets.py', 'scripts/prepare_android_runtime_*.py', 'scripts/build_android_runtime_native_debs.sh', 'runtime_tools/termux-packaging-recipes/**') }}

- name: Decode release keystore
env:
Expand Down Expand Up @@ -80,19 +83,20 @@ jobs:
if [ -z "$GITHUB_CLIENT_ID" ]; then
echo "::warning::AND_CODE_GITHUB_CLIENT_ID repo variable is not set - the published APK will have no GitHub sign-in"
fi
./gradlew detekt spotlessCheck :app:lintGithubDebug :app:testGithubDebugUnitTest assembleGithubDebug assembleGithubRelease
# The native runtime payload (proot, libtalloc, libandroid-shmem) is compiled first from
# the pinned Termux recipes with the NDK, so the github APKs carry the source-built proot
# (including the seccomp fork fix in runtime_tools/termux-packaging-recipes/) instead of
# the Termux mirror prebuilts. This must match the fdroiddata recipe
# (srclibs: TermuxPackages@<commit>, ndk: r29).
bash scripts/build_android_runtime_native_debs.sh --setup --output-dir build/termux-debs
./gradlew detekt spotlessCheck :app:lintGithubDebug :app:testGithubDebugUnitTest \
-Pandcode.sourceNativeLibs=true assembleGithubDebug assembleGithubRelease
# Separate invocation, deliberately without GITHUB_CLIENT_ID: this is the same flavor and
# signing config F-Droid's own build server produces (gradleprops: andcode.fdroidBuild=true,
# no client ID), so this asset is what fdroiddata's Binaries:/AllowedAPKSigningKeys: verify
# a reproducible build against - it must be built exactly the way F-Droid builds it.
# GITHUB_CLIENT_ID is set at step level above, so it must be unset here explicitly:
# otherwise it is baked into BuildConfig and classes.dex no longer matches F-Droid's.
#
# The fdroid APK is built the way F-Droid's build server builds it, including the
# native runtime payload: proot, libtalloc and libandroid-shmem are compiled from
# the pinned Termux recipes with the NDK here so no prebuilt binary is downloaded.
# This must match the fdroiddata recipe (srclibs: TermuxPackages@<commit>, ndk: r29).
bash scripts/build_android_runtime_native_debs.sh --setup --output-dir build/termux-debs
env -u GITHUB_CLIENT_ID ./gradlew -Pandcode.fdroidBuild=true -Pandcode.sourceNativeLibs=true :app:assembleFdroidRelease

- name: Resolve tag
Expand Down
28 changes: 19 additions & 9 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,22 @@ source code.** See [TRADEMARKS.md](TRADEMARKS.md) for trademark notices.

## Bundled native runtime components (PRoot / Termux-derived)

These binaries reach the APK one of two ways. The **github** flavor downloads them from the official
Termux package mirror at build time (pinned by package version and SHA-256 hash of the compiled
`.deb` in [`runtime_tools/termux_assets.lock.json`](runtime_tools/termux_assets.lock.json)). The
**fdroid** flavor compiles the same three Termux packages from source with the Android NDK, from the
pinned `termux-packages` commit declared by the fdroiddata recipe's `srclibs:` (`TermuxPackages`).
Either way they are packaged into the APK so the on-device Linux runtime can start, and AndCode does
not patch or modify these packages beyond what Termux's own packaging performs. **Full license text
Release APKs (both the **github** and **fdroid** flavors) build these three packages from source with the
Android NDK r29, using the pinned Termux package recipes: `proot`, `libtalloc` and `libandroid-shmem`
are compiled from the `termux-packages` commit pinned in
[`scripts/build_android_runtime_native_debs.sh`](scripts/build_android_runtime_native_debs.sh). The
`proot` recipe is overridden to the 5.1.107.96 build in
[`runtime_tools/termux-packaging-recipes/proot.build.sh`](runtime_tools/termux-packaging-recipes/proot.build.sh).
Local and CI developer builds instead download the prebuilt packages from the official Termux package
mirror, pinned by package version and SHA-256 hash of the compiled `.deb` in
[`runtime_tools/termux_assets.lock.json`](runtime_tools/termux_assets.lock.json). Either way they are
packaged into the APK so the on-device Linux runtime can start. AndCode applies one modification to
`proot`: [`proot-seccomp-fork-as-clone.patch`](runtime_tools/termux-packaging-recipes/proot-seccomp-fork-as-clone.patch),
which makes PRoot run `fork(2)` as `clone(SIGCHLD)` when Android's app seccomp policy rejects `fork`
(needed on x86_64, where musl calls `SYS_fork` directly). It is proposed upstream as
[termux/proot#415](https://github.com/termux/proot/pull/415). This paragraph is the GPL-2.0 §2(a)
notice of that modification for the `proot` binary. Packages other than `proot` are not modified
beyond Termux's own packaging. **Full license text
for each of GPL-2.0, GPL-3.0 (which LGPL-3.0 incorporates by reference), LGPL-3.0, and the
BSD-3-Clause text used by `libandroid-shmem` is bundled verbatim, unmodified, in
[`THIRD_PARTY_LICENSES/`](THIRD_PARTY_LICENSES/) in this repository and at
Expand All @@ -25,8 +34,9 @@ BSD-3-Clause text used by `libandroid-shmem` is bundled verbatim, unmodified, in
| `libandroid-shmem` | 0.7 | [BSD-3-Clause](THIRD_PARTY_LICENSES/BSD-3-Clause-libandroid-shmem.txt), per [`TERMUX_PKG_LICENSE`](runtime_tools/termux-packaging-recipes/libandroid-shmem.build.sh) and the project's own `LICENSE` file | Copyright (c) 2013 Sergii Pylypenko; Copyright (c) 2017 Fredrik Fornwall | Upstream source archive `v0.7.tar.gz`, SHA-256 `1e5ff8459bc0a8c229dd8a94b27d119987e09ef3414331c2b5ebfff20b98e867` (from [github.com/termux/libandroid-shmem](https://github.com/termux/libandroid-shmem/archive/refs/tags/v0.7.tar.gz), tagged release, not `master`) |
| `libtalloc` | 2.5.0 | [LGPL-3.0-or-later](THIRD_PARTY_LICENSES/LGPL-3.0.txt) for the actual runtime library. Termux's own packaging metadata tags the *package* `GPL-3.0` (a coarser, package-level tag), but the shared library source itself (`talloc.c`/`talloc.h`, the only files that become `libtalloc.a`/`libtalloc.so`) carries its own header: *"the following LGPL license applies to the talloc library. This does NOT imply that all of Samba is released under the LGPL"* — version 3 or later. Resolved; no longer `REQUIRES_LICENSE_REVIEW`. | Copyright (C) Andrew Tridgell 2004; Copyright (C) Stefan Metzmacher 2006 | Upstream source archive `talloc-2.5.0.tar.gz`, SHA-256 `912afa237510ae542a7733998eb18a12bcda35ab6729c8e2ddb43e8d0ebab007` (from [samba.org/ftp/talloc](https://www.samba.org/ftp/talloc/talloc-2.5.0.tar.gz), versioned release path, not a mutable branch) |

The fdroid flavor compiles all three from the pinned `TermuxPackages` commit, which can lag the
mirror by a version or two (currently `proot` 5.1.107.94, `libtalloc` 2.4.3, `libandroid-shmem` 0.7).
The source build compiles `libtalloc` and `libandroid-shmem` from the pinned `TermuxPackages` commit,
which can lag the mirror by a version or two (currently `libtalloc` 2.4.3, `libandroid-shmem` 0.7).
Its `proot` recipe is overridden to 5.1.107.96 as described above.

**Packaging recipes, mirrored (not just linked):** the exact `TERMUX_PKG_*` build recipe used for
each package above — the thing that actually produces the `.deb` pinned by hash in
Expand Down
2 changes: 1 addition & 1 deletion THIRD_PARTY_SERVICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Claude Code, Antigravity, and OpenCode specifically.
| **MCP servers you configure** | Optional tool/context servers you add for an agent to call | Depends on the server (local command or remote URL you provide) | The agent CLI connects to the server you configured | Any server credentials go wherever you configure them (e.g., server-side env vars); AndCode does not manage server-side secrets | No | Whichever terms the specific MCP server operator sets | Remove the server in **Settings → MCP** | Third-party servers you choose to add; not affiliated with AndCode |
| **Alpine Linux** (`dl-cdn.alpinelinux.org`) | Minimal Linux root filesystem the on-device runtime runs in | N/A (unauthenticated download) | The app downloads the official Alpine minirootfs archive over HTTPS | N/A | No | [Alpine Linux license terms](https://alpinelinux.org/) (per-package) | Delete the local runtime | Independent open-source project |
| **Debian** (`deb.debian.org`, `security.debian.org`) | Bookworm root filesystem used only for the glibc-dependent Antigravity CLI | N/A (unauthenticated `apt` mirrors) | `apt` inside the Debian rootfs fetches packages over the configured mirrors | N/A | No | [Debian's licenses](https://www.debian.org/legal/) (per-package) | Delete the local runtime | Independent open-source project |
| **Termux package mirror** (`packages.termux.dev`) | Source of the `proot`, `libandroid-shmem`, and `libtalloc` binaries bundled into the APK at build time | N/A (build-time download, pinned by hash) | Build machine only, not the end-user's device at runtime | N/A | No | Upstream licenses vary — see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) | N/A (bundled at build time) | Independent open-source project |
| **Termux package sources** (`github.com/termux/termux-packages`, and the `packages.termux.dev` mirror for local/CI dev builds) | Build recipes and source for the `proot`, `libandroid-shmem`, and `libtalloc` binaries bundled into the APK at build time (release APKs build them from source; dev builds download prebuilt packages) | N/A (build-time fetch; source pinned by commit, dev-build packages pinned by hash) | Build machine only, not the end-user's device at runtime | N/A | No | Upstream licenses vary — see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) | N/A (bundled at build time) | Independent open-source project |
| **Firebase Crashlytics** (Google) | Crash and non-fatal error reporting in release builds | N/A (app-level Firebase project, no end-user login) | The app sends crash reports and small diagnostic breadcrumbs directly to Firebase; custom log lines/keys AndCode's own code adds are redacted on a best-effort basis (see PRIVACY.md §7), but automatic fatal-crash collection by the Crashlytics SDK itself is not routed through that redaction | N/A (no user credential; app-level Firebase config) | This *is* a Google-operated collection service, not an AndCode server | [Firebase Terms of Service](https://firebase.google.com/terms) / [Google Privacy Policy](https://policies.google.com/privacy) | Disabled automatically in debug builds; release collection follows the app's diagnostics policy | Independent Google service; not affiliated with the AI-agent integrations above |
| **Firebase Analytics** (Google) | Opt-in anonymous app-open/session and runtime outcome metrics | N/A (app-level Firebase project, no end-user login) | The Firebase SDK sends telemetry directly to Firebase; AndCode excludes prompts, code, responses, tokens, and workspace paths | N/A (no user credential; app-level Firebase config) | This *is* a Google-operated collection service, not an AndCode server | [Firebase Terms of Service](https://firebase.google.com/terms) / [Google Privacy Policy](https://policies.google.com/privacy) | Disabled by default; enable or withdraw consent in Settings | Independent Google service; not affiliated with the AI-agent integrations above |

Expand Down
28 changes: 19 additions & 9 deletions app/src/main/assets/legal/oss_licenses.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,22 @@ source code.** See [TRADEMARKS.md](TRADEMARKS.md) for trademark notices.

## Bundled native runtime components (PRoot / Termux-derived)

These binaries reach the APK one of two ways. The **github** flavor downloads them from the official
Termux package mirror at build time (pinned by package version and SHA-256 hash of the compiled
`.deb` in [`runtime_tools/termux_assets.lock.json`](runtime_tools/termux_assets.lock.json)). The
**fdroid** flavor compiles the same three Termux packages from source with the Android NDK, from the
pinned `termux-packages` commit declared by the fdroiddata recipe's `srclibs:` (`TermuxPackages`).
Either way they are packaged into the APK so the on-device Linux runtime can start, and AndCode does
not patch or modify these packages beyond what Termux's own packaging performs. **Full license text
Release APKs (both the **github** and **fdroid** flavors) build these three packages from source with the
Android NDK r29, using the pinned Termux package recipes: `proot`, `libtalloc` and `libandroid-shmem`
are compiled from the `termux-packages` commit pinned in
[`scripts/build_android_runtime_native_debs.sh`](scripts/build_android_runtime_native_debs.sh). The
`proot` recipe is overridden to the 5.1.107.96 build in
[`runtime_tools/termux-packaging-recipes/proot.build.sh`](runtime_tools/termux-packaging-recipes/proot.build.sh).
Local and CI developer builds instead download the prebuilt packages from the official Termux package
mirror, pinned by package version and SHA-256 hash of the compiled `.deb` in
[`runtime_tools/termux_assets.lock.json`](runtime_tools/termux_assets.lock.json). Either way they are
packaged into the APK so the on-device Linux runtime can start. AndCode applies one modification to
`proot`: [`proot-seccomp-fork-as-clone.patch`](runtime_tools/termux-packaging-recipes/proot-seccomp-fork-as-clone.patch),
which makes PRoot run `fork(2)` as `clone(SIGCHLD)` when Android's app seccomp policy rejects `fork`
(needed on x86_64, where musl calls `SYS_fork` directly). It is proposed upstream as
[termux/proot#415](https://github.com/termux/proot/pull/415). This paragraph is the GPL-2.0 §2(a)
notice of that modification for the `proot` binary. Packages other than `proot` are not modified
beyond Termux's own packaging. **Full license text
for each of GPL-2.0, GPL-3.0 (which LGPL-3.0 incorporates by reference), LGPL-3.0, and the
BSD-3-Clause text used by `libandroid-shmem` is bundled verbatim, unmodified, in
[`THIRD_PARTY_LICENSES/`](THIRD_PARTY_LICENSES/) in this repository and at
Expand All @@ -25,8 +34,9 @@ BSD-3-Clause text used by `libandroid-shmem` is bundled verbatim, unmodified, in
| `libandroid-shmem` | 0.7 | [BSD-3-Clause](THIRD_PARTY_LICENSES/BSD-3-Clause-libandroid-shmem.txt), per [`TERMUX_PKG_LICENSE`](runtime_tools/termux-packaging-recipes/libandroid-shmem.build.sh) and the project's own `LICENSE` file | Copyright (c) 2013 Sergii Pylypenko; Copyright (c) 2017 Fredrik Fornwall | Upstream source archive `v0.7.tar.gz`, SHA-256 `1e5ff8459bc0a8c229dd8a94b27d119987e09ef3414331c2b5ebfff20b98e867` (from [github.com/termux/libandroid-shmem](https://github.com/termux/libandroid-shmem/archive/refs/tags/v0.7.tar.gz), tagged release, not `master`) |
| `libtalloc` | 2.5.0 | [LGPL-3.0-or-later](THIRD_PARTY_LICENSES/LGPL-3.0.txt) for the actual runtime library. Termux's own packaging metadata tags the *package* `GPL-3.0` (a coarser, package-level tag), but the shared library source itself (`talloc.c`/`talloc.h`, the only files that become `libtalloc.a`/`libtalloc.so`) carries its own header: *"the following LGPL license applies to the talloc library. This does NOT imply that all of Samba is released under the LGPL"* — version 3 or later. Resolved; no longer `REQUIRES_LICENSE_REVIEW`. | Copyright (C) Andrew Tridgell 2004; Copyright (C) Stefan Metzmacher 2006 | Upstream source archive `talloc-2.5.0.tar.gz`, SHA-256 `912afa237510ae542a7733998eb18a12bcda35ab6729c8e2ddb43e8d0ebab007` (from [samba.org/ftp/talloc](https://www.samba.org/ftp/talloc/talloc-2.5.0.tar.gz), versioned release path, not a mutable branch) |

The fdroid flavor compiles all three from the pinned `TermuxPackages` commit, which can lag the
mirror by a version or two (currently `proot` 5.1.107.94, `libtalloc` 2.4.3, `libandroid-shmem` 0.7).
The source build compiles `libtalloc` and `libandroid-shmem` from the pinned `TermuxPackages` commit,
which can lag the mirror by a version or two (currently `libtalloc` 2.4.3, `libandroid-shmem` 0.7).
Its `proot` recipe is overridden to 5.1.107.96 as described above.

**Packaging recipes, mirrored (not just linked):** the exact `TERMUX_PKG_*` build recipe used for
each package above — the thing that actually produces the `.deb` pinned by hash in
Expand Down
Loading
Loading