Download and install ADB, drivers and Fastboot. Android firmware using the FastBoot utility Not every phone will allow you to do this


Most of the articles in the X-Mobile section are devoted to hacks and tweaks that require obtaining root rights, modifying the firmware, or replacing it with a custom one. However, not every reader is ready to subject their smartphone to such operations, fearing that they can turn the device into a brick or lead to instability in operation. Today I will debunk these myths and show that even in the most stalemate situation, bringing a smartphone back to life is not so difficult.

Destroying myths

Let's talk about what it really means to “turn a smartphone into a brick” and what other pitfalls can await the user on the way to changing the system and installing custom firmware. What glitches can be caught in this case and is it possible to kill a smartphone by reflashing it incorrectly? Will you lose the warranty forever or can the smartphone be returned to its previous condition? Can custom firmware really fail a smartphone owner at the most inopportune moment and are they worth it?

Myth 1. Incorrect flashing can kill a smartphone

A fall from the fifth floor can kill a smartphone, but not flashing it. The main problem that anyone who wants to reflash a smartphone faces is that during the installation of the firmware, a failure may occur, which will lead to its inoperability, and the smartphone will actually turn into a brick.

All this is true, but only on paper. To understand why, it’s enough to understand how the process of flashing a smartphone works and what system components are used. To be able to install third-party firmware on a smartphone, you need to unlock the bootloader (not in all cases), get root and install a custom recovery console (ClockworkMod or TWRP), capable of installing firmware with any digital signature.

The recovery console is stored in a separate partition of the internal NAND memory and is in no way connected with the installed operating system. After installing a modified version of the console, it will be possible to flash custom firmware or even another OS (Firefox OS, for example). If a failure occurs during the installation of the firmware, the smartphone will not be able to boot it, but the recovery console will remain in place, and all you need to do is boot into recovery again and reinstall the firmware.

In addition, any custom recovery console contains a backup/restore function, which allows you to make a backup copy of the main firmware and restore it unchanged (with all applications, settings and data) in the event that something goes wrong. In fact, the smartphone can be returned to its original state.


You may ask: what happens if the installation of the Recovery Console itself fails? Nothing, in this case the situation will be the opposite, when the operating system itself will remain in place, and the console will be lost. To deal with it, you just need to re-flash recovery directly from Android.

Hypothetically, one can imagine a situation where both the firmware and the recovery console are killed (although this is quite difficult to do), but even in this case, the primary bootloader, flashed into the permanent memory of the smartphone, will always remain in place.

Conclusion: it is impossible to kill a smartphone by installing third-party firmware through a custom recovery console. Either the recovery or the primary bootloader will always remain in place.

Myth 2. Custom firmware is unreliable

Firmware differs from firmware. On the vastness of the World Wide Web you can find a huge number of Android builds for every taste and color, and most of them are really slag, which can lead to instability in the operation of the smartphone and loss of some functionality. Therefore, the first thing to remember is that you should only deal with serious custom firmware developed by large teams of experienced developers. First of all, these are CyanogenMod, Paranoid Android, AOKP, OmniROM and MIUI.

Second. There are two types of firmware: officially supported and ported by third-party developers. The same CyanogenMod, for example, has an official version for the Nexus 4 smartphone, but does not have one for the Motorola Defy. But for Defy there is an unofficial port of CyanogenMod 11 from a developer with the nickname Quarx. The difference between them is that the CyanogenMod team is responsible for the support and proper operation of the first, while the second is Quarx personally. Official firmware versions are usually fully functional, but the correct operation of the latter depends on the third-party developer.

Well, third. There are stable and development versions of the firmware. Stable versions of CyanogenMod have the index M (CyanogenMod 11.0 M7, for example). This firmware version usually does not contain bugs. Development versions (in the case of CyanogenMod these are daily nightly builds) may contain bugs and are therefore not recommended for everyday use.

Conclusion: if you install a stable official version of the “normal” firmware on your smartphone, the risk of encountering bugs is minimal. Everything else is for experimenters.

Myth 3. Software that requires root rights can brick a smartphone

In theory, an application with root rights can do anything with the smartphone's firmware, including erasing it completely. Therefore, you need to be extremely careful with such software. The software we talk about on the pages of the magazine is completely safe and tested in our own skin. In addition, for all the time I have been using smartphones on Android (and this is starting from version 1.5), I never I haven’t encountered a situation where software with root support killed a smartphone.

Software distributed through Google Play usually fully corresponds to the stated characteristics, and if it led to a brick or left a backdoor in the depths of the smartphone, it would not last even a week in the store. In any case, here you need to follow the “trust but verify” rule and carefully read the instructions for using root applications.

Myth 4. Root rights make a smartphone vulnerable to viruses

What makes a smartphone vulnerable to viruses is not root rights, but the bugs used to obtain them. Rooting tools and viruses can exploit the same Android vulnerabilities to gain root privileges, so the fact that the device is rooted does not change anything. A well-written virus will not ask for permissions in the standard way, giving away its presence; instead, it will use the same vulnerability to obtain them covertly.

Moreover, having root, you get the opportunity to install the latest version of Android (in the form of custom firmware), in which these bugs are already fixed. Also, do not forget that most custom firmware allows you to disable root or create white lists of applications that can use these rights.

Myth 5. A rooted smartphone may fail

