feat(mobile): add encrypted Android companion and self-hosted Relay#351
Open
Crain99 wants to merge 24 commits into
Open
feat(mobile): add encrypted Android companion and self-hosted Relay#351Crain99 wants to merge 24 commits into
Crain99 wants to merge 24 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds an installable Android companion for Codeg, with two remote
connection modes:
connections to a blind Relay and exchange end-to-end encrypted envelopes.
The desktop does not need a public IP or inbound port.
its normal Web Service token.
It also adds the desktop pairing/revocation workflow, a standalone Relay and
desktop bridge, self-hosting templates, mobile-oriented workspace layouts, and
Android build/release automation.
Android download
The complete signed review package is available before merge:
Package metadata:
cn.crain.codeg.mobile0.20.3(versionCode=20003)arm64-v8a,armeabi-v7a,x86,x86_64b52ea281cc8a335ea3bd9f7c0aef752acd6bcfb1b3b08fa59a65c6ac599aa00aThe release workflow now builds the same four-ABI universal APK instead of an
arm64-only artifact.
Desktop Codeg changes
The mobile client is intentionally thin: Agents, ACP connections, terminals,
Git operations and project files continue to run on desktop Codeg. The desktop
changes in this PR are:
one-time QR pairing, six-digit safety-code confirmation and device revocation;
event stream without exposing the Codeg Web Service token to the Relay;
preserving the existing Tauri and browser transports;
manager, sidebar, task/status surfaces, settings navigation, welcome screen
and composer without changing desktop breakpoints;
Mobile access remains opt-in. Existing desktop and server behavior is unchanged
until a Relay endpoint is configured and enabled.
Relay and self-hosting
The Relay is an independent Rust WebSocket router. It authenticates routing
credentials, applies limits and forwards opaque encrypted frames; it does not
receive the Codeg token or decrypt chats, code, commands or attachments.
QR codes; the APK does not hard-code a Relay operator or domain.
wss://; plaintextws://is accepted only forloopback development.
itself remains on a private network; Codeg port 3080 should not be exposed for
Relay mode.
See
docs/relay/self-hosting-zh-CN.md,docs/relay/protocol-v1.mdanddocs/relay/threat-model.md.iOS status
The iOS project and simulator compile-smoke path are included, but this PR does
not provide an IPA or TestFlight build. An Apple Developer distribution
certificate and provisioning profile are not currently available. Android is
therefore the only installable mobile package attached to this PR.
Validation
Executed locally:
Android release verification:
apksigner verify --verbosepassed;aapt;android:debuggablemarker in the release manifest;The Relay/Bridge tests cover multi-device isolation, revocation, one-time
pairing, replay rejection, long ordered encrypted streams, multipart attachment
upload, cancellation, idempotency and reconnect-backoff reset.
Known limits and rollout notes
to be brought back to the foreground.
ciphertext size remains observable even though payloads are end-to-end
encrypted.
those test packages must be uninstalled before installing this PR candidate.
Commit structure
The history follows the repository's existing Conventional Commit style and is
kept in reviewable layers: mobile shell foundation, Relay protocol/router,
desktop bridge and pairing, deployment hardening, reconnect/attachment fixes,
mobile UI refinements, self-hosted Relay support, and universal Android release
packaging. The final review-polish commits include:
fix(mobile): refine compact workspace layoutsfeat(relay): support self-hosted mobile endpointschore(mobile): publish universal Android packagesdocs(mobile): remove deployment-specific references