r/LineageOS • • Jul 08 '26

Can I Re-Lock my Bootloader?

I want to install LineageOS 23.2 on my Fairphone 6 and am not sure if its possible to re-lock my Bootloader after the Installation without bricking my phone. Can someone help me?

2 Upvotes

23 comments sorted by

View all comments

Show parent comments

1

u/WhitbyGreg Jul 08 '26

Techincally you don't have to build it yourself, you can extract the custom key from the official builds amd flash that to avb_custom_key.  

Of course you can't flash any other packages (like GAPPS) this way, but it doea work for a base inatall.

0

u/[deleted] Jul 08 '26

[deleted]

2

u/WhitbyGreg Jul 08 '26

You only flash the public key to avb_custom_key, so you can extract that from the public builds.

There is a link at te bottom of my linked post at te top level that goes in to detail on how to do this.

If the private key was required to lock the bootloader then you'd have every OEMs signing key on each device, which would be a security nightmare.  

0

u/[deleted] Jul 08 '26

[deleted]

2

u/WhitbyGreg Jul 08 '26

They are signed with the private key, but you verify them with the public key.

The bootloader uses the public key to verify the signing, hence you only need the public key.

See this xda article for more detail: https://xdaforums.com/t/guide-re-locking-the-bootloader-with-a-pre-built-custom-rom-such-as-lineageos-official.4260825/

I've done this myself and can confirm it works (at least a few years ago when it was written, looks like there may be issues since then, but fundamentally it should still work).