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
17 changes: 9 additions & 8 deletions .fdroid/com.redtermapp.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
Name: RedTerm
Categories:
- Terminal
- System
License: GPL-3.0-or-later
WebSite: https://github.com/GlobalTechInfo/RedTerm
SourceCode: https://github.com/GlobalTechInfo/RedTerm
IssueTracker: https://github.com/GlobalTechInfo/RedTerm/issues
Changelog: https://github.com/GlobalTechInfo/RedTerm/blob/v2.0.0/CHANGELOG.md
Changelog: https://github.com/GlobalTechInfo/RedTerm/blob/v2.4.0/CHANGELOG.md

Description: |
RedTerm is a full terminal environment for Android. It installs real Linux
Expand All @@ -14,7 +15,7 @@ Description: |

Included:

* A dozen distributions: Alpine, Debian, Ubuntu, Kali, Fedora, Rocky,
* 20 Linux distributions: Alpine, Debian, Ubuntu, Kali, Fedora, Rocky,
AlmaLinux, Void, Arch, Manjaro and openSUSE, for arm64-v8a, armeabi-v7a,
x86_64 and x86.
* A built-in OpenSSH client and server, so you can reach a machine over SSH
Expand All @@ -32,9 +33,9 @@ Description: |
# Screenshots are referenced by URL from the release tag, so no copies live in
# the repository and nothing has to be duplicated or rewritten.
Screenshots:
- 1: https://raw.githubusercontent.com/GlobalTechInfo/RedTerm/v2.0.0/screenshots/home.jpg
- 2: https://raw.githubusercontent.com/GlobalTechInfo/RedTerm/v2.0.0/screenshots/main.jpg
- 3: https://raw.githubusercontent.com/GlobalTechInfo/RedTerm/v2.0.0/screenshots/terminal.jpg
- 4: https://raw.githubusercontent.com/GlobalTechInfo/RedTerm/v2.0.0/screenshots/sessions.jpg
- 5: https://raw.githubusercontent.com/GlobalTechInfo/RedTerm/v2.0.0/screenshots/settings.jpg
- 6: https://raw.githubusercontent.com/GlobalTechInfo/RedTerm/v2.0.0/screenshots/notification.jpg
- 1: https://raw.githubusercontent.com/GlobalTechInfo/RedTerm/v2.4.0/screenshots/home.jpg
- 2: https://raw.githubusercontent.com/GlobalTechInfo/RedTerm/v2.4.0/screenshots/main.jpg
- 3: https://raw.githubusercontent.com/GlobalTechInfo/RedTerm/v2.4.0/screenshots/terminal.jpg
- 4: https://raw.githubusercontent.com/GlobalTechInfo/RedTerm/v2.4.0/screenshots/sessions.jpg
- 5: https://raw.githubusercontent.com/GlobalTechInfo/RedTerm/v2.4.0/screenshots/settings.jpg
- 6: https://raw.githubusercontent.com/GlobalTechInfo/RedTerm/v2.4.0/screenshots/notification.jpg
31 changes: 31 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,39 @@ Agreed plan, all phases to be delivered. Status is tracked below and updated as
a theme that declares `terminalBg`, `terminalText` and `colorPrimary` themes the whole
app including the terminal.

## bionic gates static executables on the TLS segment, and proot-executed binaries must not be static

- **A static NDK executable can abort on start with `executable's TLS segment is
underaligned: alignment is 8 (skew 0), needs to be at least 64 for ARM64 Bionic`.**
bionic's static-TLS layout check (StaticTlsLayout) validates `PT_TLS` p_align and
vaddr skew, and the NDK's plain static link emits 8. The 16 KB-era NDK makes the
static path a dead end for proot-executed binaries on top of that: bionic's own
`.bss` is 16 KB aligned, and a proot-loaded ELF must keep 4 KB LOAD segments or it
breaks 4 KB-page devices (`-z max-page-size` cannot down-align input sections).
- **The fix is to link dynamically, as `build-mosh.sh` does for the mosh client:**
bionic's shared `libc.so`, `INTERP /system/bin/linker64` (the guest reaches both
through the `/system` bind), 4 KB LOADs, and the dynamic linker's own TLS setup
instead of the static gate. `build-redterm-api.sh` builds the API helper this way
and verifies every LOAD stays ≤ 4 KB; the mosh build pins the same check.
- `build-proot.sh` still patches the static proot's `PT_TLS` (aarch64) / links the
32-byte `.ld` (armv7a), because proot is shipped as a static `libproot.so`; that is
the same gate handled per-binary, and the rule is *dynamic unless you own the ELF's
TLS alignment yourself*.

## A shell file is run, not read

- **An `exec` that continues across lines dies at the first line that ends without a
backslash, and the lines after it never run.** The proot launcher's api bind was emitted
on its own line between the ordinary binds and the guest command: the `exec proot …`
statement ended at the ordinary-binds line (no continuation), so the api bind and the
command became orphan lines the shell never executed — proot started with the default
shell and no api bind, the app log reported the bridge on, and the launcher *file*
contained the perfectly correct line. Read-back of a generated script proves what was
written, not what the shell will execute: when a generated line feeds a multi-line
`exec`, the test has to pin the logical line (same line as its neighbours, ends in
`\`), the way `ProotLaunchTest` now does. And a unit test that asserts the api bind
*appears somewhere* in the script passed on every build that carried this bug.

- **Quote `%` in anything written into a shell.** Bash does not treat a leading `%` as an
ordinary character: `%1`, `%?` and `%T` are *job specifiers*, and an unquoted one is
executed as `fg`. `HISTFMT=%F %T` — one assignment and one word, quotes dropped in a
Expand Down
Loading
Loading