2026-11-16 09:09:09 +08:00
|
|
|
# OpenChamber Native
|
|
|
|
|
|
2026-11-18 19:08:06 +08:00
|
|
|
A lightweight OpenChamber client for phones, written in **Flutter** (Dart).
|
|
|
|
|
Android first. This branch (`flutter`) is a framework evaluation: the same
|
|
|
|
|
feature set as the earlier Asuka/Go and MyGo attempts, reimplemented in
|
|
|
|
|
Flutter to compare mobile UI maturity.
|
2026-11-16 09:09:09 +08:00
|
|
|
|
2026-11-18 22:18:45 +08:00
|
|
|
Status: 0.3.1 — servers (passwordless / password login, HTTP/HTTPS and
|
|
|
|
|
SOCKS5/socks5h proxy, self-signed certificates and pinning), session list with search and live
|
2026-11-18 19:08:06 +08:00
|
|
|
events, chat with streaming Markdown, tool rows with image previews, a
|
|
|
|
|
context usage ring with a detail sheet, model/agent switching, copy / fork /
|
|
|
|
|
revert, attachments (photos/files), permissions. Android 7.0 (API 24)+.
|
2026-11-16 09:09:09 +08:00
|
|
|
|
|
|
|
|
## What is here
|
|
|
|
|
|
|
|
|
|
| Path | What |
|
|
|
|
|
| --- | --- |
|
2026-11-18 22:18:45 +08:00
|
|
|
| `lib/api/` | Dart OpenChamber client: auth, sessions, messages, SSE, models/agents, permissions, prompt/interrupt/fork/revert, `/api/fs/raw`; HTTP/HTTPS proxies via `HttpClient.findProxy`, SOCKS5/socks5h via `socks5_proxy`, pinning/self-signed via `badCertificateCallback` |
|
2026-11-18 19:08:06 +08:00
|
|
|
| `lib/storage.dart` | Saved servers in `shared_preferences`, tokens in `flutter_secure_storage` (Android Keystore) |
|
|
|
|
|
| `lib/state.dart` | The app state: connections, live sessions, the open chat, and SSE event folding |
|
2026-11-18 20:11:49 +08:00
|
|
|
| `lib/screens/` | Servers, sessions, chat (streaming Markdown via `gpt_markdown`, composer, sheets) |
|
2026-11-18 19:08:06 +08:00
|
|
|
| `lib/widgets/` | The context usage ring |
|
|
|
|
|
|
2026-11-18 20:11:49 +08:00
|
|
|
Markdown rendering reuses **`gpt_markdown`** (BSD-3), the Flutter AI-output renderer
|
|
|
|
|
that [dsh-Go](https://github.com/ccch1mneyyy/dsh-go) uses: streaming-friendly,
|
2026-11-18 20:48:12 +08:00
|
|
|
syntax-highlighted code blocks with copy, tables, LaTeX and task lists. The input
|
|
|
|
|
bar and the model chip follow dsh-Go's composer design (MIT, referenced rather
|
|
|
|
|
than copied): a rounded capsule, a leading attach key, an auto-growing borderless
|
|
|
|
|
field, the usage ring, and a 36px send/stop key that morphs while a turn runs.
|
|
|
|
|
Read-aloud (TTS) is intentionally **not** implemented (matching the original).
|
2026-11-16 09:09:09 +08:00
|
|
|
|
|
|
|
|
## Run
|
|
|
|
|
|
2026-11-18 19:08:06 +08:00
|
|
|
Flutter 3.50 (stable) lives at `~/SDK/flutter`; artifacts use the China
|
|
|
|
|
mirrors.
|
2026-11-18 13:20:20 +08:00
|
|
|
|
2026-11-16 09:09:09 +08:00
|
|
|
```bash
|
2026-11-18 19:08:06 +08:00
|
|
|
export PATH=$HOME/SDK/flutter/bin:$PATH
|
|
|
|
|
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
|
|
|
|
|
export PUB_HOSTED_URL=https://pub.flutter-io.cn
|
2026-11-16 09:09:09 +08:00
|
|
|
export ANDROID_HOME=$HOME/SDK/AndroidSDK
|
|
|
|
|
export JAVA_HOME=$HOME/SDK/jdk-21
|
|
|
|
|
|
2026-11-18 19:08:06 +08:00
|
|
|
flutter pub get
|
|
|
|
|
flutter test
|
|
|
|
|
flutter build apk --release # dist artifacts in build/app/outputs/flutter-apk
|
2026-11-16 09:09:09 +08:00
|
|
|
```
|
|
|
|
|
|
2026-11-18 22:18:45 +08:00
|
|
|
`android/app/build.gradle.kts` sets the application id
|
|
|
|
|
`net.blumia.openchamber.flutter`, `minSdk 24`, and signs releases with
|
2026-11-18 19:08:06 +08:00
|
|
|
`~/SDK/test-upload.jks` (override via `OPENCHAMBER_KEYSTORE*` env). Dart's
|
|
|
|
|
`HttpClient` dials sockets itself, so plain `http://` LAN servers work in
|
2026-11-18 22:18:45 +08:00
|
|
|
release without a cleartext manifest flag, as with the Go clients. Only a
|
|
|
|
|
working connection is saved: a failed attempt stays in the form.
|
|
|
|
|
|
|
|
|
|
Proxies accept `http://`, `https://`, `socks5://` and `socks5h://` (the
|
|
|
|
|
last two resolve names at the proxy). `tool/proxy_probe.dart` checks the
|
|
|
|
|
client against a live server through local test proxies.
|
2026-11-16 09:09:09 +08:00
|
|
|
|
2026-11-18 19:08:06 +08:00
|
|
|
Earlier attempts: `main` (Asuka/Go, 0.2.x) and `mygo` (MyGo, 0.3.0).
|