- Hacking Android
- Srinivasa Rao Kotipalli Mohammed A. Imran
- 795字
- 2021-07-14 10:56:09
Locked and unlocked boot loaders
A boot loader is the first program that runs when you boot your device. Boot loader takes care and initiates your hardware and Android kernel. Without this program, our device doesn't boot. Those manufacturers of your devices usually write boot loaders and so usually they are locked. This ensures that the end users cannot make any changes to the device firmware. To run custom images on your device, boot loader has to be unlocked first before we proceed with it. Even when you want to root a device with a locked boot loader, it requires unlocking it first if there is a possible and available way to do it. Some manufacturers provide an official method to unlock boot loader. In the next section, we will see how to unlock a boot loader on Sony devices. If the boot loader cannot be unlocked, we will have to find a flaw that allows us to root the device.
Determining boot loader unlock status on Sony devices
As mentioned earlier, some manufacturers provide an official method to unlock boot loaders.
Specifically on Sony devices, we can type the following code and follow the steps shown:
*#*#7378423#*#*
Note
Note: These device codes could vary from manufacturer to manufacturer and could be obtained from the respective manufacturer if they provide support for it.
When we type the preceding number on Sony devices, it opens up the following screen:

- Click the Service Info button. It shows the following screen:
- Click the Configuration button to see the status of your boot loader. If boot loader unlock is supported by the vendor, it will show the following output under Rooting status:
- If the boot loader is already unlocked, then it will show the following output:
Unlocking boot loader on Sony through a vendor specified method
The following steps show the process of unlocking boot loader on Sony devices. This gives an idea of how vendors provide support for unlocking boot loaders on their devices:
- Check if boot loader unlock is supported. This was shown earlier.
- Open up the following link:
http://developer.sonymobile.com/unlockbootloader/unlock-yourboot-loader/
- Choose the device model and click Continue:
- This then shows us a prompt for entering an e-mail address. Enter a valid email address here:
- After entering a valid email address, click the Submit button. We should receive an email from Sony as shown in the following screenshot:
- The email consists of a link that takes us to another link, where Sony verifies the IMEI number of the device whose boot loaders have to be unlocked. Enter your IMEI number here:
- This IMEI number is required to generate the unlock code. Once we enter a valid IMEI number and click Submit, we should be greeted with a screen with an unlocking code followed by the steps to unlock:
- Once we receive the boot loader unlock code, we connect our device in fastboot mode. The steps to enter into fastboot mode could vary from model to model. Most of the time it is the difference with, which hardware keys have to be pressed to get into fastboot mode.
For Sony devices, follow these steps:
- Power off the device.
- Connect your USB cable to the device.
- Hold the volume up button and connect the other side of the USB cable to the laptop.
These steps should connect the device to the laptop in fastboot mode.
We can check the devices connected using the following command:
fastboot devices

Once the device is connected in fastboot mode, we can run the following command with the vendor provided unlock code to unlock the device:

The preceding code shows that boot loader unlock is completed.
Though the process here is shown specifically with Sony devices, this is almost the same with most of the official manufacturer methods.
Note
Warning: This process sometimes may cause damage to your device. While writing this book, this boot loader unlock process provided by the manufacturer has lead my Sony device to get into boot loop. Looking at the stack overflow questions, we have noticed that this happened to many other people on these models (C1504, C1505). We had to flash the device with a stock OS provided by the vendor later to get our device working again. Finally, it is safe! Apart from this, an unlocked boot loader is nothing but a door without lock. So it is possible for an attacker to steal all the data from the lost/stolen device.
Rooting unlocked boot loaders on a Samsung device
In this section, we will discuss how to root an unlocked Samsung note 2 which uses Samsung's customized version of Android OS, we will also see what the differences between Stock Recovery and Custom Recovery are, and finally we will install a Custom ROM on our Note 2 device.
- Practical Data Analysis Cookbook
- The DevOps 2.3 Toolkit
- Boost程序庫完全開發(fā)指南:深入C++”準(zhǔn)”標(biāo)準(zhǔn)庫(第5版)
- Python概率統(tǒng)計
- 國際大學(xué)生程序設(shè)計競賽中山大學(xué)內(nèi)部選拔真題解(二)
- Java異步編程實戰(zhàn)
- Photoshop智能手機(jī)APP UI設(shè)計之道
- Java技術(shù)手冊(原書第7版)
- Scala程序員面試算法寶典
- 打開Go語言之門:入門、實戰(zhàn)與進(jìn)階
- PrimeFaces Blueprints
- HTML+CSS+JavaScript網(wǎng)頁制作:從入門到精通(第4版)
- Java面試一戰(zhàn)到底(基礎(chǔ)卷)
- Hands-On Artificial Intelligence with Unreal Engine
- Responsive Web Design with HTML5 and CSS3(Second Edition)