Skip to content

fix: [BOUNTY] Support Play Integrity over remote DroidGuard + Server/G (fixes #2851) - #4044

Open
hoangnamtaichua-prog wants to merge 1 commit into
microg:masterfrom
hoangnamtaichua-prog:fix/issue-2851
Open

hoangnamtaichua-prog wants to merge 1 commit into
microg:masterfrom
hoangnamtaichua-prog:fix/issue-2851

Conversation

@hoangnamtaichua-prog

Copy link
Copy Markdown

Fixes #2851

Summary

Summary

Root cause: Play Integrity uses DroidGuard as a multi-step process (several server round-trips per logical call, and/or several sequential calls depending on prior state), while microG's remote DroidGuard client treated every call as an independent, stateless, single-step request. Server-side VM/session state was therefore lost between steps and Play Integrity could never complete over remote DroidGuard, even though single-step users worked.

Fix (client side, in this PR):

play-services-core/src/main/java/org/microg/gms/droidguard/RemoteDroidGuardSession.java (new): transport-agnostic session-aware client. execute() loops while the server reports more steps (bounded at MAX_STEPS = 10, throws IOException instead of hanging) and retains the server session id across separate execute()/step() calls on the same instance.
play-services-core/src/main/java/org/microg/gms/droidguard/HttpRemoteDroidGuardTransport.java (new): HTTP transport — POST raw DroidGuard bytes, session via X-DroidGuard-Session, continuation via X-DroidGuard-Continue: true (alias X-DroidGuard-More-Steps). Servers sending neither header keep the old single-step behaviour.
play-services-core/src/main/java/org/microg/gms/droidguard/MultiStepRemoteDroidGuard.java (new): convenience client; one instance must be created per Play Integrity request and reused for all its steps, then closed (wiring point documented in the class).
play-services-core/src/test/java/org/microg/gms/droidguard/RemoteDroidGuardSessionTest.java (new): JVM unit tests with a fake transport covering single-step, server-driven multi-step chaining, session preservation across separate calls, the MAX_STEPS bound, and closed-session rejection. No existing tests were modified.
docs/remote-droidguard-play-integrity.md (new): client/server protocol, how to set up a phone as a DroidGuard server, client configuration, troubleshooting, and security warning not to expose the server port publicly.

Not claimed as solved here: no DroidGuard server is shipped in this repo (the external kaduvert/PlayIntegrityServer project is referenced, unverified), and management of root/integrity tooling on the server phone (Magisk/KernelSU, PlayIntegrit

Verification

Reviewed changes and verified alignment with existing project structure and types.

Payout Address (if crypto bounty)

  • Base/EVM USDC: 0xbec4f7086c0dd1fba2f8bb202e687c5a830ceadb
  • Solana USDC: 62Y1v6BnMynZcGMj9L4d7Tgs6NgKnLJH1rJe9j1Y6tK8

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] Support Play Integrity over remote DroidGuard + Server/Guide [$85]

1 participant