Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
feat(android): release the Android app through Google Play
leepokaidc466cbf2fbb
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.mdindex 89dbe820..5b11e1be 100644--- a/.github/pull_request_template.md+++ b/.github/pull_request_template.md@@ -11,12 +11,14 @@ If you made the change with Claude Code, also run the `after-change` workflow(`.claude/workflows/after-change.js`) from the change's worktree and paste its final report.-->-## What's New+## What's New: iPhone<!---Shown on the App Store when this PR ships in an iOS release. One bullet per user-visible-iOS change, in both languages. Leave the bullets empty for changes iPhone users can't see-(host, Linux, CI, docs); a section for the version in apps/ios/WhatsNew.md takes precedence; a release with+Store notes, one section per phone app: iPhone goes to the App Store when this PR ships in an+iOS release, Android to Google Play when it ships in an Android release. One bullet per change+that app's users can see, in both languages. Leave a section's bullets empty when its users+can't see the change (host, desktop, CI, docs, or only the other phone app). A section for the+version in apps/ios/WhatsNew.md or apps/android/WhatsNew.md takes precedence; a release withneither gets a generic "Bug fixes and improvements".-->@@ -27,3 +29,13 @@ neither gets a generic "Bug fixes and improvements".### en-US-++## What's New: Android++### zh-Hant++-++### en-US++-diff --git a/.github/workflows/android-submit.yml b/.github/workflows/android-submit.ymlnew file mode 100644index 00000000..78eb7b11--- /dev/null+++ b/.github/workflows/android-submit.yml@@ -0,0 +1,97 @@+name: Submit Android++# On each v* tag that changes the Android app, builds the signed bundle from that tag and uploads+# it to a Google Play track (tools/play-submit.py), the counterpart of Submit iOS. Releases that+# leave the Android app alone skip it.+on:+ push:+ tags: ["v*"]+ workflow_dispatch:+ inputs:+ version:+ description: "Version to upload, without the v, e.g. 2.25.0"+ required: true+ track:+ description: "Play track: internal, alpha (closed testing) or production"+ default: internal++permissions:+ contents: read+ pull-requests: read++concurrency:+ group: android-submit+ cancel-in-progress: false++env:+ TRACK: ${{ inputs.track || vars.PLAY_TRACK || 'internal' }}+ VERSION: ${{ inputs.version || github.ref_name }}+ # A manual run builds the version's tag, not the branch it was started from.+ REF: ${{ inputs.version && format('refs/tags/v{0}', inputs.version) || github.ref }}++jobs:+ check:+ if: github.repository == 'leepokai/Codync'+ runs-on: ubuntu-latest+ outputs:+ ship: ${{ steps.check.outputs.ship }}+ steps:+ - uses: actions/checkout@v4+ with:+ ref: ${{ env.REF }}+ fetch-depth: 0+ - run: pip install pyjwt cryptography+ - id: check+ env:+ PLAY_SERVICE_ACCOUNT: ${{ secrets.PLAY_SERVICE_ACCOUNT }}+ run: |+ # A manual run ships the version even without Android changes.+ [[ "$GITHUB_EVENT_NAME" == workflow_dispatch ]] && export FORCE=1+ python3 tools/play-submit.py check "${VERSION#v}"++ submit:+ needs: check+ if: needs.check.outputs.ship == 'true'+ runs-on: ubuntu-latest+ timeout-minutes: 60+ steps:+ - uses: actions/checkout@v4+ with:+ ref: ${{ env.REF }}+ fetch-depth: 0+ - uses: actions/setup-java@v4+ with:+ distribution: temurin+ java-version: "21"+ - uses: android-actions/setup-android@v3+ with:+ packages: platform-tools+ - run: sdkmanager "platforms;android-37.0" "build-tools;37.0.0"+ - uses: gradle/actions/setup-gradle@v4+ - name: Build the signed bundle+ working-directory: apps/android+ env:+ UPLOAD_KEYSTORE: ${{ secrets.ANDROID_UPLOAD_KEYSTORE }}+ GOOGLE_SERVICES: ${{ secrets.ANDROID_GOOGLE_SERVICES_JSON }}+ ORG_GRADLE_PROJECT_codyncUploadKeystorePassword: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_PASSWORD }}+ run: |+ echo "$UPLOAD_KEYSTORE" | base64 -d > "$RUNNER_TEMP/upload.p12"+ printf '%s' "$GOOGLE_SERVICES" > "$RUNNER_TEMP/google-services.json"+ ./gradlew :app:bundleRelease \+ -PcodyncUploadKeystore="$RUNNER_TEMP/upload.p12" \+ -PcodyncGoogleServicesFile="$RUNNER_TEMP/google-services.json"+ - run: pip install pyjwt cryptography+ - name: Upload to Google Play+ env:+ PLAY_SERVICE_ACCOUNT: ${{ secrets.PLAY_SERVICE_ACCOUNT }}+ GH_TOKEN: ${{ github.token }}+ run: |+ gh pr list --state merged --limit 200 --json body,mergeCommit > "$RUNNER_TEMP/prs.json"+ PRS="$RUNNER_TEMP/prs.json" python3 tools/play-submit.py upload "${VERSION#v}" \+ apps/android/app/build/outputs/bundle/release/app-release.aab+ - uses: actions/upload-artifact@v4+ with:+ name: codync-android-${{ env.VERSION }}+ path: |+ apps/android/app/build/outputs/bundle/release/app-release.aab+ apps/android/app/build/outputs/mapping/release/mapping.txtdiff --git a/AGENTS.md b/AGENTS.mdindex 90e24f6f..69801668 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -23,7 +23,7 @@ Run from the repository root unless a command changes directories:- `cd apps/desktop && npm ci && npm run dev`: run the desktop app while developing and for its e2e check (renderer reloads on save, restart after `src/main` or preload changes; unpackaged, unsigned). In a linked worktree it runs a [sandbox](docs/guides/dev-app.md#worktree-sandboxes) beside the main checkout's Codync Dev; `--sandbox` does the same from the main checkout. In the main checkout, after a host change run `node tools/native-host.mjs dev` there first: `npm run dev` prefers that build over `host/target/debug`. Package `npm run dist:mac:dev` (about 45 s) only for what an unpackaged run lacks (bundled host install, Codync Screen / computer use, system permissions); `dist:*:main` only to check the production app. `npm run typecheck && npm test` for its CI checks.- `cd host && cargo build`: build the host; `cargo run -- serve` starts it in the foreground.- `cd host && cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test`: run host CI checks.-- `cd apps/android && ./gradlew :core:test :app:testDebugUnitTest :app:assembleDebug :app:lintDebug` (JDK 21, Android SDK 37): Android checks; `adb install -r app/build/outputs/apk/debug/app-debug.apk` installs Codync Dev.+- `cd apps/android && ./gradlew :core:test :app:testDebugUnitTest :app:assembleDebug :app:lintDebug` (JDK 21, Android SDK 37): Android checks; `adb install -r -d app/build/outputs/apk/debug/app-debug.apk` installs Codync Dev.- `cd apps/ios/Kit && xcodebuild test -scheme CodyncKit-Package -destination 'platform=iOS Simulator,name=<any iPhone>'`: run the iPhone package tests.- `cd cloud && npm ci && npm test && npm run typecheck`: validate the cloud service; see `docs/guides/cloudflare-testing.md` for integration checks.- `cd relay && npm ci && npm test && npm run typecheck`: install dependencies and validate the relay.@@ -45,7 +45,7 @@ After every change, test it end to end on the real apps, not just builds and uni- **Every source change ships as a release.** A version bump on `main` is the only release trigger (Auto Tag → desktop app for macOS, Linux and Windows, host, Homebrew, in-app update), so any change to shipped code (`apps/`, `host/`, `packaging/`) bumps the version before it reaches `main`, without being asked. Docs, `web/`, `cloud/`, `relay/` and CI-only changes don't bump.- Phone ↔ host compatibility: each side names the oldest version of the other it works with (`minApp` in the host's `hello`, `minHost` in each client). Additive changes need nothing; a rename/removal raises `minApp` in the same release, and the release gate holds that release until the App Store has the iPhone app: [docs/reference/compatibility.md](docs/reference/compatibility.md)- Pick the bump yourself: patch for fixes and small tweaks, minor for new features or protocol additions. Never bump major (stay on 2.x). One bump per merge into `main`: if `MARKETING_VERSION` is already ahead of the latest `v*` tag, leave it. A change to `host/crates/memory` also raises `codync-mem`'s own 0.x version once per release (leave it if it's already ahead of `main`'s); CI blocks a PR into `main` that forgets, and the merge publishes it to crates.io ([codync-mem releases](docs/guides/development.md#codync-mem-releases)).-- How: set `MARKETING_VERSION` in `apps/project.yml` and `version` in `host/Cargo.toml` (+ its `Cargo.lock` entry) and `apps/desktop/package.json` (+ `package-lock.json`) to the same value, run `xcodegen generate --spec apps/project.yml`, commit as `build: bump version to X.Y.Z`. Never touch `CURRENT_PROJECT_VERSION` (Xcode Cloud sets the iOS build number). When the iOS app changes, also write that version's section in `apps/ios/WhatsNew.md` (zh-Hant + en-US, what iPhone users notice); it becomes the App Store "What's New".+- How: set `MARKETING_VERSION` in `apps/project.yml` and `version` in `host/Cargo.toml` (+ its `Cargo.lock` entry) and `apps/desktop/package.json` (+ `package-lock.json`) to the same value, run `xcodegen generate --spec apps/project.yml`, commit as `build: bump version to X.Y.Z`. Never touch `CURRENT_PROJECT_VERSION` (Xcode Cloud sets the iOS build number). When a phone app changes, also write that version's section in its notes (zh-Hant + en-US, what that app's users notice): `apps/ios/WhatsNew.md` becomes the App Store "What's New", `apps/android/WhatsNew.md` the Google Play release notes.## Coding Style & Naming Conventions@@ -87,7 +87,7 @@ Use Swift Testing (`@Test`, `#expect`), Rust unit tests, `node --test` in the de- English only.- Thank external contributors when responding to their PRs. After merging an external PR, leave a brief thank-you comment acknowledging their contribution and confirming the merge.-PRs should explain behavior changes, link relevant issues, list validation performed, and include screenshots for UI changes. Fill the template's *What's New* bullets (zh-Hant + en-US) for iOS changes users can see; they become the App Store notes when `apps/ios/WhatsNew.md` has no section for the release. Update affected documentation in the same change.+PRs should explain behavior changes, link relevant issues, list validation performed, and include screenshots for UI changes. Fill the template's *What's New* bullets (zh-Hant + en-US, one section per phone app) for changes that app's users can see; they become the App Store or Google Play notes when that app's `WhatsNew.md` has no section for the release. Update affected documentation in the same change.## Keeping this file shortdiff --git a/CLAUDE.md b/CLAUDE.mdindex 12c19429..4a9d564c 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -69,11 +69,11 @@ After every change, test it end to end on the real apps, not just builds and uni## Versioning-- Xcode Cloud archives the `iOS` scheme on every `v*` tag and uploads it to App Store Connect with its own build number, then the `Submit iOS` workflow submits it to App Review for the App Store; don't upload from the local machine or edit `CURRENT_PROJECT_VERSION` for it. Details: [development guide](docs/guides/development.md#ios-releases-xcode-cloud).+- Xcode Cloud archives the `iOS` scheme on every `v*` tag and uploads it to App Store Connect with its own build number, then the `Submit iOS` workflow submits it to App Review for the App Store; don't upload from the local machine or edit `CURRENT_PROJECT_VERSION` for it. Details: [development guide](docs/guides/development.md#ios-releases-xcode-cloud). `Submit Android` builds the same tags and uploads them to Google Play ([Android releases](docs/guides/development.md#android-releases-google-play)).- Phone ↔ host compatibility: each side names the oldest version of the other it works with (`minApp` in the host's `hello`, `minHost` in each client). Additive changes need nothing; a rename/removal raises `minApp` in the same release, and the release gate holds that release until the App Store has the iPhone app: [docs/reference/compatibility.md](docs/reference/compatibility.md)- **Every source change ships as a release.** A version bump on `main` is the only release trigger (Auto Tag → desktop app for macOS, Linux and Windows, host, Homebrew, in-app update), so any change to shipped code (`apps/`, `host/`, `packaging/`) bumps the version before it reaches `main`, without being asked. Docs, `web/`, `cloud/`, `relay/` and CI-only changes don't bump.- Pick the bump yourself: patch for fixes and small tweaks, minor for new features or protocol additions. Never bump major (stay on 2.x). One bump per merge into `main`: if `MARKETING_VERSION` is already ahead of the latest `v*` tag, leave it. A change to `host/crates/memory` also raises `codync-mem`'s own 0.x version once per release (leave it if it's already ahead of `main`'s); CI blocks a PR into `main` that forgets, and the merge publishes it to crates.io ([codync-mem releases](docs/guides/development.md#codync-mem-releases)).-- How: set `MARKETING_VERSION` in `apps/project.yml` and `version` in `host/Cargo.toml` (+ its `Cargo.lock` entry) and `apps/desktop/package.json` (+ `package-lock.json`) to the same value, run `xcodegen generate --spec apps/project.yml`, commit as `build: bump version to X.Y.Z`. Never touch `CURRENT_PROJECT_VERSION` (Xcode Cloud sets the iOS build number). When the iOS app changes, also write that version's section in `apps/ios/WhatsNew.md` (zh-Hant + en-US, what iPhone users notice); it becomes the App Store "What's New".+- How: set `MARKETING_VERSION` in `apps/project.yml` and `version` in `host/Cargo.toml` (+ its `Cargo.lock` entry) and `apps/desktop/package.json` (+ `package-lock.json`) to the same value, run `xcodegen generate --spec apps/project.yml`, commit as `build: bump version to X.Y.Z`. Never touch `CURRENT_PROJECT_VERSION` (Xcode Cloud sets the iOS build number). When a phone app changes, also write that version's section in its notes (zh-Hant + en-US, what that app's users notice): `apps/ios/WhatsNew.md` becomes the App Store "What's New", `apps/android/WhatsNew.md` the Google Play release notes.## Layout & namingdiff --git a/apps/android/README.md b/apps/android/README.mdindex 326a2ab8..51d6844d 100644--- a/apps/android/README.md+++ b/apps/android/README.md@@ -15,14 +15,20 @@ Use JDK 21, Android SDK 37 and Build Tools 37.0.0. Set `JAVA_HOME` andcd apps/android./gradlew :core:test :app:testDebugUnitTest :app:assembleDebug :app:lintDebug./gradlew :app:assembleRelease-adb install -r app/build/outputs/apk/debug/app-debug.apk+adb install -r -d app/build/outputs/apk/debug/app-debug.apk```-Stop the old app before rebuilding. Upgrade with `adb install -r`, using the-original package and signing key; retain device data and identity. Release APKs-are unsigned until distribution signing is configured. The checksum-pinned-Gradle wrapper is checked in. `versionName` follows `apps/project.yml`;-Android's `versionCode` is independent. Feature PRs do not bump product versions.+Stop the old app before rebuilding. Upgrade with `adb install -r -d`, using the+original package and signing key; retain device data and identity (`-d` lets a debug+build from an older version replace a newer one). The checksum-pinned+Gradle wrapper is checked in. `versionName` follows `apps/project.yml` and+`versionCode` is derived from it (2.24.0 → 2024000). Feature PRs do not bump product versions.++Release builds are signed with the Google Play upload key when `codyncUploadKeystore`+and `codyncUploadKeystorePassword` are set (`codync.local.properties` or `-P`), and stay+unsigned otherwise. `./gradlew :app:bundleRelease` makes the bundle Play takes; releases+reach Play through the `Submit Android` workflow ([Android releases](../../docs/guides/development.md#android-releases-google-play)),+with the release notes in `WhatsNew.md` here.## Account and push configuration@@ -31,9 +37,10 @@ A clean checkout builds `com.pokai.Codync.android.dev` (Codync Dev) or`apps/shared/Config/dev.plist` and `main.plist`. The default push relay comes from`CodyncKit/Client/SharedStore.swift`.-Firebase client configuration is deployment-specific and excluded from Git.-Without it the app builds, pairs and chats; Account and State explain that push-is unavailable. It does not request notification permission or schedule FCM+Firebase client configuration is deployment-specific and excluded from Git (the+official one comes from the `codync-auth` Firebase project: a CI secret, and+`codyncGoogleServicesFile` locally). Without it the app builds, pairs and chats;+Account and State explain that push is unavailable. It does not request notification permission or schedule FCMregistration in that configuration. Foreground task status remains available.For a private deployment, create ignored `apps/android/codync.local.properties`.@@ -125,7 +132,7 @@ byte. `LiveRosterTest` offers separately opted-in read-only inspection of anexisting connection; it is not the ordinary reset suite.The emulator-only `-PcodyncReleaseTests=true` variant signs an R8 acceptance build-with the debug key. Ordinary release APKs remain unsigned. Physical camera,+with the debug key; ordinary release builds take only the upload key. Physical camera,keyboard/TalkBack, provider login, background push, voice and release acceptanceare separate [checklist](../../docs/plans/android-app.md) gates.diff --git a/apps/android/WhatsNew.md b/apps/android/WhatsNew.mdnew file mode 100644index 00000000..55c18069--- /dev/null+++ b/apps/android/WhatsNew.md@@ -0,0 +1,8 @@+<!--+Google Play release notes for the Android app. Write it in the change that bumps the version:+a `## <version>` section with one `### <locale>` per Play language (zh-Hant, published as zh-TW;+en-US), listing what Android users notice, each under 500 characters (Play's limit;+tools/play-submit.py cuts longer notes at the last whole line). tools/play-submit.py reads the+released version's section; a version without one gets the PRs' "What's New: Android" bullets,+else a generic "Bug fixes and improvements" line. Delete old sections.+-->diff --git a/apps/android/app/build.gradle.kts b/apps/android/app/build.gradle.ktsindex 73fb285d..418ba82b 100644--- a/apps/android/app/build.gradle.kts+++ b/apps/android/app/build.gradle.kts@@ -34,7 +34,14 @@ if (firebaseConfig != null) apply(plugin = "com.google.gms.google-services")val productVersion = rootProject.file("../project.yml").readLines().first { it.trimStart().startsWith("MARKETING_VERSION:") }.substringAfter(':').trim()-// Explicit, emulator-only R8 acceptance; ordinary release artifacts stay unsigned.+// Play needs a rising integer per upload; deriving it from the version needs no counter, and+// tools/play-submit.py reads a track's version back from it.+val productVersionCode = productVersion.split('.').map(String::toInt)+ .let { (major, minor, patch) -> major * 1_000_000 + minor * 1_000 + patch }+// Play upload key (Google re-signs with the app signing key); without it release artifacts stay unsigned.+val uploadKeystore = deploymentValue("codyncUploadKeystore")?.takeIf(String::isNotBlank)?.let(::file)+check(uploadKeystore == null || uploadKeystore.isFile) { "The configured upload keystore does not exist." }+// Explicit, emulator-only R8 acceptance, signed with the debug key.val releaseTests = providers.gradleProperty("codyncReleaseTests").map(String::toBoolean).getOrElse(false)val voiceModel = configurations.create("voiceModel") {@@ -89,12 +96,18 @@ android {applicationId = deploymentValue("codyncApplicationId") ?: "com.pokai.Codync.android"minSdk = 29targetSdk = 36- versionCode = 1+ versionCode = productVersionCodeversionName = productVersiontestInstrumentationRunner = if (releaseTests) "com.codync.android.VoiceReleaseRunner" else "androidx.test.runner.AndroidJUnitRunner"buildConfigField("String", "PUSH_RELAY_URL", javaString(deploymentValue("codyncPushRelayUrl") ?: upstreamRelay))buildConfigField("boolean", "PUSH_CONFIGURED", (firebaseConfig != null).toString())}+ if (uploadKeystore != null) signingConfigs.create("upload") {+ storeFile = uploadKeystore+ storePassword = requireNotNull(deploymentValue("codyncUploadKeystorePassword")) { "Set codyncUploadKeystorePassword." }+ keyAlias = "upload"+ keyPassword = storePassword+ }buildTypes {debug {applicationIdSuffix = ".dev"@@ -113,6 +126,7 @@ android {buildConfigField("String", "CLERK_PUBLISHABLE_KEY", javaString(deploymentValue("codyncClerkPublishableKey") ?: accountValue("main", "clerkPublishableKey")))isMinifyEnabled = trueproguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")+ signingConfig = signingConfigs.findByName("upload")}create("releaseAcceptance") {initWith(getByName("release"))diff --git a/apps/android/app/proguard-rules.pro b/apps/android/app/proguard-rules.proindex f2097e49..9b6c4cc2 100644--- a/apps/android/app/proguard-rules.pro+++ b/apps/android/app/proguard-rules.pro@@ -9,6 +9,11 @@-keepclassmembers class * extends com.sun.jna.PointerType { public <init>(); }-dontwarn java.awt.**+# Crash reports (CrashReports.kt) send class, method, file and line names as they are and count+# frames under com.codync as Codync's, with no mapping file: keep those readable, still shrunk and optimized.+-keepattributes SourceFile,LineNumberTable+-keep,allowshrinking,allowoptimization class com.codync.** { *; }+# Glance persists widget class identity to distinguish receivers across upgrades.# Keep each class/constructor distinct while optimizing its implementation.-keep,allowoptimization class com.codync.android.** extends androidx.glance.appwidget.GlanceAppWidget {diff --git a/docs/architecture/file-structure.md b/docs/architecture/file-structure.mdindex 24e40897..529faed8 100644--- a/docs/architecture/file-structure.md+++ b/docs/architecture/file-structure.md@@ -23,8 +23,8 @@ Codync/├── apps/│ ├── project.yml # XcodeGen source of truth for every Apple target│ ├── Codync.xcodeproj/ # Generated Xcode project-│ ├── shared/Config/ # {dev,main}.plist: environment for the iPhone and desktop apps-│ ├── ios/ # App/, Views/, Resources/, Widgets/, NotificationService/+│ ├── shared/Config/ # {dev,main}.plist: environment for the iPhone, Android and desktop apps+│ ├── ios/ # App/, Views/, Resources/, Widgets/, NotificationService/, WhatsNew.md (App Store notes)│ │ └── Kit/ # The iPhone app's Swift package│ │ ├── Sources/│ │ │ ├── CodyncKit/ # Wire models, transports, design; widget-safe@@ -48,7 +48,7 @@ Codync/│ │ ├── src/preload/ # window.codync bridge│ │ ├── src/renderer/ # React UI: store/, components/, views/│ │ └── native/ # codync-speech (macOS on-device speech helper)-│ ├── android/ # Android phone app (Kotlin, Compose), ported from the iPhone app+│ ├── android/ # Android phone app (Kotlin, Compose), ported from the iPhone app; WhatsNew.md (Google Play notes)│ │ ├── core/ # JVM models, crypto, pairing, encrypted channel, host and cloud clients│ │ ├── design/ # Codync's components: palette, type, motion, glass, sheets, menus, dialogs, controls, symbols│ │ ├── app/ # Screens, the store (AppStore), notifications, Live updates, Glance widgets@@ -62,7 +62,7 @@ Codync/├── relay/ # Separate APNs push Worker; src/ and test/├── discord/ # Discord GitHub-role Worker (discord.codync.dev)├── docs/ # Architecture, features, design, guides, reference, plans, investigations, archive-├── tools/ # Release, App Store submission and font scripts+├── tools/ # Release, App Store and Google Play submission (store_release.py: what both share), font scripts├── packaging/ # Distribution templates├── marketing/app-store-screenshots/ # App Store screenshot editor (bun dev; Export bundle → out/)├── web/ # Website (Next.js static export)diff --git a/docs/guides/development.md b/docs/guides/development.mdindex 333f0186..57b1134a 100644--- a/docs/guides/development.md+++ b/docs/guides/development.md@@ -156,4 +156,12 @@ To bump, set `version` in `host/crates/memory/Cargo.toml` (patch for fixes, mino## iOS releases (Xcode Cloud)-The Xcode Cloud workflow "Release" on the product "iOS" has no automatic start condition (its own tag trigger never fired); it only runs when started through the API, and it archives the `iOS` scheme in Release with deployment preparation **TestFlight and App Store** (the "Internal Testing Only" option produces builds App Review can't take) and uploads it to App Store Connect. Xcode Cloud overrides the build number with its own counter (`CI_BUILD_NUMBER`, configured under Xcode Cloud settings → Build Number in App Store Connect), so `CURRENT_PROJECT_VERSION` in `project.yml` is only the local default. The checked-in `apps/Codync.xcodeproj` is what the cloud builds: regenerate it whenever `project.yml` changes, and commit `apps/Codync.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved` whenever a package version changes (Xcode Cloud never resolves packages itself; copy `apps/ios/Kit/Package.resolved` there if Xcode wrote it to `apps/ios/Kit/`). Xcode Cloud reads public package repositories without any connection. The `Submit iOS` GitHub workflow (`.github/workflows/ios-submit.yml` → `tools/asc-submit.py`, secrets `ASC_KEY_ID`, `ASC_ISSUER_ID`, `ASC_PRIVATE_KEY`) runs on every `v*` tag (the tags Auto Tag pushes after a version bump on `main`). It compares the tag with the last version sent to App Review (a version never sent or pulled back, such as one a failed run left behind, doesn't count; a rejected one does): when nothing the iPhone app is built from changed (`apps/ios/` including `apps/ios/Kit/`, except `WhatsNew.md` and the Kit tests, `apps/shared/`, the package pins, or `apps/project.yml` beyond its version lines), iOS skips that release, so host- or desktop-only releases neither build nor touch a version in review. Otherwise it starts the Xcode Cloud archive on the tag (or on `main` while `main` is the tagged commit: Xcode Cloud hears of a new tag through a GitHub webhook that sometimes never arrives), waits for that build to finish processing and submits it for App Review, released automatically after approval. The latest version wins: a version still *Waiting for Review* is pulled back, renamed and resubmitted with the new build; one already *In Review* or approved is left alone (rerun the workflow with the version once it is out). *What's New* comes from the version's `## <version>` section in `apps/ios/WhatsNew.md` (one `### <locale>` per App Store language, written in the version bump); without one, the `### zh-Hant` / `### en-US` bullets under `## What's New` in the PR template are collected from every PR merged since the last App Store version (changes pushed to `main` without a PR add nothing); with neither, empty fields get a generic "Bug fixes and improvements" line. Running `Submit iOS` by hand with a version ships it even without iPhone changes. After each `Submit iOS` run, the `iOS dSYMs` workflow (`.github/workflows/ios-dsyms.yml` → `tools/upload-dsyms.py`, on macOS) downloads that release's archive from Xcode Cloud and uploads its dSYMs to PostHog (secret `POSTHOG_CLI_API_KEY`), so iPhone crash reports are symbolicated; run it by hand with a version after a manual `Submit iOS` or to upload an older one ([iPhone crash tracing](iphone-crash-tracing.md)). `python3 tools/asc-submit-test.py` checks the PR parsing, the change detection and the archive source. `DRY_RUN=1 tools/asc-submit.py <version>` prints the writes without making them.+The Xcode Cloud workflow "Release" on the product "iOS" has no automatic start condition (its own tag trigger never fired); it only runs when started through the API, and it archives the `iOS` scheme in Release with deployment preparation **TestFlight and App Store** (the "Internal Testing Only" option produces builds App Review can't take) and uploads it to App Store Connect. Xcode Cloud overrides the build number with its own counter (`CI_BUILD_NUMBER`, configured under Xcode Cloud settings → Build Number in App Store Connect), so `CURRENT_PROJECT_VERSION` in `project.yml` is only the local default. The checked-in `apps/Codync.xcodeproj` is what the cloud builds: regenerate it whenever `project.yml` changes, and commit `apps/Codync.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved` whenever a package version changes (Xcode Cloud never resolves packages itself; copy `apps/ios/Kit/Package.resolved` there if Xcode wrote it to `apps/ios/Kit/`). Xcode Cloud reads public package repositories without any connection. The `Submit iOS` GitHub workflow (`.github/workflows/ios-submit.yml` → `tools/asc-submit.py`, secrets `ASC_KEY_ID`, `ASC_ISSUER_ID`, `ASC_PRIVATE_KEY`) runs on every `v*` tag (the tags Auto Tag pushes after a version bump on `main`). It compares the tag with the last version sent to App Review (a version never sent or pulled back, such as one a failed run left behind, doesn't count; a rejected one does): when nothing the iPhone app is built from changed (`apps/ios/` including `apps/ios/Kit/`, except `WhatsNew.md` and the Kit tests, `apps/shared/`, the package pins, or `apps/project.yml` beyond its version lines), iOS skips that release, so host- or desktop-only releases neither build nor touch a version in review; a release whose host asks for a newer iPhone app (`MIN_APP`) than that version ships anyway, so the release gate never waits for an iPhone app that isn't coming. Otherwise it starts the Xcode Cloud archive on the tag (or on `main` while `main` is the tagged commit: Xcode Cloud hears of a new tag through a GitHub webhook that sometimes never arrives), waits for that build to finish processing and submits it for App Review, released automatically after approval. The latest version wins: a version still *Waiting for Review* is pulled back, renamed and resubmitted with the new build; one already *In Review* or approved is left alone (rerun the workflow with the version once it is out). *What's New* comes from the version's `## <version>` section in `apps/ios/WhatsNew.md` (one `### <locale>` per App Store language, written in the version bump); without one, the `### zh-Hant` / `### en-US` bullets under `## What's New: iPhone` in the PR template are collected from every PR merged since the last App Store version (changes pushed to `main` without a PR add nothing); with neither, empty fields get a generic "Bug fixes and improvements" line. Running `Submit iOS` by hand with a version ships it even without iPhone changes. After each `Submit iOS` run, the `iOS dSYMs` workflow (`.github/workflows/ios-dsyms.yml` → `tools/upload-dsyms.py`, on macOS) downloads that release's archive from Xcode Cloud and uploads its dSYMs to PostHog (secret `POSTHOG_CLI_API_KEY`), so iPhone crash reports are symbolicated; run it by hand with a version after a manual `Submit iOS` or to upload an older one ([iPhone crash tracing](iphone-crash-tracing.md)). `python3 tools/asc-submit-test.py` checks the PR parsing, the change detection, the `MIN_APP` check (all three in `tools/store_release.py`, shared with Google Play) and the archive source. `DRY_RUN=1 tools/asc-submit.py <version>` prints the writes without making them.++## Android releases (Google Play)++The Android app is `com.pokai.Codync.android` in the Play Console account *李博凱* (a personal account: production access needs a closed test with at least 12 testers opted in for 14 days, then an application in Play Console). Google Play re-signs every bundle with its own app signing key (Play App Signing); the build is signed with the upload key `upload` (`~/.codync-release/upload-keystore.p12`, password in `upload.properties` there and in the login Keychain as *Codync Android upload keystore*; Play Console can reset a lost upload key). Gradle signs `release` when `codyncUploadKeystore` and `codyncUploadKeystorePassword` are set (`apps/android/codync.local.properties` or `-P`); otherwise the release bundle stays unsigned. `versionCode` is derived from `MARKETING_VERSION` (`major × 1 000 000 + minor × 1 000 + patch`, so 2.24.0 is 2024000): no counter to keep, and a track's version code names the release it came from. R8 shrinks the release but keeps Codync's own class and method names and line numbers (`proguard-rules.pro`), so the app's PostHog crash reports read without a mapping file; Play takes the mapping from the bundle for its own reports.++The `Submit Android` GitHub workflow (`.github/workflows/android-submit.yml` → `tools/play-submit.py`) is the counterpart of `Submit iOS` and runs on the same `v*` tags. It compares the tag with the version on the Play track: when nothing the Android app is built from changed (`apps/android/` except its tests, the release acceptance build, README and `WhatsNew.md`; `apps/shared/`; the shared string catalogs and relay URL it reads from `CodyncKit`), Android skips that release, unless the track is empty or the tag's host asks for a newer app (`MIN_APP`) than the track's version. Otherwise it builds the signed bundle from the tag with the official Firebase configuration and uploads it to the track (repository variable `PLAY_TRACK`, `internal` until production access), released at once with the release notes from the version's `## <version>` section in `apps/android/WhatsNew.md`, else the `## What's New: Android` bullets of the PRs merged since the track's version, else a generic line (`zh-Hant` becomes Play's `zh-TW`; each language cut to Play's 500 characters at a whole line). Running it by hand takes a version (without the `v`; it builds that tag) and a track and ships even without Android changes; a version Play already has from another track isn't uploaded again but moved to that track, which is how a release is promoted. Secrets: `PLAY_SERVICE_ACCOUNT` (the `codync-play` service account of the `codync-auth` Google Cloud project, invited in Play Console with *View app information* and *Release apps to testing tracks*; add *Release to production* when the app gets production access), `ANDROID_UPLOAD_KEYSTORE` (base64 of the upload keystore), `ANDROID_UPLOAD_KEYSTORE_PASSWORD` and `ANDROID_GOOGLE_SERVICES_JSON`. `python3 tools/play-submit-test.py` checks the version codes, the release notes, the paths that count and the track comparison; `DRY_RUN=1 tools/play-submit.py upload <version> <bundle>` reads the track and prints the writes without making them.++Firebase lives in the same `codync-auth` project, with the Android apps `com.pokai.Codync.android` and `.dev` (one `google-services.json` serves both; the local copy is in `~/.codync-release/`, referenced by `codyncGoogleServicesFile`). The push relay sends with the `codync-fcm` service account (role *Firebase Cloud Messaging API Admin*, Worker secret `FCM_SERVICE_ACCOUNT`). Clerk's mobile SSO allowlist has `clerk://com.pokai.Codync.android.callback` and `.oauth` (production) and the `.dev` pair (development).diff --git a/docs/plans/android-app.md b/docs/plans/android-app.mdindex 5e99167d..0df82f7a 100644--- a/docs/plans/android-app.md+++ b/docs/plans/android-app.md@@ -1,6 +1,6 @@# Android parity and acceptance-Status: **in development, merged into `dev`** (#151, #152, #154, #155), not released yet. The+Status: **in development, merged into `dev`** (#151, #152, #154, #155), on Google Play internal testing, not public yet. TheAndroid app is a 1:1 port of the iPhone app: each screenis built from its iOS source (`apps/ios/Views`, `apps/ios/Kit/Sources/CodyncUI`) with theAndroid `design` module (see the [Android README](../../apps/android/README.md)). Product@@ -30,7 +30,7 @@ emulator against a real host; device acceptance is listed separately.| Version check | `VersionMismatch.MIN_HOST`, the host's `minApp`, the update card in the roster and in place of the composer | Set `MIN_HOST` to the first release that ships Android support when it's cut || Remote screen | Ported: viewer from Computers, the chat header (watch a bot, then take over) and `codync-dev://screen`; WebRTC H.264, trackpad and direct touch, long-press drag, two-finger scroll, pinch zoom streaming the visible region, keyboard with IME and modifier keys, clipboard, displays, take over/hand back, Rotate | Pinch, IME composition and a hardware keyboard on a device; TURN relay path and renewal || Analytics | Ported: PostHog feature events with the Settings switch (and its sheet), crash reports sent on the next launch | — |-| Packaging | Debug, unsigned R8 release, CI, optional Firebase/private configuration | Play signing, distribution, `versionCode` policy |+| Packaging | Debug, R8 release signed with the Play upload key, `versionCode` from the version, Firebase (`codync-auth`) and private configuration, `Submit Android` to Google Play (internal testing since 2.24.0) | Production access (closed test), see [Before a Play release](#before-a-play-release) |## Gates before merge into dev@@ -60,7 +60,7 @@ was walked through on an emulator against a real host.| What | Code | What it needs || --- | --- | --- || Revoke this phone's access (also on Remove of a computer approved through the account); removing older copies of the computer from the account | `core/.../CloudClient.kt` (`revokeAccess`, `removeComputer`), `AppStoreAccount.kt`, `SettingsView.kt` | A signed-in account on the emulator or a phone; only request tests cover it |-| Push delivery (alerts, background Live update refresh) | `PushService.kt`, `AppStoreNotifications.kt` | A Firebase project and the push Worker's FCM secret (owner's go-ahead). The notification look is covered by `AlertNotificationTest` |+| Push delivery (alerts, background Live update refresh) | `PushService.kt`, `AppStoreNotifications.kt` | A device with Google Play services running the official build (Firebase and the relay's FCM secret are set up since 2026-10-24). The notification look is covered by `AlertNotificationTest` || OpenAI Realtime, Gemini Live and Speech mode with a real key | `WebRtcPeer.kt`, `core/.../OpenAIRealtimeEngine.kt`, `GeminiLiveEngine.kt`, `CloudSpeechEngine.kt` | A provider key on the paired computer; the fallback to on-device voice is verified || Remote screen: Chinese IME composition, a hardware keyboard, the TURN relay path and its credential renewal | `ScreenKeys.kt`, `ScreenSession.kt`, `ScreenView.kt` | A computer it's safe to type into, and a signed-in host for the relay; viewing, trackpad and pinch zoom are verified || On-device voice with a live microphone | `PlatformSpeech.kt`, `LocalVoiceAudio.kt` | A phone; on the emulator the recognizer was fed the speech fixture |@@ -86,13 +86,41 @@ was walked through on an emulator against a real host.## Before a Play release+Set up on 2026-10-24 ([Android releases](../guides/development.md#android-releases-google-play)): the+Play Console app with every App content declaration (Data safety included), the store listing in+en-US and zh-TW, the upload key and Play App Signing, the `codync-play` publisher, Firebase and the+relay's `FCM_SERVICE_ACCOUNT`, Clerk's Android redirects, and 2.24.0 on internal testing+(tester list `codync-testers`). The listing reuses the App Store's copy (its subtitle as the short+description) and the App Store screenshot deck's Android twin (`marketing/app-store-screenshots`,+Android tab: the same captions over Android captures, *Follow along in the status bar* in place of+the Dynamic Island) with its feature graphic, per language.++- [ ] Closed test: the account is personal, so production access needs a closed test (track+ `alpha`) with at least 12 testers opted in for 14 days in a row, then the application in+ Play Console. Set the repository variable `PLAY_TRACK=alpha` once it runs, then run+ `Submit Android` by hand with the current version and `alpha` (it moves the version Play+ already has there) or promote it in Play Console.+- [ ] Account deletion inside the app: Play requires it for apps that create accounts. Today an+ account is deleted on request (`codync.dev/privacy#delete-account`, by email); add a *Delete+ account* action (cloud method that deletes the Clerk user, whose webhook already removes the+ rest) to every client.+- [ ] Reviewer access: pairing needs a computer, so review needs a way in (a demo video of+ pairing and a chat, or a reusable demo host), linked from App content → Login details.+- [ ] The foreground service video Play asks for the microphone and media playback services+ (voice calls), if it asks when the release goes to review.- [ ] Physical upgrade keeps the saved account, pinned keys, bots and history.- [ ] Physical portrait/landscape/foldable, keyboard, large text and TalkBack.- [ ] Provider sign-in/switching, failed sign-out and revocation.-- [ ] Firebase project and the push Worker's `FCM_SERVICE_ACCOUNT` secret (owner's go-ahead).+- [ ] Push on a device with the official Firebase configuration (credentials verified with a+ dry-run send; no device delivery yet).+- [ ] Set `MIN_HOST` to the first release that ships Android support.- [ ] Host release gating for Android: like iPhones and the App Store, a release that raises`minApp` must wait while paired Android phones can't get that version from Play([compatibility](../reference/compatibility.md)).+- [ ] Move the default push relay URL into `apps/shared/Config/{dev,main}.plist` (iOS reads+ them as `AccountConfig.plist`), so the Android build stops parsing the iOS kit's+ `SharedStore.swift` and iPhone-only edits there stop counting as Android changes.+- [ ] *Release to production* permission for `codync-play`, then `PLAY_TRACK=production`.## Shared deploymentdiff --git a/docs/reference/compatibility.md b/docs/reference/compatibility.mdindex 316028ad..1cfd898c 100644--- a/docs/reference/compatibility.md+++ b/docs/reference/compatibility.md@@ -51,8 +51,9 @@ couldn't get the matching side yet.- **Additive changes need no floor change**: new fields (clients decode leniently; newSwift fields are optional), new methods, new enum values (kept as strings).- **Renaming, removing or changing the meaning** of anything an older client reads or sends:- change it, set `MIN_APP` to this release (its iPhone part ships with it: the change- touches `apps/ios/Kit/`, so `Submit iOS` includes it), add a row to the floor history, and re-record+ change it, set `MIN_APP` to this release (the phone apps ship with it: `Submit iOS` and+ `Submit Android` ship any release whose `MIN_APP` is above their store's version, even+ without app changes), add a row to the floor history, and re-recordthe wire shape snapshot. That release isn't offered (downloads, updaters, Homebrew) untilthe App Store has the iPhone app (next section), so nobody is asked for an update thatisn't there yet.diff --git a/marketing/app-store-screenshots/app-store-screenshots.json b/marketing/app-store-screenshots/app-store-screenshots.jsonindex 9314d682..d4e00af0 100644--- a/marketing/app-store-screenshots/app-store-screenshots.json+++ b/marketing/app-store-screenshots/app-store-screenshots.json@@ -111,59 +111,120 @@],"android": [{- "id": "s_mup83m53_5",+ "id": "s_a1","layout": "hero","label": {- "en": "MEET YOUR APP"+ "en": "CODYNC",+ "zh-Hant": "CODYNC"},"headline": {- "en": "Sell one\nidea per slide."+ "en": "Your coding agents,\nas bots.",+ "zh-Hant": "你的 coding agent,\n變成 bot。"},- "screenshot": ""+ "screenshot": "/screenshots/android/phone/en/01.png"},{- "id": "s_mup83m53_6",+ "id": "s_a2",+ "layout": "device-top",+ "label": {+ "en": "DELEGATE",+ "zh-Hant": "交辦"+ },+ "headline": {+ "en": "Say what.\nPut the phone away.",+ "zh-Hant": "交代一句,\n手機收起來。"+ },+ "screenshot": "/screenshots/android/phone/en/02.png",+ "inverted": true,+ "transforms": {+ "caption": {+ "x": 86.4,+ "y": 1330,+ "width": 907.1999999999999,+ "height": 537.6+ }+ }+ },+ {+ "id": "s_a3","layout": "device-bottom","label": {- "en": "FEATURE 01"+ "en": "APPROVE",+ "zh-Hant": "批准"},"headline": {- "en": "Your headline\nlives here."+ "en": "Approve\nfrom anywhere.",+ "zh-Hant": "人在哪,\n都能批准。"},- "screenshot": ""+ "screenshot": "/screenshots/android/phone/en/03.png"},{- "id": "s_mup83m53_7",+ "id": "s_a4","layout": "two-devices","label": {- "en": "FEATURE 02"+ "en": "GROUP CHAT",+ "zh-Hant": "群組"},"headline": {- "en": "Show two\nscreens at once."+ "en": "Let your bots\nreview each other.",+ "zh-Hant": "讓 bot\n互相 review。"},- "screenshot": "",- "screenshotSecondary": ""+ "screenshot": "/screenshots/android/phone/en/04.png",+ "screenshotSecondary": "/screenshots/android/phone/en/05.png",+ "transforms": {+ "caption": {+ "x": 86.4,+ "y": 64,+ "width": 907.1999999999999,+ "height": 537.6+ }+ }},{- "id": "s_mup83m53_8",+ "id": "s_a5","layout": "device-top","label": {- "en": "FEATURE 03"+ "en": "LIVE UPDATES",+ "zh-Hant": "即時更新"},"headline": {- "en": "Flip the contrast\nfor visual rhythm."+ "en": "Follow along\nin the status bar.",+ "zh-Hant": "狀態列上\n隨時看進度。"},- "screenshot": "",- "inverted": true+ "screenshot": "/screenshots/android/phone/en/06.png",+ "inverted": true,+ "transforms": {+ "caption": {+ "x": 86.4,+ "y": 1330,+ "width": 907.1999999999999,+ "height": 537.6+ }+ }},{- "id": "s_mup83m53_9",+ "id": "s_a6",+ "layout": "hero",+ "label": {+ "en": "USAGE",+ "zh-Hant": "用量"+ },+ "headline": {+ "en": "Know your limits\nat a glance.",+ "zh-Hant": "額度剩多少,\n一眼就知道。"+ },+ "screenshot": "/screenshots/android/phone/en/07.png"+ },+ {+ "id": "s_a7","layout": "no-device","label": {- "en": "MORE"+ "en": "WORKS WITH",+ "zh-Hant": "支援"},"headline": {- "en": "And so\nmuch more."+ "en": "Claude Code\nCodex · Cursor\nGemini · Pi\n& dozens more",+ "zh-Hant": "Claude Code\nCodex · Cursor\nGemini · Pi\n還有數十種"},"screenshot": ""}@@ -469,7 +530,8 @@"layout": "feature-graphic","label": {},"headline": {- "en": "Your tagline goes here."+ "en": "Your coding agents, as bots.",+ "zh-Hant": "把寫程式的 AI 變成你的隊友"},"screenshot": ""}diff --git a/marketing/app-store-screenshots/public/screenshots/android/phone/en/01.png b/marketing/app-store-screenshots/public/screenshots/android/phone/en/01.pngnew file mode 100644index 00000000..8c1e5f3cBinary files /dev/null and b/marketing/app-store-screenshots/public/screenshots/android/phone/en/01.png differdiff --git a/marketing/app-store-screenshots/public/screenshots/android/phone/en/02.png b/marketing/app-store-screenshots/public/screenshots/android/phone/en/02.pngnew file mode 100644index 00000000..eced31abBinary files /dev/null and b/marketing/app-store-screenshots/public/screenshots/android/phone/en/02.png differdiff --git a/marketing/app-store-screenshots/public/screenshots/android/phone/en/03.png b/marketing/app-store-screenshots/public/screenshots/android/phone/en/03.pngnew file mode 100644index 00000000..5014d4a2Binary files /dev/null and b/marketing/app-store-screenshots/public/screenshots/android/phone/en/03.png differdiff --git a/marketing/app-store-screenshots/public/screenshots/android/phone/en/04.png b/marketing/app-store-screenshots/public/screenshots/android/phone/en/04.pngnew file mode 100644index 00000000..34482e81Binary files /dev/null and b/marketing/app-store-screenshots/public/screenshots/android/phone/en/04.png differdiff --git a/marketing/app-store-screenshots/public/screenshots/android/phone/en/05.png b/marketing/app-store-screenshots/public/screenshots/android/phone/en/05.pngnew file mode 100644index 00000000..7aef3925Binary files /dev/null and b/marketing/app-store-screenshots/public/screenshots/android/phone/en/05.png differdiff --git a/marketing/app-store-screenshots/public/screenshots/android/phone/en/06.png b/marketing/app-store-screenshots/public/screenshots/android/phone/en/06.pngnew file mode 100644index 00000000..df48161eBinary files /dev/null and b/marketing/app-store-screenshots/public/screenshots/android/phone/en/06.png differdiff --git a/marketing/app-store-screenshots/public/screenshots/android/phone/en/07.png b/marketing/app-store-screenshots/public/screenshots/android/phone/en/07.pngnew file mode 100644index 00000000..4a7e368aBinary files /dev/null and b/marketing/app-store-screenshots/public/screenshots/android/phone/en/07.png differdiff --git a/tools/asc-submit-test.py b/tools/asc-submit-test.pyindex 626896de..17581eca 100644--- a/tools/asc-submit-test.py+++ b/tools/asc-submit-test.py@@ -1,4 +1,4 @@-"""Self-check for asc-submit.py: python3 tools/asc-submit-test.py"""+"""Self-check for asc-submit.py and store_release.py: python3 tools/asc-submit-test.py"""import importlib.utilimport pathlib@@ -10,10 +10,19 @@ sys.modules.setdefault("jwt", types.ModuleType("jwt"))spec = importlib.util.spec_from_file_location("asc_submit", pathlib.Path(__file__).with_name("asc-submit.py"))asc = importlib.util.module_from_spec(spec)spec.loader.exec_module(asc)+import store_release # noqa: E402, already loaded from tools/ by asc-submit.pytemplate = pathlib.Path(__file__).parent.parent.joinpath(".github/pull_request_template.md").read_text()-filled = template.replace("### zh-Hant\n\n-", "### zh-Hant\n\n- 例行任務改用同一個表單").replace(- "### en-US\n\n-", "### en-US\n\n- Routines use one form")+++def fill(platform, zh, en):+ """The PR template with a bullet per language in `platform`'s What's New section."""+ head, rest = template.split(f"## What's New: {platform}\n")+ rest = rest.replace("### zh-Hant\n\n-", f"### zh-Hant\n\n- {zh}", 1).replace("### en-US\n\n-", f"### en-US\n\n- {en}", 1)+ return f"{head}## What's New: {platform}\n{rest}"+++filled = fill("iPhone", "例行任務改用同一個表單", "Routines use one form")prs = [{"body": filled.replace("\n", "\r\n"), "mergeCommit": {"oid": "a"}},{"body": filled, "mergeCommit": {"oid": "b"}}, # duplicate bullet is dropped@@ -23,19 +32,27 @@ prs = [# an empty template followed by a PR footer (shipped as "🤖 ..." in v2.4.3) adds nothing{"body": template + "\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nhttps://claude.ai/code/x","mergeCommit": {"oid": "c"}},- # emoji are stripped (the App Store rejects them), so this repeats a bullet above- {"body": filled.replace("- Routines use one form", "- Routines use one form 🚀"), "mergeCommit": {"oid": "b"}},+ # Android's bullets never reach the App Store, nor the iPhone's Google Play+ {"body": fill("Android", "通知改經由 Firebase 送達", "Notifications arrive through Firebase"), "mergeCommit": {"oid": "c"}},]-assert asc.pr_notes(prs, {"a", "b", "c"}) == {- "zh-Hant": "- 例行任務改用同一個表單", "en-US": "- Routines use one form"}, asc.pr_notes(prs, {"a", "b", "c"})-assert asc.pr_notes(prs, {"c"}) == {}+assert store_release.pr_notes(prs, {"a", "b", "c"}, "iPhone") == {+ "zh-Hant": "- 例行任務改用同一個表單", "en-US": "- Routines use one form"}, store_release.pr_notes(prs, {"a", "b", "c"}, "iPhone")+assert store_release.pr_notes(prs, {"c"}, "iPhone") == {}+assert store_release.pr_notes(prs, {"a", "b", "c"}, "Android") == {+ "zh-Hant": "- 通知改經由 Firebase 送達", "en-US": "- Notifications arrive through Firebase"}print("ok")-# WhatsNew.md loses its emoji too: v2.19.2's ❤️ and 🎉 failed the submission after 2.19.1 was pulled back.+# A version's WhatsNew.md section, split by locale.with tempfile.TemporaryDirectory() as tmp:- asc.NOTES = pathlib.Path(tmp, "WhatsNew.md")- asc.NOTES.write_text("## 2.19.2\n\n### en-US\n\n- Bots react with a ❤️ or a 🎉\n\n## 2.19.1\n\n### en-US\n\n- Old\n")- assert asc.release_notes("2.19.2") == {"en-US": "- Bots react with a or a"}, asc.release_notes("2.19.2")+ notes = pathlib.Path(tmp, "WhatsNew.md")+ notes.write_text("## 2.19.2\n\n### en-US\n\n- Bots react\n\n### zh-Hant\n\n## 2.19.1\n\n### en-US\n\n- Old\n")+ assert store_release.release_notes(notes, "2.19.2") == {"en-US": "- Bots react"}+ assert store_release.release_notes(notes, "2.19.3") == {}+# The App Store rejects emoji: v2.19.2's ❤️ and 🎉 failed the submission after 2.19.1 was pulled back.+# A bullet that repeats another once they're gone is dropped.+assert asc.app_store_text("- Bots react with a ❤️ or a 🎉") == "- Bots react with a or a"+assert asc.app_store_text("- Routines use one form\n- Routines use one form 🚀\n\n- Next") == \+ "- Routines use one form\n\n- Next"print("ok")# Release history: v2.2.3 changed only the Mac app, host and website; v2.3.1 changed kit/.@@ -43,6 +60,11 @@ assert not asc.ios_changed("v2.2.2", "v2.2.3")assert asc.ios_changed("v2.3.0", "v2.3.1")assert not asc.ios_changed("v2.19.2", "v2.19.3") # only WhatsNew.md under apps/iosassert asc.ios_changed("v2.19.1", "v2.19.2")+# v2.24.0's host asks for 2.21.0 (MIN_APP): a store version below it ships again without changes.+assert store_release.locked_out("2.20.1", "v2.24.0")+assert not store_release.locked_out("2.21.0", "v2.24.0")+assert not store_release.locked_out(None, "v2.24.0")+assert not store_release.locked_out("2.1.0", "v2.2.0") # predates MIN_APPprint("ok")# The base version: skip the run's own version and any never sent or pulled back, keep a rejected one.diff --git a/tools/asc-submit.py b/tools/asc-submit.pyindex a6077e25..e013dc82 100755--- a/tools/asc-submit.py+++ b/tools/asc-submit.py@@ -11,8 +11,11 @@ to App Review is skipped (FORCE=1 ships it anyway). Otherwise, when SINCE is setthe version exists yet, it starts the Xcode Cloud archive on the tag (or on main while main is thetagged commit), then waits for the build.+A release whose host asks for a newer iPhone app (MIN_APP) than the last version sent ships even+without iPhone changes.+What's New comes from the version's section in apps/ios/WhatsNew.md, else from the-"## What's New" bullets of the PRs merged since the last App Store version (PRS: `gh pr list+"## What's New: iPhone" bullets of the PRs merged since the last App Store version (PRS: `gh pr list--json body,mergeCommit` output); without either, empty fields get a generic line.Latest version wins: a version still waiting for review is pulled back, renamed and@@ -20,21 +23,22 @@ resubmitted with the new build. A version already in review is left alone."""import json-import subprocessimport os+import reimport sysimport timeimport urllib.error-import reimport urllib.requestfrom datetime import datetimefrom pathlib import Pathimport jwt+import store_release as store+from store_release import git+APP_ID = "6760984418"API = "https://api.appstoreconnect.apple.com/v1"-WHATS_NEW = {"en-US": "Bug fixes and improvements.", "zh-Hant": "錯誤修正與改進。"}UNSENT = {"PREPARE_FOR_SUBMISSION", "READY_FOR_REVIEW", "DEVELOPER_REJECTED"} # never sent, or pulled backEDITABLE = UNSENT | {"REJECTED", "METADATA_REJECTED", "INVALID_BINARY"}DONE = {"READY_FOR_DISTRIBUTION", "REPLACED_WITH_NEW_VERSION", "REMOVED_FROM_SALE"}@@ -49,47 +53,20 @@ IOS_PATHS = ["apps/ios", "apps/shared", "apps/Codync.xcodeproj/project.xcworkspa":(exclude)apps/ios/WhatsNew.md", ":(exclude)apps/ios/Kit/Tests"]-def git(*args):- return subprocess.run(["git", *args], capture_output=True, text=True, check=False).stdout.strip()--def ios_changed(base, tag):"""Whether anything the iPhone app is built from differs between two refs."""- if git("diff", "--name-only", base, tag, "--", *IOS_PATHS):+ if store.changed(base, tag, IOS_PATHS):return Trueproject = git("diff", "-U0", base, tag, "--", "apps/project.yml").splitlines()return any(line[:1] in "+-" and line[:3] not in ("+++", "---") and "_VERSION" not in linefor line in project)-def release_notes(version):- """{locale: text} from the `## <version>` section, split by `### <locale>` headings, without- emoji (the App Store rejects them)."""- text = EMOJI.sub("", NOTES.read_text()) if NOTES.exists() else ""- section = re.search(rf"^## {re.escape(version)}\s*$(.*?)(?=^## |\Z)", text, re.M | re.S)- if not section:- return {}- parts = re.split(r"^### +(\S+)\s*$", section.group(1), flags=re.M)[1:]- return {loc: body.strip() for loc, body in zip(parts[::2], parts[1::2]) if body.strip()}---def pr_notes(prs, commits):- """{locale: bullets} from "### <locale>" under "## What's New" in the PRs merged into this release."""- notes = {}- for pr in prs:- if (pr.get("mergeCommit") or {}).get("oid") not in commits:- continue- body = re.sub(r"<!--.*?-->", "", (pr.get("body") or "").replace("\r\n", "\n"), flags=re.S)- section = re.search(r"^## What.s New[ \t]*$(.*?)(?=^## |\Z)", body, flags=re.M | re.S)- for loc, text in re.findall(r"^### +(\S+)[ \t]*$(.*?)(?=^### |\Z)", section[1] if section else "",- flags=re.M | re.S):- # Only filled bullets count: text after the section (a PR footer) is not a note,- # and the App Store rejects emoji in What's New.- for line in map(str.strip, text.splitlines()):- line = EMOJI.sub("", line).strip()- if re.match(r"[-*] +\S", line) and line not in notes.setdefault(loc, []):- notes[loc].append(line)- return {loc: "\n".join(lines)[:4000] for loc, lines in notes.items() if lines}+def app_store_text(text):+ """What's New as the App Store takes it: without emoji (it rejects them) or a line their removal+ left repeating another, within 4000 characters."""+ lines = [EMOJI.sub("", line).rstrip() for line in text.splitlines()]+ return "\n".join(line for i, line in enumerate(lines) if not line or line not in lines[:i]).strip()[:4000]def token():@@ -178,9 +155,8 @@ def main(version):tag = f"v{version}"since = datetime.fromisoformat(os.environ.get("SINCE", "2000-01-01T00:00:00Z"))shipped = last_sent(store_versions(), version)- base = f"v{shipped}" if shipped and git("tag", "-l", f"v{shipped}") else \- git("describe", "--tags", "--abbrev=0", "--match", "v*", f"{tag}^")- if os.environ.get("FORCE") != "1" and base and not ios_changed(base, tag):+ base = store.release_base(shipped, tag)+ if os.environ.get("FORCE") != "1" and base and not ios_changed(base, tag) and not store.locked_out(shipped, tag):print(f"nothing the iPhone app is built from changed since {base}; not shipping iOS {version}")returnprint(f"iOS changes since {base or 'the start'}")@@ -226,18 +202,15 @@ def main(version):"attributes": {"platform": "IOS", "versionString": version, "releaseType": "AFTER_APPROVAL"},"relationships": {"app": {"data": {"type": "apps", "id": APP_ID}}}}})["data"]["id"]- notes, source = release_notes(version), "WhatsNew.md"- if not notes and os.environ.get("PRS"):- with open(os.environ["PRS"]) as prs:- commits = set(git("rev-list", f"{base}..{tag}" if base else tag).split())- notes, source = pr_notes(json.load(prs), commits), "PRs"- print(f"What's New from {source}: {sorted(notes) or 'none, generic text'}")+ notes, source = store.notes_for(NOTES, version, "iPhone", base, tag)+ notes = {locale: app_store_text(text) for locale, text in notes.items()}+ print(f"What's New from {source or 'nowhere, generic text'}: {sorted(notes)}")if version_id != "dry-run":for loc in call("GET", f"/appStoreVersions/{version_id}/appStoreVersionLocalizations")["data"]:locale = loc["attributes"]["locale"]text = notes.get(locale) or notes.get("en-US")if not text and not loc["attributes"].get("whatsNew"):- text = WHATS_NEW.get(locale, WHATS_NEW["en-US"])+ text = store.GENERIC_NOTES.get(locale, store.GENERIC_NOTES["en-US"])if text:call("PATCH", f"/appStoreVersionLocalizations/{loc['id']}", {"data": {"type": "appStoreVersionLocalizations", "id": loc["id"], "attributes": {"whatsNew": text}}})diff --git a/tools/play-submit-test.py b/tools/play-submit-test.pynew file mode 100644index 00000000..6d0bc222--- /dev/null+++ b/tools/play-submit-test.py@@ -0,0 +1,51 @@+"""Self-check for play-submit.py: python3 tools/play-submit-test.py"""++import importlib.util+import pathlib+import re+import sys+import types++sys.modules.setdefault("jwt", types.ModuleType("jwt"))+spec = importlib.util.spec_from_file_location("play_submit", pathlib.Path(__file__).with_name("play-submit.py"))+play = importlib.util.module_from_spec(spec)+spec.loader.exec_module(play)++# The version code is the Gradle build's, and names its version back.+gradle = pathlib.Path(__file__).parent.parent.joinpath("apps/android/app/build.gradle.kts").read_text()+assert re.search(r"major \* 1_000_000 \+ minor \* 1_000 \+ patch", gradle), "versionCode formula drifted from play-submit.py"+assert play.version_code("2.24.0") == 2_024_000+assert play.version_name(play.version_code("2.9.13")) == "2.9.13"+assert play.version_code("2.10.0") > play.version_code("2.9.999")+print("ok")++# Release notes: Play's languages only, zh-Hant as zh-TW, cut at a whole line within 500 characters.+long = "\n".join(f"- line {i} " + "x" * 40 for i in range(20))+notes = play.play_notes({"en-US": long, "zh-Hant": "- 新功能", "ja": "- 新機能"})+assert [n["language"] for n in notes] == ["en-US", "zh-TW"], notes+assert len(notes[0]["text"]) <= 500 and notes[0]["text"].endswith("x") and notes[1]["text"] == "- 新功能", notes+assert play.play_notes({"en-US": "y" * 600})[0]["text"] == "y" * 500+print("ok")++# Release history: v2.20.4 left the Android app alone; v2.23.1 changed its chat.+assert not play.store.changed("v2.20.3", "v2.20.4", play.ANDROID_PATHS)+assert play.store.changed("v2.23.0", "v2.23.1", play.ANDROID_PATHS)+# The bundle's sources count; tests, the release acceptance build, the README and the Play notes don't.+files = play.store.git("ls-files", "--", *play.ANDROID_PATHS).splitlines()+assert {"apps/android/app/build.gradle.kts", "apps/android/design/build.gradle.kts", "apps/shared/Config/main.plist"} <= set(files)+assert not [f for f in files if re.search(r"/src/(test|androidTest|releaseAcceptance)/|README\.md$|WhatsNew\.md$", f)]+print("ok")++# An empty track (a new one, such as alpha) takes the release; otherwise it's compared with the+# track's newest version, which a rerun finds already there.+def track(*codes):+ play.call = lambda *args, **kwargs: {"releases": [{"versionCodes": list(codes)}]}+++track()+assert play.should_ship("2.20.4", "edit")+track("2020003")+assert not play.should_ship("2.20.4", "edit")+track("2020003", "2020004")+assert not play.should_ship("2.20.4", "edit")+print("ok")diff --git a/tools/play-submit.py b/tools/play-submit.pynew file mode 100644index 00000000..5aa20303--- /dev/null+++ b/tools/play-submit.py@@ -0,0 +1,166 @@+#!/usr/bin/env python3+"""Upload the Android app of a version to a Google Play track.++Usage: play-submit.py check 2.25.0 prints ship=true|false (also to $GITHUB_OUTPUT)+ play-submit.py upload 2.25.0 app-release.aab+Env: PLAY_SERVICE_ACCOUNT (the codync-play service account's JSON key); TRACK (internal, alpha for+closed testing, production; default internal); STATUS (completed, or draft to finish the release in+Play Console); FORCE=1 ships without Android changes; PRS as in asc-submit.py; DRY_RUN=1 prints+writes instead. Runs in a checkout with the release tags.++A release whose tag changes nothing the Android app is built from since the version on the track+is skipped, unless the track is empty or the tag's host asks for a newer app (MIN_APP). The version+code comes from the version (apps/android/app/build.gradle.kts), so the track's version code names+the release it was built from; a version Play already has (from another track) moves to TRACK+instead of being uploaded again. Release notes come from apps/android/WhatsNew.md, else the PRs'+"## What's New: Android" bullets, zh-Hant as zh-TW, cut to Play's 500 characters.+"""++import json+import os+import sys+import time+import urllib.error+import urllib.parse+import urllib.request+from pathlib import Path++import jwt++import store_release as store++PACKAGE = "com.pokai.Codync.android"+API = f"https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{PACKAGE}"+UPLOAD = f"https://androidpublisher.googleapis.com/upload/androidpublisher/v3/applications/{PACKAGE}"+TRACK = os.environ.get("TRACK") or "internal"+STATUS = os.environ.get("STATUS") or "completed"+DRY_RUN = os.environ.get("DRY_RUN") == "1"+LOCALES = {"en-US": "en-US", "zh-Hant": "zh-TW"} # WhatsNew.md locale → Play language+NOTES = Path(__file__).resolve().parent.parent / "apps/android/WhatsNew.md"+# What the Android app is built from: its sources, the shared account configuration, and the+# strings and push relay it takes from the iPhone kit. Tests, the emulator-only release acceptance+# build and the Play notes never reach the bundle.+ANDROID_PATHS = ["apps/android", "apps/shared", "apps/ios/Kit/Sources/CodyncKit/Resources/Languages",+ "apps/ios/Kit/Sources/CodyncKit/Client/SharedStore.swift",+ ":(exclude)apps/android/*/src/test/*", ":(exclude)apps/android/*/src/androidTest/*",+ ":(exclude)apps/android/app/src/releaseAcceptance", ":(exclude)apps/android/README.md",+ ":(exclude)apps/android/WhatsNew.md"]+++def version_code(version):+ """Must match `versionCode` in apps/android/app/build.gradle.kts."""+ major, minor, patch = map(int, version.split("."))+ return major * 1_000_000 + minor * 1_000 + patch+++def version_name(code):+ return f"{code // 1_000_000}.{code // 1_000 % 1_000}.{code % 1_000}"+++def play_notes(notes):+ """Play's releaseNotes for the locales it lists, each cut at its last whole line within 500+ characters."""+ out = []+ for locale, language in LOCALES.items():+ text = notes.get(locale)+ if not text:+ continue+ while len(text) > 500 and "\n" in text:+ text = text.rsplit("\n", 1)[0]+ out.append({"language": language, "text": text[:500]})+ return out+++def token():+ account = json.loads(os.environ["PLAY_SERVICE_ACCOUNT"])+ now = int(time.time())+ assertion = jwt.encode({"iss": account["client_email"], "aud": account["token_uri"], "iat": now,+ "exp": now + 3600, "scope": "https://www.googleapis.com/auth/androidpublisher"},+ account["private_key"], algorithm="RS256")+ body = urllib.parse.urlencode({"grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer",+ "assertion": assertion}).encode()+ with urllib.request.urlopen(urllib.request.Request(account["token_uri"], data=body)) as res:+ return json.load(res)["access_token"]+++def call(method, url, body=None, data=None, content_type="application/json"):+ # A dry run still opens (and drops) an edit to read the track, but changes nothing in it.+ if DRY_RUN and method in ("POST", "PUT") and "/edits/" in url:+ print(f"DRY_RUN {method} {url} {json.dumps(body) if body else ''}")+ return {}+ req = urllib.request.Request(+ url, method=method, data=data if data is not None else json.dumps(body).encode() if body else None,+ headers={"Authorization": f"Bearer {call.token}", "Content-Type": content_type})+ try:+ with urllib.request.urlopen(req, timeout=600) as res:+ raw = res.read()+ except urllib.error.HTTPError as e:+ sys.exit(f"{method} {url} -> {e.code}\n{e.read().decode()}")+ return json.loads(raw) if raw else {}+++def track_version(edit):+ """The newest version on TRACK, from its version codes."""+ releases = call("GET", f"{API}/edits/{edit}/tracks/{TRACK}").get("releases", [])+ codes = [int(code) for release in releases for code in release.get("versionCodes", [])]+ return version_name(max(codes)) if codes else None+++def should_ship(version, edit):+ tag = f"v{version}"+ shipped = track_version(edit)+ base = store.release_base(shipped, tag)+ if os.environ.get("FORCE") != "1" and shipped and base and not store.changed(base, tag, ANDROID_PATHS) \+ and not store.locked_out(shipped, tag):+ print(f"nothing the Android app is built from changed since {base}; not shipping Android {version}")+ return False+ print(f"shipping Android {version} (on {TRACK}: {shipped or 'nothing'})")+ return True+++def upload(version, bundle, edit):+ code = version_code(version)+ if code in (b["versionCode"] for b in call("GET", f"{API}/edits/{edit}/bundles").get("bundles", [])):+ print(f"Play already has {version} ({code}); moving it to {TRACK}")+ else:+ with open(bundle, "rb") as file:+ uploaded = call("POST", f"{UPLOAD}/edits/{edit}/bundles?uploadType=media", data=file.read(),+ content_type="application/octet-stream")+ if not DRY_RUN and uploaded.get("versionCode") != code:+ sys.exit(f"{bundle} has version code {uploaded.get('versionCode')}, expected {code} for {version}")++ # Notes cover everything since the track's version, the same base `check` compared with.+ tag = f"v{version}"+ base = store.release_base(track_version(edit), tag)+ notes, source = store.notes_for(NOTES, version, "Android", base, tag)+ if not notes:+ notes, source = store.GENERIC_NOTES, "the generic line"+ print(f"release notes from {source}: {sorted(notes)}")++ call("PUT", f"{API}/edits/{edit}/tracks/{TRACK}", {"track": TRACK, "releases": [{+ "name": version, "versionCodes": [str(code)], "status": STATUS, "releaseNotes": play_notes(notes)}]})+ if DRY_RUN:+ call("DELETE", f"{API}/edits/{edit}")+ return+ call("POST", f"{API}/edits/{edit}:commit")+ print(f"{version} ({code}) is on {TRACK} as {STATUS}")+++def main(command, version, bundle=None):+ call.token = token()+ edit = call("POST", f"{API}/edits")["id"]+ if command == "check":+ ship = should_ship(version, edit)+ call("DELETE", f"{API}/edits/{edit}")+ print(f"ship={str(ship).lower()}")+ if os.environ.get("GITHUB_OUTPUT"):+ with open(os.environ["GITHUB_OUTPUT"], "a") as out:+ out.write(f"ship={str(ship).lower()}\n")+ elif command == "upload":+ upload(version, bundle, edit)+ else:+ sys.exit(__doc__)+++if __name__ == "__main__":+ main(*sys.argv[1:])diff --git a/tools/store_release.py b/tools/store_release.pynew file mode 100644index 00000000..e6f36eda--- /dev/null+++ b/tools/store_release.py@@ -0,0 +1,76 @@+"""What the App Store and Google Play submissions share: release notes, the release they compare+with, and change detection. Each store's own rules stay in its script.++Imported by tools/asc-submit.py and tools/play-submit.py (run from tools/, so a plain import works).+"""++import json+import os+import re+import subprocess++# For a release with neither a WhatsNew.md section nor PR bullets.+GENERIC_NOTES = {"en-US": "Bug fixes and improvements.", "zh-Hant": "錯誤修正與改進。"}+++def git(*args):+ return subprocess.run(["git", *args], capture_output=True, text=True, check=False).stdout.strip()+++def release_base(shipped, tag):+ """The ref a release is compared with: the store's version's tag, else the tag before `tag`."""+ return f"v{shipped}" if shipped and git("tag", "-l", f"v{shipped}") else \+ git("describe", "--tags", "--abbrev=0", "--match", "v*", f"{tag}^")+++def changed(base, tag, paths):+ """Whether anything under `paths` (git pathspecs) differs between two refs."""+ return bool(git("diff", "--name-only", base, tag, "--", *paths))+++def locked_out(shipped, tag):+ """Whether the host at `tag` turns the store's app version away (its MIN_APP is newer), so the+ app ships even without changes of its own."""+ found = re.search(r'pub const MIN_APP: &str = "([^"]+)";', git("show", f"{tag}:host/src/compat.rs"))+ return bool(shipped and found) and tuple(map(int, found[1].split("."))) > tuple(map(int, shipped.split(".")))+++def release_notes(path, version):+ """{locale: text} from the `## <version>` section of a WhatsNew.md, split by `### <locale>` headings."""+ text = path.read_text() if path.exists() else ""+ section = re.search(rf"^## {re.escape(version)}\s*$(.*?)(?=^## |\Z)", text, re.M | re.S)+ if not section:+ return {}+ parts = re.split(r"^### +(\S+)\s*$", section.group(1), flags=re.M)[1:]+ return {loc: body.strip() for loc, body in zip(parts[::2], parts[1::2]) if body.strip()}+++def pr_notes(prs, commits, platform):+ """{locale: bullets} from "### <locale>" under "## What's New: <platform>" in the PRs merged+ into this release."""+ notes = {}+ for pr in prs:+ if (pr.get("mergeCommit") or {}).get("oid") not in commits:+ continue+ body = re.sub(r"<!--.*?-->", "", (pr.get("body") or "").replace("\r\n", "\n"), flags=re.S)+ section = re.search(rf"^## What.s New: {platform}[ \t]*$(.*?)(?=^## |\Z)", body, flags=re.M | re.S)+ for loc, text in re.findall(r"^### +(\S+)[ \t]*$(.*?)(?=^### |\Z)", section[1] if section else "",+ flags=re.M | re.S):+ # Only filled bullets count: text after the section (a PR footer) is not a note.+ for line in map(str.strip, text.splitlines()):+ if re.match(r"[-*] +\S", line) and line not in notes.setdefault(loc, []):+ notes[loc].append(line)+ return {loc: "\n".join(lines) for loc, lines in notes.items() if lines}+++def notes_for(path, version, platform, base, tag):+ """({locale: text}, source): the version's section in `path`, else the PRs' What's New bullets+ for `platform` merged since `base` (PRS: `gh pr list --json body,mergeCommit` output), else none."""+ if notes := release_notes(path, version):+ return notes, path.name+ if os.environ.get("PRS"):+ with open(os.environ["PRS"]) as prs:+ commits = set(git("rev-list", f"{base}..{tag}" if base else tag).split())+ if notes := pr_notes(json.load(prs), commits, platform):+ return notes, "PRs"+ return {}, Nonediff --git a/web/app/privacy/page.tsx b/web/app/privacy/page.tsxindex 09782c51..bf6ce6ce 100644--- a/web/app/privacy/page.tsx+++ b/web/app/privacy/page.tsx@@ -9,7 +9,7 @@ export default function Privacy() {<main className="flex-1 flex flex-col items-center px-6 py-16"><article className="max-w-2xl w-full space-y-6"><h1 className="text-3xl font-bold text-white">Privacy Policy</h1>- <p className="text-neutral-400 text-sm">Last updated: October 19, 2026</p>+ <p className="text-neutral-400 text-sm">Last updated: October 24, 2026</p><Section title="Overview">Codync lets you message the AI agents that run on your own computer. It is built so that your files, conversations and credentials stay on your devices.@@ -18,19 +18,23 @@ export default function Privacy() {<Section title="What stays on your devices"><ul className="list-disc pl-5 space-y-2"><li><strong>Bots and conversations</strong> are stored by the Codync host on your computer (in <code>~/.codync</code>). Your phone keeps a cache so the app opens instantly.</li>- <li><strong>Your phone talks directly to your computer</strong> over your local network or Tailscale. There is no Codync server in between and no Codync account.</li>+ <li><strong>Your phone talks to your computer</strong> directly over your local network or Tailscale, or, away from home, through our relay, which only forwards end-to-end encrypted data it can't read.</li><li><strong>Agents run with your own logins</strong> (Claude Code, Codex, Cursor and others). Codync never sees or stores their credentials.</li><li><strong>Usage limits</strong> are read locally from the agents installed on your computer. Only percentages reach your phone.</li></ul></Section><Section title="Push notifications">- To notify you when a bot needs you or finishes, your computer sends a short alert (the bot's name and a one-line preview) through our push relay, a Cloudflare Worker that forwards it to Apple Push Notification service. The relay does not store notifications. Your device token is encrypted into a ticket that only the relay can read; your computer never sees the raw token.+ To notify you when a bot needs you or finishes, your computer sends a short alert (the bot's name and a one-line preview) through our push relay, a Cloudflare Worker that forwards it to Apple Push Notification service (iPhone) or Firebase Cloud Messaging (Android). The alert is encrypted for your phone, so the relay and those services carry only generic text, and the relay does not store notifications. Your device token is encrypted into a ticket that only the relay can read; your computer never sees the raw token.+ </Section>++ <Section title="Codync account (optional)">+ You can sign in with Apple or Google to find your computers from any phone. Your account keeps your email address, an account ID, and the names of the phones and computers you connect with it. Codync works without an account.</Section><Section title="Data we collect"><p className="mb-2">- Only usage analytics. They are on by default; turn them off on each phone and each computer in Settings (Share usage analytics), and that device stops sending right away.+ Usage analytics, and, if you sign in, the account data described under Codync account. Analytics are on by default; turn them off on each phone and each computer in Settings (Share usage analytics), and that device stops sending right away.</p><ul className="list-disc pl-5 space-y-2"><li><strong>What we record:</strong> which features you use, such as opening the app and its screens, setting up and pairing a device (and whether you allow notifications), creating or deleting a bot, sending a message (with the number of attachments, not the files), starting a routine or a voice call, and installing a connector from the catalog. Each event carries the app version, the platform and the agent and model a bot uses.</li>@@ -45,11 +49,13 @@ export default function Privacy() {<Section title="Third-party services"><ul className="list-disc pl-5 space-y-2">- <li><strong>Apple Push Notification service</strong>: delivers notifications and Live Activity updates.</li>- <li><strong>Cloudflare Workers</strong>: runs the push relay (nothing stored).</li>+ <li><strong>Apple Push Notification service</strong>: delivers notifications and Live Activity updates on iPhone.</li>+ <li><strong>Google Firebase Cloud Messaging</strong>: delivers notifications and live updates on Android.</li>+ <li><strong>Cloudflare Workers</strong>: runs the push relay (nothing stored) and the Codync account service.</li>+ <li><strong>Clerk</strong>: runs sign-in for the optional Codync account.</li><li><strong>PostHog (US)</strong>: stores the usage analytics described above, unless you turned them off.</li><li><strong>The AI agents you choose</strong>: they run on your computer under their own terms and privacy policies.</li>- <li><strong>OpenAI or Google (optional, voice calls)</strong>: only if you add your own OpenAI or Gemini API key in a call's settings. Your voice then goes from your iPhone or Mac directly to that provider, under your account and its privacy policy, together with the bot's name and description and the chat messages it asks for during the call. The key is stored encrypted on your computer, which uses it only to start calls and list models. Without a key, voice calls use Apple speech recognition on your device.</li>+ <li><strong>OpenAI or Google (optional, voice calls)</strong>: only if you add your own OpenAI or Gemini API key in a call's settings. Your voice then goes from your phone or computer directly to that provider, under your account and its privacy policy, together with the bot's name and description and the chat messages it asks for during the call. The key is stored encrypted on your computer, which uses it only to start calls and list models. Without a key, voice calls use your device's own speech recognition.</li></ul><p className="mt-2">This policy covers Codync as we publish it. Codync services run by third parties (for example a hosted host or relay) handle your data under their own privacy policies; we don't operate them and receive none of that data.</p></Section>@@ -58,6 +64,18 @@ export default function Privacy() {Everything lives on your devices. Delete a bot to remove its conversation; uninstall the host and delete <code>~/.codync</code> to remove all of it. Deleting the phone app removes its cache. Turning analytics off stops new events from being sent.</Section>+ <Section id="delete-account" title="Delete your Codync account">+ <p className="mb-2">+ To delete your Codync account, email{" "}+ <a href={`mailto:${EMAIL}?subject=Delete%20my%20Codync%20account`} className="text-white underline">{EMAIL}</a>{" "}+ from the address you sign in with, with the subject “Delete my Codync account”. We delete it within 30 days and reply when it's done.+ </p>+ <ul className="list-disc pl-5 space-y-2">+ <li><strong>Deleted:</strong> your account (email address and account ID), the phones and computers connected to it and their access, and the usage analytics linked to it.</li>+ <li><strong>Kept:</strong> nothing on our side. Bots and conversations stay on your computer until you delete them there (see Data retention).</li>+ </ul>+ </Section>+<Section title="Children's privacy">Codync is not directed at children under the age of 13.</Section>@@ -88,9 +106,9 @@ export default function Privacy() {);}-function Section({ title, children }: { title: string; children: React.ReactNode }) {+function Section({ id, title, children }: { id?: string; title: string; children: React.ReactNode }) {return (- <section>+ <section id={id}><h2 className="text-xl font-semibold text-white mb-2">{title}</h2><div className="text-neutral-400 leading-relaxed">{children}</div></section>diff --git a/web/app/terms/page.tsx b/web/app/terms/page.tsxindex 2834af23..52e92295 100644--- a/web/app/terms/page.tsx+++ b/web/app/terms/page.tsx@@ -9,14 +9,14 @@ export default function Terms() {<main className="flex-1 flex flex-col items-center px-6 py-16"><article className="max-w-2xl w-full space-y-6"><h1 className="text-3xl font-bold text-white">Terms of Use</h1>- <p className="text-neutral-400 text-sm">Last updated: October 15, 2026</p>+ <p className="text-neutral-400 text-sm">Last updated: October 24, 2026</p><Section title="1. Acceptance of Terms">By using Codync you agree to these terms. If you don't agree, don't use the app.</Section><Section title="2. The service">- Codync is free, open-source software (Apache License 2.0) that lets you message AI agents running on your own computer from your iPhone, Mac, Windows PC or Linux desktop.+ Codync is free, open-source software (Apache License 2.0) that lets you message AI agents running on your own computer from your iPhone, Android phone, Mac, Windows PC or Linux desktop.</Section><Section title="3. Your responsibility">