Skip to content

Manage paired devices from OX Mobile - #103

Merged
n0rpan merged 61 commits into
mainfrom
mobile/manage-devices
Nov 29, 2026
Merged

n0rpan merged 61 commits into
mainfrom
mobile/manage-devices

Conversation

@n0rpan

@n0rpan n0rpan commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

Track headless host administration in #95. Add a Paired devices screen to host settings. It marks this phone, shows requests waiting to pair, and lets an operator approve, decline, or revoke another device through the host's existing signed settings requests.

Stacked on #97 at 61e0d73, checked against main at 3234845. Built and linked the unsigned iPhone app on Linux with xtool’s Darwin linker, and ran formatting and git diff --check. Live approval and revocation from a phone still need verification.

Add an AVFoundation camera adapter behind a narrow C bridge. The Pair screen requests camera permission, scans an OX invitation, and hands the link to the existing Rust verified pairing flow. Cancel, denied, unavailable and invalid codes keep manual entry available, and the scanner stops after one accepted code so a repeated frame cannot pair twice.

Tracks #95. Based on #97.
Settings → Paired devices lists the devices paired with this host under
this login, marks the phone that is asking, revokes another device, and
approves or declines a device waiting in an open pairing window.

The screen is a new `devices` module that speaks the existing signed
`DeviceAction` requests through `PairedClient::settings` (`devices`,
`revoke_device`, `approve_pending`, `deny_pending`). The host's
`Reply`, `Device` and `PendingPair` types are not compiled for iOS and
Android, so the module keeps a read-only copy of the fields the phone
shows; unknown fields from a newer host are ignored. A shorter reply
still lists devices.

mobile.rs gains the `Screen::Devices` arm, the Settings entry and a
`devices` state field, plus the three view helpers the module reuses.
No server or signing code changes.

Validation: the module and the mobile sources typecheck and pass clippy
with `-D warnings` on a host-target stand-in that includes the real
files (only the UIKit keyboard bridge and the platform credential store
are stubbed), and the reply shape parses both the host's documented JSON
and the server's own serde encoding. Not verified: an iOS/Android build
or a run against a live host — this machine has no SDK and no mobile
test lane. `cargo fmt` and the desktop/ci tests pass.

Refs #95.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-29T07:51:17.112096Z f22344d Manual request
🔒 Security Review ✅ Completed 2026-11-28T20:18:04.744376Z 2ca27cd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

The phone now shows and changes the host's update settings through the
existing signed `host_update` settings action, with the host keeping every
update decision.

- Export `host_updates` on iOS and Android and build the settings envelope
  in one place (`host_updates::request`), used by the desktop client and the
  phone, so the command cannot drift between them.
- Add a Host updates screen: installed version, the host's own state
  message, update mode, release channel, scheduled status, schedule/cancel
  and refresh. Unmanaged installations show the status and installation
  guidance without controls.
- Replies are the host's authoritative `Status`; controls are disabled while
  a request is out, a reply is dropped when the paired host or the screen
  changed, and a failed initial load offers a retry.

Tests are wire-only: the command JSON, the settings envelope the server
parses, and the status reply. No test host preferences or downloads run.
Decode a bounded Camera2 luminance frame with the maintained quircs 0.10.3 crate through a small JNI bridge. The repo-owned Camera2 Activity requests the camera permission once, delivers exactly one result, and releases the camera and handler thread on pause, cancel and finish. It reuses the shared invitation gate and keeps manual text pairing available. Add host tests for decoding a host-style QR and for the JNI frame bounds.
Base automatically changed from mobile/native-app to main November 28, 2026 23:14

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ca9c6b2f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/ox-mobile/src/devices.rs Resolved
n0rpan and others added 19 commits November 29, 2026 04:45
Transplant the three QR commits (3172630, 45d5c95, 9bbeb1d) onto
1711f60's native iPhone composer. The shared invitation parser, the
manual pairing fallback, the camera usage description and the camera
permission handling are kept. The incidental mobile-beta changes that
were on the previous PR head are left out.

Co-Authored-By: Claude Code <[email protected]>
@n0rpan n0rpan added the full-ci label Nov 29, 2026
@n0rpan

n0rpan commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator Author

In line to merge. Commit f22344d is reviewed with nothing blocking; it enters the merge queue when OX merge check passes.

@n0rpan

n0rpan commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator Author

@codex security review

Asked for by the full-ci label, for commit f22344d.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: f22344db54

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@n0rpan
n0rpan enabled auto-merge November 29, 2026 07:51
@n0rpan
n0rpan added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit a22d5d9 Nov 29, 2026
53 of 57 checks passed
@n0rpan
n0rpan deleted the mobile/manage-devices branch November 29, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant