Skip to content

armgit / andee

Public Imported from GitHub
0

Andee lives on your phone or Mac and uses any app like you do—no integrations, no root, any model; memory and passwords never leave your device | Andee 住进你的手机或 Mac,像你一样操作任何 App——无需集成、无需 Root、支持任意模型,记忆和密码绝不离开设备。

chore(release): v0.4.0

booboosui3e6d1680507b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 61c9deb..8f9d90f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,7 +4,7 @@ Notable changes to Andee. The format follows [Keep a Changelog](https://keepacha
## Versioning policy
-- `versionCode` / `versionName` live in `app/build.gradle` and are currently **`6` / `"0.3.2"`**.
+- `versionCode` / `versionName` live in `app/build.gradle` and are currently **`7` / `"0.4.0"`**.
- Releases are tagged `vMAJOR.MINOR.PATCH`, `versionName` mirrors the tag without the leading `v`,
and `versionCode` increases by one per release. `versionCode` must increase **monotonically** or
Android refuses the upgrade; the same number must never be reused for two different builds.
@@ -13,7 +13,8 @@ Notable changes to Andee. The format follows [Keep a Changelog](https://keepacha
**The project starts at `0.x`, and that is the accurate number rather than a modest one.** Nothing is
frozen. The tool-schema contract a hub brain speaks has been rewritten repeatedly
-(`net/ToolSchemas.kt` has been rewritten in every release so far), the `local.properties`
+(`net/ToolSchemas.kt` has been rewritten in most releases — it read "in every release so far" until
+a release did not touch it, which is why the count is not written down here), the `local.properties`
build flags that decide the first-install language, the thinking default and whether CodeFlying is
compiled in have all been added since, and a saved scene is a shape that only appeared in `0.2.0`. Each of those is something a user or a second implementation would have to rebuild against,
so `0.x` is being honest that MINOR may break. The release that moves off `0` should be the one where
@@ -27,6 +28,86 @@ hash into `versionName` at build time would close this hole; it is not implement
## [Unreleased]
+## [0.4.0] - 2026-10-14
+
+Two new capabilities, both of them choices rather than defaults: **a second voice provider** (Google,
+selectable beside the existing one, contributed as PR #8) and **a launcher icon that is the
+character's thinking pose**. Behind them, three fixes to how the interface is drawn — the primary
+button, the type scale on a phone, and a tracker string that had been calling every new device a
+Volcengine device.
+
+### Added
+
+- **A second voice provider.** `VoiceConfig.voiceProvider` reads `huoshan` or `google`, the settings
+ card grew a **Voice provider** picker above the two credential blocks, and `AsrController` /
+ `TtsController` now build one of two engines behind a shared interface (`AsrEngine`, `TtsEngine`);
+ the two are streaming on both sides and reduce to the same five calls, so nothing above them
+ changed. Volcengine stays the fallback — anything that is not exactly `google` reads as Volcengine,
+ and it is the leftmost option — because for every device that predates this row, Volcengine is what
+ it has been running.
+ Google's two halves are different protocols: recognition runs over the **Gemini Live API** (a
+ WebSocket, so it needs the project *number* and a location) and synthesis is plain HTTP against the
+ same Vertex Express key. Its defaults are a real region and two model names rather than a blank
+ (`asia-northeast1`, `gemini-3.5-transcribe-live-preview`, `gemini-3.1-flash-tts-preview`), and every
+ hint on its rows is the value a blank row resolves to — a card that advertises a model but silently
+ calls another is lying in the one place the user goes to decide.
+ **`GOOGLE_VOICE_KEY` non-empty at package time is also what makes Google the default provider.**
+ That is deliberate: a build is packaged for whoever it is packaged for, and baking a key is the most
+ explicit statement of that intent there is. The repository's own source defaults to the empty string,
+ so a checkout with nothing configured builds exactly what it built before Google existed.
+ The self-check moved with it, and the move is the interesting part: `voiceKey` now asks for the key
+ of the provider **actually in use**, and `voiceReach` probes that provider's host. The rows name
+ neither — a green tick earned by the Volcengine key while the device is talking to Google is the exact lie
+ that having one checklist instead of two exists to prevent.
+ *(Contributed by @kuafu-limanxiang in [#8](https://github.com/kuafuai/andee/pull/8).)*
+- **The launcher icon is now the thinking pose, on white.** It was built from a sheet with a glow
+ painted around the whole head and composited over that glow; it is now built from the cut-out of the
+ character with a hand on its chin, on a plain `#ffffff`. Same character either way, so nothing about
+ the identity changes — the icon is now the pose the app is in when it is thinking, and the background
+ is literally white because these illustrations were drawn on white and the warm light on the ball's
+ edge is painted on the ball itself. The inferred-glow treatment is not deleted; it is one flag away
+ (`--bg glow`), because it is real work that came close. The icon set also came out smaller,
+ 405.4 → 258.3 KiB.
+
+### Changed
+
+- **The primary button is one flat fill instead of a blue-to-violet gradient.** A gradient inside a
+ pill makes the button carry its own light source — the look of a landing page's call to action —
+ and it was the only colour in the whole palette that did not answer to the theme, so on a light card
+ it sat there like a sticker off another design. It is now `Palette.tint`, a step deeper than each
+ theme's own accent, which keeps the button the loudest thing on a card for the reason that survives
+ going flat: it is the only saturated fill on it. Violet went with the gradient — the interface has
+ exactly one hue and it is blue. `Glass.TINT_START` and `Glass.TINT_END` are gone.
+ The label had to move with the fill, and that is measurable rather than taste: it was `Glass.TITLE`,
+ near-black by day and white at night, which works on a saturated ground at night and measures about
+ **4:1** by day — under the line for body text. It is `Glass.ON_TINT` now, white in both themes,
+ because both fills were picked deep enough to carry it. Seven call sites, one token each; no other
+ surface changes.
+- **Type is sized against the device now, not just against the tablet.** The six rungs were drawn on a
+ 711dp tablet where a card is 500dp wide with air around it. A phone is 392dp and the same card fills
+ it edge to edge, so the same 26sp title read as a heading on one and a shout on the other — on the
+ phone it showed up as a row title clipped to "Accessibilit…" with the next card pushed off screen
+ entirely. Nothing about the type had grown: the box framing it lost a third of its width while
+ padding, radii and line spacing stayed in dp, and that mismatch is what reads as clumsy rather than
+ as large. Six rungs now carry a second column about three quarters of the first, chosen once from the
+ device's short side against Android's own 600dp line (`sw600dp`) — the same line, not a second one.
+ The tablet column is the original design and is untouched; a phone gets 20 / 15.5 / 13.5 / 12 / 10.5 /
+ 9.5. **MICRO moves least on purpose**: it is already the floor of what can be read, and a floor that
+ moves with the screen is not a floor. The system font scale is deliberately not read — a phone with
+ text turned up still renders these at that scale, and the phone column is set with that in mind.
+- **Every English-facing markdown file is now free of Chinese characters.** The README had to be; the
+ other fourteen did not, and they had accumulated UI labels, language badges (the Chinese badge text
+ became `Chinese`, with its link target unchanged), and one piece of shorthand. The rule is mechanical now rather than a
+ habit, and it is worth knowing what it deliberately excludes: **code identifiers, code comments and
+ `CLAUDE.md` are out of scope** — the last one is written for AI assistants.
+
+### Fixed
+
+- **The voice self-check named a provider the device might not be using.** `voiceKey` asked for
+ `apiKey` and `voiceReach` probed `openspeech.bytedance.com`, unconditionally — correct while there
+ was one provider, and a wrong answer the moment there were two. Both follow the selected provider
+ now.
+
## [0.3.2] - 2026-10-14
Wake word plus polish, and the first release that ships the APK with the release rather than telling
diff --git a/CLAUDE.md b/CLAUDE.md
index 4ae2e66..2335b02 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -153,9 +153,15 @@ Screenshots return base64 PNG over the wire (downscaled to 1280 long side — se
### Voice pipeline
-`AsrController` / `TtsController` are thin state machines gluing `AudioIO` (raw PCM 16-bit LE) to hand-rolled ByteDance 火山 clients. `HuoshanAsr` and `HuoshanTts` implement **custom binary WebSocket framing** — 4-byte header + event/seq + gzipped JSON payload — ported from other projects (wxBot's Python, electron-vite's TypeScript respectively); the class KDoc documents the wire format and event-code sequence, and is the only spec available. Don't "simplify" the framing.
+`AsrController` / `TtsController` are thin state machines gluing `AudioIO` (raw PCM 16-bit LE) to a speech backend. **There are two backends and they are chosen by `VoiceConfig.voiceProvider`**: ByteDance 火山 (the default, and the only one a source checkout has) and Google. `AsrEngine` / `TtsEngine` are the interfaces between them; they exist because both backends are *streaming* and reduced to the same five calls, so the two fit one shape without either being reshaped — not because a branch inside the controller would have been hard. Everything above the interface is provider-agnostic, including the caller's silence rule, which reads `Listener.onPartial` and nothing else.
-Non-obvious: `AsrController.stopImpl` deliberately blocks on `waitFinished(3000)` because 火山 sends the final transcript ~500 ms *after* the client's `isLast` — closing eagerly loses it.
+`HuoshanAsr` and `HuoshanTts` implement **custom binary WebSocket framing** — 4-byte header + event/seq + gzipped JSON payload — ported from other projects (wxBot's Python, electron-vite's TypeScript respectively); the class KDoc documents the wire format and event-code sequence, and is the only spec available. Don't "simplify" the framing.
+
+`GoogleAsr` / `GoogleTts` are **two different protocols behind one key**: recognition runs over the Gemini Live API (a WebSocket, so it needs the project *number* and a location), synthesis is plain HTTP against the same Vertex Express key.
+
+Non-obvious, and now cross-provider: `AsrController.stopImpl` blocks on `waitFinished(...)` because 火山 sends the final transcript ~500 ms *after* the client's `isLast` — closing eagerly loses it. That wait is **not a shared constant**: it is `AsrEngine.finalWaitMs`, asked of the engine in play, because the two differ structurally. 火山 produces a final only when told the utterance is over, so its answer is already on its way; Gemini Live ends turns on its own voice detector, so by the time it is asked it has usually already answered and the request is what provokes a last push of trailing silence. Raising a single shared number to suit Google would quietly have made 火山 slower to give up on a server that had stopped answering — which is the mistake the interface exists to prevent.
+
+`VoiceConfig.voiceProvider` is **anything that is not exactly `google` reads as 火山**, the same fail-closed direction `brainConfig` and `groundingEnabled` use, and 火山 is the leftmost option in the picker for the same reason. Google's defaults are real values rather than blanks (`asia-northeast1`, two model names) and every hint on its settings rows is what a blank row resolves to. **`GOOGLE_VOICE_KEY` non-empty at package time is what makes Google the default provider** — a build is packaged *for* whoever it is packaged for. Note the consequence for anything that reports on the voice path: `SelfCheck.voiceKey` and `voiceReach` both follow the selected provider now, and the rows deliberately name neither provider, because a green tick earned by the 火山 key while the device is talking to Google is the lie that having one checklist instead of two exists to prevent.
### The ball wears the face the model picked (`brain/SpeechMood.kt`)
@@ -508,13 +514,13 @@ All settings live in one `SharedPreferences` file (`voice_prefs`), read/written
`llm_api_key` **is** a preference, unlike the two constants below and deliberately so: the DeepSeek key is the user's own and gets rotated, so it has to be replaceable without a rebuild. Note the standing limitation this shares with every other *typed* field: `SettingsUi.saveAndHide()` and `save()` both skip blank values, so a field can be overwritten but never cleared. That is why the brain is an explicit `brain=hub|local` setting rather than "blank `hub_url` means go local" — the latter would have had no way back.
-The settings card works around that limitation for the three settings that are really enums. `brain`, `llm_thinking` and `grounding` are **segmented pickers**, not text fields, and `saveAndHide()` writes every picker unconditionally (a picker's value is never blank, so `save()` can't drop it) while still writing only non-empty text fields. Two things to preserve when editing `SettingsUi`: the **leftmost option is the fallback** when the saved string matches nothing, which is why `grounding` lists 关 first and `brain` lists 本机 first — the same fail-closed direction `groundingEnabled` and `brainConfig` apply when reading; and a picker's key must be in `VoiceConfig.current()` or the row silently redraws as the leftmost option every time the card opens. The brain section shows only the half in play (`hub_url` / `device_name` *or* the DeepSeek rows, never both), and the 火山 endpoint group — which sits directly after the brain section — starts collapsed because the endpoints and resource IDs ship working defaults — the one row in it that has no default, and that the device cannot work without, is the key.
+The settings card works around that limitation for the settings that are really enums. `brain`, `llm_thinking`, `grounding` and `voice_provider` are **segmented pickers**, not text fields, and `saveAndHide()` writes every picker unconditionally (a picker's value is never blank, so `save()` can't drop it) while still writing only non-empty text fields. Two things to preserve when editing `SettingsUi`: the **leftmost option is the fallback** when the saved string matches nothing, which is why `grounding` lists 关 first, `brain` lists 本机 first and `voice_provider` lists 火山 first — the same fail-closed direction `groundingEnabled`, `brainConfig` and `voiceProvider` apply when reading; and a picker's key must be in `VoiceConfig.current()` or the row silently redraws as the leftmost option every time the card opens. The brain section shows only the half in play (`hub_url` / `device_name` *or* the DeepSeek rows, never both), and the 火山 endpoint group — which sits directly after the brain section — starts collapsed because the endpoints and resource IDs ship working defaults — the one row in it that has no default, and that the device cannot work without, is the key. **The voice block as a whole follows the voice provider**: `applyProvider` shows the 火山 rows *or* the Google rows and never both, because they are not two flavours of the same thing (火山's are endpoints and resource ids; Google's are a project number, a location and two model names). That block is also **not drawn at all under the CodeFlying backend**, and not merely disabled — there `voiceProvider` is pinned to 火山 and every endpoint and credential comes from the build, so every control in it would be read by nothing; its `setVisible` belongs to the mode picker rather than to this build pass, so picking 本机 out of CodeFlying shows the block without a save-and-rebuild.
**The card is bilingual, and nothing else on the device is.** `lang` (`VoiceConfig.uiLanguage()`) is `zh` / `en`, and every string in `SettingsUi` exists twice through one helper, `t(zh, en)` — there are no string resources here, because there is no Activity and no layout XML to hang them off. Two deliberate asymmetries. Unset falls through to `Locale.getDefault()` rather than to Chinese: an English tablet opening a Chinese settings card is the same bug as the reverse, and once the user picks one the saved value outranks the system locale forever. And the language picker is the one setting **written the instant it is tapped**, then `rebuild()` swaps the whole view tree in place (reusing the old `LayoutParams`, `removeView` + `addView`, no `OwnCard` change) — the redraw in the new language *is* the confirmation, and a switch that waited for 保存 would look broken for as long as the user looked at it. Consequence, accepted: 取消 does not put the language back. `rebuild()` carries unsaved text across via `currentEdits()`, so the swap is not a data loss. Scope: `VaultUi`, `WakeEnrollUi`, the ball's subtitles and everything the brain says are still Chinese-only — `lang` is a settings-card setting, not a device locale.
-`VoiceConfig.API_KEY` ships **empty**, and must stay that way in this repository. It used to hold a real 火山 key so a fresh install could hear and speak with no setup — a trade only available to a build nobody else reads. In public source a key is a key in a search index, and a bare UUID is not a shape GitHub's secret scanning recognises, so nothing would warn anyone it had leaked. The key is therefore the user's to supply, in ⚙ (`api_key`, which is in `ALLOWED_KEYS` and has a `SettingsUi` row for exactly this reason). `VoiceConfig.TTS_SPEAKER` stays a compiled-in constant — it is a voice name, not a credential, and it is only the fallback for the looks that ship without one (see `lookSpeaker`).
+`VoiceConfig.API_KEY` ships **empty**, and must stay that way in this repository. It used to hold a real 火山 key so a fresh install could hear and speak with no setup — a trade only available to a build nobody else reads. In public source a key is a key in a search index, and a bare UUID is not a shape GitHub's secret scanning recognises, so nothing would warn anyone it had leaked. The key is therefore the user's to supply, in ⚙ (`api_key`, which is in `ALLOWED_KEYS` and has a `SettingsUi` row for exactly this reason). **The same rule now covers the Google side**: `GOOGLE_VOICE_KEY` and its five companions live in `local.properties` (gitignored) and are empty in the repository's copy, so a clean checkout builds exactly what it built before Google existed. `VoiceConfig.TTS_SPEAKER` stays a compiled-in constant — it is a voice name, not a credential, and it is only the fallback for the looks that ship without one (see `lookSpeaker`).
-The consequence to design for is that **an empty key fails at the WebSocket handshake**, which surfaces as a connect timeout — a device that looks like it has a network problem when what it has is a blank field. That is why `SelfCheck.voiceKey` exists and sits immediately before `voiceReach`: it is free, offline, and it is what makes `voice_host` green + ASR failing a usable deduction. It is `WARN`, not `FAIL`, because the brain, the screen tools and the notebook all work mute.
+The consequence to design for is that **an empty key fails at the handshake**, which surfaces as a connect timeout — a device that looks like it has a network problem when what it has is a blank field. That is why `SelfCheck.voiceKey` exists and sits immediately before `voiceReach`: it is free, offline, and it is what makes `voice_host` green + ASR failing a usable deduction. It is `WARN`, not `FAIL`, because the brain, the screen tools and the notebook all work mute. Both rows follow the selected provider, and neither names it — see the voice-pipeline section above.
### Notification triage: the device forms its own opinion first
diff --git a/DISCLAIMER.md b/DISCLAIMER.md
index 806034a..d649ca7 100644
--- a/DISCLAIMER.md
+++ b/DISCLAIMER.md
@@ -34,7 +34,7 @@ An **experimental** piece of software that you install on **your own device**. I
| What | Goes to | Default |
|---|---|---|
-| Your speech (ASR) and its speech (TTS) | **Volcengine / ByteDance cloud** | `openspeech.bytedance.com` |
+| Your speech (ASR) and its speech (TTS) | **The speech provider you select** — Volcengine / ByteDance by default, or Google | Whichever is picked in ⚙ → **Backend → Voice provider**: Volcengine → `openspeech.bytedance.com`; Google → `aiplatform.googleapis.com`. A build packaged with a Google key comes up on Google; the source checkout defaults to Volcengine |
| The conversation, **and every tool result** | The "brain" you configured | `brain=local` (the out-of-box default) → `api.deepseek.com` on a Chinese UI and `api.openai.com` on an English one; in hub mode, your own `hub_url` |
| The private notebook (`Notebook` — what it remembers about you, what it promised) | **On this device only** | Filtered out of the hub payload |
| **Version check**: your version number, phone model / brand / OS version, UI language, one random install ID | **A server the maintainers run** (not a third party) | Once on first launch, and once per tap on the self-check page's **Check again**; capped at 10 per IP per day |
@@ -46,7 +46,7 @@ The second row needs spelling out: **tool results are part of the conversation.*
**So "local mode" does not mean "processed locally."** Local mode swaps the hub for whichever provider you typed in. It does not keep a single byte on the device.
Therefore:
-- *"We do not monitor or store your data"* — **mostly true, but do not overclaim it.** No database, no behavioural analysis, and no reading of anything you send; the one exception is the version check, which tells us that some device of some model on some IP is running 0.3.2.
+- *"We do not monitor or store your data"* — **mostly true, but do not overclaim it.** No database, no behavioural analysis, and no reading of anything you send; the one exception is the version check, which tells us that some device of some model on some IP is running 0.4.0.
- *"Your data never leaves the device"* — **false. Do not claim it.**
## 3. What it can actually do (not hypotheticals — current state of the code)
diff --git a/DISCLAIMER.zh-CN.md b/DISCLAIMER.zh-CN.md
index 02e80d7..7286c20 100644
--- a/DISCLAIMER.zh-CN.md
+++ b/DISCLAIMER.zh-CN.md
@@ -33,7 +33,7 @@
| 什么数据 | 去哪 | 默认 |
|---|---|---|
-| 你说的话(语音识别)、它说的话(语音合成) | **火山引擎(字节跳动)云端** | `openspeech.bytedance.com` |
+| 你说的话(语音识别)、它说的话(语音合成) | **你选的那家语音服务商** —— 默认是火山引擎(字节跳动),也可以选 Google | 看 ⚙ → **后端 → 语音服务商** 选了谁:火山 → `openspeech.bytedance.com`;Google → `aiplatform.googleapis.com`。打包时内置了 Google 密钥的构建默认走 Google;源码检出默认走火山 |
| 对话内容,**以及全部工具返回结果** | 你配置的"大脑" | `brain=local`(开箱默认)→ 中文界面走 `api.deepseek.com`、英文界面走 `api.openai.com`;hub 模式下走你自己的 `hub_url` |
| 私人笔记本(`Notebook`:它记住的你、以及它答应过的事) | **只在本机** | 不进 hub 载荷,不外发 |
| **版本自检**:当前版本号、手机型号 / 品牌 / 系统版本、界面语言、一个随机安装 ID | **维护者自己的一台服务器**(不是第三方) | 首次启动一次,以及在自检页点「重新检查」时一次;同一 IP 每天最多 10 次 |
@@ -45,7 +45,7 @@
**因此"本机模式"不等于"本地处理"** —— 本机模式只是把大脑从 hub 换成了你填的那个服务商。它没有让数据留在设备上,一个字都没有。
所以:
-- 「我们不会监控和存储您的数据」——**基本成立,但别把话说满**。不落库、不做行为分析、不看你发的内容;唯一的例外是版本自检,它让我们知道"某个 IP 上,有一台某个型号的设备在跑 0.3.2"。
+- 「我们不会监控和存储您的数据」——**基本成立,但别把话说满**。不落库、不做行为分析、不看你发的内容;唯一的例外是版本自检,它让我们知道"某个 IP 上,有一台某个型号的设备在跑 0.4.0"。
- 「您的数据不会离开设备」——**不成立,而且不要说**。
## 3. 它真的能做什么(以下都不是危言耸听,是代码里的现状)
diff --git a/README.md b/README.md
index acd3800..c798e14 100644
--- a/README.md
+++ b/README.md
@@ -123,7 +123,8 @@ is what would make a new one a port rather than a rewrite, but nothing outside A
> send messages under your name, read your messages, contacts and location, and — with a robot dog
> attached — physically move. It is experimental, carries no warranty, and **what it does is your
> responsibility**, including a transfer to the wrong person. Data does leave the device: your speech
-> goes to Volcengine, and the conversation goes to whichever brain you configure. Read
+> goes to whichever speech provider you select (Volcengine by default, Google if you pick it), and the
+> conversation goes to whichever brain you configure. Read
> **[DISCLAIMER.md](DISCLAIMER.md)** and **[docs/acceptable-use.md](docs/acceptable-use.md)** first.
## Key features
@@ -333,11 +334,15 @@ behind it falls back to something else. The ball does at least say so out loud,
doing nothing.
-**2. The voice key — optional.** A [Volcengine Speech](https://www.volcengine.com/product/voice-tech)
-API key, in the **Volcengine API key** field of the same **Backend → On-device** tab. Without it
-ASR and TTS fail during the WebSocket handshake, which surfaces as a **connect timeout** — the device looks
-like it has a network problem when what it has is a blank field. Everything else still works; it is
-just mute and deaf.
+**2. The voice key — optional.** You pick the provider first, at the top of the same **Backend →
+On-device** tab (**Voice provider** → Volcengine or Google), and then fill in that provider's key.
+This is a separate service from Volcengine's, with its own terms and data handling.
+For **Volcengine**, a [Volcengine Speech](https://www.volcengine.com/product/voice-tech) API key goes
+in the **Volcengine API key** field; for **Google**, a Vertex Express key plus a GCP project *number*
+and a location. Without a key for whichever one is selected, ASR and TTS fail during the handshake,
+which surfaces as a **connect timeout** — the device looks like it has a network problem when what it
+has is a blank field. Everything else still works; it is just mute and deaf.
+Whichever you pick, the audio goes to that provider — see [DISCLAIMER.md](DISCLAIMER.md).
> **If you took the CodeFlying route in [Quick Start](#quick-start), both keys are already baked in.**
> ⚙ → **Backend** will show **CodeFlying** as the active tab; LLM, ASR, TTS and the long tail of
@@ -556,7 +561,7 @@ Pure Kotlin, no Compose; the whole thing hangs off two pillars, `WindowManager`
| minSdk | 30 | Android 11 — `AccessibilityAction.ACTION_IME_ENTER` and `takeScreenshot` are both API 30+ |
| Java / Kotlin JVM target | 1.8 | `sourceCompatibility` 1.8, `jvmTarget = '1.8'` |
| **Build JDK** | **17–20** | see [Which JDK](#which-jdk) — this is the step people get stuck on |
-| versionCode / versionName | 6 / 0.3.2 | see [CHANGELOG.md](CHANGELOG.md) for the policy |
+| versionCode / versionName | 7 / 0.4.0 | see [CHANGELOG.md](CHANGELOG.md) for the policy |
| applicationId / namespace | `net.kuafuai.andee` | never changed from the template. It affects nothing |
**Runtime dependencies** (`app/build.gradle`):
@@ -968,7 +973,8 @@ The four points worth reading even if you read nothing else:
defence, because it is not one.
- **What it sends is yours.** Messages, posts, calls and orders go out under your name.
- **Your data leaves the device.** There is no analytics SDK in this repo — but speech goes to
- Volcengine, the conversation plus every tool result goes to whichever brain endpoint you configure,
+ whichever speech provider you select (Volcengine by default, Google if you pick it), the conversation
+ plus every tool result goes to whichever brain endpoint you configure,
and the version check goes to a server the maintainers run. Local mode changes the destination, not
the fact.
- **It can be steered by what is on screen.** Anyone who can get you to open a page can influence it.
@@ -984,7 +990,7 @@ Read it before redistributing: **the ML Kit barcode SDK and the `play-services-*
open-source**, and the barcode model is fetched from Google at runtime.
See [CHANGELOG.md](CHANGELOG.md) for what changed and for the versioning policy. The latest release is
-**`v0.3.2`** — pre-1.0 on purpose, because the wire contract and the build flags are still moving.
+**`v0.4.0`** — pre-1.0 on purpose, because the wire contract and the build flags are still moving.
## Related documents
diff --git a/README.zh-CN.md b/README.zh-CN.md
index b119abd..9e6e6b7 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -109,7 +109,8 @@ https://github.com/user-attachments/assets/866e8333-e97b-4bf5-9525-540f9fdb01cd
> **装之前先读这段。** Andee 会替你点击、输入、动手。他能完成一笔支付,能以你的名义发消息,能读你的
> 短信、通讯录和位置,接了机器狗还会**真的在地板上移动**。他是实验性的、不提供任何担保,而
-> **他做的一切都算你的** —— 包括转错账。数据也会离开设备:语音走火山引擎,对话走你配置的那个大脑。
+> **他做的一切都算你的** —— 包括转错账。数据也会离开设备:语音走你选的那家服务商(默认火山,
+> 也可以选 Google),对话走你配置的那个大脑。
> 装之前请先读 **[DISCLAIMER.zh-CN.md](DISCLAIMER.zh-CN.md)** 和 **[docs/acceptable-use.zh-CN.md](docs/acceptable-use.zh-CN.md)**。
## 核心能力
@@ -287,10 +288,13 @@ debug 包**。它省掉的是「自己打包」,**省不掉「配令牌」**
OpenAI 兼容端点(`llm_api_key`,中文界面默认 `https://api.deepseek.com`)。**空着,本机大脑根本跑不起来**
—— 它后面没有别的兜底。球至少会把这句话说出来,而不是默默什么都不做。
-**2. 语音密钥 —— 非必须。** 一个[火山引擎语音服务](https://www.volcengine.com/product/voice-tech)
-的 API Key,填在**后端 → 本机**同一 tab 下的「火山 API Key」。不填,识别和合成会在 WebSocket
-握手阶段失败,**表现为连接超时** —— 看着像网络坏了,其实是那一栏空着。其余功能照常,只是既听不见
-也说不出。
+**2. 语音密钥 —— 非必须。** 先在同一个**后端 → 本机** tab 顶部选服务商(**语音服务商** → 火山 /
+Google),再填该服务商的密钥。这是两个独立的服务,条款和数据处理各归各家。
+选**火山**就填[火山引擎语音服务](https://www.volcengine.com/product/voice-tech)的 API Key;
+选 **Google** 则要一把 Vertex Express Key,外加 GCP 的**项目编号**(不是项目名)和一个区域。
+选中的那家没填密钥,识别和合成就会在握手阶段失败,**表现为连接超时** —— 看着像网络坏了,
+其实是那一栏空着。其余功能照常,只是既听不见也说不出。
+不管你选哪家,音频都会发到那家 —— 见 [DISCLAIMER.zh-CN.md](DISCLAIMER.zh-CN.md)。
> **如果你走的是[快速开始](#快速开始)里 CodeFlying 那条路,这两把 Key 都已经在安装包里了。**
> ⚙ → **后端**会直接显示 **CodeFlying** 这一 tab 为当前后端;LLM、ASR、TTS 以及海量第三方 API
@@ -403,7 +407,7 @@ OpenAI 兼容端点(`llm_api_key`,中文界面默认 `https://api.deepseek.c
| minSdk | 30 | Android 11 —— 因为要用 `AccessibilityAction.ACTION_IME_ENTER`(API 30+)和 `takeScreenshot`(API 30+) |
| Java / Kotlin JVM target | 1.8 | `sourceCompatibility` 1.8、`jvmTarget = '1.8'` |
| **构建用 JDK** | **17–20** | 见[配 JDK](#配-jdk),这是最容易卡住的一步 |
-| versionCode / versionName | 6 / 0.3.2 | 策略见 [CHANGELOG.md](CHANGELOG.md) |
+| versionCode / versionName | 7 / 0.4.0 | 策略见 [CHANGELOG.md](CHANGELOG.md) |
| applicationId / namespace | `net.kuafuai.andee` | 从模板里没改,不影响功能 |
**运行库依赖**(`app/build.gradle`):
@@ -852,7 +856,8 @@ CLAUDE.md 给 AI 编码助手看的架构说明(英文)
`FLAG_SECURE`,**本项目对这条路径没有任何技术围栏**。任何涉及钱的操作都要人在场;并且请记住
**"是 AI 自己做的"不是抗辩理由**,因为它确实不是。
- **他发出去的东西是你的。** 消息、帖子、通话、订单,署名都是你。
-- **你的数据会离开设备。** 本仓库里没有数据分析 SDK,但语音会走火山引擎,对话连同**全部工具返回
+- **你的数据会离开设备。** 本仓库里没有数据分析 SDK,但语音会走你选的那家服务商(默认火山,
+ 也可以选 Google),对话连同**全部工具返回
结果**会走到你配置的那个大脑端点,版本自检会走到一台维护者自己跑的服务器。"本机模式"换的是
目的地,不是这个事实。
- **他能被屏幕上的字操纵。** 任何能让你打开一个页面的人,都可能影响到他。
@@ -865,7 +870,7 @@ CLAUDE.md 给 AI 编码助手看的架构说明(英文)
随包分发的第三方组件清单在 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。再分发之前请先看:
**ML Kit 扫码 SDK 和 `play-services-*` 不是开源许可**,而且扫码模型是运行时从 Google 拉的。
-改了什么、以及版本号策略见 [CHANGELOG.md](CHANGELOG.md) —— 当前版本是 **`v0.3.2`**,故意停在
+改了什么、以及版本号策略见 [CHANGELOG.md](CHANGELOG.md) —— 当前版本是 **`v0.4.0`**,故意停在
pre-1.0:线上协议和构建开关都还在动。
## 相关文档
diff --git a/app/build.gradle b/app/build.gradle
index 7a2af72..36243ee 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -34,8 +34,8 @@ android {
applicationId "net.kuafuai.andee"
minSdk 30
targetSdk 34
- versionCode 6
- versionName "0.3.2"
+ versionCode 7
+ versionName "0.4.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
diff --git a/docs/permissions.md b/docs/permissions.md
index 290a56e..ebd2e12 100644
--- a/docs/permissions.md
+++ b/docs/permissions.md
@@ -102,7 +102,7 @@ Andee has a vault (`config/Vault.kt`) for the account passwords you enter yourse
| What | Where it goes | Default |
|---|---|---|
-| Speech recognition (what you say), speech synthesis (what he says) | **Volcengine (ByteDance) cloud** | `openspeech.bytedance.com` |
+| Speech recognition (what you say), speech synthesis (what he says) | **The speech provider you select** — Volcengine (ByteDance) by default, or Google | Whichever is picked in ⚙ → **Backend → Voice provider**: Volcengine → `openspeech.bytedance.com`; Google → `aiplatform.googleapis.com`. A build packaged with a Google key comes up on Google; the source checkout defaults to Volcengine |
| Conversation content, **and every tool result** | The "brain" **you** configured | `brain=local` (the out-of-box default) → `api.deepseek.com` on a Chinese UI and `api.openai.com` on an English one; in hub mode, your own `hub_url` |
| Private notebook (`config/Notebook.kt`: what he remembers about you, what he promised) | **On-device only** | It is `localOnly` and never enters the hub payload |
| **Version check**: your version number, phone model / brand / OS version, UI language, one random install ID | **A server the maintainers run** (not a third party) | Once on first launch, and once per tap on **Check again**; capped at 10 per IP per day |
diff --git a/docs/permissions.zh-CN.md b/docs/permissions.zh-CN.md
index 683a806..459332f 100644
--- a/docs/permissions.zh-CN.md
+++ b/docs/permissions.zh-CN.md
@@ -102,7 +102,7 @@ Andee 有一个保险箱(`config/Vault.kt`),用来存你自己填进去的
| 什么数据 | 去哪 | 默认值 |
|---|---|---|
-| 语音识别(你说的话)、语音合成(他说的) | **火山引擎(字节跳动)云端** | `openspeech.bytedance.com` |
+| 语音识别(你说的话)、语音合成(他说的) | **你选的那家语音服务商** —— 默认是火山引擎(字节跳动),也可以选 Google | 看 ⚙ → **后端 → 语音服务商** 选了谁:火山 → `openspeech.bytedance.com`;Google → `aiplatform.googleapis.com`。打包时内置了 Google 密钥的构建默认走 Google;源码检出默认走火山 |
| 对话内容,**以及全部工具返回结果** | 你配置的"大脑" | `brain=local`(开箱默认)→ 中文界面走 `api.deepseek.com`、英文界面走 `api.openai.com`;hub 模式下走你自己的 `hub_url` |
| 私人笔记本(`config/Notebook.kt`:记住的你、答应过的事) | **只在本机** | 是 `localOnly`,不进 hub 载荷 |
| **版本自检**:当前版本号、手机型号 / 品牌 / 系统版本、界面语言、一个随机安装 ID | **维护者自己的一台服务器**(不是第三方) | 首次启动一次,以及在自检页点「重新检查」时一次;同一 IP 每天最多 10 次 |
diff --git a/docs/releases/v0.4.0.md b/docs/releases/v0.4.0.md
new file mode 100644
index 0000000..4225fd6
--- /dev/null
+++ b/docs/releases/v0.4.0.md
@@ -0,0 +1,204 @@
+# v0.4.0
+
+**A second voice provider, a launcher icon that is the character rather than a description of it, and
+three fixes to how the interface is drawn.** The voice work is the first change in this project
+contributed from outside the maintainers and merged as a pull request.
+
+> **The attached APK is the `debug` build, as a stopgap.** The release build type has no
+> `signingConfig` and there is no keystore in this repository, so `assembleRelease` emits
+> `app-<abi>-release-unsigned.apk`, which will not install until you sign it. Rather than ship nothing
+> while that decision is still open, the attached APK is the debug variant: signed with the standard
+> Android debug certificate, and it installs as-is. It is `debuggable`, it is larger than a signed
+> release build, and it is **bare** — no keys, English, CodeFlying off. See **[Download](#download)**
+> for the two keys you will have to supply yourself before it can do anything.
+
+## Highlights
+
+- **You can choose who hears and who speaks.** Before this release there was one speech provider and
+ it was not a choice; now there are two, picked in **⚙ → Backend → Voice provider**. Volcengine stays
+ the default and the fallback.
+- **The self-check stopped naming a provider the device might not be using.** Its key and reachability
+ rows now ask about the provider actually selected, and they name neither — a green tick earned by one
+ provider's key while the device is talking to the other is the lie the checklist exists to prevent.
+- **The launcher icon is the character's thinking pose, on white** — the same character as before, in
+ the pose the app is in when it is working.
+- **The primary button is one flat blue fill instead of a gradient**, and it now answers to the theme
+ like everything else. **Type is sized against the device**, so a phone no longer renders a tablet's
+ title clipped to `Accessibilit…` with the next card pushed off screen.
+
+## What's Changed
+
+### Added
+
+- **Google ASR and TTS, as a second voice provider.** `VoiceConfig.voiceProvider` reads `huoshan` or
+ `google`; the settings card gained a **Voice provider** picker above the two credential blocks; and
+ `AsrController` / `TtsController` now build one of two engines behind a shared interface
+ (`AsrEngine`, `TtsEngine`). The interface exists because both backends are *streaming* and reduce to
+ the same five calls — nothing above them had to change. Volcengine remains the fallback: anything
+ that is not exactly `google` reads as Volcengine, and it is the leftmost option, because for every
+ device that predates this row it is what has been running.
+ Google's two halves are **different protocols behind one key**: recognition runs over the Gemini Live
+ API (a WebSocket, so it needs the project *number* and a location) and synthesis is plain HTTP. Its
+ defaults are real values rather than blanks — `asia-northeast1`,
+ `gemini-3.5-transcribe-live-preview`, `gemini-3.1-flash-tts-preview` — and every hint on its rows is
+ what a blank row resolves to, because a card that advertises a model but silently calls another is
+ lying in the one place the user goes to decide. The key's *value* is never printed; the project
+ number is not a secret, and showing it is how the row can be checked at a glance.
+ **A build with `GOOGLE_VOICE_KEY` non-empty comes up on Google**, and that is deliberate: a build is
+ packaged for whoever it is packaged for. This repository's own copy of that setting is empty, so a
+ checkout builds exactly what it built before Google existed.
+ *(Contributed by @kuafu-limanxiang in [#8](https://github.com/kuafuai/andee/pull/8).)*
+- **The launcher icon is now the thinking pose, on white.** It was built from a sheet with a glow
+ painted around the whole head and composited over that glow; it is now built from the cut-out of the
+ character with a hand on its chin, on a plain `#ffffff`. Same character either way, so nothing about
+ the identity changes. The background is literally white because these illustrations were drawn on
+ white and the warm light on the ball's edge is painted on the ball itself — no colour is inferred
+ from anything. The inferred-glow treatment is not deleted, just one flag away (`--bg glow`). The icon
+ set also came out smaller: 405.4 → 258.3 KiB.
+
+### Changed
+
+- **The primary button is one flat fill instead of a blue-to-violet gradient.** A gradient inside a
+ pill makes the button carry its own light source — the look of a landing page's call to action — and
+ it was the only colour in the whole palette that did not answer to the theme, so on a light card it
+ sat there like a sticker off another design. It is now one theme-aware fill, a step deeper than each
+ theme's accent, which keeps the button the loudest thing on a card for the reason that survives going
+ flat: it is the only saturated fill on it. Violet went with the gradient — the interface has exactly
+ one hue and it is blue. `Glass.TINT_START` and `Glass.TINT_END` are gone.
+ The label moved with the fill, and that is measurable rather than a matter of taste: the old one was
+ near-black by day and white at night, which works on a saturated ground at night and measures about
+ **4:1** by day — under the line for body text. It is white in both themes now, because both fills
+ were picked deep enough to carry it. Seven call sites, one token each; no other surface changes.
+- **Type is sized against the device now, not just against the tablet.** The six rungs were drawn on a
+ 711dp tablet where a card is 500dp wide with air around it. A phone is 392dp and the same card fills
+ it edge to edge, so the same 26sp title read as a heading on one and a shout on the other — on a
+ phone it showed up as a row title clipped to `Accessibilit…` with the next card pushed off screen
+ entirely. Nothing about the type had grown: the box framing it lost a third of its width while
+ padding, radii and line spacing stayed in dp, and that mismatch is what reads as clumsy rather than as
+ large. Six rungs now carry a second column about three quarters of the first, chosen once from the
+ device's short side against Android's own 600dp line (`sw600dp`) — the same line, not a second one.
+ The tablet column is the original design and is untouched; a phone gets 20 / 15.5 / 13.5 / 12 / 10.5 /
+ 9.5. **The smallest rung moves least, on purpose**: it is already the floor of what can be read, and a
+ floor that moves with the screen is not a floor.
+- **Every English-facing markdown file is now free of Chinese characters.** The README had to be; the
+ other fourteen did not, and they had accumulated UI labels, language badges (now `Chinese`, with the
+ link target unchanged) and one piece of shorthand. What the rule deliberately excludes is worth
+ knowing: code identifiers, code comments and the internal notes written for AI assistants are out of
+ scope.
+
+### Fixed
+
+- **The voice self-check named a provider the device might not be using.** Its key row asked for the
+ Volcengine key and its reachability row probed `openspeech.bytedance.com`, unconditionally —
+ correct while there was one provider, and a wrong answer the moment there were two. Both follow the
+ selected provider now.
+
+## Download
+
+Android 11+ (`minSdk 30`). The APK is **per-ABI** (`splits` in `app/build.gradle`), so pick the file
+that matches your device:
+
+| File | Take it if |
+|---|---|
+| `andee-0.4.0-debug-arm64-v8a.apk` | anything bought in the last several years — **this is the one for almost everyone** |
+| `andee-0.4.0-debug-armeabi-v7a.apk` | an older 32-bit device |
+| `andee-0.4.0-debug-x86_64.apk` | an emulator |
+
+### This build is deliberately bare
+
+It is built from source with nothing configured — **verified against the generated `BuildConfig`, not
+assumed**:
+
+- `CODEFLYING_ENABLED` is `false`, and both `CODEFLYING_KEY` and `CODEFLYING_DOMAIN` are empty, so
+ **CodeFlying is not available in this build** and nothing is pre-wired to a hosted backend.
+- **The Google voice settings are empty too**, so this build comes up on **Volcengine** and has no
+ provider key of any kind baked in. Being bare is what keeps the claim above true: a build packaged
+ with a Google key would come up on Google instead.
+- `DEFAULT_LANG` is `en`: a device that has never picked a language comes up in **English**.
+- The thinking default is off.
+
+### The two keys you have to supply yourself
+
+**The assistant cannot do anything until you give it two keys.** Open **⚙ → Backend → On-device** and
+fill in:
+
+1. **The model key (LLM)** — an OpenAI-compatible endpoint plus a model name. On an English UI these
+ default to `https://api.openai.com/v1` and `gpt-4o-mini`; a Chinese UI defaults to
+ `https://api.deepseek.com` and `deepseek-flash`.
+2. **The voice key** — speech recognition and synthesis. Pick the provider first (**Voice provider** →
+ Volcengine or Google), then fill in that provider's key: a Volcengine Speech key, or a Google Vertex
+ Express key plus a GCP project *number* and a location. Optional: without it the assistant is silent
+ but still works on screen.
+
+Then, in this order: grant **Overlay** → enable **Accessibility** → tap the ball. Until the keys are
+in, the card the assistant puts up will name what is missing — that is the self-check working, not a
+fault.
+
+> **Would you rather not configure keys at all?** Then this APK is the wrong door. Use the one-click
+> page instead — **[codeflying.app/andee](https://www.codeflying.app/andee)**, or
+> **[codeflying.net/andee](https://www.codeflying.net/andee)** in mainland China. Describe what you
+> want, tap the build button, and you get a package with the **tokens already configured** plus a QR
+> code to scan. Starting is free and the free token allowance is **finite — once it runs out, tokens
+> must be bought.** It is a separate service with no direct relationship to this project, with its own
+> terms, pricing and data handling.
+
+### Why a debug build, when the README says not to hand one out
+
+Because the alternative, today, is no binary at all. The README's advice still stands for anything you
+*distribute*: a debug APK is `debuggable`, and its certificate is the **shared Android debug key** —
+so it cannot install over a release-signed build, which means moving from this to a signed release
+takes an uninstall, and an uninstall takes the notebook and the vault with it. Use this to try the
+thing, not to hand it to someone who will depend on it.
+
+## Known issues
+
+- **The wake threshold's margin is thin**, carried from `v0.3.2` and unchanged here: the eight measured
+ judgements sit in 1.47–2.05 with the line landing in the gap between 1.69 and 1.77 — 0.08 wide. There
+ is still **no quality gate on enrolment takes**, so a future enrolment can contribute a bad one.
+- **A light generated page still fades in over a dark stage.** `TextPage`, `TracePage`,
+ `Theme.Body.Fullscreen`'s window background and `HtmlActivity`'s WebView backdrop are all still dark.
+ Carried over from `v0.3.1`; not addressed here.
+- **A build with CodeFlying compiled in but no API key can still raise the wrong complaint.** The
+ availability test looks at `CODEFLYING_ENABLED` and the domain rather than the key. Carried from
+ `v0.1.1` onward; not fixed by this release.
+- **`assets/andee_key.txt` is tracked by git and is not in `.gitignore`.** It ships empty, which is
+ correct — the per-user token is written in at package time. But a local build that fills it in would
+ be a key in a tracked file, and nothing currently stops that being committed.
+- The two issues `v0.1.0` listed are **unchanged and untouched in this release**:
+ `tools/verify_faces_lab.py` still reports 7/16 assertions passing against the committed
+ `reports/ball-faces-lab.html`, and the debug WebSocket server (`net/BodyWsServer`) still binds
+ `0.0.0.0:9008` with no authentication (documented in `SECURITY.md`).
+
+## Before you install
+
+Read **[DISCLAIMER.md](../../DISCLAIMER.md)** and
+**[docs/acceptable-use.md](../acceptable-use.md)** first. This app asks for accessibility, overlay,
+notification access, SMS and call log, and it can complete a payment by tapping. The only guardrail on
+that path is Android's `FLAG_SECURE`; the prompt-level checks on risky actions are instructions to the
+model, not enforcement.
+
+## Install from source
+
+If you would rather build it yourself — or need a *signed* release build, which is what you should
+actually distribute:
+
+```bash
+git clone https://github.com/kuafuai/andee
+cd andee
+git checkout v0.4.0
+./gradlew :app:assembleDebug # installs as-is, signed with the debug certificate
+```
+
+To reproduce the attached build exactly, leave `local.properties` with no `CODEFLYING_*` keys, no
+`GOOGLE_VOICE_*` keys, and `DEFAULT_LANG=en`; that is the whole configuration, and nothing is passed
+on the command line.
+
+`assembleRelease` needs your own keystore — the repo has none, so it produces an unsigned APK that
+will not install until you sign it. Full from-scratch setup, including the JDK traps, is in the
+README's **Provisioning** section.
+
+**Upgrading from v0.3.2:** `versionCode` moves `6 → 7`, so this installs over it normally. Nothing you
+configured is discarded — a device that has never picked a voice provider keeps using Volcengine, and
+the new picker reports that rather than changing it.
+
+**Full Changelog**: https://github.com/kuafuai/andee/compare/v0.3.2...v0.4.0