Review of "Landline" version 0.1 (1)

Details Page Preview

Landline — your iPhone's calls, messages and notifications on the GNOME desktop. A quiet dot in the top bar when the iPhone is linked over Bluetooth. When something arrives the dot grows into a pill: read and answer an SMS or iMessage from a small card, answer or decline a call and choose whether its sound plays on the computer or on the iPhone. Notifications of the other iPhone apps appear in the GNOME notification list. The menu also shows the battery level, recent calls, and can switch on the iPhone's Personal Hotspot connection. Nothing is installed on the iPhone and no account or cloud service is involved. REQUIRES A SEPARATE ENGINE. The extension is only the interface. The Bluetooth work is done by a small background service, the Landline engine, which is not part of this extension and must be installed first. Instructions: https://github.com/d101c/landline#install-the-engine Without the engine the extension shows "Engine not running" and does nothing else. What the extension does on your system: - Processes it starts: "systemctl --user start landline-engine.service" once when the engine does not answer; "systemctl --user restart landline-engine.service" when you click "Fix It"; and the read-only "status" command of the engine's setup helper (landline-setup, when installed), to know whether the Bluetooth settings are in place. - Administrator password: only on systems where a Bluetooth setting required by iPhones is missing (BlueZ older than 5.88 needs its experimental mode; some systems disable L2CAP ERTM). The setup dialog then offers to change it ("pkexec /usr/local/libexec/landline/landline-setup apply"), and the "Undo" button of Phone Settings puts it back ("pkexec /usr/local/libexec/landline/landline-setup revert"). In both cases the password window is the system's own (pkexec), and it is only ever used on the setup helper that the engine's installer placed in that root-owned directory, after checking that the file belongs to root and that nobody else can write it. If that helper is not installed, no password is asked: the dialog shows the commands to run yourself, and Phone Settings has no "Undo" button. - Clipboard: the "Copy Commands" button writes those commands to the clipboard when you click it. The extension never reads the clipboard. - Links: "Reply in app" on a WhatsApp, Telegram or Signal notification opens that app's own link (web.whatsapp.com, tg:, sgnl:) with the sender's phone number, on your click. - Network: no network request. "Use iPhone's Internet Connection" asks NetworkManager to turn the iPhone's existing Bluetooth profile on or off. - No telemetry. Limits: - iPhone only. Text replies work for SMS and iMessage; for other apps the extension shows the notification and can open the app, but cannot send a reply itself. - Photos and other attachments are not shown, group conversations cannot be started from the computer. - The extension is inactive on the lock screen. - Tested on GNOME 51 with BlueZ 5.87 and PipeWire. The engine is derived from Tether by Zack Bartel (MIT licence): https://github.com/zackb/tether iPhone is a trademark of Apple Inc. This project is not affiliated with or endorsed by Apple.

Extension Homepage
https://github.com/d101c/landline

No comments.

FAQ

Files

Note: Binary files aren't shown on the web site. To see all files, please download the extension zipfile.

Shexli (experimental) manual_review 1

Shexli found 1 issue that may need reviewer attention.

EGO-A-005 manual_review

extensions should not access the clipboard directly

Direct clipboard access via `St.Clipboard.get_default()` requires reviewer scrutiny.

Review Guidelines

  • extension.js:397
    St.Clipboard.get_default()

All Versions

Version Status
0.1 (1) Unreviewed

Previous Reviews on this Version

