I've signed my own secure boot loader on Linux, but I don't know if you can do it on Android at all, since you don't have keys or can modify the secure storage easily.
I've signed my own secure boot loader on Linux, but I don't know if you can do it on Android at all, since you don't have keys or can modify the secure storage easily.
If so, you might be able to use my avbroot project [1]. It roots the boot image, signs it with your own key, and replaces the OTA verification certificate with your own, so you can install future updates signed by your key while the bootloader is locked.
[1] https://github.com/chenxiaolong/avbroot
EDIT: I read a bit about OnePlus devices. Looks like they do indeed support locking the bootloader with a custom signing key installed. So I went ahead and added support for OnePlus' OTAs in avbroot: https://github.com/chenxiaolong/avbroot/pull/32. There are only minor differences compared to Pixel's OTA images.
Even if you could, Google's hardware attestation API is based on checking their keys against their cloud services, and that's what banking and DRM video apps will generally be testing for going forward.
Client (validate)-> server, requires a valid signature which I cannot sign unless I have access to their private key
Client <-(SpoofedAuthSuccess) SpoofServer, is also impossible if the client requires data from a server to work properly going forward. The only thing you could attain, is to unlock the client locally if you reverse engineered it, but any data not stored locally, is impossible to get. So wrt. games, since you mentioned DRM, it might be possible to unlock the content if it is local, given a clever reverse engineering solution? Even if they encrypted the data on disk, at some point, they have to decrypt it in-memory locally.
But for server, where all validation and data is gated behind an 'authoritative' server, I guess it's just game over for unlocking anything yourself with a certificate. Even if you manage to magically solve it, they will just issue a new certificate, and quickly invalidate the old one I guess.
Also, I know companies have used the root status as a form of DRM. That's not about user security, it's about protecting DRM security, like Widevine L1 or L3 and the android Netflix app. Financial apps haven't been an issue for me, I am running bootloader unlocked and rooted using Magisk.
So if self signing cannot guarantee those assumptions that are being made, there's no way around it.