Manual flashing of a smartphone based on Android is a powerful tool that allows you to bring the device back to life after critical failures, remove software pre-installed by the manufacturer, or install the latest version of the operating system when official updates have already been stopped. However, this process requires extreme care and understanding of the architecture of mobile devices. Any error at the stage of writing data to memory can turn the phone into a โbrickโ that shows no signs of life.
Before taking active steps, you must clearly understand the risks. Warranty The device will be canceled immediately after unlocking the bootloader, and in some cases the warranty does not cover software failures initially. You act at your own peril and risk, and the success of the operation depends on the accuracy of each step of the instructions and the quality of the software used.
In this guide we will look at a universal algorithm of actions that is suitable for most devices with processors Qualcomm i MediaTek, and will also touch on the features of working with branded utilities. We will look at preparing drivers, working with the command line and the nuances of installing custom recovery. The main thing is to take your time and double check each file before starting the recording process.
Preparing the workplace and necessary files
The success of the operation depends 90% on the quality of preparation. You will need a computer running Windows (rarely Linux or macOS), a working USB cable, preferably the original one, and a stable power connection. The first step is to search and download the correta firmware image specifically for your device model. Using a file from another modification of the phone, even with a similar name, is guaranteed to cause damage.
It is critically important to install the correct ones. USB drivers. Without them, the computer simply will not see the smartphone in download mode. Snapdragon processors often require Qualcomm HS-USB QDLoader drivers, while MediaTek processors often require MTK VCOM Drivers. You also need to download the package Platform Tools (ADB and Fastboot) from the official website of Android developers.
โ ๏ธ Attention: Download firmware only from trusted resources, such as the official forum XDA Developers or the manufacturerโs website. Files from third-party file hosting services may contain viruses or be damaged.
After downloading all components, unpack the archives into a separate folder on the root drive of your computer so that the path to the files does not contain Cyrillic characters or spaces. This is a common cause of errors when executing commands in the terminal. Check the integrity of the downloaded firmware images using checksums, if they are provided by the author of the assembly.
โ๏ธ Preparing for firmware
Unlocking the bootloader and obtaining access rights
Modern smartphones come with a locked Bootloader, which prohibits the installation of something not signed by the manufacturer software. The unlocking procedure is unique for each brand. For example, on Xiaomi devices you need to wait from 3 to 15 days after linking your account, and on Motorola or OnePlus The unlock code can be obtained instantly through the official website.
First you need to activate the developer menu. Go to Settings โ About phone and quickly click 7 times on the item Build number. After a notification appears that you have become a developer, go to the new menu For developers and enable the option USB debugging. There may also be an item Factory unlock (OEM Unlocking) that needs to be activated.
Then the phone is switched to Fastbootmode. This is usually done by turning off the device and holding down the combination of volume and power buttons when connecting to a PC. In the computer command line, being in the tools folder, enter the command to check the connection:
fastboot devices
If the device is detected, the unlock command is entered. It erases all data from the internal storage, so backup required.
fastboot flashing unlock
A warning about data loss will appear on the smartphone screen. Confirm the action with the volume buttons. After the reboot, the bootloader will be unlocked, and you can proceed to the next step.
What to do if the command is not executed?
If the fastboot flashing unlock command gives the error 'Command not allowed', then the manufacturer has blocked this feature at the server level or for your specific software version. In this case, manual firmware using standard methods is impossible without the use of paid boxes or vulnerability exploits.
Installing custom TWRP recovery
The standard recovery menu (Stock Recovery) has limited functionality and allows you to install only updates signed by the manufacturer. To manually flash third-party images, you need to install a custom recovery, the most popular of which is TWRP (Team Win Recovery Project). It supports working with file systems, installing ZIP archives and creating full backups.
Download the image file twrp.imgcorresponding to the code name of your device. Place it in the folder with Platform Tools. Put your smartphone into Fastboot mode and run the temporary recovery boot command:
fastboot boot twrp.img
This command loads TWRP into RAM without writing to flash memory. This is a safe way to test the functionality of the menu. If everything went well and you see the recovery touch interface, you can perform a permanent installation.
Inside the TWRP menu, select Install, then press the button Install Image at the bottom of the screen. Select the downloaded TWRP image file and specify the partition Recovery to write to. After completing the procedure, reboot the system. Now you have full control over the file system of the device.
Before installing the firmware in TWRP, go to the Wipe section and format the Data section (Format Data) by entering the word 'yes'. This is necessary to remove encryption, otherwise the new system will not be able to read the internal memory.
The process of installing firmware via Fastboot and Recovery
There are two main methods of manual firmware: through the Fastboot script (for devices with an unlocked bootloader) and through the Recovery menu (universal method). The Fastboot method involves writing system partitions one by one using commands like fastboot flash system system.img. This method is faster, but requires knowledge of the exact partition structure of your device.
The method via TWRPis more obvious. Copy the archive with the firmware (usually in .zip format) to the phone's internal memory or SD card. Boot into recovery mode. Before installation, be sure to perform a data wipe (Wipe). Select sections Dalvik / ART Cache, System, Cache and Data. Do not format the internal memory if you store firmware files there, unless this is required by the specific build.
In the TWRP main menu, click Install, select the firmware archive and swipe to confirm the installation starts. The process may take from 2 to 10 minutes. In the installation log you will see a progress bar and messages about mounting partitions. If the process is completed successfully, a button will appear Reboot System.
| Memory section | Description of contents | Risk in case of error |
|---|---|---|
boot |
System kernel and ramdisk | The phone will not turn on (Bootloop) |
system |
Android operating system files | Boot is impossible or cyclic reboot |
recovery |
Recovery menu | Inability to enter recovery mode |
userdata |
User data and applications | Loss of all personal files and settings |
After the first boot, the new system will initialize applications, which may take some time. Do not interrupt this process, even if the phone seems frozen. Optimizing applications is a normal phenomenon after a clean installation.
Installation of Google drivers and GApps services
Many custom firmware, especially based on the project LineageOS or AOSP, are supplied without pre-installed services Google due to licensing restrictions. This means no Play Market, YouTube account synchronization. To fully use your smartphone, you must manually install the package GApps (Google Apps).
Download the appropriate GApps package from the resource OpenGApps or NikGApps. It is important to select the correct processor architecture (usually arm64) and the version of Android that matches the installed firmware. Installation is carried out immediately after the system firmware, before the first boot, directly from the TWRP menu.
Follow the same algorithm: Install โ select the GApps archive โ swipe for installation. Do not reboot the system between installing the firmware and the Google package, as this may lead to errors in the application registry. If you forget to install GApps right away, you will have to Wipe the data again and repeat the procedure again.
โ ๏ธ Attention: Never install GApps packages designed for a newer version of Android than the one on your phone. This will cause a critical system failure (Force Close) immediately after loading.
Possible errors and ways to eliminate them
During the process of manual firmware, users often encounter various errors. The most common one is Error 7 in TWRP. It means a mismatch between the Android version in the firmware archive and the version expected by the installation script, or a problem with partition access rights. Solution: update TWRP to the latest version or use the command adb sideload.
If the phone goes into Bootloop (endless reboot on the logo), try going to Recovery and doing Wipe Cache/Dalvik. If this does not help, the firmware may be damaged or not suitable for your device revision. In the worst case, you will need to return to the stock firmware via EDL (Emergency Download Mode), which often requires an authorized service account.
Problems with drivers in Windows are solved by disabling driver digital signature verification. To do this, when booting your PC, you need to go to additional boot options and select the appropriate item. Without this, the system may block the installation of drivers for Fastboot or ADB mode.
Most firmware errors (90%) are associated with incorrect selection of the firmware file or failure to clear the Data partition before installing a new system.
Frequently asked questions (FAQ)
Is it safe to unlock the bootloader for banking apps?
Unlocking the bootloader violates the integrity of Android's security system. Banking applications (Sberbank, Tinkoff, etc.) and Google Pay may refuse to work because they see that the system is compromised. You can get around this using a utility Magisk and modules for hiding root access, but this is a constant โarms raceโ between bank developers and enthusiasts.
Is it possible to flash a phone if it does not turn on?
If the phone does not turn on, but responds to connecting to a PC (vibrates, defined in the device manager as QHSUSB_BULK or MediaTek USB Port), then you can flash it through the Emergency Download (EDL) mode or SP Flash Tool. If the power controller is dead or the memory is physically damaged, software methods are powerless.
Will IMEI be erased during manual flashing?
If only the system, boot and vendor partitions are correctly flashed, IMEI is not affected, since it is stored in a protected EFS or Persist partition. However, if you accidentally format the entire drive or flash the wrong image of the modem, losing the IMEI is possible. Always make a backup of the EFS partition before any manipulations.
Why do you need USB debugging?
USB Debugging provides access to the ADB command system. Without debugging enabled, your computer won't be able to send commands to your phone, install apps, or take screenshots in debug mode. This is the main gateway for any advanced device management from a PC.