jg__ posted a review
Landline 0.1 — notes for the reviewer Architecture, in brief - extension.js wires three things: a client of a local Unix socket (lib/engineClient.js), a state model with no GLib or Shell import (lib/model.js and lib/model/, unit-tested outside the Shell), and the views (lib/indicator.js, lib/cards.js, lib/setup.js, lib/notifications.js). - The model receives the engine's JSON events and the user's actions, and view() returns what the top bar, the card and the setup dialog must show. It sets no timer: extension.js keeps a single timeout for its next deadline. - prefs.js is a plain Adw window bound to the GSettings schema. It imports only lib/setupHelper.js, which imports lib/subprocess.js and lib/names.js (Gio and GLib, no Shell library). - Nothing is created before enable(). disable() removes every source, ends the subprocesses still running (see below for the one exception), closes the socket, disconnects the settings and destroys the indicator, every setup dialog not yet destroyed (including one fading out) and the notification sources. - No synchronous file or process call in the Shell process: file attributes are read with query_info_async, drawings with load_contents_async, subprocesses are awaited. - No network request, no telemetry, no bundled binary or script: the zip contains only GJS, CSS, SVG, the schema and the licence. Why an external engine Linking an iPhone means acting as a Bluetooth accessory: pairing with a dual (Classic + LE) bond, ANCS over GATT for notifications, MAP and PBAP through obexd for messages and contacts, hands-free for calls, and keeping those links alive across sleep and range losses. That is a long-running C++ service (derived from Tether by Zack Bartel, MIT) and cannot reasonably live in the Shell process. It is installed separately, as a systemd user service (landline-engine.service). The extension is a front end to it, in the same way other extensions are front ends to syncthing or ddcutil. Without the engine the extension shows "Engine not running" with a "Try Again" button and does nothing else. Installation instructions: https://github.com/d101c/landline#install-the-engine Every subprocess the extension starts 1. systemctl --user start landline-engine.service — extension.js, _startEngine(). Once each time the socket stops answering, before saying the engine is not running. 2. systemctl --user restart landline-engine.service — extension.js, _restartEngine(). Only on a click on "Fix It". 3. <setup helper> status — lib/setupHelper.js, SetupHelper.status(). Read-only, no privilege: prints one JSON line saying whether the Bluetooth settings an iPhone needs are in place. Run at enable(), after an "apply", and every two seconds only while the setup dialog is showing the commands to run by hand. The helper is /usr/local/libexec/landline/landline-setup, or the copy a local install leaves in ~/.local/lib/landline/. It is installed with the engine; it is not in the zip. If neither exists nothing is run. 4. pkexec /usr/local/libexec/landline/landline-setup apply — lib/setupHelper.js, runAsRoot(), from the setup dialog on a click on "Continue". See below. 5. pkexec /usr/local/libexec/landline/landline-setup revert — the same function, from prefs.js, on a click on "Undo" in the settings window. The row is only shown when that file passes the same check as for 4 (owned by root, not writable by group or others, executable). Declared in the description, like 4. All go through one function, run() in lib/subprocess.js: Gio.Subprocess with an argument vector (no shell, no string built from user input), awaited with wait_async / communicate_utf8_async, never a synchronous wait. What disable() does to a subprocess still running run() is given a Gio.Cancellable that disable() cancels (for 5, the settings window cancels it when it closes). Cancelling ends the wait and calls Gio.Subprocess.force_exit(), which sends SIGKILL: - 1 and 2: the systemctl client is ended. The start or restart job it had already handed to systemd is systemd's and is not undone. - 3: the helper's read-only status command is ended. - 4 and 5: while the password window is up, pkexec (setuid, real uid still the user's) can be signalled: it is ended, and the helper is never started, so nothing is changed. Once the password has been accepted the helper runs as root and a signal from the user cannot reach it (force_exit() then does nothing): it is left to finish (it writes a few configuration files, reloads systemd and udev and may restart bluetooth.service) rather than stopped half-way. The extension no longer waits for it and ignores its result. After disable() no new subprocess is started: run() starts nothing once its cancellable is cancelled. Not subprocesses, but worth knowing - Gio.AppInfo.launch_default_for_uri() — lib/notifications.js, on a click on the "Reply in app" action of a WhatsApp, Telegram or Signal notification. The URI (lib/replyLinks.js) is https://web.whatsapp.com/send?phone=…, tg://resolve?phone=… or sgnl://signal.me/#p/…, with the sender's number. - libnm (gi://NM, imported on demand in lib/hotspot.js) — activates or deactivates the Bluetooth connection profile NetworkManager already holds for the paired iPhone, on a click on "Use iPhone's Internet Connection". Nothing is created or deleted. - Gio.Settings on org.gnome.desktop.notifications (lib/quiet.js) — read only, to follow Do Not Disturb. Where privilege is raised, and why never on a user-writable path Two system settings may be missing: BlueZ's experimental mode (needed before BlueZ 5.88) and L2CAP ERTM (disabled on some systems). Both need root. The extension never writes them itself and never elevates anything from its own directory or from the home directory: - pkexec is only ever given the fixed path /usr/local/libexec/landline/landline-setup (a constant in lib/names.js; no environment variable, no setting, no argument changes it), and only after rootHelper() in lib/setupHelper.js has checked that the file is owned by uid 0, is not writable by group or others, and is executable. - That file is put there by the engine's installer (the helper copies itself to the root-owned directory the first time the user runs it with sudo, together with a polkit action for the password dialog's message), never by the extension. - When the root-owned copy is absent, no password is asked from the Shell at all: the dialog shows the command to run in a terminal, with a "Copy Commands" button, and continues by itself once the settings are in place. - On a system where both settings are already right (the common case with a recent BlueZ), this step does not exist. What shexli reports (0.2.1) - EGO-A-005, clipboard: true and intended. extension.js _copyCommands() writes the commands above to the clipboard on a click on "Copy Commands". It is the only clipboard access; nothing is ever read. Declared in the description. - EGO-M-004, shell-version: shexli does not know GNOME 51 yet. The metadata lists 51 only: it is the one release the extension was run on, and its menus use the open()/close() parameters of 51 ({animate: false}), which GNOME 50 does not have. Other things you may ask about - session-modes is not set: the extension is disabled on the lock screen. - The model is one class assembled from one module per subject (lib/model/*.js, each a function that extends the class it is given), so that each subject can be read on its own. - The four drawings of iPhone screens in illustrations/ are my own SVGs, with no Apple artwork or logo. "iPhone" is used in the texts only to name the phone.