Software designed to obtain root does four simple things: launches an exploit that allows you to gain root rights in the system, mounts the /system partition in write mode, copies the su binary required to obtain root rights in the future to the /system/xbin directory, and installs the SuperSU or SuperUser application, which will take control whenever any application requests root privileges using su.

None of these steps can crash or kill the smartphone. The only thing that can happen is that the exploit will cause a segmentation fault and the smartphone will reboot, after which it will continue to work normally.


Myth 6. By getting root and installing custom firmware, I will lose the warranty

The guarantee is lost not from the very fact of obtaining root, but due to its detection by the service center. Most devices can be unrooted using the Universal Unroot application or by reinstalling the stock firmware using the official application from the manufacturer.

There are, however, two exceptions to this rule. The first is Knox, which comes pre-installed on new Samsung smartphones and tablets such as the Galaxy S4, S5, Note 3 and Note 10.1. Knox provides an increased level of Android security by responding to any firmware modifications and installation of third-party kernels and firmware. If the user performs these actions, the system sets a trigger that confirms the fact of the modification. The trigger is implemented in hardware (eFuse chip), so it cannot be reset to its initial position. On the other hand, it is not entirely clear whether the service center will refuse to repair the device on this basis. Second: the eFuse chip is installed on some other devices (for example, smartphones from LG), and it also allows you to accurately determine whether the smartphone has been rooted or flashed.

If we talk about custom firmware, everything is more complicated. Typically, the flashing operation requires unlocking the bootloader, and this can be done either using special exploits or using the smartphone manufacturer's web service. In any case, the unlocked bootloader will definitely indicate that the smartphone did not belong to a blonde.

On some smartphones, it is possible to lock the bootloader back, but you should learn about this separately, and also keep in mind that the newly locked bootloader will most likely receive the status Re-locked, and not Locked, as it was originally (this happens on HTC smartphones, For example). The only exceptions here are smartphones and tablets of the Nexus line, the bootloader of which can be locked and unlocked in three clicks without any dancing with a tambourine, and no one will find fault with anything.

INFO

On Linux, ADB and Fastboot can be installed separately from the Android SDK. On Ubuntu: sudo apt-get install android-tools-fastboot. On Fedora: sudo yum install android-tools.

To prevent Knox from interfering with root applications, you can disable it using the following command from the terminal: su pm disable com.sec.knox.seandroid.

conclusions

Getting root and flashing a smartphone are absolutely safe operations that cannot brick the smartphone for purely technical reasons. The only exception is an attempt to hack the bootloader in order to unlock it. In this case, the eFuse chip (if the smartphone has one) may work and block the ability to turn on the smartphone.

Fortunately, today smartphone manufacturers either prefer not to block the ability to turn on a smartphone with a hacked bootloader (by setting a trigger indicating the fact of such an action, as Knox does), or implement a special web service that allows you to painlessly unlock the bootloader with loss of warranty on the smartphone. which saves users from having to risk breaking the bootloader.

Problems that may arise during flashing

So, now let's talk about what problems can arise when getting root and flashing and how to deal with them.

Scenario one: after an unsuccessful flashing, the smartphone stopped booting

Unsuccessful flashing can be caused by several factors: the battery died and the firmware was only half filled; the firmware turned out to be faulty or intended for a different smartphone model. In the end, there was simply not enough space on the smartphone, which can happen when trying to install the latest version of Android on a smartphone that is three or four years old.

Outwardly, all these problems usually manifest themselves either in endless resets of the smartphone to the initial manufacturer logo, or in the so-called boot loop, when the boot animation plays on the screen for more than five to ten minutes. There may also be problems with the screen (multi-colored ripples) and a non-working touch screen, which also prevent the use of the smartphone.

In all these cases, it is enough to do one simple thing: turn off the smartphone by long pressing the power button, then turn it on while holding down the volume down button (some smartphones use a different combination), and after you get into recovery, reinstall the firmware (Install zip from sdcard - > Chooze zip from sdcard) or restore the backup (Backup and restore -> Restore). Everything is easy and simple.

Scenario two: the firmware works, but recovery is not available

This can happen after a failed installation or update of the Recovery Console. The problem is that after rebooting the smartphone and turning it on while holding down the volume down button, a black screen appears, after which the smartphone either resets or freezes.

Solving this problem is not easy, but very simple. You can install the recovery console on the vast majority of smartphones using the TWRP Manager, ROM Manager or ROM Installer applications. They themselves determine the smartphone model, download and flash the required recovery, without requiring a reboot. If you can’t restore the console with their help, just find instructions on the Internet for installing recovery on your device.

Scenario three: neither firmware nor recovery is available

To be honest, it is difficult for me to imagine such a scenario, but, as practice confirms, it is quite real. There are two ways to get out of this situation: use fastboot to upload recovery to your smartphone, or use a tool from the manufacturer to install stock firmware. We'll look at the second method in more detail in the next section, and I'll talk about fastboot here.

Fastboot is a tool that works directly with the device’s primary bootloader and allows you to upload firmware to your smartphone, recovery, and unlock the bootloader (in Nexus devices). Fastboot support is available in many smartphones and tablets, but some manufacturers block the ability to use it. So you will have to consult the Internet about its availability.

