Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
main ▾

Modern-Apps.git / communicate-dev / AGENTS.md

AGENTS.md5.0 KiBRenderedCodeRaw

AGENTS.md — communicate-dev/ (':communicate-dev')

Scoped supplement. Global rules in root AGENTS.md apply. Stay inside communicate-dev/ + communicate/.

  • Gradle: :communicate-dev / dir: communicate-dev/
  • Module type: Android library (common-conventions-library); it is not an app and has no applicationId, launcher icon, or store metadata.
  • Host: :communicate links this module only from its dev variant (devImplementation). Release builds do not compile, link, or package it.
  • This module is dev-build-only by owner decision and is excluded from the repo line count for :communicate.
  • Package names under com.vayunmathur.communicate.* are kept where JNI symbol names (Rust crates communicate_signal / communicate_mls), protobuf/wire formats, Room schemas, and persisted DataStore/auth formats freeze them. The library namespace (com.vayunmathur.communicatedev) only names this module's own R/resources.
  • Entry files: none (no UI entry points). The host's registration entries live in communicate/src/dev/java/com/vayunmathur/communicate/ui/RegistrationEntries.kt (dev variant) with a Google-Voice-only release counterpart in communicate/src/release/; the three line feature gates (data/{whatsapp,signal,rcs}/*Feature.kt, enabled = true) live here, with enabled = false stubs in the host's src/release.
  • Deps: :library, :library:ui, :library:log, :library:network, :library:image, :library:room (+ Room runtime/KSP), :library:aosp-stubs (compileOnly), RingRTC, libsignal, protobuf, libphonenumber

Overview

Purpose: Owns the dev-only messaging lines of Communicate — WhatsApp, Signal, and RCS (data, transports, crypto, Room DBs, protos, Rust, registration data) — so those lines do not count against or ship in the :communicate release app. Dev builds of :communicate gain the lines through this module; release behaviour is unchanged. Key features:

  • WhatsApp primary client line (Noise + Double Ratchet), Signal line (libsignal + Rust protocol), and RCS line (SIP/MSRP + MLS E2EE) for dev builds
  • Registration wizard data for the three lines (screens are host route sub-stacks in the host's src/dev)
  • Line sync foreground services and the shared in-app Telecom services, declared in this module's manifest so they merge only into dev builds (the service classes live in the host's src/dev — they need host MainActivity/R/notifications)

Architecture / data-flow: Host (:communicate, dev variant) links this module via devImplementation. This module owns data/whatsapp, data/signal, data/rcs (transports under data/<line>/transport/, E2E under data/<line>/e2e/), the 11 protos in src/main/proto (hand-rolled GenerateProtoTask, no proto plugin), both Rust crates (src/main/rust, src/main/rust-mls via rustNativeLib), and the line Room schemas in schemas/. Host-side glue that needs host classes stays in the host's src/dev: repository extensions (CommunicateRepository{Rcs,RcsGroup,Signal,WhatsApp,WhatsAppCalls}), RCS file-transfer/outbox/typing repository glue, the sync services, and the UI/telecom seams; the host's src/release carries no-op counterparts. A library cannot depend on the host app, so line code here never references host classes: shared frozen types (data/SecretSealer.kt, data/CommunicateLine.kt, data/call/{InAppCall,WebRtcInit}.kt) are canonical here with byte-identical copies in the host's src/release for its Google Voice / call-UI paths, and Telecom/foreground-service mirroring goes through data/call/InAppCallSystemBridge (installed by the host's InAppCallTelecom). Gotchas:

  • Never add this module as an implementation dependency of :communicate; it is devImplementation only. A release APK containing these classes is a regression.
  • :library:aosp-stubs is compileOnly only — it must never be packaged.
  • Registration wizards are host route sub-stacks (Route.WhatsAppRegistration, Route.SignalRegistration, RCS routes); step state stays in route arguments, not in held selection state.
  • RingRTC is the only WebRTC distribution allowed on the classpath; never add another WebRTC dependency.
  • The src/release copies of SecretSealer / CommunicateLine / InAppCall / WebRtcInit in :communicate must stay byte-identical to the canonical files here (KeyStore alias communicate_secret_key and the v1: sealed format are frozen; in each variant exactly one copy compiles).
  • Members used by host src/dev glue and by host integration tests are public here (the two clients' test-seam state, RcsSessionManager.sessionsMutable, RcsMsrp connection isClosed(), RcsGbaAuth.digestAuthorizationHeader, canonicalWhatsAppChatJid, the *ForTest database/base-url overrides, and similar) because Kotlin internal does not cross the module boundary; keep new additions minimal and prefer lib-local APIs.

Verify (this module only)

./gradlew :communicate-dev:compileDebugKotlin
./gradlew :communicate-dev:testDebugUnitTest
./gradlew :communicate-dev:lint
./gradlew :communicate:compileDevKotlin
./gradlew :communicate:compileReleaseKotlin