App 2.4.0: pair with the server by QR code

The Server tab gets "Pair with phone" right under the server URL, which
is now pre-filled with https://car.stinnesbeck.com. It opens a dialog
with a QR code and the short code, polls the server, and on approval
saves this car's own token like Save would — nothing to type in the
car. Denied, expired, and pairing switched off on the server are each
reported. PairingClient is tested against a stand-in for the server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QLJfZQZeAKAwSqViTmLzki
This commit is contained in:
2026-10-17 16:16:52 +02:00
co-authored by Claude Opus 5.5
parent d5f68e1bd9
commit c578a882bd
7 changed files with 384 additions and 3 deletions
+13
View File
@@ -55,6 +55,19 @@
<string name="hint_installation_id">Installation ID</string>
<string name="helper_installation_id">Your data is stored under this ID. Keep it when reinstalling.</string>
<string name="server_err_url">Enter an https:// URL</string>
<string name="btn_pair">Pair with phone</string>
<string name="pair_hint">Shows a QR code: scan it with your phone and approve with the approval password. The token below is then filled in for you.</string>
<string name="pair_title">Pair with phone</string>
<string name="pair_scan">Scan with your phone, or open %1$s and enter this code:</string>
<string name="pair_waiting">Waiting for approval…</string>
<string name="pair_starting">Contacting the server…</string>
<string name="pair_ok">Paired — this car now has its own token</string>
<string name="pair_denied">Pairing was denied on the phone</string>
<string name="pair_expired">The code expired — press Pair with phone again</string>
<string name="pair_not_enabled">Pairing is not enabled on the server (no APPROVAL_PASSWORD)</string>
<string name="pair_error">Pairing failed: %1$s</string>
<string name="pair_cancel">Cancel</string>
<string name="pair_qr_description">QR code to approve this car on your phone</string>
<string name="server_err_token">The token must be at least 24 characters, without spaces</string>
<string name="server_err_installation_id">Not a valid ID (UUID)</string>
<string name="server_saved">Server settings saved</string>