Android Upgrades, Custom ROMs (LineageOS), & Kernels

Pre-Relock Checklist: 10 Critical Steps to Avoid a Permanent Android Bootloader Brick

Google AdSense Native Placement - Horizontal Top-Post banner

Introduction

Relocking your Android device’s bootloader can seem like a straightforward task, often done for security, warranty purposes, or to enable specific functionalities like Google Pay that detect unlocked bootloaders. However, it’s a process fraught with peril if not executed meticulously. A single misstep can transform your high-tech smartphone into an expensive paperweight – a permanent bootloader brick, often unrecoverable even by service centers. This comprehensive guide outlines 10 critical steps you must follow to minimize the risk of bricking your device when attempting to relock its bootloader, especially after extensive modifications like custom ROMs, kernels, or root access.

Understanding the Risks of Relocking

Android’s security model, particularly Verified Boot (also known as dm-verity), is designed to ensure the integrity of the operating system from boot-up. When you relock your bootloader, it expects to find an unaltered, cryptographically signed operating system. If it detects any discrepancy – a custom recovery, a modified kernel, an unofficial ROM, or even an incorrect stock firmware version – it will refuse to boot. This can lead to a hard brick (where the device won’t even enter fastboot mode) or a soft brick (stuck in a bootloop or fastboot, but recoverable). Anti-rollback protection, common on newer devices, adds another layer of complexity, preventing you from flashing older, vulnerable firmware versions.

The 10-Step Pre-Relock Checklist

Relocking your bootloader requires patience and precision. Do not rush any step.

1. Backup Everything You Value

Before embarking on any major system modification, a complete backup is non-negotiable. This includes your personal data, app data, and most importantly, a Nandroid backup of your entire system partition from your custom recovery (like TWRP).

adb backup -all -f C:pathtobackupfilename.ab

Alternatively, use cloud services or manual file transfers. For a Nandroid backup, boot into TWRP, select "Backup," choose all partitions (Boot, System, Data, Cache, EFS if available), and swipe to backup. Store this backup on an external drive or your PC.

2. Verify OEM Unlocking Status

Many devices require "OEM Unlocking" to be enabled in Developer Options before you can unlock or relock the bootloader. Ensure this option is toggled on. If it’s greyed out or off, troubleshoot why before proceeding. If you can’t enable it, you might not be able to relock the bootloader safely, or at all.

3. Flash the Exact Stock Firmware (Matching Version)

This is arguably the most critical step. You MUST flash the official, untouched stock firmware package that EXACTLY matches the version your device expects for relocking. This includes matching the Android version, security patch level, and regional variant. Flashing an older version on a device with anti-rollback protection will hard brick it. Flashing a newer version might also cause issues.

You can often find official firmware packages on your device manufacturer’s support page or reliable community forums (e.g., XDA Developers). Typically, you’ll use fastboot commands to flash individual partitions:

fastboot flash boot_a boot.img
fastboot flash system_a system.img
fastboot flash vendor_a vendor.img
... (and so on for all relevant partitions like dtbo, vbmeta, product, etc.)
fastboot --set-active=a  (if your device uses A/B partitions, ensure both slots are updated or active is set correctly)
fastboot reboot-fastboot (to ensure partitions are recognized)

Some manufacturers provide a single flashable ZIP or executable tool; follow their specific instructions meticulously.

4. Boot into the Stock OS and Verify Functionality

After flashing the stock firmware, reboot your device without relocking the bootloader. Let it boot into the newly flashed stock operating system. Go through the initial setup. Test core functionalities: Wi-Fi, cellular, camera, GPS, audio, and all sensors. This step confirms that the stock firmware has been installed correctly and is fully operational. Any issues here indicate a problem with your firmware package or flashing process, and you should resolve them before thinking about relocking.

5. Re-enable OEM Unlocking (If It Toggled Off)

Sometimes, flashing a full stock firmware package or performing a factory reset will automatically toggle off the "OEM Unlocking" option in Developer Options. Go back into Developer Options and ensure it is still enabled. If it’s disabled and greyed out, it typically means your device is not officially supported for bootloader unlocking or relocking in its current state (e.g., carrier-locked devices). Do NOT proceed if you cannot enable it.

6. Disable Root Access and Flash Stock Recovery

If you had root access (e.g., Magisk) or a custom recovery (e.g., TWRP), these must be completely removed.

For Magisk, use the "Uninstall Magisk" option within the Magisk app and select "Complete Uninstall".

For custom recovery, you typically need to flash the stock recovery image using fastboot:

fastboot flash recovery recovery.img

Ensure you have the correct stock recovery.img from your firmware package.

7. Remove All Other Custom Modifications

This includes custom kernels, modules, fonts, system-level modifications, or anything that alters the system or vendor partitions from their stock state. Even small modifications can trip Verified Boot. If you followed step 3 correctly (flashing full stock firmware), this step should largely be covered, but it’s worth double-checking for any lingering effects of previous modifications.

8. Execute the Relock Command

With all previous steps meticulously completed and verified, you are now ready to issue the relock command.

Reboot your device into fastboot mode:

adb reboot bootloader

Then, execute the relock command (this command varies slightly by manufacturer, but flashing lock is common):

fastboot flashing lock

You will receive a confirmation prompt on your device’s screen. Read it carefully and confirm the relock. Once confirmed, your bootloader will relock, and your device will reboot.

9. Monitor the First Boot After Relock

The first boot after relocking the bootloader can take longer than usual. Be patient. Watch for any error messages or boot loops. If the device boots successfully to the setup screen, you’ve likely succeeded. If it gets stuck or displays a "Your device has been corrupted" message, something went wrong, and you might need to re-evaluate your firmware or previous steps.

10. Test All Core Functions Again

Even if the device boots successfully, it’s crucial to re-test all core functionalities: Wi-Fi, Bluetooth, mobile data, calls, camera, GPS, NFC, and any other hardware features. This ensures that the relock process did not inadvertently corrupt any part of the system or drivers.

Conclusion

Relocking your Android bootloader is not a task to be taken lightly. It demands precision, the correct tools, and the exact matching firmware. By diligently following these 10 critical steps, you drastically reduce the risk of turning your valuable smartphone into a permanent brick. Always prioritize backups, verify every stage, and remember that when in doubt, it’s better to pause and research further than to risk irreparable damage. Good luck, and may your bootloader stay healthy!

Android Mobile Specs & Compare Directory

Are you researching mobile hardware properties, processor SoCs, GPU chipsets, or RAM configurations? Access our complete specs catalog to compare up to 5 devices side-by-side!

Compare Devices Specs →
Google AdSense Inline Placement - Content Footer banner