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.2.0

booboosuia81fb6dab355
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 858eaf6..e9bc9fb 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 **`2` / `"0.1.1"`**.
+- `versionCode` / `versionName` live in `app/build.gradle` and are currently **`3` / `"0.2.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,7 @@ 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` alone has changed in eight commits since the first), the `local.properties`
+(`net/ToolSchemas.kt` alone has changed in ten commits since the first), 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 this
release. Each of those is something a user or a second implementation would have to rebuild against,
@@ -28,6 +28,129 @@ hash into `versionName` at build time would close this hole; it is not implement
## [Unreleased]
+## [0.2.0] - 2026-10-10
+
+Three new capabilities and two permission fixes. A minor bump rather than a patch, because the three
+are new capabilities by this file's own definition — the first release where that rule has had to
+decide anything. The permission pair is the part worth reading: the app had been telling the model
+things about the system permission sheet that measuring on a device showed to be false, in one case
+in the direction that made the model act on a grant nobody had given.
+
+### Added
+
+- **A single tap on the ball now stops whatever is running and then listens.** A tap used to mean
+ "listen" and nothing else, which left a gap the moment the ball was busy: to redirect it the user
+ had to stop it first (three taps) and then ask again (one more) — two gestures for one intent.
+ Tapping something busy and having it stop and listen is what one person does to another, and it is
+ the only reading of the tap that is not "talk over the thing you cannot hear". The stop is
+ `stopEverything()`, reused rather than reimplemented, so the single tap and the triple tap cannot
+ drift into two different stops and the hub gets its `task.stop` either way. It is guarded on
+ `dispatcher.isTaskActive()`: on an idle ball there is nothing to stop, and the call would still
+ clear a pending 继续修改, tell the hub to stop, and flash 已停止 ahead of 听着… — three side effects
+ for a tap that only ever meant "listen". Triple-tap still stops, and is still the *immediate* stop,
+ because a single tap has to wait out the double-tap window before it knows it is not the first of
+ two. No gesture moved and no string changed: what a tap *does* depends on what is running, which is
+ not something a line of text can say. Verified on device (HONOR AMM-AN00) — an idle tap listens
+ without flashing 已停止.
+- **A device with no conversation is offered ready-made scenes instead of a dead line.** It used to
+ show 还没有对话 and nothing under it. There is nothing to be helpful *about* yet, and a ball in the
+ corner has taught a newcomer nothing about what the thing does, so the one moment this app can be
+ proactive without being early went unused. The card now shows a hint line — 告诉我,或者选一个 —
+ then a bubble per preset from `ScenePresets`, each labelled with the scene's name and carrying a
+ sentence the user could have said: the name is what a person picks between, the sentence is exactly
+ the part a newcomer cannot invent. Both are fields of one `ScenePresets.Text`, so a bubble cannot
+ promise one thing and send another. **Tapping a bubble adopts the scene before it speaks** — this
+ was wrong first and is the part worth naming: a scene is something the notebook holds, so a bubble
+ that only sent its sentence asked the model about a scene nobody had saved, and it correctly
+ answered that it had never seen one, in front of the user. It is `adoptIfMissing` rather than
+ `adopt` on purpose: a bubble is offered whether or not the preset was adopted, and `saveScene`
+ replaces the whole row including `prompt`, so adopting twice would put the preset's text back over
+ the user's own edited version with nothing to say it had happened. Pre-adopting the presets at
+ install was the other candidate and is worse — a written-down preset is an ordinary scene, so
+ deleting one would have it come back at the next install, the language would freeze to whatever the
+ device spoke then, and it contradicts `LocalPrompt` §11. Emptiness is the whole safety story and it
+ is mechanical: the moment there is a conversation the strip is `GONE` for good, because a
+ suggestion strip parked over a live chat would be the app talking about itself instead of
+ answering. Two numbers are enforced rather than asked for by `ScenePresetsTest`, which caps every
+ summary in both languages and checks that every name a bubble can send is one `byName` can look
+ back up. Verified on device (HONOR AMM-AN00) by reading the notebook over the 9008 tool port.
+- **Long-pressing a history row opens the log behind it.** The scrollback says what was said;
+ everything that earned the right to say it — which tools ran, with what arguments, what came back,
+ what the model reasoned, and what each request cost in prompt tokens — was already in
+ `files/brain_trace.jsonl` and reachable only with `run-as`. The new page is built from those
+ records and opened through `HtmlActivity`, which is where folding the card, hanging the ball off
+ the ledge and the 完成 pill were already solved. Long-press because the other two gestures on a row
+ are taken — a single tap opens a page row's page, a double tap reads a message fullscreen — and the
+ two detectors had to become **one**, because `setOnTouchListener` replaces rather than chains, so a
+ second one would have silently killed the first. **The row and its log are joined by
+ `<process start>-<gen>`, and `gen` alone would have been wrong:** it is an in-memory counter that
+ restarts at 1 with every process while the trace file is persistent, so on the test device `"gen":1`
+ accounted for 176 of 278 records, and installing the change reproduced the collision within 89
+ seconds. A scrollback matching on `gen` would have opened a reinstall's first turn onto yesterday's
+ first turn, with nothing on screen to say so; `BrainTraceTest` locks the join down, dash included.
+ Two things the page got wrong before it was ever shown to anyone, both found by reading records
+ back off the device rather than by reasoning about them: the `turn` card labelled its body "Said",
+ so the user's own sentence appeared in the assistant's mouth on the first card of the page (the
+ heading is where the origin belongs, and `kind` is the field that knows it), and the `end` card
+ said "Turn ended" when `BrainTrace.end` is only written on an *abnormal* finish — two of three
+ turns measured had none at all. Records written before this commit have no `turn` field, so a row
+ from before the upgrade offers no gesture, and the same rule keeps hub-brain rows, scene-change
+ rows and notification read-outs from offering a dead entry.
+
+### Fixed
+
+- **`request_permissions` answered `{"started": true}` no matter what actually happened.** That was a
+ hard-coded `true` meaning only that `startActivity` had not thrown. After a second refusal Android
+ 11+ draws no dialog at all and the call still said true, so the brain read "it is on" and
+ immediately called `get_location`. Measured on turn `1791621839492-4`: the request returned at
+ +19.257s, `get_location` fired at +20.839s and answered `permission denied` 1 ms later — the model
+ gave the user 1.582s to find a dialog that was never drawn, then spent 34.6s looking for a way
+ around it. The reply now carries what happened rather than that something was attempted: `mode`
+ (`solo` / `handoff` / `settings`, who answers the sheet), `result` (`granted` / `denied` /
+ `no_dialog` / `waiting`) and `next`, one line saying what to do about that result. `mode` comes from
+ `routeOf`, a pure function of the ids kept on a whitelist so a permission added to the catalog later
+ falls on "the user was asked once more than necessary" rather than "the ball agreed on their
+ behalf". `result` resolves the distinction that pays for all of it: a refusal and a silent block
+ both read `PERMISSION_DENIED` and demand opposite responses, and
+ `shouldShowRequestPermissionRationale` — readable only from an Activity — is what separates them.
+ `PermissionRequestActivity` used to drop `grantResults` on the floor; it now hands the verdict back
+ through arm/await/settle, and `PermissionsController` waits `DIALOG_GRACE_MS` for it, a grace
+ period rather than a wait for the human. Verified on HONOR AMM-AN00 (location/solo/granted,
+ contacts/handoff/waiting, steps/solo/waiting, each with the sheet really on screen); 37 unit tests
+ pass, with `PermissionsRouteTest` pinning the routes from the id list without a device.
+- **The permission sheet was drawn *underneath* the expanded card, so the user could never see it.**
+ An expanded card is a fullscreen surface and our overlay sits above every activity, so
+ `GrantPermissionsActivity` was drawn below it. Verified on device: the dialog really was up — it
+ was both `ResumedActivity` and `mCurrentFocus` — while a screenshot showed nothing but the card. A
+ question nobody can see is worse than no question, and it is exactly the state `waiting` promises.
+ `device.*` deliberately never folds, on the reasoning that reading state is a conversation rather
+ than an actuation; this branch is the exception that reasoning did not cover, because it addresses
+ the user in a window of the system's own. `device.scan` and `device.vault.fill` already fold for
+ the same reason, so this joins them — and only when `confirm=true`, because the first call is the
+ script the brain reads back and that one belongs in the card.
+- **Both READMEs gained a one-click build page and had its likely-reading fixed.** The nav and the
+ CodeFlying paragraph now point at the `/andee` page — describe the app, tap 立即打包, get a
+ pre-configured package with a QR code — and the "any app" feature line was reworded in both
+ languages, because "not a list of integrations" was being read as a claim about integrations this
+ app has rather than a claim about aim. The page itself is a separate service with no direct
+ relationship to this project, as that paragraph already says.
+
+### Changed
+
+- **The prompt's rule about the system permission sheet was wrong, and is now the measured one.** It
+ said a system permission sheet "does not take a tap you inject", and that turned out to be false.
+ With the card folded, an injected tap on 「始终允许」 really does grant: `READ_CONTACTS` went
+ false → true, and one tap on 「本次使用允许」 produced an `ACCESS_FINE_LOCATION` carrying `ONE_TIME`,
+ a flag only that button can set. The earlier four failures had one cause between them and it was our
+ own card eating the touch, not the sheet refusing it. So the rule changes from "you cannot press it"
+ to **"you cannot read it, so do not aim at it"**: the sheet exposes no accessibility elements at
+ all, so any tap is blind, and the button at the bottom of this particular screen is
+ 「禁止后不再提示」, which nothing can undo. That is the real reason this step stays the user's, and
+ it is a reason that survives being measured. `LocalPrompt` §0's `type_text`-only rule is stated as
+ the general one — a tool saying it pressed something is not the thing being done — and §1's list of
+ genuine exceptions gains the sheet, which is worth naming because putting it on screen is the whole
+ of what firing does.
+
## [0.1.1] - 2026-10-09
### Fixed
diff --git a/DISCLAIMER.md b/DISCLAIMER.md
index ddd31c0..698e2c7 100644
--- a/DISCLAIMER.md
+++ b/DISCLAIMER.md
@@ -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.1.1.
+- *"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.2.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 575e19c..742ee6d 100644
--- a/DISCLAIMER.zh-CN.md
+++ b/DISCLAIMER.zh-CN.md
@@ -45,7 +45,7 @@
**因此"本机模式"不等于"本地处理"** —— 本机模式只是把大脑从 hub 换成了你填的那个服务商。它没有让数据留在设备上,一个字都没有。
所以:
-- 「我们不会监控和存储您的数据」——**基本成立,但别把话说满**。不落库、不做行为分析、不看你发的内容;唯一的例外是版本自检,它让我们知道"某个 IP 上,有一台某个型号的设备在跑 0.1.1"。
+- 「我们不会监控和存储您的数据」——**基本成立,但别把话说满**。不落库、不做行为分析、不看你发的内容;唯一的例外是版本自检,它让我们知道"某个 IP 上,有一台某个型号的设备在跑 0.2.0"。
- 「您的数据不会离开设备」——**不成立,而且不要说**。
## 3. 它真的能做什么(以下都不是危言耸听,是代码里的现状)
diff --git a/README.md b/README.md
index c952576..b267a78 100644
--- a/README.md
+++ b/README.md
@@ -527,7 +527,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 | 2 / 0.1.1 | see [CHANGELOG.md](CHANGELOG.md) for the policy |
+| versionCode / versionName | 3 / 0.2.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`):
@@ -948,7 +948,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.1.1`** — pre-1.0 on purpose, because the wire contract and the build flags are still moving.
+**`v0.2.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 eb8d3e0..ef1ee03 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -382,7 +382,7 @@ OpenAI 兼容端点(`llm_api_key`,默认 `https://api.deepseek.com`)。**
| 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 | 2 / 0.1.1 | 策略见 [CHANGELOG.md](CHANGELOG.md) |
+| versionCode / versionName | 3 / 0.2.0 | 策略见 [CHANGELOG.md](CHANGELOG.md) |
| applicationId / namespace | `net.kuafuai.andee` | 从模板里没改,不影响功能 |
**运行库依赖**(`app/build.gradle`):
@@ -840,7 +840,7 @@ CLAUDE.md 给 AI 编码助手看的架构说明(英文)
随包分发的第三方组件清单在 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。再分发之前请先看:
**ML Kit 扫码 SDK 和 `play-services-*` 不是开源许可**,而且扫码模型是运行时从 Google 拉的。
-改了什么、以及版本号策略见 [CHANGELOG.md](CHANGELOG.md) —— 当前版本是 **`v0.1.1`**,故意停在
+改了什么、以及版本号策略见 [CHANGELOG.md](CHANGELOG.md) —— 当前版本是 **`v0.2.0`**,故意停在
pre-1.0:线上协议和构建开关都还在动。
## 相关文档
diff --git a/app/build.gradle b/app/build.gradle
index 4eaee45..c009942 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -34,8 +34,8 @@ android {
applicationId "net.kuafuai.andee"
minSdk 30
targetSdk 34
- versionCode 2
- versionName "0.1.1"
+ versionCode 3
+ versionName "0.2.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
diff --git a/docs/releases/v0.2.0.md b/docs/releases/v0.2.0.md
new file mode 100644
index 0000000..068c031
--- /dev/null
+++ b/docs/releases/v0.2.0.md
@@ -0,0 +1,126 @@
+# v0.2.0
+
+**Three new capabilities and two permission fixes.** A minor bump rather than a patch, because the
+three are new capabilities by the definition in [CHANGELOG.md](../../CHANGELOG.md#versioning-policy) —
+the first release where that rule has had to decide anything.
+
+The permission pair is the part worth reading. The app had been telling the model things about the
+system permission sheet that measuring on a device showed to be false — once in the direction that
+made the model act on a grant nobody had given, and once in the direction that hid the question from
+the person meant to answer it.
+
+> **No APK is attached to this release, on purpose.** 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. Shipping a binary a
+> reader cannot install would be worse than shipping none. Build it yourself — see *Install* below.
+
+## Highlights
+
+- **Long-press a history row to read the log behind it.** The scrollback says what was said; the new
+ page shows what earned the right to say it — which tools ran, with what arguments, what came back,
+ what the model reasoned, and what each request cost in prompt tokens. It was already on disk and
+ reachable only with `run-as`.
+- **A single tap on the ball stops what is running and then listens.** Redirecting a busy assistant
+ used to take two gestures and four taps; tapping something busy and having it stop and listen is
+ what one person does to another.
+- **An empty card now offers ready-made scenes** instead of 还没有对话 and nothing under it — one
+ bubble per preset, each with a sentence you could have said. Tapping one adopts the scene and then
+ speaks it.
+- **The system permission sheet can actually be seen now.** It was being drawn *underneath* the
+ expanded card, so the dialog was up and focused while the screen showed nothing but the card.
+- **`request_permissions` no longer claims success it cannot observe.** It answered
+ `{"started": true}` even when Android drew no dialog at all, so the model read "it is on" and
+ immediately used the permission.
+
+## What's Changed
+
+### Added
+
+- **Long-press a history row to open its log** (`ui/TracePage.kt`). Joined to the row by
+ `<process start>-<gen>` — `gen` alone would have been wrong, because it restarts at 1 with every
+ process while the trace file is persistent, so a scrollback matching on it would open a reinstall's
+ first turn onto yesterday's first turn. Rows written before this release, hub-brain rows,
+ scene-change rows and notification read-outs offer no gesture, because `turn = null` means there is
+ no log to open. Two page faults were caught by reading records back off the device rather than by
+ reasoning about them: the `turn` card labelled its body "Said" (putting the user's own sentence in
+ the assistant's mouth), and the `end` card said "Turn ended" when `BrainTrace.end` is written only
+ on an *abnormal* finish.
+- **A single tap on the ball stops, then listens.** The stop is `stopEverything()`, reused so the
+ single tap and the triple tap cannot drift apart, and guarded on `dispatcher.isTaskActive()` so an
+ idle tap does not clear a pending 继续修改 or flash 已停止. Triple-tap is still the immediate stop.
+ Verified on device (HONOR AMM-AN00).
+- **Ready-made scenes on a card with no history.** Tapping a bubble **adopts** the scene before it
+ speaks — a bubble that only sent its sentence asked the model about a scene nobody had saved. It is
+ `adoptIfMissing`, so tapping the same bubble again later leaves your own edits intact. The strip is
+ `GONE` for good the moment there is a conversation. Verified on device (HONOR AMM-AN00).
+
+### Fixed
+
+- **`request_permissions` reported an attempt as an outcome.** The reply now carries `mode`
+ (`solo` / `handoff` / `settings`), `result` (`granted` / `denied` / `no_dialog` / `waiting`) and
+ `next`. The split that pays for it: a refusal and a silent block both read `PERMISSION_DENIED` and
+ demand opposite responses, and `shouldShowRequestPermissionRationale` — readable only from an
+ Activity — is what separates them. Measured before the fix on turn `1791621839492-4`: the request
+ returned at +19.257s, `get_location` fired at +20.839s and answered `permission denied` 1 ms later,
+ so the model gave the user 1.582s to find a dialog that was never drawn. Verified on device; 37
+ unit tests pass.
+- **The permission sheet was drawn underneath the expanded card.** Our overlay sits above every
+ activity, so `GrantPermissionsActivity` was drawn below the card — the dialog really was
+ `ResumedActivity` and `mCurrentFocus` while a screenshot showed nothing but the card. The card now
+ folds first, and only when `confirm=true`, because the first call is the script the brain reads back
+ and that one belongs in the card.
+- **Both READMEs point at the one-click build page**, and the "any app" feature line was reworded in
+ both languages — "not a list of integrations" was being read as a claim about integrations this app
+ has rather than a claim about aim.
+
+### Changed
+
+- **The prompt's claim about the permission sheet was wrong and is now the measured one.** It said
+ the sheet "does not take a tap you inject". With the card folded, an injected tap on 「始终允许」
+ really does grant — `READ_CONTACTS` went false → true, and one tap on 「本次使用允许」 produced an
+ `ACCESS_FINE_LOCATION` carrying `ONE_TIME`, a flag only that button can set. The earlier four
+ failures had one cause and it was our own card eating the touch. The rule becomes **"you cannot read
+ it, so do not aim at it"**: the sheet exposes no accessibility elements, so any tap is blind, and
+ the button at the bottom of this screen is 「禁止后不再提示」, which nothing can undo.
+
+## Known issues
+
+- **A build with CodeFlying compiled in but no API key can raise the wrong complaint.** The
+ self-check's availability test looks at `CODEFLYING_ENABLED` and the domain rather than the key, so
+ such a build reports 大脑 key missing and sends the user to fill in a DeepSeek key — while the real
+ cause is at build time. Carried over from `v0.1.1`; not fixed by this release.
+- 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
+
+Android 11+ (`minSdk 30`), arm64-v8a for anything bought in the last several years. There is no binary
+in this release; build one:
+
+```bash
+git clone https://github.com/kuafuai/andee
+cd andee
+git checkout v0.2.0
+./gradlew :app:assembleDebug # installs as-is, signed with the debug certificate
+```
+
+`assembleRelease` needs your own keystore — the repo has none, so it produces an unsigned APK. Either
+way the APK is **per-ABI** (`splits` in `app/build.gradle`), so pick the file that matches the device.
+Full from-scratch setup is in the README's **Provisioning** section. Then, in this order: grant
+Overlay → enable Accessibility → tap the ball → put in your own keys under ⚙.
+
+**Upgrading from v0.1.1:** `versionCode` moves `2 → 3`, so this installs over it normally. History
+rows written by an older build carry no `turn` field, so they will not offer the new long-press —
+that is by design, not a migration failure.
+
+**Full Changelog**: https://github.com/kuafuai/andee/compare/v0.1.1...v0.2.0