0
Fork 0
mirror of https://github.com/zeronsh/comet.git synced 2026-11-16 18:57:19 +00:00
comet/apps/android
History 2026-11-07 19:36:35 -07:00
..
app Merge zeron/credit-rate 2026-11-07 19:36:35 -07:00
gradle Android runs the relay layer 2026-11-07 03:52:06 +00:00
icons The new app icon on iOS and Android (#1239) 2026-11-05 14:55:14 -07:00
screenshots Android: Gmail-style Sessions page; the transcript fades behind the composer (#1029) 2026-10-24 19:37:31 -07:00
.gitignore Android app on the shared Rust mobile core (Material 3 Expressive) (#609) 2026-10-24 17:12:34 -07:00
build.gradle.kts Android app on the shared Rust mobile core (Material 3 Expressive) (#609) 2026-10-24 17:12:34 -07:00
gradle.properties Android app on the shared Rust mobile core (Material 3 Expressive) (#609) 2026-10-24 17:12:34 -07:00
gradlew Android app on the shared Rust mobile core (Material 3 Expressive) (#609) 2026-10-24 17:12:34 -07:00
gradlew.bat Android app on the shared Rust mobile core (Material 3 Expressive) (#609) 2026-10-24 17:12:34 -07:00
README.md Merge remote-tracking branch 'origin/main' into android/play-testing-release 2026-11-02 21:58:58 +00:00
settings.gradle.kts Android app on the shared Rust mobile core (Material 3 Expressive) (#609) 2026-10-24 17:12:34 -07:00

Zeron for Android

A Jetpack Compose viewport onto the zeron mesh, built on the same Rust mobile core as the iOS app (crates/mobile). Rust decides what to paint and where; Kotlin paints, scrolls and handles gestures. The transcript's text measurement, markdown layout, prefix-sum virtualization and display lists are the exact code iOS runs — see docs/mobile-rewrite.md.

The UI is Material 3 Expressive (MaterialExpressiveTheme, expressive motion, flexible app bars, shape-morphing loading indicators, connected button groups, segmented lists) themed with Zeron's own palette and Geist type.

Build & run

Requires JDK 21, the Android SDK (platform 37, NDK 29.0.14206865), and Rust with cargo install cargo-ndk and rustup target add aarch64-linux-android x86_64-linux-android.

cd apps/android
./gradlew :app:installDebug

The buildCore task runs scripts/android/build-core.sh, which builds crates/mobile for Android (jniLibs) and generates its Kotlin bindings into target/android-core/. -PzeronSkipCore reuses the last build while iterating on Kotlin; ZERON_ANDROID_ABIS=arm64-v8a builds one ABI. scripts/android/gen-icons.sh rasterizes the shared tool/file SVG icons (needs rsvg-convert). The Geist fonts are read straight from the iOS app's Fonts/ folder, so both platforms measure and draw the same bytes.

Releases

.github/workflows/android.yml (run by ci.yml) builds a release APK and Google Play App Bundle (.aab, arm64, the core at the mobile-dist profile) whenever the app or the Rust core changes: pull requests that touch the app or the mobile core (or carry the ci:full label) get it as workflow artifacts, and pushes to main publish the APK to zeron.sh/releases/zeron-android-arm64.apk — the website's Android download — with a copy per build (zeron-<version>-<build>-android-arm64.apk) and .sha256s.

The version is the workspace's (Cargo.toml); the build number grows with each run. Publishing needs the upload key in repository secrets (ANDROID_KEYSTORE_BASE64, ANDROID_KEYSTORE_PASSWORD, ANDROID_KEY_ALIAS, ANDROID_KEY_PASSWORD) so each build installs over the last; without them the APK is debug-signed and not published. Locally, ZERON_ANDROID_KEYSTORE (and the three variables beside it) signs assembleRelease the same way.

Google Play testing

Every Android workflow run also saves an android-aab artifact (bundle and SHA-256 checksum, retained for 90 days). Builds from main or a manual run use the release key; pull requests use a debug key and cannot upload to Play. The APK and bundle share the same version code, 1000 + GITHUB_RUN_NUMBER. Start a new run, rather than rerunning an uploaded build, to get a new code.

For the first release, download android-aab from Actions and upload the .aab in Play Console → Test and release → Testing → Open testing. Complete the app's required declarations, signing setup, and review before opening the test.

To enable subsequent automatic uploads:

  1. Enable the Google Play Android Developer API in a Google Cloud project.
  2. Create a service account and grant it access to Zeron only in Play Console → Users and permissions, with app read access and permission to release to testing tracks. It does not need production, financial, or account admin access.
  3. Store its JSON key in the repository secret GOOGLE_PLAY_SERVICE_ACCOUNT_JSON.
  4. Set repository variable PLAY_UPLOAD_ENABLED=true. Pushes to main that trigger the Android workflow will then upload the signed bundle to open testing (beta). PLAY_TRACK=internal selects internal testing instead.
  5. The default PLAY_RELEASE_STATUS=draft leaves the uploaded release ready in Console. Once the app's initial setup/review is complete, set it to completed to roll future uploads out to testers, subject to Google's review.

For a manual build/upload, run Android on main, check upload_play, and choose beta (open testing) or internal, plus draft or completed. Manual runs leave the website download unchanged. Only testing tracks are accepted; this workflow does not release to production.

The Play upload job is serialized. Avoid editing a release in Console during an upload. If Play rejects a release, the signed artifact remains downloadable and the workflow reports the error. Missing credentials never fall back to a debug-signed Play upload.

Layout

core/        AppModel (owns CoreClient, republishes snapshots as flows),
             CredentialStore, Fonts + AndroidMeasurer (Minikin fallback
             measurement for glyphs Geist lacks)
design/      ZeronTheme (Material 3 Expressive), transcript palette
transcript/  TranscriptState (layout engine + viewport: anchoring, follow the
             tail), Transcript (virtualized rows over LayoutFrame), RowModel
             (canvas painter for Rust display lists, streaming veil, fades),
             Widgets (copy, disclosures, tool rail, shimmer, images…)
terminal/    TerminalView (a shell on the chat's host: paints the Rust
             emulator's frames, IME and hardware keys, scrollback fling,
             pinch to resize, selection), TerminalGlyphs (box drawing, blocks)
ui/          Sign-in and the welcome pages, sessions (a Material 3 bottom
             app bar with the New session FAB), session + composer,
             companions (subagents, side chats, terminals: chips above the
             composer and a sheet), subagent transcripts, terminal + key bar,
             new session (Cloud too), search, settings, and Cloud: Providers,
             an agent's accounts, Cloud, Billing, GitHub, Cloud projects.
             TabletShell: large screens (≥ 700dp wide) put the sessions
             sidebar beside the open session and its companions in an
             inspector column (iPad's split); Settings is a dialog there.

The core links C++ (libc++_shared.so ships beside it: build-core.sh passes --link-libcxx-shared to cargo-ndk).

Launch extras

Mirrors the iOS launch arguments:

adb shell am start -n sh.zeron.android/.MainActivity \
  --ez demo true --es route chat:chat-veil
Extra Effect
--ez demo true Offline demo workspace (Rust DemoHost)
--ez fast true / --ez longreply true Demo stream speed / reply length
--ez big true / --ez huge true Demo transcripts with 120 / 600 turns
--es route chat:<id> / new / search / settings (more) / archived Open a screen at launch (with nobody signed in, on the demo)
--es route cloud / cloud:billing / cloud:repos / billing / providers[:cloud|:<device id>] / accounts:cloud:<harness> / accounts:device:<id>:<harness> / new:cloud / welcome[:<step>] Cloud pages, a new session set to Cloud, the welcome pages
--ez cloud true Offer Cloud in the demo (its pages read the demo's Cloud)
--es companion companions / terminal / side-chat:<id> / subagent:<tool id> / model-picker With route chat:<id>, open the companions sheet, a terminal, a side chat, a subagent or the model picker over it (model-picker also works with route new)
--ez terminal-demo true The opened terminal types a short script (screenshots)
--ez signedout true Clear stored credentials
--es wallpaper <path> / none Set (or clear) the wallpaper from a file the app can read, e.g. adb push art.jpg /data/local/tmp/ && adb shell run-as sh.zeron.android cp /data/local/tmp/art.jpg files/ then --es wallpaper /data/user/0/sh.zeron.android/files/art.jpg
--es wallpaper-effect <none|dither|ascii|halftone|scanlines> Wallpaper effect