To access fastboot, you will need drivers and the Android SDK. When they are installed, open the command line, go to the SDK installation directory, then to the platform-tools directory, turn off the smartphone, turn it on with the volume buttons pressed (both) and connect it using a USB cable to the PC. Next, you need to find the recovery image in .img format for your device and run the command:

$ fastboot flash recovery image.img

Or even force the smartphone to boot recovery without actually installing it:

$ fastboot boot image.img

In the same way you can flash official firmware update:

$ fastboot update update-file.zip

You can find a recovery suitable for your device either on the TWRP website or in the XDA-Developers and w3bsit3-dns.com forums.

We return the smartphone to its original state

In this section, I will talk about ways to return your smartphone to clean stock, no matter what state it is in. These instructions can be used both to unbrick your smartphone and to remove traces of rooting and flashing. Unfortunately, I can’t talk about all possible models, so I’ll focus on the four most popular flagships: Nexus 5 (I call this sample the control one), Galaxy S5, LG G2 and Sony Xperia Z2.

Nexus 5 and other Google phones

Restoring Nexus devices to their original state is easier than any other smartphone or tablet. In fact, it is so simple that there is not even anything to talk about. In fact, all you need to do is install the ADB/fastboot drivers (on Linux you don’t even need them), download the archive with the firmware and run the script. The whole operation looks like this step by step:

  1. from here.
  2. Download and install Android SDK.
  3. Download the archive with the firmware for the desired device from the Google website.
  4. Turn off the device, turn it on with the volume buttons pressed (both) and connect using a USB cable.
  5. Unpack the archive with the firmware and run the flash-all.bat (Windows) or flash-all.sh (Linux) script and wait for the operation to complete.
  6. We launch the command line, go to the directory with the Android SDK, then platfrom-tools and execute the fastboot oem lock command to lock the bootloader.

For those who are interested in what the script does, here is a list of commands:

Fastboot flash bootloader bootloader-DEVICE-NAME-VERSION.img fastboot reboot-bootloader fastboot flash radio radio-DEVICE-NAME-VERSION.img fastboot reboot-bootloader fastboot flash system system.img fastboot reboot-bootloader fastboot flash userdata userdata.img fastboot flash recovery recovery.img fastboot flash boot boot.img fastboot erase cache fastboot flash cache cache.img

Galaxy S5

With the Galaxy S5 smartphone everything is a little more complicated, but overall quite simple. This time you will need the Samsung Odin application, which will be used to flash the smartphone’s firmware. Sequencing:

  1. Download and install the latest version of Samsung USB drivers from here.
  2. Download and install the latest version of Odin from here.
  3. Go to the website samfirmware.com, enter the SM-G900F model in the search, find the firmware marked Russia, download and unpack.
  4. Turn off the smartphone and turn it on with the Volume Down and Home buttons pressed, wait five seconds until a warning message appears.
  5. Press the volume up button to put the smartphone into Odin mode.
  6. We connect the smartphone using a USB cable.
  7. Launch Odin, press the PDA button and select the file with the extension tar.md5 inside the directory with the unpacked firmware.
  8. Click the Start button in Odin and wait until the firmware process is completed.

As I already said, this operation will return the smartphone to its original state, but will not reset the trigger installed by the Knox system (if it was in the standard firmware). Therefore, the service center may refuse to repair.

LG G2

Restoring the LG G2 to its factory state won't cause any problems either. The number of steps in this process is somewhat larger, but they themselves do not require special preparation and knowledge. So, what to do to return the G2 to factory firmware:

  1. Download and install ADB Driver Installer from here.
  2. Download the official firmware (Europe Open 32G or Europe Open) from here.
  3. Download and install LG Mobile Support Tool, as well as FlashTool (goo.gl/NE26IQ).
  4. Turn off the smartphone, hold down the volume up button and insert the USB cable.
  5. Expand the FlashTool archive and run the UpTestEX.exe file.
  6. In the window that opens, select Select Type -> 3GQCT, Phone Mode -> DIAG, in the Select KDZ file option select the firmware downloaded in the second step.
  7. Click the CSE Flash button at the bottom of the screen.
  8. In the window that opens, click Start.
  9. In the next window, select the country and language and click Ok.
  10. We wait for the firmware to finish, and then turn off and turn on the smartphone.

This is all. But keep in mind that, as in the case of Samsung, the smartphone will still have Rooted status, and this cannot be fixed.

Sony Xperia Z2

Now about how to return the Sony Xperia Z2 smartphone to its factory state. As in the previous two cases, this will require stock firmware and the official firmware utility. You launch the utility on your PC, connect your smartphone using a USB cable and start the update process. Step by step it all looks like this:

  1. Download and install ADB Driver Installer from here.
  2. Reset your smartphone to factory settings.
  3. Download and install the Flash Tool from the official Sony website and the latest firmware from here.
  4. Copy the firmware file to the C:/Flashtool/Firmwares directory.
  5. Turn off the smartphone and turn it on while holding down the Volume Down and Home keys.
  6. We connect the smartphone to the PC using a USB cable and launch the Flash Tool.
  7. Click the button with the lightning icon in the Flash Tool. In the window that opens, select Flashmode, double-click on the firmware in the list that opens.

WARNING

In many smartphones, an unlocked bootloader will not allow an over-the-air update.

In 90% of cases, unlocking the bootloader will entail deleting all data from the smartphone, including the memory card.

conclusions

