android_attestation library

Android hardware key attestation for Flutter, with a GrapheneOS check.

The device's secure hardware (TEE or StrongBox) signs a certificate that describes the OS it booted: its verified boot state, the key that signed it, whether the bootloader is locked, and its patch level. A rooted OS cannot forge that signature. See AndroidAttestation.

Classes

AndroidAttestation
Entry point. All methods are safe to call on any platform: off Android they report "unavailable" instead of throwing.
AttestationResult
Facts read from one attestation. Nothing here is a verdict on its own; check isTrustworthy before relying on any OS field.

Enums

SecurityLevel
Where the attested key lives.
VerifiedBootState
The device's verified boot state, as reported by the secure hardware.

Constants

grapheneOSVerifiedBootKeys → const Map<String, String>
Verified boot key fingerprints of official GrapheneOS releases.
grapheneOSVerifiedBootKeysTimestamp → const int
Unix timestamp of the attestation.json the list above was taken from.