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
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,58 @@ What changed in each version of Cortex Terminal, newest first. The release workf
of a GitHub release from the section of its version here. Older versions are described on the
[GitHub releases](https://github.com/ssfuisu/cortex/releases) page.

## 1.29.3 (2026-12-05)

### Fixed

- **The desktop stayed black.** Ubuntu 26.04's GTK loads every icon and picture through glycin,
which first asks bubblewrap (`bwrap`) for a sandbox. Android gives apps no namespaces, and bwrap
failed with "Can't read /proc/sys/kernel/overflowuid: Permission denied", an answer glycin did not
know: it took the sandbox for available, no icon could be loaded, and XFCE's session, panel and
desktop ended at once ("Bail out! … Failed to load …image-missing.svg: Loader process exited").
Cortex's `bwrap` now answers with bubblewrap's own message for a system without user namespaces,
and glycin loads images without the sandbox. The desktop, its panel and programs (Firefox, the
terminal, Mousepad, Thunar) start again.
- **Character set conversions other than UTF-8 failed** in every C program: glibc loads its
converters (`/usr/lib/<arch>/gconv`) with its own internal calls, which the hook does not see. iconv
said "conversion from `ISO-8859-1' is not supported", GTK could not take text from the desktop's
clipboard ("Error converting selection from STRING"), and vim, git and PHP's iconv failed with
Latin-1 or Windows-1254 (Turkish) text. The hook now sets `GCONV_PATH` to the rootfs's converters of
its own architecture.
- **uptime, vmstat, ps, top and Node's `os.cpus()`**: Android keeps `/proc/uptime`, `/proc/stat`,
`/proc/loadavg`, `/proc/vmstat` and most of `/proc/sys` from apps. `uptime` failed ("Cannot get
system uptime"), `vmstat` too ("Unable to create vmstat structure"), `ps` said "Unable to get system
boot time" and showed wrong start times, `top` showed no CPU use, and `os.cpus()` was empty in
Node, so build tools that start one worker per processor started none. Where the kernel refuses
them, the hook now makes these files from what an app may ask for (the clocks, `sysinfo()`, the
number of processors, `uname()`), as it did for `/proc/version`. What each processor did is not
known to an app: it is counted as idle.
- **Node's `os.networkInterfaces()` threw "Permission denied"**, and with it development servers
that print their network address (Vite, webpack's, Next.js); Python's `socket.if_nameindex()` and
`hostname -I` failed too. glibc's `getifaddrs()` and `if_nameindex()` bind a netlink socket and ask
for the links, which Android 11+ refuses apps. Where they fail, the hook asks the way Android's own
libc does: the addresses (which apps may read) and each interface's name and flags. Hardware
addresses stay hidden, as Android hides them from apps.
- **Names added to `/etc/hosts` were never found, and service names were unknown**: glibc reads
`/etc/hosts`, `/etc/resolv.conf` and `/etc/services` from inside itself, where the hook does not
reach, so it read Android's `/etc` (no resolv.conf, no services). `getservbyname("https")` failed,
`getaddrinfo(host, "ssh")` was refused or gave port 80, and `gethostbyname()` failed for every name
("Host name lookup failure" in Python's `socket.gethostbyname_ex()`, `getent hosts`, Perl, PHP).
`getaddrinfo()` now looks in Cortex's `/etc/hosts` first and takes service names from its
`/etc/services`; `getservbyname()`, `getservbyport()`, `getprotobyname()` (Python's
`socket.getprotobyname("tcp")` failed too) and the `gethostbyname()` family answer from them,
Cortex's `/etc/protocols` and the DNS fallback where glibc finds nothing.
- **`chsh` called every shell invalid**, `/bin/bash` too, and refused a new one to a user:
`getusershell()` read Android's `/etc/shells` (there is none) and gave glibc's built-in two. It
reads Cortex's now.

### Tests

- The emulator test checks iconv (also with an empty environment), bwrap's answer and the made
files of /proc, the network interfaces, /etc/hosts and /etc/services.
- The package test starts and asks MariaDB as root (`sudo mariadb`), its administrator on Ubuntu: as
the app's user it was refused ("Access denied for user 'cortex'"), as on any Ubuntu.

## 1.29.2 (2026-12-04)

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ android {
// privacy warnings. Writable rootfs binaries (app_data_file) execute via libcortex-exec.so
// in nativeLibraryDir (apk_data_file), which holds execute_no_trans under targetSdk >= 29.
targetSdk = 35
versionCode = 12902
versionName = "1.29.2"
versionCode = 12903
versionName = "1.29.3"
// UbuntuOnDeviceTest (app/src/androidTest), on Firebase Test Lab
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

Expand Down
14 changes: 14 additions & 0 deletions app/src/main/assets/scripts/bwrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
# bwrap (bubblewrap) in Cortex: Android gives an app no namespaces, so a sandbox of bubblewrap's
# cannot be made here. The real one failed with "Can't read /proc/sys/kernel/overflowuid: Permission
# denied", which its users do not know: GTK's image loader (glycin) then took the sandbox for
# available and every icon and picture failed to load, which ended XFCE's session, panel and desktop
# at once (a black desktop). This answers with bubblewrap's own message for a system without user
# namespaces, which glycin, Flatpak and the others recognize and do without the sandbox.
case "${1:-}" in
--version|--help|--usage)
if [ -x /usr/bin/bwrap ]; then exec /usr/bin/bwrap "$@"; fi
;;
esac
echo "bwrap: No permissions to create a new namespace, likely because the kernel does not allow non-privileged user namespaces." >&2
exit 1
2 changes: 2 additions & 0 deletions app/src/main/cpp/cortex-hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <sys/sysinfo.h>
#include <dirent.h>
#include <limits.h>
#include <errno.h>
Expand Down Expand Up @@ -100,6 +101,7 @@ static void *cortex_next(void *own, const char *name) {
#include "hook/exec.c"
#include "hook/net.c"
#include "hook/sockets.c"
#include "hook/ifaddrs.c"
#include "hook/sysv_shm.c"
#include "hook/memfd_locks.c"
#include "hook/termios.c"
Loading
Loading