Changing the operating system on a mobile device is a powerful tool that allows you to give a second life to an old gadget or unlock the potential of a new one. Users often wonder how to change the firmware on an Android phone when official support for the device has been discontinued or when the standard interface is no longer suitable for its functionality. Custom firmware can significantly speed up the operation of the smartphone, remove pre-installed garbage and even update the Android version where the manufacturer did not provide for it.
However, this process is associated with certain risks. Incorrect actions can lead to the fact that the phone turns into a “brick” and stops turning on. Bootloader (bootloader) of the device must be unlocked, and all data from the internal memory will be permanently deleted during the installation process. Therefore, before starting the procedure, it is critically important to weigh the pros and cons, as well as prepare all the necessary tools.
In this article we will analyze in detail the entire path: from finding a suitable system image to the final boot into the new operating environment. You will learn about the differences between stock and custom builds, get acquainted with the necessary utilities for your PC and understand the logic of work Recovery menu. Even if you are doing this for the first time, strictly following the algorithm will minimize the risks of failure.
Preparing the device and selecting firmware
The first and most important step is to find compatible software. You can’t just download the first firmware you come across for your phone model. It is necessary to know exactly the device codename (codename), which often differs from the marketing name. For example, Xiaomi Redmi Note 10 may have a code name sunny, and the firmware for another model with a similar name simply will not install or will damage the system.
There are two main types of firmware: stock (official from the manufacturer) and custom (developed by the community, such as LineageOS, Pixel Experience). Stock versions guarantee stable operation of all hardware modules, including the camera and NFC, but may contain unnecessary applications. Custom builds are often cleaner and faster, but sometimes they can have minor bugs. Selecting a source Downloads are critical: use only trusted forums such as 4PDA or XDA Developers.
Before downloading the system image, make sure you have access to a computer and a quality USB cable. Cheap cables that come with some accessories often only support charging and do not transfer data, which will make the flashing process impossible. It is also worth checking the battery level - it should be at least 60-70% so that the phone does not turn off at the most crucial moment.
⚠️ Attention: Download firmware only from official developer sites or reputable forums. Files from dubious sources may contain malicious code or be damaged, which will damage the device.
Before downloading the firmware, check the checksum (MD5 or SHA-256) of the file with the one listed on the developer’s website. This ensures that the file was downloaded completely and was not damaged during the download process.
Unlocking the bootloader and installing drivers
Most smartphone manufacturers lock the bootloader (Bootloader) to protect the device from unauthorized intervention. To change the firmware, this lock must be removed. The unlocking process is unique for each brand: it requires waiting from 3 to 7 days and a special Mi Unlock utility, it requires receiving an unlock code through the official website, and the procedure is performed directly through the command line. Xiaomi requires a wait of 3 to 7 days and a special Mi Unlock utility, Motorola - receiving an unlock code through the official website, and Google Pixel the procedure is performed directly through the command line.
For interaction A computer with a phone in download mode requires special drivers. Without them, the PC simply will not see the device when you switch it to Fastboot or Download Modemode. Qualcomm processors often require Qualcomm USB Drivers, while MediaTek processors often require MTK VCOM Drivers. Installing these components is a mandatory step, without which further actions are pointless.
After installing the drivers, you need to activate the USB debugging mode on the smartphone itself. To do this, go to Settings → About phone and quickly click 7 times on the build number to become a developer. Then in the menu that appears For developers activate the item USB debugging. This will allow the computer to send commands to the device.
adb devices
This command, entered in the command line on the computer, should list the connected devices. If you see your phone's serial number, it means the connection is established correctly. If the list is empty, check the cable, drivers, or try another USB port, preferably connected directly to the motherboard, and not through the front panel of the case.
☑️ Ready to unlock
Installing custom Recovery (TWRP)
The standard recovery menu, which is found in every Android smartphone, has extremely limited functionality and allows you to install only official updates signed with the manufacturer’s cryptographic key. To install third-party firmware, you need to replace it with a custom solution, the most popular of which is Team Win Recovery Project (TWRP).
The TWRP installation process usually occurs through Fastboot mode. After unlocking the bootloader, put the phone into this mode (often using a combination of the volume and power buttons) and connect it to the PC. Using the command fastboot flash recovery twrp.img you write the recovery image to a special memory section. It is important to note that on some modern devices with dynamic partitions (A/B partition), the command may differ.
Immediately after flashing TWRP firmware, you cannot boot into a regular system, since stock Android can overwrite the custom recovery back to stock when first launched. Therefore, immediately after entering the command to disconnect the cable, you need to hold down the key combination to enter Recovery (usually Volume up + Power) and hold them until the TWRP logo appears.
In the TWRP menu you will have access to advanced functions: creating full backups (Nandroid backup), wiping partitions, installing ZIP archives with firmware and superuser rights (Root). The interface is touch-sensitive and intuitive, which greatly simplifies the process compared to the stock menu, controlled only by volume buttons.
What to do if TWRP is not installed?
On some new devices (especially on MediaTek processors or with data encryption), direct installation of TWRP may be blocked. In such cases, sometimes it helps to temporarily load the image without writing it to memory with the fastboot boot twrp.img command, after which you can install it on permanent media within the session.
The process of installing new firmware
When the custom recovery is installed and running, you can proceed to the main stage - installing a new system. The firmware file (usually in .zipformat) must be copied in advance to the phone’s internal memory or to an SD card. In the TWRP menu, select Install, find the archive with the firmware and swipe to confirm the installation has begun.
Before installing a new system, it is strongly recommended to perform a full data reset (Wipe). In the Wipe section, select Advanced Wipe and check the sections Dalvik / ART Cache, System, Data and Cache. Do not touch the partition Internal Storageif there are firmware files there, and be careful with the partition SD Card. Wiping these partitions removes the old system and cache, preventing file conflicts.
Once the firmware installation is complete, the process may take from 2 to 10 minutes depending on the power of the device and the size of the image. In the installation log you will see the status Successfulif everything went without errors. If the process is interrupted with an error or status Error 7, this often means a mismatch in the recovery version or a damaged firmware file.
Often, along with the firmware, you need to install a Google add-on package (GApps), since they are not available in custom assemblies due to licensing restrictions. The GApps file is also installed through the Install menu immediately after the firmware, but before the first boot of the system, while the phone is in Recovery mode.
| Partition type | Purpose | Need to be cleaned? |
|---|---|---|
System |
Stores operating system files | Yes, required |
Data |
Custom applications and settings | Yes, for a clean installation |
Cache |
Temporary system files | Recommended |
Dalvik / ART |
Optimization cache applications | Yes, required |
Internal Storage |
User files (photos, music) | No (if there is firmware) |
First boot and initial setup
After successful installation of all components, select item Reboot → System. The first boot after flashing always takes longer than usual - from 5 to 15 minutes. At this time, the system optimizes applications and creates a file structure. Don't panic if your phone freezes at the Android or new firmware logo; give it time.
If the device has booted, you will be greeted by an initial setup wizard. Here you can select your language, connect to Wi-Fi, and sign in to your Google account. It is worth paying attention to the screen and gesture settings, since in custom firmware they may differ from the interface you are used to. Setting up gestures and navigation buttons are often placed in a separate menu.
Restoring data from a backup is the next step. If you used cloud services, contacts and photos will be pulled up automatically. Applications will have to be installed again from the Play Market. However, if you made a full backup via TWRP before flashing, you can restore it, but this is not recommended when changing the Android version due to possible conflicts.
Possible problems and ways to solve them
Even with careful preparation, unforeseen situations may arise. One of the most common problems is Bootloop (cyclic reboot), when the phone constantly reboots before reaching the desktop. This may be caused by incompatibility of the GApps version with the Android version or an error when clearing partitions.
To solve the problem, go back to Recovery mode. Try Wipe Dalvik/Cache and reboot. If this does not help, you may have to reflash the device again by downloading another firmware collection. It is also worth checking whether the version of GApps is suitable (for example, for Android 11 you need a version of GApps specifically for 11).
Another common error is a non-working camera or fingerprint sensor. In the world of custom firmware, this is often called a “bug”. Check the thread with the firmware on the forum: if other users are complaining about the same thing, it means that this is a developer flaw, and it is difficult for an ordinary user to fix it. You will have to wait for an updated firmware version.
⚠️ Attention: If the phone has stopped responding to buttons and does not enter Recovery or Fastboot (Hard Brick) mode, you will need to use specialized PC apps, such as QFIL for Qualcomm or SP Flash Tool for MediaTek, as well as search for a special engineering cable or Test Point on the board.
Most boot problems can be solved by re-wiping the Dalvik and Cache partitions in Recovery mode or by flashing the image again from a trusted source.
Frequently asked questions (FAQ)
Will the warranty be void after flashing the phone?
In most cases Unlocking the bootloader and installing custom software will void the manufacturer's warranty. In addition, on many devices a counter Knox (for Samsung) or similar protection mechanisms are triggered, which physically record the fact of interference with the software. It is often impossible to return everything as it was in software.
Is it possible to update the firmware over the air (OTA) after installing a custom build?
Usually no. Standard OTA updates are only for stock firmware and verify the manufacturer's digital signature. However, some popular custom firmware (for example, LineageOS) have their own built-in update mechanism, which allows you to download new versions directly from the system settings menu.
Is it safe to use banking applications on custom firmware?
By default, many banking applications do not work on devices with an unlocked bootloader or root access for security reasons. However, there are methods for hiding these facts (for example, Magisk Hide modules) that allow you to bypass the check. But this is an arms race: banks are constantly improving protection, and there is no guarantee of 100% work.
What to do if Wi-Fi or Bluetooth does not work after the firmware?
Most often this means that you did not save or restore the partition EFS or Modem, where the unique calibration data of your device’s radio modules is stored. Before any flashing, it is critical to backup these particular partitions via TWRP. Restoring them after the fact without a backup is extremely difficult, and sometimes impossible.
Do you need to format the internal memory before installation?
When moving from one version of Android to another (for example, from 10 to 12), formatting the Data section is mandatory, since the encryption structure changes. If you are just updating within one version, a simple Wipe is sufficient. Full formatting will delete all files, so make sure you save photos and documents on your computer.