Get rid of bootloader unlocked warning

In previous article we unlocked MotoG’s bootloader which resulted in the appearance of nasty “bootloader unlocked” warning on the screen.

Warning about unlocked bootloader

To get rid of it we have to dump logo partition, edit it’s contents and flash it back to the MotoG.

Dumping logo partition

Let’s start – enable root access via adb in Settings -> Developer options and connect to your phone via adb shell. We need to find which device is mounted as logo partition, so we have to run: ls -al /dev/block/platform/msm_sdcc.1/by-name to enumerate device partitions with aliases:

Great, we found logo partition (line 23), so we can copy it to /sdcard. The easiest way is to use dd utility: dd if=/dev/block/mmcblk0p27 of=/sdcard/logo-copy.bin

After that exit from adb shell and pull file from device by running: adb pull /sdcard/logo-copy.bin ~/logo-copy.bin

and voilà. We can edit it and disable this warning.

Editing dumped logo partition contents

We need to have hexeditor installed – personally I prefer Okteta, so all examples here are based on it. Depending on your Linux distribution you can get it by running:

Ubuntu: sudo apt-get install okteta

Fedora: sudo yum install okteta

Arch: sudo pacman -S okteta

OK. Let’s open our logo.bin in hex editor. As you can see on a picture below, there is some file header with a few picture items listed (file structure will be described in next article). We have to change value of six bytes: “12 08 00 66 5E 02” placed at offset 0000:0066 (second item marked with green) with a value “04 00 00 56 D1 07” – the same value which is visible at offset 0000:0026 (first item marked with green).

Logo.bin in Okteta
Logo.bin in Okteta

After change both items should have the same value: “04 00 00 56 D1 07” – it’s a position and length of picture data used by specific image. So, right now logo_unlocked picture will be using logo_boot picture data and we’ll see nice blue “M” logo after flashing this file and restarting phone. Save the file with logo-fixed.bin file name, it will be used in next step.

Flashing fixed partition contents to the phone

In this step we’re going to flash logo-fixed.bin file on phone, we have to restart phone to the bootloader:

and next use fastboot to flash logo-fixed.bin file into logo partition:

Restart phone:

and we’re done. We have nice “M” logo :)

Till next time!

Leave a Reply