Flashing a smartphone via a computer is a process that requires not only technical skills, but also understanding risks. Android 12, despite the release of new versions, it remains a relevant system for many devices, especially budget and middle class ones. Unlike updating โ€œover the airโ€ (OTA), manual firmware via a PC gives control over the software version, allows you to restore the โ€œbrickโ€ or install custom firmware with advanced functions.

However, there are pitfalls here: from locking the bootloader (bootloader) to incompatibility of firmware with hardware. For example, firmware from Samsung Galaxy A52 is not suitable for Xiaomi Redmi Note 10, even if both models officially support Android 12. In this article we will analyze the only reliable way to flash firmware via a PC is using the ADB and Fastboot toolswhich works on 90% of devices with an unlocked bootloader.

Before you start, answer two questions for yourself question: Why do you need it (speedup, new features, crash recovery?) and Are you ready? possible data loss or even device failure. If the answers are not obvious, it is better to stop at this stage.

Device preparation: unlocking the bootloader and backup

The first and most critical step is unlocking the bootloader (bootloader). Without this, no firmware will be installed via fastboot. The process is different for different manufacturers:

  • ๐Ÿ”“ Google Pixel, OnePlus, Xiaomi: unlocking via command fastboot flashing unlock (requires confirmation on the phone).
  • ๐Ÿ”’ Samsung, Huawei: official unlocking is often impossible without special keys (for example, through a service Samsung Members).
  • โš ๏ธ Realme, Oppo: you may need to send a request to the manufacturer indicating the IMEI.

Important: unlocking will reset the device to factory settings. Therefore required make a backup:

  • ๐Ÿ“ฑ Contacts, SMS, calls: synchronize with Google Account or export through applications like Swift Backup.
  • ๐Ÿ“ท Photo/video: copy to PC or to the cloud (Google Photos, Yandex Disk).
  • ๐ŸŽฎ Game saves: use the built-in cloud saving functions (for example, in Genshin Impact or Call of Duty Mobile).
โš ๏ธ Attention: On some devices (for example Xiaomi with MIUI), unlocking the bootloader requires linking your account to the device for 72 hours. Check this in advance in the settings developer (Settings โ†’ About phone โ†’ MIUI version - tap 7 times).
๐Ÿ“Š Your experience with Android firmware?
Never flashed
Flashed official versions
Installed custom firmware (LineageOS, Pixel Experience)
I do this professionally

Choice of firmware: official vs custom

Not only the functionality, but also the stability of the device depends on the type of firmware. Official firmware (stock ROM) guarantee compatibility with hardware, but often lack new features. Custom (for example, LineageOS, Pixel Experience) add flexibility, but may contain bugs.

Firmware type Pros Cons Where to download
Official (Stock ROM) Maximum stability, support for OTA updates, compatibility with manufacturer services (for example, Samsung Knox) Limited settings, possible bloatware (pre-installed applications) Official websites (Samsung Firmware, Xiaomi Flash Tool)
Custom (AOSP) Clean Android, advanced settings, regular updates (even for old devices) Possible bugs with camera, sensors, banking applications (due to lack of certification) Forum.xda-developers.com, LineageOS.org
GSI (Generic System Image) Universal firmware for devices with Project Treble, support for new versions of Android Camera modules, NFC, some sensors may not work GitHub (repositories like phhusson/treble_experimentations)

For beginners, we recommend starting with official firmware. For example, if your Redmi Note 9 Pro "glitched" after the update, download the latest stable version of MIUI for your model from the site en.miui.com. Custom firmware should only be considered if you are confident in your skills or for devices that the manufacturer has abandoned (for example, Nokia 6.1 with Android 12 from the community).

โš ๏ธ Attention: Firmware from unofficial sources (torrents, telegram channels) may contain malicious code. Always check file hashes (MD5/SHA-1) and reviews on forums.
๐Ÿ’ก

Before downloading the firmware, check its version. for your region. For example, Samsung releases separate assemblies for Russia (SER), Europe (XXU) and Asia (XSG). A discrepancy can lead to problems with the mobile network.

Installing the necessary tools on a PC

For firmware via a computer you will need:

  1. ADB and Fastboot โ€”utilities for interacting with Android via the command line. Download Platform Tools from Google (weight ~5 MB).
  2. USB drivers for your device. For most smartphones, a universal package is suitable Google USB Driver, but for Samsung or MediaTek separate drivers may be required.
  3. Firmware in format .zip (for recovery) or .img (for fastboot).

Installation instructions:

  1. Unpack platform-tools to the root of the disk C:\ (path should not contain Cyrillic alphabet!).
  2. Connect the phone to the PC in Fastboot (press Volume down + Power with the device turned off).
  3. Open the command line in folder with platform-tools (Shift + right mouse button โ†’ "Open PowerShell window here").
  4. Check the connection with the command:
    fastboot devices

    If the device is displayed, the drivers are installed correctly.

โ˜‘๏ธ Check before flashing

Done: 0 / 4

Step-by-step guide for flashing firmware via Fastboot

This method is suitable for devices with an unlocked bootloader and firmware in the format .img. The example is given for Google Pixel 6, but the steps are similar for most devices (except Samsung โ€”they have their own protocol Odin).

Step 1. Put the device into Fastboot mode

Turn off the phone. Press and hold data-i="144">for 10 seconds until a screen with a robot and the inscription appears Volume down + Power for 10 seconds until a screen with a robot and the inscription appears Fastboot mode.

Step 2. Unlocking the bootloader (if not done before)

In the command line, enter:

fastboot flashing unlock

fastboot flashing unlock_critical

On phone, confirm unlocking (use the volume buttons to select Unlock, confirm with the power button).

Step 3. Firmware system partitions

Unpack the downloaded firmware (for example, factory-image-gus.zip for Pixel 6) and find the files:

  • boot.img โ€” system kernel;
  • system.img โ€” main section;
  • vendor.img โ€” drivers and proprietary components;
  • dtbo.img โ€” device configuration.

Flash them one by one with the commands:

fastboot flash boot boot.img

fastboot flash system system.img

fastboot flash vendor vendor.img

fastboot flash dtbo dtbo.img

Step 4. Clear cache and reboot

Run:

fastboot erase cache

fastboot reboot

The first boot may take up to 10 minutes - do not interrupt the process!

What to do if the device is stuck on the logo?

If after flashing the phone does not boot for more than 15 minutes, try:

1. Go to recovery (Volume up + Power) and do wipe data/factory reset.

2 Repeat the firmware, checking. hash sums of files.

3. If all else fails, flash the stock ROM through an official tool (for example, Mi Flash Tool for Xiaomi).

Solving common errors when flashing

Even if you follow the instructions exactly, errors may occur. common and ways to correct them:

Error Cause Solution
FAILED (remote: 'Flashing is not allowed in Lock State') Bootloader is not unlocked Run fastboot flashing unlock (see Step 2 above)
No such file or directory Wrong path to firmware files Check that the files .img are in the same folder as fastboot.exe
Invalid sparse file format at header The file is damaged system.img Download the firmware and check the hash sum (MD5)
The device is not detected in fastboot devices There are no drivers or the cable is faulty Install the drivers manually via Device Manager or try another USB port (preferably USB 2.0)

If after flashing the phone the phone does not turn on or is stuck on the logo, do not panic. In 90% of cases, it helps re-firmware with preliminary formatting of partitions:

fastboot erase system

fastboot erase userdata

โš ๏ธ Attention: On devices with a chipset MediaTek (for example, Redmi Note 8 Pro) firmware may require tool SP Flash Tool instead of fastboot. Check this on the forum 4PDA for your model.

Firmware via custom recovery (TWRP)

An alternative way is to install the firmware via TWRP (Team Win Recovery Project). This method is suitable for .zipfirmware (for example, custom or modified stock ROM).

Advantages of TWRP:

  • ๐Ÿ”„ Ability to create a full backup of the current system (Nandroid backup).
  • ๐Ÿ“ฆ Installing firmware, kernels and mods without a PC (just copy the file to your phone).
  • ๐Ÿ› ๏ธ Recovery after unsuccessful firmware.

How to install TWRP:

  1. Download the recovery image for your model from official website (for example, twrp-3.7.0_9-0-redfin.img for Pixel 5).
  2. Flash it via fastboot:
    fastboot flash recovery twrp.img
  3. Boot into recovery: fastboot reboot recovery.
  4. In TWRP, select Install, find the downloaded firmware (.zip) and confirm installation.

Important: after installing custom firmware via TWRP required flash Magisk (for root access) or Disable_Dm-Verity_ForceEncrypt (if you need to disable encryption). Otherwise, the device may get stuck in a loading loop.

๐Ÿ’ก

TWRP does not support devices with Dynamic Partitions used in Android 10+. For such models (for example Pixel 4 XL), firmware is only possible via fastboot.

Checking firmware and post-configuration

After successful firmware, perform several checks:

  1. Checking the Android version: Settings โ†’ About phone โ†’ Android version. Should be displayed Android 12 (API 31).
  2. Testing basic functions:
    • ๐Ÿ“ž Calls and mobile data (check IMEI in *#06#).
    • ๐Ÿ“ท Camera (take a photo on the main and front).
    • ๐Ÿ”‹ Charging (connect the charger).
    • ๐Ÿ”Š Speakers and microphone (record a voice message).
  • SafetyNet check: Install the application SafetyNet Test from Play Market. If the test fails, banking applications (for example, SberBank Online) may not work. Solution: flash Magisk with the module Universal SafetyNet Fix.
  • If problems are found (for example, NFC or the fingerprint sensor does not work), return to the original firmware or find an alternative build on the forums. For example, for Samsung Galaxy S21 with a broken NFC, the regional version of the firmware often helps XEU (Europe) instead of SER (Russia).

    FAQ: Frequently asked questions about Android 12 firmware

    Is it possible to flash Android 12 on a device that does not officially support this version?

    Yes, but with reservations. For this you need custom firmware based on Android 12 (for example, LineageOS 19 or ArrowOS). However:

    • โš ๏ธ The camera, sensors or mobile network may not work (depending on developer support).
    • โšก Performance may drop due to an unoptimized kernel.
    • ๐Ÿ”’ Banking applications will refuse to work without additional patches (for example, MagiskHide Props Config).

    Before installation, check reviews on XDA Developers for your model.

    How to return the official firmware after custom?

    For a return to stock firmware:

    1. Download the official firmware for your model (for example, from the site Samsung Firmware or Xiaomi Flash Tool).
    2. Flash it through fastboot or a proprietary tool (Odin for Samsung, for Xiaomi). back. Mi Flash for Xiaomi).
    3. Perform a factory reset (Wipe data in recovery).

    Important: On some devices (for example, Huawei) returning to the official firmware may block the bootloader back.

    Why does the battery drain after Android 12 firmware?

    Accelerated discharge after firmware is a common problem. Reasons and solutions:

    • ๐Ÿ”„ Cache and data: Reset the cache in recovery (Wipe cache partition).
    • ๐Ÿ”‹ Battery calibration: Completely discharge and charge the phone 2-3 times.
    • ๐Ÿ› ๏ธ Background processes: Check application activity in Settings โ†’ BatteryDisable autorun of unnecessary apps.
    • โšก Unoptimized kernel: If you flashed custom firmware, try a different kernel (for example, FrancoKernel for Pixel).
    Is it possible to flash Android 12 without unlocking the bootloader?

    No. Unlocking the bootloader is a prerequisite for any firmware via fastboot or TWRP. Exceptions:

    • ๐Ÿ“ฑ Some devices Samsung can be flashed through Odin without unlocking, but only official firmware.
    • ๐Ÿ”ง On older devices (up to Android 5.0), exploits sometimes work to bypass the lock, but this not relevant for Android 12.

    An attempt to flash a locked device will result in an error FAILED (remote: 'Flashing is not allowed').

    How to flash Android 12 on a device with a damaged screen?

    If the screen does not respond to touches, but the device turns on:

    1. Connect the phone to the PC and use adb to control:
      adb shell input tap x y # tap emulation by coordinates
      

      adb shell input swipe x1 y1 x2 y2 # swipe emulation

    2. To unlock the bootloader use commands fastboot (see Step 2 in the instructions above).
    3. If the screen is completely black, but the device is detected in fastboot devices, flash the firmware "blindly" according to the instructions.

    For devices with MediaTek (for example, Redmi 9A) firmware via SP Flash Tool with the option Format All + Download.