Interface EngineContext
The narrow set of framework services lent to a ShieldEngine.
Handed to the engine rather than reached for, so the engine never needs access to the platform implementation object. That keeps the framework's implementation accessor package-private, and it keeps the list of things an engine can do small enough to review.
-
Method Summary
Modifier and TypeMethodDescriptionvoidconfirmPlatformAttestation(String keyId) Acknowledges that the verifying service recorded the attested key, releasing the client to use cheap assertions from here on.String[]Digests of the certificates the running app is actually signed with, for comparison against what it was built with.String[]Component identifiers of the accessibility services currently enabled.String[]Platform-detected compromise reasons, such asrootorfrida.getProperty(String key, String defaultValue) A build-stamped property, such as the build key or the per-build hardening manifest.Non-prompting secure storage, for the attestation key identifier and cached tokens.booleanTrue when the platform provides attestation and this build bundled it.voidWrites to the framework log.voidpublishSignal(ShieldSignal signal) Publishes an observation toShieldSignals, where the app can see it and from where it is offered to the service on the next token fetch.requestPlatformAttestation(String nonce) Requests a raw platform attestation (Play Integrity or App Attest) bound to the nonce.voidClears cached platform attestation state, forcing a fresh hardware key on the next request.
-
Method Details
-
getSecureStorage
SecureStorage getSecureStorage()Non-prompting secure storage, for the attestation key identifier and cached tokens. On device this is the platform keychain or keystore. -
requestPlatformAttestation
Requests a raw platform attestation (Play Integrity or App Attest) bound to the nonce.
The result is opaque and must be forwarded to the verifying service; the engine must not try to interpret it on the device, because a device the attacker controls can be made to produce any interpretation.
-
isPlatformAttestationSupported
boolean isPlatformAttestationSupported()True when the platform provides attestation and this build bundled it. -
resetPlatformAttestation
void resetPlatformAttestation()Clears cached platform attestation state, forcing a fresh hardware key on the next request. Used when the service reports that the device's attestation key is unknown to it. -
confirmPlatformAttestation
Acknowledges that the verifying service recorded the attested key, releasing the client to use cheap assertions from here on. Call it once the service has accepted an attestation token; until then the platform refuses to assert against a key the service cannot yet resolve. -
getPlatformCompromiseReasons
String[] getPlatformCompromiseReasons()Platform-detected compromise reasons, such asrootorfrida. -
getEnabledAccessibilityServices
String[] getEnabledAccessibilityServices()Component identifiers of the accessibility services currently enabled. -
getAppSignerDigests
String[] getAppSignerDigests()Digests of the certificates the running app is actually signed with, for comparison against what it was built with. Empty where the platform cannot report it.
Not exposed as public framework API: nothing in an app needs this, and publishing it would only tell an attacker exactly which value to fake.
-
getProperty
-
log
Writes to the framework log. -
publishSignal
Publishes an observation toShieldSignals, where the app can see it and from where it is offered to the service on the next token fetch.
-