The terminal's VT/xterm emulator, its screen, Sixel, the character sets,
the keys, the characters' widths and the themes move to shared/'s common
Kotlin (the same package: the app's code as it was), their JVM-only calls
in common Kotlin's ways (code points, ISO 8859-1, copyInto, Base64.Mime).
The Android app has its JVM side; iOS its framework, DModemShared (iOS
devices, simulator); Linux native runs the common tests too.
TerminalEmulatorTest in common Kotlin (kotlin.test): on the JVM and
native; XtermFeaturesTest on the JVM. CI: the shared tests on Linux
(JVM, native) and on an iOS simulator (apple.yml).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
The engine for a program in C or Swift (dmodem_engine.h): started on SIP
or a peer line, its DTE a socket, the log, status, exit, peer line and
speaker as callbacks; native-test's c_api_test drives it (AT commands, a
dial handing the program its line, BUSY, the end).
ios/build-native.sh builds the engine with D-Modem-RE, libre and Mbed
TLS for iOS (devices, simulator) and macOS into DModemEngine.xcframework;
ios/DModemSmoke's Swift tests run it on macOS through the C API. CI
(apple.yml) does both on a macOS runner; android.yml's native job runs
the engine's tests with Apple's fallbacks on Linux too.
D-Modem-RE to its claude/apple-portability branch (portable.h: Apple's
ways where Linux has its own), on top of the speaker hook.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
- proot (Termux's, external/proot) and its loader built with the NDK
for each ABI by native-proot/build.sh (talloc fetched and checked by
SHA-256, built as one file), run by Gradle before each build and
packaged as libproot.so and libproot-loader.so: extracted on install,
in the native library directory, the one place Android 10 on lets an
app run its own programs
- LinuxSystem: Alpine's minimal root file system for the phone's ABI,
found in Alpine's release list, downloaded with its SHA-256 checked,
unpacked (Tar: ustar, pax and GNU names, links and modes, nothing
written outside it, removed without following links), set up (the
phone's name servers, a prompt) and run as root with proot: the
device's /dev, /proc and /sys, made-up /proc files for those Android
hides, hard links as proot's link2symlink, and the phone's shared
storage at /sdcard when the app has "all files access"
- Settings, Linux: install (it goes on while the user moves about the
app), size, open a shell, remove; the storage permission; the
terminal's menu offers "New Linux shell (Alpine)", installing first
when it isn't there
- Hang-up sent again shortly after the first, for a job the shell was
forking as it went (found by the tests)
- Tests on the host: proot built by the same script, Alpine downloaded:
a root shell, the storage both ways, the window's size, hard links,
apk installing a package and running it, removal leaving the storage;
the tar reader against GNU and pax tars and ones made to escape; the
app installing it from Settings and opening its shell. CI installs
gawk and mksh.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
- Import PuTTY's private key files, versions 2 and 3 (with their
passphrase), their comment kept as the key's
- Export as .ppk version 3 (Argon2id, AES-256-CBC, HMAC-SHA-256, as
PuTTYgen 0.75+ writes them) or version 2 (for older PuTTY and WinSCP),
with or without a passphrase; chosen in the export dialog beside
OpenSSH's form
- Imported RSA keys that come without their primes (sshj reads .ppk
ones so) made whole again from n, e and d: Android's provider
wouldn't encode them, so they couldn't be kept
- Tested against puttygen: every key type, both versions, with and
without a passphrase, read by puttygen (MAC and decryption checked)
and converted back to the same private key; puttygen's own keys
imported; a wrong passphrase refused. CI installs putty-tools.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
- Port forwards per entry and live per session, in ssh's own syntax:
local (-L), remote (-R) and dynamic (-D, a SOCKS 4/4a/5 proxy);
each one's state (listening, port, connections, errors) shown in
the session's "Port forwards, agent, keys" panel, more added there
- Agent forwarding (ssh -A): the app's keys served to the server over
the agent protocol (Ed25519, ECDSA, RSA with rsa-sha2-256/512), each
use confirmed by the user unless the entry says not to
- ssh-keygen: Ed25519, ECDSA P-256/384/521 and RSA 2048/3072/4096 with
a comment; SHA256 and MD5 fingerprints and randomart as -lv draws
them; the private key exported in OpenSSH's form, encrypted with a
passphrase (bcrypt KDF, aes256-ctr) as ssh-keygen writes it; comments
changed; a key put on the server once (ssh-copy-id)
- Tests against OpenSSH itself where installed (sshd, ssh, ssh-add,
ssh-keygen): every key type read back by ssh-keygen with and without
a passphrase, its randomart and fingerprints matched; forwards both
ways and SOCKS through sshd; ssh on the server logging in onward with
the forwarded agent, and refused when the user says no; ssh-copy-id.
CI installs OpenSSH for them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
- Gradle 9.8.1, AGP 9.4.1 (its built-in Kotlin, 2.4.21), compileSdk 37,
minSdk 26; the native library built by externalNativeBuild for
arm64-v8a, armeabi-v7a, x86_64 and x86 (only dmodem_jni, NDK r29), 16 KB
page aligned; R8 keeps NativeModem's natives and callbacks.
- ModemService: a foreground service (specialUse) that runs the native
modem with its DTE on DteHub, sends the init commands (ATX3), holds a
wake lock and a low-latency Wi-Fi lock while on, takes the DNS servers
from the active network, and starts the modem again when the default
network changes (after the call in progress); a notification with the
call's state and Stop.
- DteHub: the modem's DTE shared by any number of listeners (console,
terminal, bridges), kept across the modem's restarts.
- ModemState: the run state, the call's status, the log and the
console's text, for the UI and the notification.
- Settings in DataStore: the SIP account (or user:password@host pasted),
incoming calls, T.38, init commands, country, log levels; no backups
(the password).
- UI (Compose, Material 3): Modem (start/stop, status, an AT command line
and the modem's output), Settings, Log.
- Tests: DteHub and the settings (JVM, 5 pass); NativeModemTest
(instrumented: the library loads, binds, answers AT, ATI3, ATX3, stops,
and closing the DTE stops it), compiled here, run by CI on an emulator.
- CI: the APK, unit tests and lint; native-test on the runner; the
instrumented tests on an x86_64 emulator. The private submodule needs
a DMODEM_RE_TOKEN secret.
Lint: no issues.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs