TL;DR: To relock bootloader safely, back up everything, remove root, and flash a complete firmware set signed for your exact device. Confirm every boot-related partition is trusted before locking. The lock operation wipes user data. Never relock with patched, mixed-version or uncertain images, because verified boot may reject them and brick the phone.

By the PrivacyPortal team
Last updated 23 August 2026.
A safe bootloader relock is a state check, not a repair step. Locking turns verified-boot enforcement back on. It does not restore boot, init_boot, recovery, vendor_boot, dtbo or vbmeta. Restore a complete, correctly signed build first. Then use the method documented for your exact model. The relock will normally factory-reset the phone. It may also affect warranty support, over-the-air updates, banking apps and Play Integrity. No procedure can promise that a particular bank or payment app will accept the device.
A safe relock starts with one complete firmware set, not a collection of images from different builds.
What relocking a bootloader actually does
The bootloader starts Android and checks whether early system components can be trusted. An unlocked bootloader permits you to flash software outside the manufacturer’s normal update chain. A locked bootloader rejects software that its configured root of trust cannot verify.
Android Verified Boot, often shortened to AVB, links partitions through signed metadata. The vbmeta partition carries much of that verification data. If one linked partition is patched, corrupt or from another release, a locked device may refuse to boot.
Relocking usually performs a data wipe. This protects an owner whose lost phone is modified by someone else. Copy photos, authenticator recovery codes, messages and app data somewhere safe before starting.
Android’s official bootloader guidance states that changing device lock state should erase user data.
The Android bootloader locking documentation explains the LOCKED and UNLOCKED states. It also describes the required data reset.
When to relock bootloader access
Relock only when the installed operating system explicitly supports it. A fully restored stock build is the common case. GrapheneOS is another valid case on an officially supported Pixel because its installation process configures verified boot for the signed GrapheneOS release.
Do not relock merely to hide an unlocked status from an app. Bootloader state, hardware-backed key attestation and Play Integrity are related, but they are not the same check. An app can also inspect root traces, system properties or its own risk signals.
A sensible decision rule is simple:
- Relock stock firmware when every image came from one official package for the exact model.
- Relock GrapheneOS only through its official, supported installation flow.
- Relock another custom ROM only if its maintainers document locked verified boot for that device.
- Stay unlocked if any installed partition is patched or its origin is uncertain.
Remaining unlocked is safer than forcing a lock onto an unknown system. An unlocked phone has a weaker physical-security posture, so keep it encrypted and under your control.
Can you relock without brick risk?
No method is risk-free. You can reduce the risk by proving that the installed firmware and signing state are coherent before the lock command runs.
| Installed state | Relock outlook | What to do |
|---|---|---|
| Complete official stock firmware | Usually supported | Use the manufacturer’s documented restore and lock process. |
| Official GrapheneOS on a supported Pixel | Expected and recommended | Use the official GrapheneOS installer and verify its release key. |
| Custom ROM with documented locked AVB support | Device-specific | Follow that project’s exact signing and key-enrolment guide. |
| Rooted or patched boot image | Unsafe | Restore the complete matching firmware before locking. |
| Mixed slots or mixed build versions | High brick risk | Flash one complete release to the required slots. |
| Unknown partition history | Unsafe | Assume modification and perform a complete official restore. |
How to relock bootloader safely
This general procedure applies only where the device maker or operating-system project supports relocking.
- Back up all data. Treat the phone as if it will be fully erased, because a correct relock normally wipes userdata.
- Identify the exact model. Record the product name, region, carrier variant and current build before downloading anything.
- Check that relocking is supported. Read the current instructions from the manufacturer or ROM project for that exact model.
- Remove modifications. Do not rely on uninstalling a root app. Restore every modified partition from one trusted firmware release.
- Flash the complete supported build. Use the project’s installer or official flashing tool. Do not mix images from separate releases.
- Boot the restored system once if instructed. Confirm the phone starts normally before enforcing the locked state.
- Return to the bootloader. Android SDK Platform-Tools users can run adb reboot bootloader when USB debugging is authorised.
- Issue the documented lock action. Many modern fastboot devices use fastboot flashing lock, but some use another command or an installer button.
- Confirm on the phone. Read the on-screen warning, accept the data wipe and do not disconnect power during the change.
- Verify the result. Check the lock-state screen, complete a clean boot and install pending official updates before restoring personal data.
Prerequisites and files to prepare
Charge the phone above 60%. Use a sound USB cable and a stable computer. Install the current official Android SDK Platform-Tools, then record the version shown by fastboot --version. Avoid old copies bundled with unrelated flashing utilities.
Download the complete firmware for the exact model and region. Verify any published checksum. Keep the archive intact until its contents are needed. Pixel owners returning to stock should use Google’s official factory images and flashing guidance.
The appended “Modules, apps & files to try” section should be treated as a download checklist. A module that spoofs lock status is not a substitute for trusted firmware and must be removed before a genuine relock.
Verification after the relock
A successful command is not enough. The phone should boot without an orange unlocked-device warning. Fastboot should report a locked state using the field documented by the manufacturer. Field names vary, so do not copy a check from another brand.
Test both slots where the official guide requires it. Then install one official over-the-air update. An OTA failure can expose mismatched partitions that were not obvious during the first boot.
Play Integrity results are not proof that the boot chain is correct. App acceptance can change after server-side updates. Test essential banking, work and payment apps before relying on the phone.
Verification includes a clean boot, a reported locked state and a successful supported update path.
How to relock GrapheneOS correctly
GrapheneOS supports relocking on the Pixel models listed by the project. Its signed releases work with the supported verified-boot process. Use the official GrapheneOS web installer, including its “Lock bootloader” stage.
Do not replace GrapheneOS boot or vbmeta images with patched copies. Rooting GrapheneOS breaks the state expected by its normal locked installation. Reflash the complete official release before trying to relock.
To relock GrapheneOS safely, confirm the installer recognises the exact supported Pixel. Complete its flash process without skipping steps. Let the installer perform the documented lock action, then confirm it on the device.
The GrapheneOS installation guide instructs users to lock the bootloader after installing the operating system, restoring full verified-boot enforcement.
The phrase “relock GrapheneOS” should not be applied to unofficial ports. A build carrying the GrapheneOS name for an unsupported device does not gain the official project’s signing or hardware support.
Stock Android and manufacturer differences
There is no universal Android relock command. Fastboot, flashing permissions, anti-rollback controls and recovery paths differ between manufacturers. Even two regional versions of one model can require different packages.
Google Pixel factory images offer a well-defined restore path. Motorola and OnePlus models often use fastboot-based flows, but partition layouts and rescue tools vary. Xiaomi users should take special care with Mi Flash.
In Xiaomi Flash Tool, clean all keeps the bootloader unlocked. clean all and lock adds a relock. Selecting the lock option with the wrong regional ROM can leave the device unable to boot or authenticate.
Samsung devices do not follow the generic fastboot process. Download Mode, VaultKeeper, regional policy and Remote Mobile Management can affect unlock status. Knox’s warranty e-fuse can remain tripped after stock firmware is restored and the bootloader is locked.
Samsung’s Knox warranty bit is an irreversible hardware-backed record on affected devices; relocking does not reset it.
Failure modes seen in practice
Most relock failures begin before the command. The user restores one visible change but misses a linked partition. Common examples include a Magisk-patched boot or init_boot, custom recovery, altered vendor_boot, disabled verification flags, or a mismatched vbmeta.
- Mixed builds: system comes from one monthly release while boot files come from another.
- Slot mismatch: slot A boots, but slot B contains older or modified components.
- Wrong variant: firmware targets another region, carrier or hardware revision.
- Anti-rollback: the device refuses firmware older than its permitted rollback index.
- Interrupted flash: a cable, battery or computer failure leaves an incomplete partition set.
- Premature lock: a flashing tool combines restoration and locking before the restored system is tested.
If the phone still reaches fastboot while unlocked, stop and restore the right package. Do not lock it “to see if that helps”. Locking removes recovery options rather than repairing the firmware.
Banking apps, Play Integrity and security
A bootloader relock can restore the normal trust state on many stock devices. It does not guarantee Play Integrity, Google Wallet, Widevine L1 or bank-app access. Hardware key invalidation, account risk checks and OEM records can persist.
Unlocking does not remove the Trusted Execution Environment, or TEE. It normally wipes or invalidates protected keys so a thief cannot unlock a phone and extract them. Some devices provision fresh keys after a correct stock restore and relock.
Modules such as Tricky Store or Bootloader Spoofer can alter what selected software sees. They do not physically relock the device. Their behaviour can also fail after app, Play Services or operating-system updates.
For a dependable daily phone, prefer a supported locked operating system over a growing stack of concealment modules. PrivacyPortal’s guide to de-Googled Android phones explains the wider trade-offs between app compatibility and reducing Google dependence.
What to do if the phone will not boot
Do not keep issuing random lock, unlock or erase commands. Photograph the error screen and record the exact model, active slot, firmware package and commands already used.
If the bootloader remains unlocked, use the official recovery or flashing process to restore a complete matching release. If it is locked and rejects the installed images, use the manufacturer’s authorised rescue route. Some devices support a signed recovery tool. Others require service intervention.
Unlocking again may erase data and may not be permitted from the failed state. Never flash another model’s bootloader, radio or partition table as an experiment. Those components can turn a recoverable verified-boot failure into a hard brick.
Our Android bootloader risk guide can help you map the security and recovery trade-offs before another attempt.
Frequently asked questions
Does relocking the bootloader wipe data?
Yes, a supported transition from unlocked to locked should factory-reset the phone. Back up first and assume all user data will be lost. A tool that appears to preserve data should not be trusted unless the device maker explicitly documents that behaviour.
Can I relock a bootloader with a custom ROM?
Only if that ROM supports verified boot while locked on your exact device. GrapheneOS supports this on its officially listed Pixels. Many community ROMs do not. Locking an unsupported custom ROM can make the phone unbootable.
Can I relock without returning to stock?
Sometimes, but only with a ROM designed for a locked boot chain and the correct signing-key process. If the project offers no clear relocking instructions, return to complete official stock firmware or remain unlocked.
Will relocking make banking apps work?
It may restore one trust signal, but it cannot guarantee access. Banks can check Play Integrity, device certification, root traces, app history and their own fraud systems. Test each essential app after the clean setup.
Does uninstalling Magisk make relocking safe?
No. Removing the Magisk app does not prove that patched boot files were restored. Flash the complete matching firmware set, or use the ROM project’s full supported installer, before locking.
What is the safest way to relock without brick problems?
To relock bootloader safely, use one complete signed build for the exact model. Verify its source and checksum, remove every modification, follow the device-specific guide, accept the data wipe, and check normal boot plus OTA updates before restoring your data.
PrivacyPortal sells ready-to-use, de-Googled GrapheneOS Pixels — hardened, kept updated, and shipped with our encrypted Graphite messenger. Browse privacy phones →
