Repository navigation
fix: [BOUNTY] Support Play Integrity over remote DroidGuard + Server/G (fixes #2851) - #4044
Open
hoangnamtaichua-prog wants to merge 1 commit into
Open
hoangnamtaichua-prog wants to merge 1 commit into
hoangnamtaichua-prog wants to merge 1 commit into
Conversation
… DroidGuard + Server/G)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
0xbec4f7086c0dd1fba2f8bb202e687c5a830ceadb62Y1v6BnMynZcGMj9L4d7Tgs6NgKnLJH1rJe9j1Y6tK8