plugins { id("common-conventions-app") // Store-listing screenshots rendered from Compose @Preview (car views). id("common-conventions-preview-metadata") id("com.google.devtools.ksp") } launcherIcon { symbol = "call" } // Pixel Watch 5 is armeabi-v7a (32-bit) only: an arm64-only APK is rejected at install. nativeAbis { armv7 = true } android { defaultConfig { applicationId = "com.vayunmathur.communicate" } compileOptions { isCoreLibraryDesugaringEnabled = true } packaging { resources { // libsignal-client bundles its desktop JNI natives (macOS .dylib, // Windows .dll) as Java resources. They can never load on Android and // add ~40 MB to the APK — strip them. The Android lib/arm64-v8a/ // libsignal_jni.so is unaffected. excludes += setOf("**/*.dylib", "*.dylib", "**/*.dll", "*.dll") } jniLibs { // Test-only libsignal native (NativeTesting bridge); unused in prod. excludes += "**/libsignal_jni_testing.so" } } } dependencies { coreLibraryDesugaring(libs.desugar.jdk.libs) // Dev-only line library (WhatsApp/Signal/RCS). Linked only into the // dev variant, so release builds neither compile nor package it. // `dev` is a repo-custom build type, so there is no static // `devImplementation` accessor; use add() like the convention does. add("devImplementation", project(":communicate-dev")) } rustNativeTests { nativeClasses.addAll( listOf( "com.vayunmathur.communicate.data.Y3MergedGvTest", "com.vayunmathur.communicate.data.Y3RcsSendSuccessTest", "com.vayunmathur.communicate.rcs.MlsLifecycleRcsPass3Test", "com.vayunmathur.communicate.rcs.RcsSlice3E2ESupportTest", "com.vayunmathur.communicate.rcs.RcsSlice3Pass2E2ETest", "com.vayunmathur.communicate.rcs.RcsSlice3Pass2FakeTransportTest", "com.vayunmathur.communicate.rcs.RcsSlice3Pass2UiTest", "com.vayunmathur.communicate.signal.RegistrationHttpClientSignalPass3Test", "com.vayunmathur.communicate.signal.RustSignalCryptoSignalPass3Test", "com.vayunmathur.communicate.signal.SignalAuthAndServiceDataTest", "com.vayunmathur.communicate.signal.SignalCallAndTransportParseTest", "com.vayunmathur.communicate.signal.SignalCdsiTest", "com.vayunmathur.communicate.signal.SignalGroupsAndSyncTest", "com.vayunmathur.communicate.signal.SignalIdentitySignalPass3Test", "com.vayunmathur.communicate.signal.SignalInboundPollW1Test", "com.vayunmathur.communicate.signal.SignalSafetyNumberTest", "com.vayunmathur.communicate.signal.SignalSealedSenderTest", "com.vayunmathur.communicate.signal.SignalSlice2E2ETest", "com.vayunmathur.communicate.signal.SignalSlice2InboundTest", "com.vayunmathur.communicate.signal.SignalSlice2MessagingOfflineTest", "com.vayunmathur.communicate.signal.SignalSlice2SealedCacheTest", "com.vayunmathur.communicate.signal.Y1SignalMessagingGroupTest", "com.vayunmathur.communicate.signal.Y1SignalSendPipelineTest", "com.vayunmathur.communicate.signal.Y2SignalSocketRegTest", "com.vayunmathur.communicate.signal.Y3SignalGroupOpsServerTest", "com.vayunmathur.communicate.signal.Y3SignalPipelineServerTest", "com.vayunmathur.communicate.signal.Y3SignalServerApiTest", "com.vayunmathur.communicate.telephony.WelcomeJoinRcsPass3Test", "com.vayunmathur.communicate.ui.Y3GroupCreatePickerTest", "com.vayunmathur.communicate.whatsapp.W5Slice1AttestationTest", "com.vayunmathur.communicate.whatsapp.W5Slice1MexRouterTest", "com.vayunmathur.communicate.whatsapp.W5Slice1RegBundleTest", "com.vayunmathur.communicate.whatsapp.WhatsAppAttestationTest", "com.vayunmathur.communicate.whatsapp.WhatsAppRegistrationBadParamRegressionTest", "com.vayunmathur.communicate.whatsapp.Y1WaE2eSyncTest", "com.vayunmathur.communicate.whatsapp.Y1WaInboundTest", "com.vayunmathur.communicate.whatsapp.Y1WaRegistrationHttpTest", "com.vayunmathur.communicate.whatsapp.Y2WaSocketSendTest", "com.vayunmathur.communicate.whatsapp.Y3AppStatePageTest", ) ) // Shared-JVM polluters keep forkEvery = 1 in the same companion task: // these touch the process-wide DataStoreUtils singleton (the // datastore_default file behind GoogleVoiceSession and the line // sessions) or collect its flows, so persisted DataStore state can // leak into classes expecting defaults when batched. Audit rule: // any test instantiating a *LineSession / GoogleVoiceSession or // using DataStoreUtils.getInstance directly belongs here. All other // classes batch. // // Post-batch CI fallout (46858d7faa, 5-CPU) added six more: // (The fixed P-CSCF port 5060 shared by the DirectSip/Ims tests is // handled in those classes with SO_REUSEADDR + bounded bind retry: // forkEvery is a per-worker restart counter, not a fixed batch, so // no task placement can serialize them.) // - RcsSlice3Pass2DirectSipAuthTest asserts the RcsDirectSip // singleton's SIP CSeq starts at 1; batched neighbours that drive // the same singleton (same Robolectric sandbox classloader) // increment it first ("CSeq: 7 REGISTER" observed). // - RcsSlice3Pass2TransportTest asserts RcsCapabilityExchange's // updates flow starts empty; neighbours populate it. // - RcsSlice3Pass2TlsAndFtTest holds RcsMsrpTls's process-wide // cached identity + persisted identity files and the // RcsDatabase.overrideForTest seam. // - W5Pass2ClientCoreTest / W5Pass2SyncHistoryTest / // W5Pass2ContactUtilsTest drive the WhatsAppClient singleton // (auth/db/socket/state fields and its never-cancelled IO scope), // whose asynchronous leftovers from batched neighbours can land // inside their assertions. isolatedClasses.addAll( listOf( "com.vayunmathur.communicate.data.SecretSealingTest", "com.vayunmathur.communicate.data.Y1RepositoryLoadersTest", "com.vayunmathur.communicate.googlevoice.GoogleVoiceSessionSlice4Test", "com.vayunmathur.communicate.rcs.RcsSlice3Pass2DirectSipAuthTest", "com.vayunmathur.communicate.rcs.RcsSlice3Pass2TlsAndFtTest", "com.vayunmathur.communicate.rcs.RcsSlice3Pass2TransportTest", "com.vayunmathur.communicate.ui.Y2TopLevelScreensTest", "com.vayunmathur.communicate.whatsapp.W5Pass2ClientCoreTest", "com.vayunmathur.communicate.whatsapp.W5Pass2ContactUtilsTest", "com.vayunmathur.communicate.whatsapp.W5Pass2SyncHistoryTest", // Batch-shift fallout from the wear merge's added classes: // Y2RepositoryRcsSendTest's MMS send and // Y1RegistrationScreensTest's RCS verify (AndroidKeyStore via // Room/SQLCipher) fail when they share a batched Robolectric // sandbox with new neighbours; both pass isolated. "com.vayunmathur.communicate.data.Y2RepositoryRcsSendTest", "com.vayunmathur.communicate.ui.Y1RegistrationScreensTest", ) ) } dependencies { // Google Voice virtual line: protojson RPCs + SIP-over-WSS transport go through // the repo's own Android-only HTTP/WebSocket stack (no OkHttp/Ktor). implementation(project(":library:network")) // Both sides of the Wear OS sync live in this one APK (same // applicationId and signing, as the WearLink handshake requires): // data/WearCommunicateSync publishes the phone snapshot, // sync/WearLinkBridge receives it on a watch. FormFactor picks the // side at runtime. implementation(project(":library:wearlink")) // Watch experience (ui/Wear*): Wear Compose + the repo log facade the // watch store/sync code writes through. implementation(libs.androidx.wear.compose.material) implementation(libs.androidx.wear.compose.foundation) implementation(project(":library:log")) // Local Compose image loading for Google Voice MMS previews (remote https + content://). implementation(project(":library:image")) // RingRTC supplies both Signal's calling engine and the org.webrtc classes every line's calling // uses. It bundles its own WebRTC, so no other WebRTC distribution can be on the classpath: the two // ship ~368 identical org.webrtc class names, and RingRTC's native library binds to that exact // package via JNI symbol names and FindClass descriptors, so relocating it is not an option either. implementation(libs.ringrtc.android) // E.164 normalization to reconcile SIM vs Google Voice numbers. implementation(libs.libphonenumber) // Compile-only stubs for the framework's @SystemApi app-data backup transport // and single-registration RCS APIs (SipDelegateManager, UCE). Absent from the // public SDK; the framework provides them at runtime, so they must NOT be // packaged. See :library:aosp-stubs. compileOnly(project(":library:aosp-stubs")) // Persist the Google Voice / WhatsApp session (cookies, API key, auth, number). implementation(libs.androidx.datastore.preferences) // Document-start JS injection to hook fetch/XHR before the GV web app captures them. implementation(libs.androidx.webkit) // Room runtime for any host-side Room usage in tests; the three line // databases themselves live in :communicate-dev. implementRoom(libs) implementation(project(":library:room")) // kotlinx.serialization — session/auth data persistence + serviceData blob. implementation(libs.kotlinx.serialization.json) // Car templates (P-car-dock): AndroidX Car App Library, same pairing as // :maps. Only pulled into the car code path (service/car/) — phone UI, // sync services and crypto paths are untouched. implementation(libs.androidx.car.app) implementation(libs.androidx.car.app.projected) // Car-view store-listing screenshots render through the shared host renderer. add("screenshotTestImplementation", project(":library:carhost")) // Voicemail tab audio playback: plain ExoPlayer (no session/controller stack — // voicemail clips are short local files, not a browsable media library). implementation(libs.androidx.media3.exoplayer) // voicemailNumber() reads TelephonyManager.voiceMailNumber, which the unit-test stub // android.jar does not implement ("not mocked"). Robolectric supplies the framework // shadows so the pilot lookup (and its permission/dual-SIM fallbacks) can be asserted // on the JVM; same reason emergency/pdf use it. // Line proto/libsignal types reach host unit tests through :communicate-dev's // public API; its implementation deps are not exposed, so tests name them here. testImplementation(libs.protobuf.java) testImplementation(libs.libsignal.android) testImplementation(libs.robolectric) testImplementation(libs.androidx.car.app.testing) testImplementation(libs.androidx.test.core) // Compile-only hidden-API stubs (SipMessage etc.) so RCS inbound tests can reference // them; Robolectric's android-all supplies the real implementations at runtime. testImplementation(project(":library:aosp-stubs")) // Route slice-6 contract tests use KClass reflection (sealedSubclasses, constructors). testImplementation(libs.kotlin.reflect) // RCS slice tests: real in-memory Room database via the bundled sqlite driver // (same pattern as :todo's TodoMigrationTest). testImplementation(libs.androidx.sqlite.bundled.jvm) }