Flashing a smartphone, and even more so gaining root access, is not at all such a scary and dangerous operation as it may seem at first glance. If you do everything correctly and do not resort to tools that unlock the smartphone’s bootloader, bypassing the manufacturer’s tools, you will not be able to brick your smartphone. Yes, in some cases you will have to tinker to get everything back in place, but what is better - to use a locked smartphone that does not allow you to do even half of the things that it is capable of, or to gain complete control over the device? After all, reinstalling Windows on a PC doesn't scare anyone.

Need to flash Android using FastBoot, but don't know how? This article provides detailed instructions on using the FastBoot utility, how to use it, where to download it from and how to flash an Android device.

This manual will fully explain how to use FastBoot! How to use Fastboot to clean partitions, flash IMG files, reboot and many others.

If you don’t know how to install archived updates, then you need the article - how to install firmware in zip format on android with pictures.

Downloading and installing FastBoot

Before flashing Android using FastBoot, you need to download this utility and install it on the desired computer:

  1. You can download FastBoot from the Android developers page included platform-tools .
  2. Or use the program Adb Run, more precisely better, in which everything is included, and also knows how to unlock the Android pattern.

Why is ADB RUN better?

Launching the Fastboot utility

Depending on what you chose, downloaded the fastboot utility separately or selected adb run, the launch may differ!

If you downloaded Separately Fastboot

Extract the files:

  1. adb.exe
  2. AdbWinApi.dll
  3. AdbWinUsbApi.dll
  4. fastboot.exe
  5. libwinpthread-1.dll

Move them to the C:\ drive, Windows folder. You have successfully installed ADB and Fastboot on your computer!

After you have downloaded and installed FastBoot, open the " Command line".

Windows command line example

Example of installing ADB and Fastboot.

If you downloaded ADB RUN

If your choice fell on a proprietary program ADB RUN, then run it, type A and press Enter.

Files which needs to be flashed preferably place in the same folder with the Fastboot utility.

Instructions on how to flash Android
using FastBoot

Android firmware in Fastboot means flashing separate files for different blocks of device memory (system, data, boot).

It is very important to write commands and firmware files as they are specified!

If you have the command:

fastboot flash cache NazvaniAFiLe.img

then you need to write exactly this way, and not any other way. In other words case is important otherwise you will get - there is no such file.

Reboot Commands
Fastboot to firmware mode (bootloader)

  • In order to start working with an Android device using Fastboot, you first need to put your smartphone or tablet into bootloader mode using adb:

adb reboot bootloader

  • Reboot Android from firmware mode (bootloader) to the same mode:

fastboot reboot-bootloader

  • Reboot Android from bootloader firmware mode to bootloader mode:

fastboot reboot-bootloader

  • Reboot Android to normal mode from bootloader firmware mode:

fastboot reboot

The command "sees" your Android PC

Make it a habit before doing anything in Fastboot to check if there is a connection between your computer and Android:

  • Checking whether the PC “sees” your Android:

fastboot devices

This command must be executed when the device is already in firmware mode (bootloader)

Bootloader unlock and lock commands
Google Pixel, Nexus in Fastboot

  • Unlock bootloader for Pixel, Nexus:

fastboot oem unlock or fastboot flashing unlock

  • Lock bootloader for Pixel, Nexus:

fastboot oem lock

Command to find out bootloader version

Shows the bootloader version number installed on Android:

fastboot getvar version-bootloader

Partition formatting commands
in Fastboot (Fastboot Erase)

Before flashing any partition in Android, you must first format it so that there are no problems in further work:

  • Erases the Cache partition in Fastboot:

fastboot erase cache

  • Erases the Date section (Data/UserData) in Fastboot:

fastboot erase userdata or fastbot -w

  • Erases the System partition in Fastboot:

fastboot erase system

  • Erases the Recovery partition in Fastboot:

fastboot erase recovery

Commands for flashing Android partitions in Fastboot
(Fastboot Flash)

After you have formatted the Android partition or partitions, you can proceed to the next step, flashing the firmware:

  • Flash the system partition:

fastboot flash system imya.img

  • Flash the cache partition:

fastboot flash cache imya.img

  • Flash the Data section:

fastboot flash userdata imya.img

  • Flash the Recovery partition:

fastboot flash recovery imya.img

Instead of imya.img You must insert the name of the file to be flashed!

  • Flash all partitions (boot, recovery and system):

fastboot flashall

Command to install update.zip

Flashes an update archive on Android in the update.zip format - a ZIP archive with IMG images of various sections:

fastboot update filename.zip

For Sony devices

Checking the connection of the Sony device, if the answer is 0.3 device, then it is connected:

fastboot.exe -i 0x0fce getvar version

Unlock bootloader Sony

fastboot.exe -i 0x0fce oem unlock 0xReceived_Key

More detailed information on unlocking Bootloader Sony - How to unlock Bootloader Sony.

Waiting for Device error

If you have the following message on in the command window for a long time: waiting for device- Means:

  • The driver is not installed or installed incorrectly - reinstall or install
  • Android device is not in Bootloader mode - translate
  • Incorrect connection to the USB port - use the rear USB 2.0 ports of the computer, do not use USB hubs

Video example of working with the Fastboot utility

For those who don't understand anything!

For those who don’t understand anything, then use the proprietary application ADB RUN, this program contains almost all the commands that are needed for FASTBOOT!

Below is an example of how ADB RUN works - how to quickly flash a Recovery file using ADB RUN in less than 5 seconds (just remember to switch to bootloader mode first)!

That's all! Read more articles and instructions in the section Articles and Android Hacks. Stay with the site, it will be even more interesting!

Unlocking the bootloader on your smartphone is the first step to speed it up and install custom firmware. And, contrary to popular belief, this feature is supported on most devices. Below is the official method for unlocking the operating system bootloader.

Not every phone will allow you to do this.

There are two types of phones in this world: Those that allow you to unlock the bootloader and those that do not.

The ability to unlock the bootloader depends on your smartphone manufacturer, model, and even your operator. All Nexus smartphones allow you to unlock the bootloader, and many phones from Motorola and HTC will allow you to unlock the bootloader in the same way as on the Nexus.

Other smartphones, as well as operators, do not provide the ability to unlock the bootloader in an official way. In this case, you will have to wait until the developers find vulnerabilities with which you can get root rights and download custom firmware to your phone. If you have such a smartphone, then, alas, this article will not help you.

The best way to find out which category your smartphone belongs to is to look at a specialized website. If you have an HTC or Motorola smartphone, then you can also check the unlocking capability on the HTC and Motorola websites. If the bootloader of your smartphone cannot be unlocked using the official method, then only the unofficial unlocking or root method, which can usually be found on the XDA Developers forum, will help you.

Step 0: Back up everything you want to keep

Before you begin, it should be noted that this process will erase all of your data. Therefore, if you have any Important files, be it photos, music, videos or anything else, then now is the time to save everything to your computer. In addition, if you have any application settings that you want to save, then use the backup function to create a backup of the settings and save it on your computer too.

Here's another tip: since I know I'll want to root my smartphone, I always unlock the bootloader as soon as I buy a new device. This way I don't waste time customizing the phone to suit myself only to delete all the data after a couple of days.

Once you have saved all important files, you can begin.

Step 1: Install Android SDK and drivers for your phone

You will need two things for this process: Android Debug Bridge, which is a command line for PC that you can use to communicate with your phone, and a USB driver for your device. If you installed them earlier, then you need to update them to the latest version.

Here are brief installation instructions:

  • 1. Go to the Android SDK download page and scroll down to “SDK Tools Only”. Download the ZIP file for your OS and extract the archive.
  • 2. Launch SDK Manager and uncheck all items except “Android SDK Platform-tools”. If you are using a Nexus phone, you can also select “Google USB Driver” to download Google drivers.
  • 3. After installation is complete, you can close the SDK manager.
  • 4. Install USB drivers for your phone. You can find them on the website of the smartphone manufacturer (eg Motorola or HTC)
  • 5. Restart your computer if necessary.

Turn on your phone and connect it to your computer using a USB cable. Open the tools folder in your Android SDK installation folder and Shift+Right Click on an empty area. Select “Open a Command Prompt Here” and run the following command:
adb devices
If the serial number appears, then your phone has been detected and you can continue further. Otherwise, make sure you follow all the given steps correctly.

Step 2: Enable USB Debugging

Next, you will need to enable several options on your phone. Go to your phone settings and select "About phone". Scroll down to Build Number and click on this item 7 times. A message should appear indicating that you are logged into developer mode.

Return to the main settings page, you should see a new “For Developers” item. Enable “OEM Unlocking” if this option exists (if it doesn't, don't worry - only some phones have this option).

Then enable “USB Debugging”. Enter a password or PIN if required.

Once you do this, connect your phone to your computer. You will see a window on your phone asking “Do you want to enable USB debugging?” Check the box next to “Always allow on this computer” and click OK.

Step 3: Obtain an unlock key (not for Nexus phones)

If you have a Nexus smartphone, then proceed to the next step.

Go to the smartphone manufacturer's website to obtain an unlock key (for example, for Motorola, open this page or this one for HTC), select your device (if required) and drive or create a new account.

Further in this step there may be differences for different phones, but there should be instructions on the steps on the manufacturer’s website. It will be as follows: first, turn off the phone and boot into fastboot mode. There are different methods on different phones, but most often you need to press and hold the power button and volume down key for 10 seconds. Release the buttons and you should be in fastboot mode (HTC users will have to use the volume down key to get to the Fastboot item and use the power key to select this item).

Connect your phone and PC using a USB cable. Your phone must somehow notify you of the connection. Open the tools folder in your Android SDK installation folder and Shift+Right Click on an empty area. Select “Open a Command Prompt Here” and enter the unlock command provided by the manufacturer (for Motorola this is fastboot oem get_unlock_data command , for HTC fastboot oem get_identifier_token).

Long strings of characters will appear on the command line. Copy these characters and make one line of them without spaces and on the website, paste the resulting text into the appropriate field. If your smartphone can be unlocked, you will receive an email with a key or file, which we will use in the next step. If your device cannot be unlocked, you will also be notified about this. If you still want to go all the way and use the unofficial method, then you will need the developers' website.

Step 4: Unlock

Now you are ready to unlock. If your phone is still in fastboot mode, run the command below. If not, then turn off your phone and boot into fastboot mode. There are different methods on different phones, but most often you need to press and hold the power button and volume down key for 10 seconds. Release the buttons and you should be in fastboot mode (HTC users will have to use the volume down key to get to the Fastboot item and use the power key to select this item). Connect your phone and PC with a USB cable.

Open the tools folder in your Android SDK installation folder and Shift+Right Click on an empty area. Select “Open a Command Prompt Here”.

To unlock your device, you will need to run one simple command. For most Nexus devices, this command is:
fastboot oem unlock
If you have a new version of Nexus, for example, Nexus 5X or 6P, then the command will be slightly different:
fastboot flashing unlock
If you do not have a Nexus smartphone, then the command you need will be indicated on the manufacturer’s website. For Motorola devices, this is the command fastboot oem unlock UNIQUE_KEY, where UNIQUE_KEY is the code sent to you by email. For HTC, this is the command fastboot oem unlocktoken Unlock_code.bin, where Unlock_code.bin is a file received from the HTC manufacturer.

After running the command, the phone may ask if you really want to unlock. use Volume key to confirm.

When unlocking is complete, use the OSD menu to reboot your phone (or run the fastboot reboot command on your computer). If everything is done correctly, then when you boot the phone you will see a message that the bootloader is unlocked, and then the Android OS will load. It is important to boot Android first before doing anything like installing a custom recovery.

Congratulations on being unlocked! While you won't notice any differences, you can now install a custom recovery, get root access or install a custom firmware.

Hello friends. Today, we can say, a spontaneous post happened, what it will be about, you could already guess from the title. The thing is that just today a parcel arrived from the USA, and I became the owner of a brand new Google LG Nexus 4. And now I have two Nexuses at once - Samsung Galaxy Nexus and LG Nexus 4 - maybe I’ll even write a comparison review, if you're interested, but that's not what we're talking about today.
Yes, who cares, and I’m sure that many – the issue price is 12k rubles with delivery! But again, that’s not what I’m talking about...

Yes, Pure Android 4 is wonderful in itself - convenient, fast and almost perfect. Please note that I am talking specifically about the android that is installed in Nexus Google phones, and not all other phones (htc, Samsung, sony, etc.), because... they have been seriously reworked and changed, unfortunately, not for the better. So what could be better than almost perfect firmware? Improved custom firmware, of course!

So today I turned on the phone for the first time just to make sure it worked at all. When I was convinced of this, I turned it off and started “dancing with a tambourine.” Hot on the heels, I’ll tell you how to unlock Bootloader on Nexus 4, install recovery and flash any firmware.

In fact, all these dances with a tambourine are not such dances and even almost not with a tambourine =) I, as an already experienced user, felt confident, did not worry and did not even make any backups. As it turned out, all the procedures described below are completely identical to the procedures that I did a year ago on the Galaxy Nexus. Everything will be simple, I promise!

First you need to prepare a little and download the necessary drivers:
Download the drivers usb_driver.rar - they will be useful for connecting the device in bootloader mode to our PC. We also download the adb.rar archive – it contains Fastboot and ADB files.

Unpack the Fastboot and ADB archive to the root of drive C, it should look like C:\adb.
We also unpack the drivers to the root of drive C, it will turn out to be C:\usb_driver.

Now into battle!

Installing drivers and unlocking Bootloader in LG Nexus 4

First you need to unlock Bootloader, without this nothing can be done.

There are various solutions and even programs that allow you to unlock, get root and install recovery in one click, but I somehow don’t trust this approach, because the procedure is delicate. Although I still tried to use the NEXUS 4 TOOLKIT 1.3 program today, but, as it turned out, you can only download the basic version, and the update is available only after payment, and without the update the choice of android 4.2.2 support is not available. In short - not our option!

Three simple steps and no show-offs:

  1. Turn off the phone and put it in Fastboot mode (press the Volume Down + Power buttons), connect the USB cable.
    Windows will show a message in the tray such as “Installing software for the device.” For obvious reasons, the drivers will not install themselves. Therefore: right click on My Computer => Device Manager => We will see the unknown Android device. Click on it twice, and in the window that opens: click Update driver... => Search for drivers on that computer => Select the folder C:\usb_driver and click next. The installation will begin, some question about security will appear, install it anyway. As a result, we will see the message: “The installation of drivers for this Android Bootloader Interface device has been completed.” In the device manager it will be written that the device is working normally - that’s what you need :) Close the manager.


  2. Open the command line (Start - write cmd in the search box - press Enter):
    • In the command line write cd C:\adb and press Enter
    • Next we write fastboot oem unlock and press Enter
  3. A warning will appear on the phone screen: “Unlock bootloader?” and blah blah blah. Use the volume key to select Yes and confirm the selection with the power button. Attention! This will delete all data on your phone. Immediately after this, the fastboot screen will appear, where LOCK STATE – unlocked will appear.

It's simple, right?

Installing custom recovery on LG Nexus 4

Now we need to install recovery, without which we simply will not be able to flash firmware, kernels and any tweaks and mods.

For recovery, I recommend TWRP Team Win Recovery Project. You can view the description and features on XDA in the official topic for NEXUS 4, there is always the current version there. At the time of writing this post, the newest version is 2.4.4.0. Here is a convenient direct download link. Have you downloaded it? Great, let's move on.

We have a file openrecovery-twrp-2.4.4.0-mako.img. If you put it in the c:\adb folder and rename it twrp.img it will be easier in the next step.


Well, the bootloader is unlocked, recovery is installed. The simplest thing left is to install new firmware. By the way, we don’t need to get root if we are going to install custom firmware, root will already be there by default.

Installing custom firmware on LG Nexus 4

For almost a year of using my previous Samsung Galaxy Nexus, I tried a whole bunch of different firmware, often reflashed it, and conducted all sorts of experiments. And you know, one day I found the ideal firmware, the firmware of my dreams - this is ParanoidAndroid. I simply cannot recommend anything else other than this firmware. But, one way or another, the choice is yours; the procedure for installing different firmware is identical.

This is what your Nexus 4 might look like after installing ParanoidAndroid:

Here is a video review of the same firmware, but for those who have not personally used ParanoidAndroid, little will be clear:

So, we have decided on the firmware, we need to download it. Official topic for firmware developers, there is also a description, links and new versions. You can download the firmware itself in the mako section on goo.im, and you will also need to download Google Apps in the corresponding section on goo.im.

We downloaded the firmware and gapps, now we need to somehow upload them to the phone. If the phone is normally visible in the explorer, then skip the block of text below; if you can’t get into the phone’s memory through the explorer, then read.

There may be a small snag here, but only if you don’t read this post - because all the snags are resolved for me, and I definitely write about it!

I’m sitting and connecting the phone via USB using a cable, but it’s charging, but in the explorer I can’t see it as a folder to put our archives there for the firmware. If you have the same story, then here is the solution!

I don’t know why, but Windows decided to install ADB drivers when the phone was turned on (this does not mean fastboot, but the running android system). Maybe I did something wrong somehow, but the fact is the fact - the phone folder is not visible in Explorer. I thought that some drivers were missing, I Googled for a long time, but found nothing. I decided to use the harsh method: We go to the device manager, we see “Android device something like ADB” - just right-click on it and select Delete. We disconnect the phone and immediately connect it back - Windows should re-detect the device and install the correct drivers on it. This worked for me and the required Nexus 4 folder appeared in Explorer!

Select the folder Nexus 4 / Internal memory / Download and drop the archives there, in my case it’s pa_mako-3.10-11MAR2013-131748.zip and pa_gapps-full-4.2-20130308.zip. In your case, these will be newer versions; it’s not at all difficult to understand the markings.

When all the archives are downloaded, disconnect the phone from the computer and turn it off. We need to get into recovery mode again, to do this we hold down Volume Down + Power until fastboot turns on, where we use the volume buttons to select Recovery mode and press Power.

If it suddenly happened that you didn’t see the main screen of TWRP (it’s very easy to identify, there will be no doubt about it), but you saw an android lying on its back with a red triangle, then there is a way out, but what would you do without it?

To do this, hold down the Power button until the phone turns off. We boot into fastboot again, connect the phone via USB and repeat the recovery installation script. When the recovery is installed, do not reboot, but use the volume buttons to find the Recovery mode item and select it with the power button. Now TWRP will definitely start, which means we follow the instructions below.

We will see the main screen of TWRP, click on the top right Wipe button, and then Factory Reset - this will delete all data on the phone!

After a complete reset, you need to return to the previous screen and click on the upper left Install button. On the screen that opens, select Download from the list of folders, and then first click on the pa_mako firmware file, then Add More Zips and immediately select the pa_gapps file and finally do Swipe to Confirm Flash. Now both the firmware and Google Apps applications will be flashed immediately, about a minute of waiting and we should see the inscription Successful. It is very important to clear all caches; to do this, select the Wipe cache/dalvik button. Everything is ready - click Reboot System.

Now the system will boot, but with the ParanoidAndroid firmware. After a long download, we find ourselves in the initial phone setup menu, where you need to select a language, specify an account, etc.

Actually that's all! Good luck to you friends. If you have any questions or suggestions about the firmware process or about ParanoidAndroid, please write in the comments.

Note: How to access the developer menu on any firmware.

Open the settings, select the “About phone” item at the very bottom, scroll the screen to the “Build Number” item, it will say JDQ39, which corresponds to android version 4.2.2, you may have something else written, it doesn’t matter. Press this line 7 times in a row. As a result, the message “You have become a developer!” should appear. It turns out how easy it is to become a developer for androind =))) We return back to the settings menu, we see a new item “For Developers”.

UPD: If suddenly the phone turns into a “brick” - what should you do?

You never know what happens... Like today, for example, a colleague bought himself the same Nexus 4 and gave it to me so that I could install custom firmware. “No problem,” I said and went to follow my own instructions written above. A strange thing happened - all the data (zip file of the firmware image, for example), which I uploaded to the internal drive for subsequent firmware after the reset, they were deleted, self-destructed for some unknown reason.

In short, the phone turned into a brick, i.e. It won’t turn on, but something needs to be done. Therefore, the easiest way is to download Factory Image to your phone, i.e. factory image so that the phone looks like what you saw when you first opened the package. And here are the instructions:

  1. It is assumed that you have already installed the drivers and the phone connects to the computer when it is in fastboot mode. And also the bootloader is unlocked. In short, all the steps under the heading “Installing drivers and unlocking” have been completed.
  2. Now download the official image of the phone from here https://developers.google.com/android/nexus/images#occam At the moment, the current version is 4.3 (JWR66V), click Link opposite and download.
  3. We downloaded the archive occam-jwr66v-factory-08d2b697.tgz, inside it is another archive occam-jwr66v-factory-08d2b697.tar, and inside there are several files and another archive image-occam-jwr66v.zip - this is what we need needed, take and transfer image-occam-jwr66v.zip to the folder C:\adb
  4. Open the command line and write:
    cd c:\adb press Enter;
    fastboot erase boot press Enter;
    fastboot erase cache press Enter;
    fastboot erase system press Enter;
    fastboot erase userdata press Enter;
    fastboot reboot-bootloader press Enter;
    fastboot -w update image-occam-jwr66v.zip press Enter and wait.
    After the last operation, the phone should reboot itself and turn on.
  5. Now your phone is like new :) And you can repeat what didn’t work. Namely, upload zip archives to the phone’s memory and try to flash them again. By the way, we didn’t touch recovery during the recovery process, so you still have TWRP, which means turn off the phone, press Volume Down + Power, select recovery and go!

Well, now that’s all for sure!

See you later, friends. And I’m sorry that I stopped writing about SEO often, I promise to improve in the near future.

Not every owner of a mobile device in the form of a smartphone or tablet running an Android series operating system knows that any version of the OS has such a thing as Bootloader. What it is will now be discussed. Based on an understanding of the very essence of the issue, it will be possible to find out what operations can be performed when unlocking it.

Bootloader: what is it?

Let's start, so to speak, with the basics. The bootloader for Android systems is practically no different from what is available on any computer terminal, be it a PC or a Mac. In simple terms, Bootloader is a built-in boot tool.

If we take as an example computer terminals with several installed operating systems (say, Windows and Linux), the boot loader, after turning on the stationary unit or laptop, offers the user a choice of logging in, and after confirmation loads one or another OS.

OS boot principles

Just like in stationary systems, in mobile devices it accesses initialization files in the same way as, for example, Windows does when loading parameters from the boot.ini file.

If you pay attention to such data, it is not difficult to conclude that in Android systems you can easily change not only the boot method, but also the loaded OS, either manually or automatically. However, few people know that this tool itself only loads the system that is written for a specific model of smartphone or tablet.

Bootloader: how to unlock and why is it needed?

As for the possibilities that unlocking the bootloader suggests, the matter here is not limited to data recovery.

It is believed that in this case the user gains access to the system core, which is not possible by default. How to describe Bootloader in such a situation? What this is will become clear if you look at the lack of so-called superuser rights. It turns out that after the blocking is lifted they are not needed at any level at all. Otherwise, you often have to install special firmware and applications. If, to put it mildly, it is “clumsy,” then the entire system may fail.

Any manufacturer of mobile equipment provides for working with a component such as Bootloader. How to unlock it? This is usually done using special utilities installed on a PC when connected to a mobile device via a USB interface. Please note that superuser rights are not required in this case.

For most devices, including, for example, Sony and HTC gadgets, the use of the Adb Run utility is implied, and for Sony you will have to additionally use special Sony Fastboot drivers, and even refer to the special Unlocker section on the official website. As you can see, the procedure, although feasible, is quite complicated.

Data recovery

On the other hand, in its standard mode of operation, restoring Bootloader after resetting the settings to factory settings is quite simple. This doesn't even require a hard reset.

You just need to reset the settings on the gadget itself, and after rebooting, the system will offer to choose an option: either use new settings on the device, or restore settings, programs and files using a Google services account. In this case, you will have to enter your Gmail address with a password, and also connect to the Internet, for example, with an active Wi-Fi connection.

Installing another operating system

If we talk about the possibility of installing another OS, this issue is quite complicated, although we can solve it. The fact is that some manufacturers claim that after Android there will be no other system for the gadget. Purely a publicity stunt designed to advertise the installed system.

But the Chinese have already proven with their “left” HTC devices that both Android and Windows Phone can easily coexist on one device. Moreover, such models are supplied in most cases with an already unlocked Bootloader. What is it in this case? This is a tool that allows you not only to select a bootable OS, but also to install any other one by changing parameters at the system level.

In other words, the user can even do without any firmware or additional programs to optimize the operation of the installed operating system. Moreover! This does not even require specialized utilities such as optimizers, of which there are so many today that the user himself does not understand what to choose from this huge number of programs and applications.

What should you pay attention to separately?

But when it comes to custom firmware, which have become quite popular among many owners of mobile devices, you need to be very careful with them. Of course, smart firmware or an OS update will not do any harm; on the contrary, it will only improve the operation of the device, but when you install something unofficial and not yet tested (like computer beta versions), expect trouble. Then certainly no bootloader will help.

By the way, few realize that such versions can put too much stress on the hardware components, which, in turn, can lead to their complete inoperability. But changing the processor in the same smartphone is far from the easiest thing.

In addition, unlocking the bootloader in officially released branded gadgets implies automatic loss of warranty and the possibility of free service. So you will have to think a hundred times before performing such actions and operations.

Finally, it remains to add that the issue of installing another OS on an Android device is also, in general, quite controversial. Yes, of course, the system will work, no matter what the manufacturer says. But how it will work is another question, especially since most users usually install some kind of lightweight version that has an unknown source of origin. But in vain. Here, as they say, you can screw up so much that you won’t end up with a sin. And in case of such changes, according to current international standards, the manufacturer itself does not bear any responsibility for the correct operation of the mobile device. Therefore, the decision on expediency must be made by the owner of the gadget himself. But it’s better not to joke with such things.