init: Report valid verified boot for SafetyNet checks
Google's SafetyNet attestation includes checks for the integrity of the
verified boot chain, as reported by some ro.boot.* properties normally
passed by the bootloader. Reporting successful, valid values helps pass
SafetyNet checks, as long as other system state is intact.
However, the real prop values must be retained in recovery/fastbootd in
order for fastbootd to allow/deny flashing correctly based on the
bootloader lock state. This is accomplished a simple build time conditional,
to have the code bail out early when built for recovery. This is more reliable
and works across all OEMs rather than androidboot.mode
Given that CalyxOS is meant for usage with a locked bootloader, we only
need to spoof the value of verified boot state from yellow to green.
The other values are already acceptable, so we don't touch them
Co-authored-by: Chirayu Desai <chirayudesai1@gmail.com>
Co-authored-by: Michael Bestas <mkbestas@gmail.com>
Change-Id: I66d23fd91d82906b00d5eb020668f01ae83ec31f
1 file changed