[BOUNTY #2851] Remote DroidGuard server guide + multi-step session support#3575
Conversation
… Play Integrity - Implement session-based protocol in RemoteHandleImpl for multi-step DroidGuard flows needed by Play Integrity (pia_attest_e1) - Add begin/snapshot/close session lifecycle with fallback to single-step - Implement guardWithRequest service path that was marked TODO - Add Python server script for running DroidGuard server on old phone via Termux - Add setup guide documenting how to use a spare phone as a DroidGuard server Fixes: microg#2851 Signed-off-by: Gautam Kumar <gautamkumarofficial@users.noreply.github.com>
|
At least passes a quick visual inspection! if you could further elaborate how the server is actually supposed to be used, like getting DEVICE integrity is great and all, but explain please what device is expected in the end? Does it run on stock phones? You can not put microG together with normal GMS as i understand, so please elaborate a bit Also recording a 1-2 minute demo of the complete setup (like you having your client and server phone and a integrity request is being made) would be great but the PR can of course be reviewed without. |
|
Also explain why
|
|
Thanks for the review! Let me address each point: What device is expected for the server? Does it run on stock phones? How does it stay compliant (passing)? Why some apps may reject tokens from remote DroidGuard? Video demo: |
|
To clarify the token rejection point further — the setup guide already explains this in the Limitations section. The key issue is that Play Integrity tokens contain device-specific claims. When a token is generated on Device A but presented to an app on Device B, apps that validate these claims (banking apps, apps with strong device binding) will reject it. This is inherent to the remote DroidGuard architecture and not something we can solve in code — it is a fundamental limitation documented in the guide. |
|
alr bro but which phones? the guide also says old stock phones and it only goes up to DEVICE at most, but with stock phones the expectation would generally be STRONG because it's all right there. i'm not stupid, you have to really think about my points, they're not garbage As for the potential token rejecting issues, i guess that kind of makes sense and you wouldn't need to work on that in order to get the bounty But like you have to seriously consider the stock argument point. "Stock" means not BL unlocked or tampered with in any way besides installing the attestation token server/proxy If you unlock BL to get stock rom and then use root and magisk and whatever to get a device token, that is not what is meant by that. You have to either make it work on complete stock (which looks pretty hard to almost impossible from the answers my AI is giving me) or go the custom rom route, which does work and is promising but also requires much work (have a software manage all the sketchy software that does the "staying compliant" part) to summarize, you're still missing: a POC demo (optional), potentially your code working at all as pointed out, and the initial version of the part that manages the PIFs, the Roots, the TrickyStores and whatever else such that it's a set it and forget it kind of setupWith the latter you could even get creative, like creating some master repo with maintenance scripts that are authored by humans and fetched by devices such that they are always compliant automatically, idk, you'll work it out! |
|
To be clear: You DO NOT have to keep maintenance scripts on some public server up-to-date forever to claim the bounty, but you DO need to implement a framework that allows for this to be possible, the first initial passing version that works when it was written and the docs to make anyone be able to start adapting it, as your initial setup will eventually stop working. Perhaps you can become the first commercial integrity tokens-as-a-service seller, who knows; The world is yours! |
Summary
This PR addresses the remote DroidGuard infrastructure needed for Play Integrity support. It includes:
Changes
Client-side (RemoteHandleImpl)
Service (DroidGuardServiceImpl)
Server (new)
How it works
The remote DroidGuard server script runs on an old Android phone with microG in embedded mode. When a client device in Network mode requests a Play Integrity token:
Testing
This requires testing on actual Android devices. To verify:
Fixes: #2851