Skip to content

Implement Constellation and Asterism + DroidGuard fixes for RCS support - #3784

Open
naormeit wants to merge 62 commits into
microg:masterfrom
naormeit:rcs-bounty-2994
Open

Implement Constellation and Asterism + DroidGuard fixes for RCS support#3784
naormeit wants to merge 62 commits into
microg:masterfrom
naormeit:rcs-bounty-2994

Conversation

@naormeit

@naormeit naormeit commented Sep 5, 2026

Copy link
Copy Markdown

This PR implements the GMS services required for RCS provisioning, addressing issue #2994 where Google Messages displays "RCS chats aren't available for this device" or hangs on "Setting up...". Previously, Constellation (GmsService 155, phone number verification) and Asterism (GmsService 199, RCS ToS/consent) were bound to DummyService. This also resolves DroidGuard tachyon_registration token rejections caused by cache path discrepancies visible to DG via /proc/self/maps.

Fixes #2994.

Contributors & Changes:

  • @opstic: Implemented Constellation and Asterism from scratch (Implement play-services-constellation #3359, Implement play-services-asterism #3360), including AIDL interfaces, proto definitions, gRPC clients, all verification paths (UPI/OTP, MO-SMS, MT-SMS, TS.43 EAP-AKA), and Phenotype flags for Messages/IMS.

  • @br413: Provided DroidGuard tachyon parity fixes (RCS: DroidGuard tachyon fixes, phone-number fallback, and unit tests (#2994) #3644):

    • Changed getDir("cache_dg") to app_dg_cache/ (was app_cache_dg/).
    • Uppercased VM cache key hex (stock GMS uses uppercase, okio returns lowercase).
    • Fixed DroidGuardInitReply.createFromParcel() null handling to preserve DroidGuardResultsRequest when PFD is null.
    • Added phone number hint fallback when E.164 is null.
  • @camilo-12ch: Fixed the IID empty token issue. getIidToken() no longer returns "" on failure, preventing empty credentials from reaching Google's GPNV endpoint.

  • @paulcakeface: Fixed the public-key ack ordering bug. The EC key is now validated/regenerated before isPublicKeyAcked() is read, preventing a corrupt stored key from producing a ClientAuth header for an unacknowledged key. Includes regression test.

  • @nwinkelman2: Integrated and repaired the branches. Fixed all 11 Android lint errors, fixed the instrumentation manifest, removed the unsubstantiated custom DG classloader experiment, and fixed a false JVM Parcel round-trip assertion in tests, achieving a CI-green branch for Debug and Release.

  • Author (This PR): Implemented hasAccount correctness fix in NetworkHandleProxyFactory.createRequest(). Replaced hardcoded hasAccount = false with dynamic reading from AccountManager for com.google accounts (with SecurityException fallback to false). This prevents incorrect DroidGuard VM execution flows on devices with registered Google accounts.

Out of Scope / Not Claimed:

  • Locked-bootloader E2E hardware test (requires a microG ROM and real SIM).

  • TS.43 carrier testing (no SIM available).

  • X-Goog-Spatula header on Constellation gRPC (architecturally blocked; play-services-constellation-core cannot depend on play-services-core without creating a circular dependency).

Testing:

  • Lint (all three modules): 0 errors — BUILD SUCCESSFUL locally.

  • Unit tests: Gradle 8.13/AGP configuration incompatibility locally; CI green on base branch (nwinkelman2/integration/rcs-current-upstream).

  • Hardware E2E: Pending (no microG ROM available).

opstic and others added 30 commits April 7, 2026 16:52
InstanceID failures could be suppressed into an empty string. The empty credential was then exposed as a successful getIidToken response, signed, and included in a GetVerifiedPhoneNumbers request.

Propagate InstanceID failures to the existing error handlers and reject empty credentials before reading the FID, signing, building IIDTokenAuth, or executing GPNV. Regression tests cover exceptions, empty credentials, and the valid request path.

PR microg#3388 handles IID failures in a different Constellation implementation. This change applies equivalent error semantics plus explicit empty-token and GPNV guards to the microg#3359 architecture.
A regenerated EC key was allowed to inherit the previous key's server acknowledgement. Validate stored key material before reading that state, and reset it atomically whenever key material is generated.

Add instrumentation coverage for corrupt and valid stored key pairs.
Align DG cache naming and VM keys with stock GMS, preserve partial init replies, and fall back to phone number hints during Constellation provisioning.
Introduce shared phone-number and VM cache utilities, wire them into Constellation and DroidGuard, and add offline JUnit coverage for provisioning and tachyon-related logic.
…ctory

hasAccount in NetworkHandleProxyFactory.createRequest() was hardcoded to false. This reads the value dynamically from AccountManager for 'com.google' accounts, incorporating a SecurityException fallback to false.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOUNTY] RCS Support [14999$]

6 participants