Cortex Release v1.26.33
New
- Statically linked programs run. Programs built with
gcc -static(and other static glibc
programs) used to be killed at start by Android's seccomp filter, because their own copy of the C
library makes system calls Android forbids for apps (set_robust_listat start-up,clone3for
every thread,rseq, theset*idfamily and calls newer than the filter). Before such a program
starts for the first time, Cortex now patches those calls in its file to the answers it already
gives dynamically linked programs (success, or "not supported", from which the C library falls
back). The file keeps its times and mode, and is not touched again. Go programs are left alone:
they never make these calls, but since they bypass the C library they still do not see Ubuntu's
files such as/etc/resolv.conf. - Lines rewrap when the width changes. Turning the phone or changing the font size used to leave
long lines broken in the middle (wider screen) or cut off (narrower screen). The scrollback and the
screen are now rewrapped for the new width, with their colours and links. The cursor keeps its
place, the top of the screen stays where it was (a cleared screen is not refilled), and full-screen
programs redraw themselves as before. Showing or hiding the keyboard works as it did. - IPv6-only networks. On networks that give only IPv6 DNS servers (some mobile networks), those
servers are now used for name resolution. Cortex's fallback resolver also asks for IPv6 addresses
when a program wants one, uses IPv6 DNS servers, and DNS queries sent to::1are redirected like
those sent to127.0.0.1.
Improved
- Faster drawing. The terminal draws a row in runs of characters with the same colour and style
instead of one character at a time (about 5000 drawing calls per frame on a full phone screen
before). Other characters than plain ASCII are still drawn one by one, so they stay in their cells. - Hard links. Android does not let apps create hard links, so Cortex copies the file instead and
makes the copies look linked. All names of one file now report the same inode number and the real
number of names as their link count (it was always 2), a relative name and an absolute name of a
file are recognised as the same file, a copy keeps the times of the original, and a process can
make any number of links (after 128, earlier ones were lost). - Name resolution. When glibc finds no address, Cortex's own lookup now returns both IPv4 and
IPv6 addresses to programs that accept either, stops at the first server that says a name does not
exist (it used to send the name on to the other servers and the public resolvers), no longer turns
a numeric-only lookup (AI_NUMERICHOST) into a DNS query, looks service names such assshup in
/etc/services, and keeps glibc's error ("try again later" or "no such name") when it finds
nothing either. It also reads compressed names in replies correctly (lookups behind a CNAME could
fail) and only accepts replies from the server it asked.
Fixed
- Security: where the kernel or Android's filter has no
openat2(), opening a file with
RESOLVE_BENEATHorRESOLVE_NO_SYMLINKSignored those limits for symbolic links inside the path.
Such calls now report "not supported", so programs such as GNU tar check the path themselves. mknod()of a regular file emptied an existing file instead of failing, and a mode without a file
type created nothing.getgrouplist()reported success when the caller's buffer was too small.- Binding a Unix socket with only the address family (autobind) could bind to a random path.
- Spaces in underlined text were drawn without their underline.
res_init()replaced a resolver configuration that only lists IPv6 servers with IPv4 servers.rename()over an emulated hard link left the replaced file counted as a link.
For developers
app/src/main/cpp/cortex-hook.cis split into parts by topic inapp/src/main/cpp/hook/
(paths, files, exec, static programs, net, ...). It is still built as one file with the same
commands; the compiled code was checked to be identical for arm64, armhf and x86-64.BootstrapManagerlogs every failure it used to swallow silently (60 places).- The notes of a GitHub release now come from this file.
Downloads
Cortex-arm64-v8a-signed.apk: 64-bit ARM (almost all current phones)Cortex-armeabi-v7a-signed.apk: 32-bit ARM
How to verify a download: signing/README.md. All versions: CHANGELOG.md.