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 noapplicationId, launcher icon, or store metadata. - Host:
:communicatelinks this module only from itsdevvariant (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 cratescommunicate_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 incommunicate/src/release/; the three line feature gates (data/{whatsapp,signal,rcs}/*Feature.kt,enabled = true) live here, withenabled = falsestubs in the host'ssrc/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 hostMainActivity/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
implementationdependency of:communicate; it isdevImplementationonly. A release APK containing these classes is a regression. :library:aosp-stubsiscompileOnlyonly — 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/releasecopies ofSecretSealer/CommunicateLine/InAppCall/WebRtcInitin:communicatemust stay byte-identical to the canonical files here (KeyStore aliascommunicate_secret_keyand thev1:sealed format are frozen; in each variant exactly one copy compiles). - Members used by host
src/devglue and by host integration tests are public here (the two clients' test-seam state,RcsSessionManager.sessionsMutable,RcsMsrpconnectionisClosed(),RcsGbaAuth.digestAuthorizationHeader,canonicalWhatsAppChatJid, the*ForTestdatabase/base-url overrides, and similar) because Kotlininternaldoes 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