Repository navigation
v2.5.0: API bridge, tool screens, Amazon + NixOS catalogue, custom installer - #39
Merged
Merged
Conversation
…ile, and the user startup hook The Termux:API command surface runs entirely in-app: a per-ABI C helper spoke the abstract-UDS wire protocol with a listener in the app process, and the guest scripts reach Android features without a second SSH, camera or SMS stack. The manifest is trimmed to a defensible core so the app stops reading as a trojan profile to Play Protect, and the dispatch gate distinguishes a missing grant from an undeclared permission so affected commands answer honestly instead of dying in a pipe. /root/.startup.local is the user-managed, once-per-interactive-session startup hook (issue 32); it is in the shared tail of the generated startup for all twenty distros, and redterm-startup-local prints a safe starter body that is a no-op wherever run-parts or /etc/update-motd.d is absent. versionCode 8 / versionName 2.4.0.
…erence The gate is reading the w: lines of compileDebugKotlin, not the exit code, and 13 compiler warnings had slipped through being reported as a clean build. None is fixed by a suppression: - The five unchecked as? List<T> casts on reflective results (CellInfoApi, NetworkApis, SsidApi) become a star-projection cast plus per-element concrete casts, which the compiler can check. - The eight deprecated references stop being references: ScanResult.SSID is read by name (withdrawn on 33); setVisibleInDownloadsUi is invoked reflectively on the levels where it still has effect (<29, a documented no-op since); the no-arg MediaRecorder is reached by name with the Context constructor on 34+; the withdrawn CDMA/EHRPD/1xRTT constants stand as their stable documented values; the three-argument Locale constructor becomes Locale.forLanguageTag (non-deprecated on every level the app runs); and setWifiEnabled is reached by name on the declared type.
…unded reads, and close the review's gaps Guest paths are named on the distro side, but the bridge opens them in the app process. The launcher now exports REDTERM_ROOTFS_HOST, the guest helper attaches it to every request, and ApiPaths is the one place that projects a guest path to the host path it actually lives at (or refuses it). Share, storage-get, media-play and media-scan all go through it. Also, per the review: - ApiSocket reads run on a bounded pool with a deadline; LocalSocket has no read-timeout API, so a stuck peer is bounded by the pool cap and closed, not pinned. Response bodies over the uint16 field are refused, not sent. - A read/write size cap on saf readDocument; a counter-range guard; a bounded callback read; a non-cyclic media scan; a bound on concurrent requests. - A single JSON string encoder (ApiJson) so an SSID with control bytes is valid JSON; TtsApi keeps the exact language/region/variant; the wifi toggle checks its grant and a present boolean flag; NFC rejects a disabled radio, re-enables reader mode on resume, and posts a cancel on destroy. - installOne only replaces scripts it owns (the marker); ensureInstalled clears just the binary and stamp, keeping feature output. - the startup-hook sourcing test now runs the block the generator emits, not a hand copy. Helper binaries rebuilt for all four ABIs; GUEST_SCRIPT_VERSION is 7.
…host wire line con.peerCredentials can throw IOException; unguarded it skipped every writeResponse and the guest saw 'no response from the app'. The uid guard now catches the read and says which way it closed, instead of vanishing. Also pin the parser against the exact rootfs-host line the rebuilt helper puts on the wire, and finish the F-Droid metadata for v2.4.0.
A 'no response from the app' from the guest means the connection was accepted and then closed without an answer. Several paths did that silently: the uid guard (peerCredentials can throw), a peer that closed before sending, and nothing marked the listener coming up. Every outcome now logs, so the next on-device run says exactly which branch closed the connection instead of vanishing. Also pin the parser against the battery-status wire line with the rootfs-host extra the rebuilt helper emits.
… pool On device the pooled read stopped after 'connection accepted; reading request' and never reached any outcome, so the guest saw 'no response from the app'. The last release read inline on the request thread and worked. Revert that one change: a stuck peer blocks only its own request thread (capped by the semaphore), which LocalSocket cannot bound any other way, and is the approach that is proven on device. The safe uid guard and the per-outcome logging are kept.
…r-request log
- stop no longer closes the listener: it was the guest's only channel to
the app, so a stopped bridge could never be started again from the
guest (redterm-api-start answered 'Connection refused'). The listener
now stays up; stop flips an enabled flag, and the stopped bridge
answers every feature request with a readable refusal while the
lifecycle action still gets through to re-enable it.
- The SAF tree intent dropped CATEGORY_OPENABLE: the document UI's tree
filter declares the default category, so the extra category made the
picker unresolvable ('No Activity found to handle OPEN_DOCUMENT_TREE').
- Per-request debug lines sit behind a VERBOSE=false const, so the
compiler drops them from the build; the critical state and error
lines are kept.
…ard, multi port forwards, ssh tunnels, sftp queue, scheduled jobs
- Custom installer (file/URL/registry) reachable from the Welcome screen, the Distro dashboard, and More tools. Registry images go through the registry-v2 flow (anonymous token, per-arch manifest); file/URL compression is read from magic bytes, not the extension. - Fixes to that path: the install button re-enables on input and after a failure; the token request honours the registry 401 challenge's service/scope; extraction no longer strips a leading bin/ off standard rootfs archives (catalogue path unchanged). - Amazon Linux (amzn/amzn2/amzn2023) is its own key so its own amzn2-* repos are kept instead of being overwritten by a mis-detected fedora plan. - Mosh reachability probe + tunnel suggestion for silent mosh sessions. - Recording GIF export and 0.5x-4x playback speed. - Workspace pin to home and open-into-split-pane. - Scheduled job history, notification output tail, and failure backoff. - build-openssh.sh: --prefix=/usr --sysconfdir=/etc/ssh so rebuilt ssh binaries stop carrying the build host's paths. Bump to 2.5.0 (versionCode 9); CHANGELOG updated.
- amazonlinux and nixos join the built-in catalogue: Amazon Linux is the 2027 generation from Amazon's public ECR (AL2 ended support, the 2023 line is the one 2027 replaces), NixOS is the 26.05 channel ISO unpacked to its store. Both are built and published by the rootfs-images pipeline; the records carry the v1.0.0 release URLs, sha256s and measured install sizes. - Amazon Linux resolves to dnf, the manager its image carries, and the first-start rescue line is corrected: dnf has no -q, and the quiet slot now carries nothing instead of a flag it would reject. - NixOS reports as the named nix manager with its own package-updates explanation: the store ships the tools and carries no channel closure, so a newer image is the update path. Its first-start plan is an explicit no-op, not the unrecognised-ID fallback. - Tests: the nixos key and its no-op plan, the amazonlinux/nix manager mapping, plus the registry invariants the two records must satisfy. 703 tests, 0 failures; lint 0 errors.
- The amazonlinux and nixos records carried the shas of tarballs built on this host; the pipeline's chroot leaves a different rpm database state, so the published assets are not byte-identical and the app's download verification would have refused them. The records now carry the digests the v1.0.0 release actually serves. - The nixos record also drops to the pruned size: the image store is trimmed to the session's dynamic closure, 5.2 GB down to ~560 MB. - The sudo shim now writes into every writable bin directory that exists rather than a hardcoded /usr/bin: NixOS has no /usr, its /bin and /sbin are farm links into the store, and its PATH orders /sbin before /bin, so a shim in one still lost to the real PAM sudo in the other. A store-carried sudo is read-only, so the old one is unlinked first.
The NixOS registry entry now points at the published image that ships the nix tool family: registry-based installs (nix profile install, nix shell, nix run) work in a session, the nixpkgs channel is registered on the live nixpkgs-unstable alias, and the session's environment names the CA bundle so standalone HTTPS verifies. installSizeMb matches the pruned image. The card text says which install path is supported and that the classic channel update is not it. Amazon shows as 'Amazon'; both distros carry their icons. The changelog's v2.5.0 section records the nix items (the premature v2.6.0 section is gone), the version is 9/2.5.0 as released, and the Gradle wrapper moves to 9.9.1 so the plugin-version notice stops showing in builds.
|
Important Review skippedToo many files! This PR contains 104 files, which is 4 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Promotes the accumulated
feature/termux-apiwork tomain: the in-appAndroid API bridge (v2.4.0), the tool screens (v2.4.1), and the distro
catalogue with Amazon + NixOS and the file/URL/OCI installer (v2.5.0).
13 commits, app version 2.5.0 (code 9).
Changes
redterm-apisocket bridge(native per-ABI helper, bionic-linked) that exposes the session's file
system to host-side tooling; the defensible permission profile; the
user startup hook; zero-warning compile with withdrawn members reached
by name.
dashboard, multi port forwards, SSH tunnels, SFTP transfer queue,
scheduled guest jobs, local port forward; recording GIF export and
0.5x/1x/2x/4x playback speed; workspace pin and split-open.
26.05 joined the built-in catalogue, each with its own icon; the NixOS
image ships nix itself, so sessions install packages over the network
through the registry commands (
nix profile install,nix shell,nix run), its channel table points at the live nixpkgs-unstablealias, and the session environment names the CA bundle so standalone
HTTPS verifies. Custom distro installer: from a tarball, a URL, or a
Docker/OCI image (registry-v2 pull, layer order, compression read from
magic bytes). Version 2.5.0 / code 9; Gradle 9.9.1.
How it was tested
./gradlew test704 tests / 0 failures;
lintreports exactly the three allowedAligned16KBwarnings, 0 errors;assembleDebugclean(2.5.0 / code 9, ~34 MB).
pipeline; the registry digests in
DistroRegistrymatch the liverelease assets byte-for-byte (the publish step's index-stamping order
was fixed and the published index verified against the assets).
nix run nixpkgs#hello, standalonecurlover HTTPS, channel table present.Checklist
./gradlew assembleDebug lintDebug(gate on the build host)## [v2.5.0]— this PR is the v2.5.0 release, so the entry is under the release heading rather than Unreleased