- Ppp: the client side of PPP in HDLC-like framing (RFC 1662): LCP (MRU,
ACCM, magic, the authentication asked for), PAP or CHAP-MD5, IPCP for
an address and the DNS servers; what it doesn't take, rejected
- Internet: the ISP dialled (data mode, the settings' AT commands), PPP
on the call with the DTE to itself, the carrier or the modem going
taking the link down, +++ and ATH at the end
- PppVpnService: the link as the phone's network (all IPv4 into it,
IPv6 dropped, the app's own SIP traffic outside it)
- Home has an Internet card (Connect asks for the VPN the first time),
Settings the ISP's number, login and AT commands
Tested: framing and FCS; PAP and CHAP against a server in the test (a
wrong password said); a call on native-test's fax_line at 33600 (V.42,
V.44) to that server: online, a UDP packet out and its echo back,
disconnected and hung up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
- Home has a Fax section: send a PDF, image or text to a number, answer
a ringing call as a fax, the call as it goes (Cancel), the last faxes;
Settings has this fax's number, answering every call as a fax, fine
resolution and the fastest rate
- a call has the modem's DTE to itself (DteHub.claim) while it lasts
- documents become pages at the fax's resolution (PdfRenderer, images
dithered, text set in a monospace font); received pages are saved as
a PDF in the fax's own coding (CCITTFaxDecode) in Download/D-Modem
Tested: the app's fax on the hub to our T.30 on fax_line both ways,
the saved PDF read back by poppler, every pel as sent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
The fax machine's side in the app, over the modem's class 1 commands
(T.31): T.4's MH coding of the pages, T.30's procedure (DIS/DCS, the
training and its fallback to lower rates, the pages with MPS/EOP and
their MCF/RTN/RTP, DCN), V.17 to V.27ter as the modem has them.
Tested on D-Modem's own modems back to back (native-test's fax_line,
modem_test paced as a phone line): our sender to our receiver, efax
sending to us and receiving from us, the pages exact.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
A client has the modem's DTE as if on a serial cable, one at a time:
- TCP, raw or Telnet with RFC 2217's port control (the speed and format
answered, DTR dropped hanging up, DCD/RI/DSR/CTS notified and polled),
this phone only unless other devices are allowed, an optional password
- Bluetooth SPP: the phone offers the port, or connects to a paired
device's (an HC-05 on a vintage computer, say), again when it drops
The client going hangs up a call (as DTR dropping would), if set.
They run while the modem is on, set in the settings' new section.
Tested with sockets, pyserial's rfc2217:// client and Robolectric's
Bluetooth.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
The submodule follows D-Modem-RE's main branch now that the Android
branch is merged. What came with it reaches the app without changes
here: SIP's busy and no-answer results for a dialled call, the hook
flash as an RFC 4733 event, the far end's tone events. The engine's
host test passes and the arm64 NDK build links.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
Protocols in the transfer package with lrzsz and Kermit interop tests,
the session routing the line to a running transfer, auto-start on a
remote sz or kermit -s, and Send/Receive files in the terminal menu
with a progress banner. Received files go to Download/D-Modem.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
Wide and combining characters (wcwidth tables, ZWJ sequences), curly,
double and overline underlines, OSC 4/10/11/12 colours and queries,
OSC 8 links, OSC 52 clipboard, mouse reporting (1000/1002/1003 with
SGR, UTF-8 and urxvt encodings), focus events, DECSCUSR cursor shapes,
DECRQM/DECRQSS/XTVERSION/DA reports, XTWINOPS sizes, and Sixel images
placed as cell tiles so they scroll with the text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
- A catalog: Alpine (its own release list), Ubuntu 24.04 (its base
image, the newest point release), and from the Linux Containers
images (built daily, SHA-256 sums): Debian 13, Fedora, Arch Linux,
openSUSE Tumbleweed, Kali, Void, Rocky, AlmaLinux, Devuan; those not
built for the phone's processor shown as such (the images' index)
- Or any root file system tarball by its URL (.tar, .tar.gz, .tar.xz;
xz with org.tukaani:xz), its SHA-256 checked when given; one in a
single top folder moved up; anything else refused and removed
- Several systems side by side, each in linux/<id> with system.json;
the first release's Alpine still known
- Set up for proot at each start: resolv.conf a file (not systemd's
link), hosts, /etc/mtab, apt's sandbox user root, pacman without its
sandbox or space check, a prompt named for the distribution; root's
own login shell (bash where it has it), found through usrmerge's links
as the system sees them
- Settings, Linux: the systems installed (open, remove), "Install a
Linux" with the catalog or a URL; the terminal's "New Linux shell…"
asks which when there are several; installs report done as a state
the screens watch
- Tests: the sources' indexes, archives of each kind, the proot set-up,
checksums and refusals (offline); Alpine and a custom URL's .xz
through proot on this host; every catalog distribution's package
manager installing Lua when DMODEM_DISTROS names them
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
The appearance and terminal settings saved a whole copy of the settings
as the screen last showed them; two changes in quick succession (a theme
and a palette tapped one after the other) raced, the second undoing the
first. Each change is now applied to the stored settings inside the
store's own edit. The appearance test waits for the save it checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
- libdmodem_pty (pty.c, plain POSIX + JNI): a program on a pty of its
own as a session leader, UTF-8 input mode, window size, exit status,
and hang-up of the whole session (the shell's jobs too, found in
/proc: job control puts each in a process group of its own)
- LocalLink: the shell as a TerminalLink, like SSH's and Telnet's
- LocalShell: Android's mksh (/system/bin/sh, toybox's commands) as a
login shell in a home of the app's, with TMPDIR, TERM=xterm-256color,
COLORTERM, a UTF-8 locale and the app's own environment (so am, pm
and cmd work), and ~/.mkshrc (the system's first, then a coloured
prompt, aliases and history; kept as the user changes it)
- Shells open in tabs beside the modem's and the connections, from
Home ("Shell") or the terminal's menu ("New local shell"); an exited
one says so and offers a new one; the connection service keeps them
going in the background
- Tests: pty.c built for the host and real shells on it (sh, and mksh
with the app's start-up file): output, window size, Ctrl-C to the
job not the shell, exit status, hang-up of background jobs, a shell
that isn't there; the app opening one from Home, its exit, a new one
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
- Theme: System default (follows Android), Light or Dark; the system
bars' icons and, from Android 12, the app's night mode follow it
- Colours: the wallpaper's (Android 12+) or Violet, Phosphor, Amber,
Ocean, Teal, Rose, Graphite, each a Material scheme made from tones
of its hue (CIE LCh, kept in sRGB)
- Black background for dark mode (OLED)
- The window's own background light or dark before the first frame
- Tests: every palette's text contrast at least 4.5:1 in both modes;
the app drawn in each; the choices made in Settings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
- TerminalLink: one interface for the modem's DTE and network links;
sessions (modem, SSH, Telnet) as tabs, each with its own emulator
- SSH (sshj + BouncyCastle): password, keyboard-interactive and key
login, PTY with window-size changes, keep-alives
- Keys made or imported here (Ed25519, ECDSA P-256, RSA 3072;
OpenSSH, PKCS#8, PEM), sealed with an Android Keystore AES-GCM key;
public keys to copy and share
- known_hosts kept on first use, a changed key put to the user in red
- Passwords optionally remembered per entry, sealed the same way
- Telnet: NVT with NAWS, terminal type, binary and echo options
- Directory entries for SSH and Telnet hosts beside modem numbers;
a Disconnected bar with Reconnect and Close
- Prompts asked from connection threads, answered in dialogs, cancelled
when their connection closes
- Tests against a real SSH server (Apache MINA) in the JVM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
In the Modem tab's place: a card with what the modem is doing (off,
starting, ready, off hook, connecting, online with its rates down and up
and the call's time, hanging up) and the action for it (set up SIP, start,
hang up, stop, the terminal); the line (the SIP account, incoming calls,
the default network as Wi-Fi or mobile data, fax); quick dial of the four
systems last dialled (or a card to add one); shortcuts to the terminal and
the directory; the modem's console, folded, with its AT command line.
StatusScreen is gone (its console is the dashboard's).
DashboardShotsTest draws it first run, ready with a directory and online
into app/build/screens/. 37 tests pass; lint: no issues.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
- TerminalView filled its background with drawColor(), which fills the
clip it is given: it could paint over the Compose bar above it (the
terminal's status, keyboard, snippets, capture and menu). It fills its
own bounds now.
- The Modem tab's console turned the modem's echoed CR (ATX3\r\r\n) into
a blank line: a lone CR is dropped there now.
- ScreenshotsTest: every tab drawn with Robolectric's native graphics into
app/build/screens/ (Compose UI test).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
Cascadia Code, Sauce Code Pro (Nerd Font Mono), Source Code Pro, Roboto
Mono, JetBrains Mono, Fira Code, OpenDyslexic Mono, Inconsolata and Droid
Sans Mono in assets/fonts with their licences (OFL 1.1; Droid Sans Mono
Apache 2.0), and the system's monospace:
- the variable fonts at weight 400 and a real 700 for bold (Source Code
Pro's and Fira Code's default instances are light), the others bold by
the paint;
- ligatures (Cascadia Code, JetBrains Mono, Fira Code) on or off;
- glyphs a font hasn't got come from a fallback font: a run whose width
isn't its cells' is drawn a glyph per cell, centred and narrowed to fit,
so the grid holds;
- the cells' height holds the glyphs' ink where a font declares less
(OpenDyslexic);
- Settings: the font with a preview in the theme's colours, ligatures,
the fonts' licences.
OpenDyslexic Mono has no compiled release: it is built from its upstream
source with fontmake (assets/fonts/README.md). Sauce Code Pro is Nerd
Fonts' patched Source Code Pro (Regular, 2.4 MB).
Tests (34 pass): every font loads, keeps the grid with glyphs it hasn't
got (CP437's), and the variable fonts' bold is heavier. Lint: no issues.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
- TerminalEmulator (pure Kotlin): VT100/VT220 with xterm's extensions:
cursor movement and addressing, erase/insert/delete of characters and
lines, scrolling regions, SGR with 16, 256 and 24-bit colours (; and :
forms), the alternate screen (47/1047/1049), origin, autowrap, insert
and newline modes, application cursor keys and keypad, bracketed paste,
DEC line drawing (G0/G1, SO/SI), tab stops, REP, DSR/CPR, DA1/DA2, ENQ
answerback, OSC titles, DCS/PM/APC skipped, C1 controls, RIS/DECSTR;
ANSI.SYS's CSI s/u and clear-home for BBSes; scrollback; resize that
keeps the cursor's line; text extraction joining wrapped lines.
- Charsets: UTF-8 (streamed across reads), CP437, ISO 8859-1, both ways.
- KeyEncoder: xterm key sequences with modifiers, Ctrl/Alt on characters,
BS or DEL, CR / CR LF / LF.
- TerminalView: cells drawn in runs on whole pixels, bold as bright, iCE
colours, faint, italic, underline, strike, blink, inverse and reverse
video; box drawing and block elements drawn to fill their cells (no
gaps in ANSI art); block/underline/bar cursor with blink; fixed 80/132/40
columns or pinch zoom (kept); scrollback with drag and fling, Shift+PgUp;
long-press selection with copy, paste, select all, share and open link;
a soft keyboard input connection without suggestions, hardware keys;
volume keys as font size or Ctrl/Alt; bell as vibration or flash.
- TerminalSession: the emulator on the DTE hub, sticky Ctrl/Alt, local
echo, (bracketed) paste, capture to a file shared through a
FileProvider, hang up with +++ guard times.
- UI: Terminal tab (status and call time, keyboard, snippets, capture,
hang up, charset, clear, reset, full screen; an extra keys bar with Esc,
Ctrl, Alt, Tab, arrows with repeat, Home/End/PgUp/PgDn, F1-F12), Dial tab
(a directory with each system's init commands, charset and backspace;
dialling starts the modem), snippets with escapes, terminal settings
(11 themes and the rest).
- Tests (JVM, 32 pass): the emulator (17), the session (7), and the view
drawn for real with Robolectric's native graphics (ANSI art in CP437 at
80 columns, its cells' colours checked). Lint: no issues.
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
- external/d-modem-re: D-Modem-RE as a submodule (claude/android-support:
libdmodem_sip, the modem on a SIP line as a library, cross compiling
with libre on Mbed TLS).
- app/src/main/cpp: libdmodem_jni.so. engine.cpp runs dmd::SipModem in
a thread of its own, its DTE one end of a socket pair whose other end
is the app's; stop() from any thread, start() again after; the log
(the modem's and SIP's) and the call's status to callbacks. jni.cpp
binds it to com.neodesktop.dmodem.NativeModem (log lines made
printable ASCII for NewStringUTF: SIP messages come from the network).
- NativeModem.kt: the Kotlin side of the binding.
- native-test: the engine on the build host against a dmodemd over
loopback SIP. Passes: dialling out (CONNECT 62666, V.91), data both
ways, the status online with its rates, a hangup, stop() and a second
call after start() again, a call coming in (RING, ATA, CONNECT), and
the app closing its end ending the engine.
Built with NDK r29 for arm64-v8a and x86_64 (android-26).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs