Flashing an Android device with root access is a task that requires not only technical skills, but also understanding the risks. Many users resort to this method to install custom firmware, remove bloatware (pre-installed applications), improve performance, or bring a โ€œlockedโ€ smartphone back to life. However, the process is fraught with potential problems: from loss of warranty to complete โ€œbrickingโ€ of the device if something goes wrong.

In this article we will analyze the entire process step by step: from preparing and backing up data to selecting the appropriate firmware and installing it via TWRP or Fastboot. We will pay special attention to the nuances of working with root access, unlocking the bootloader and solutions to common errors. If you are a beginner, do not skip the sections with warnings and safety tips. Experienced users will find here relevant methods for modern devices (including models with Dynamic Partition and A/B-system).

What is Android flashing and why do you need it

Flashing is the replacement of the standard operating system on the device with an alternative version. It may be official (from the manufacturer) or custom (developed by the community, for example, LineageOS, Pixel Experience). With root access, the process becomes more flexible: you get access to system files, which allows you to:

  • ๐Ÿ”„ Remove unnecessary system applications (bloatware) that cannot be disabled using standard means.
  • โšก Install modified kernels to overclock the processor or improve autonomy.
  • ๐Ÿ› ๏ธ Restore the device to functionality after a failure (for example, after an unsuccessful OTA update).
  • ๐Ÿ”“ Bypass manufacturer restrictions (for example, unlock network ranges on Xiaomi or Samsung).

However, root access and flashing have the opposite effect side:

  • โš ๏ธ Loss of warranty (manufacturers determine hacking by status bootloader unlock or presence Magisk).
  • ๐Ÿ›ก๏ธ Security vulnerabilities (some banking applications and services, for example Google Pay, can block work on rooted devices).
  • ๐Ÿ’ฅ Risk of โ€œbrickingโ€ (turning a smartphone into a โ€œbrickโ€) due to errors during firmware flashing.

Before continuing, answer this question: do you really need root access and custom firmware? Often user tasks (for example, deleting applications or improving performance) are solved without hacking the system - via ADB or alternative launchers.

๐Ÿ“Š Why do you want to reflash Android?
Install custom firmware
Remove bloodware
Overclock the processor
Restore the "brick"
Other

Preparing the device: backing up and unlocking the bootloader

The first and most important stage is data backup. Flashing erases all information from the internal memory, including photos, contacts and applications:

  • โ˜๏ธ Cloud services: Google Drive, Dropbox or Mega for photos, documents and contacts (synchronization via Google account).
  • ๐Ÿ’พ Local copy: connect your smartphone to the PC and copy files from folders DCIM, Downloads, Pictures.
  • ๐Ÿ“ฑ Backup applications: Titanium Backup (requires root) or Swift Backup to save user applications and their data.

Next you need unlock bootloader (bootloader). This step is required to install custom recovery (TWRP) or firmware. The process differs depending on the manufacturer:

Manufacturer Unlock method Features
Xiaomi Via Mi Unlock Tool (requires binding Mi account) Waiting 7-15 days after linking the account
Samsung Enable OEM Unlock in the developer settings On new models, requires an Internet connection when unlocking
Google Pixel Team fastboot flashing unlock The simplest process, without waiting
OnePlus Through fastboot oem unlock Can reset all data even without firmware

General unlocking algorithm:

  1. Activate Developer mode (press 7 times on Build number in the phone settings).
  2. Enable USB Debugging and OEM Unlocking in the developer menu.
  3. Connect the device to the PC, open the command line and run:
    adb reboot bootloader
    

    fastboot oem unlock

โš ๏ธ Attention: On some devices (for example, Huawei or Honor) Unlocking the bootloader is officially prohibited. Using unofficial methods may lead to loss of IMEI or network problems.

Make a backup of all data|

Charge the battery to 80% or more|

Install ADB/Fastboot drivers on your PC|

Download the firmware and TWRP for your model|

Check the compatibility of the firmware with the version bootloader-->

Selection of firmware: official vs custom

The functionality of the device after installation depends on the type of firmware. Let's consider the main options:

Official firmware

These are stock (factory) versions of Android from the manufacturer. Their advantages:

  • โœ… Stability and optimization for a specific model.
  • โœ… Maintenance of the warranty (if the bootloader is not unlocked).
  • โœ… Support for all functions of the camera, sensors and wireless modules.

Where download:

  • ๐ŸŒ Official websites of manufacturers (Samsung โ€” Sammobile, Xiaomi โ€” Mi Community).
  • ๐Ÿ”— Services like Firmware.mobi or XDA Developers (check the hash sums of the files!).

Custom firmware

Popular projects:

  • ๐Ÿ“ฑ LineageOS โ€”pure Android without bloatware, regular updates.
  • ๐ŸŽจ Pixel Experience โ€”firmware with functions and design from Google Pixel.
  • ๐Ÿ”ง Havoc-OS or CrDroid โ€”flexible interface customization and performance.

Before choosing custom firmware, check:

  • ๐Ÿ” Compatibility with your model (look for topics on XDA or 4PDA).
  • ๐Ÿ“… Date of last update (firmware older than 6 months may contain vulnerabilities).
  • ๐Ÿ’ฌ User reviews about bugs (for example, problems with NFC or camera).
โš ๏ธ Attention: On devices with Dynamic Partition (for example, Samsung Galaxy S22 or Xiaomi 12) installing custom firmware can lead to loss of data in the partition userdataBefore flashing the firmware, be sure to format the partition data in TWRP!
What is the danger of firmware from unknown sources?

Unofficial firmware may contain:

- Spyware (keyloggers, backdoors for remote access).

- Modified system libraries, causing overheating or rapid battery drain.

- Incompatible drivers, due to which the camera, GPS or mobile data will refuse to work.

Always check the hash sum (MD5/SHA-1) of the downloaded file and read discussions on the forums.

Installing TWRP: custom recovery for firmware

TWRP (Team Win Recovery Project) is an alternative recovery that allows you to install firmware, make backups and restore the system. Without it, it is almost impossible to reflash a device with root access.

Installation instructions:

  1. Download the official TWRP for your model from the site twrp.me (for example, for Redmi Note 10 Pro this will be the file twrp-3.7.0_12-vayu.img).
  2. Reboot the device into mode fastboot:
    adb reboot bootloader
  3. Flash the recovery:
    fastboot flash recovery twrp.img
    

    fastboot reboot recovery

On some devices (for example, Samsung s Exynos or MediaTek) TWRP is not installed constantly due to protection RMM/KG State. In this case, use a temporary download:

fastboot boot twrp.img

After startup TWRP it is recommended:

  • ๐Ÿ”„ Make a full backup of the current system (sections boot, system, data).
  • ๐Ÿ”ง Disable signature verification firmware in the settings (Settings โ†’ Disable DM-Verity).
โš ๏ธ Attention: On devices with A/B system (for example, Google Pixel or OnePlus) TWRP may not see the partition data after reboot. Solution: flash TWRP in both slots (fastboot flash recovery twrp.img + fastboot flash recovery_b twrp.img).
๐Ÿ’ก

If, after installing TWRP, the device boots into stock recovery, try disabling automatic recovery update in the developer settings (the "Update recovery with AP" option).

Firmware process: step-by-step guide

Now that you have it TWRP and the downloaded firmware, you can begin installation. General algorithm:

  1. Cleaning partitions:
    • In TWRP select Wipe โ†’ Advanced Wipe.
    • Mark partitions Dalvik/ART Cache, System, Data, Cache.
    • For devices with Dynamic Partition may be required formatting data to F2FS or ext4.
  • Firmware installation:
    • Click Install, select the downloaded ZIP firmware file.
    • Add (if necessary) Gapps (for custom firmware without Google services) and Magisk (for root access).
    • Swipe to confirm installation.
    • First boot:

      After installation, select Reboot โ†’ System. The first boot may take 10โ€“20 minutes - do not interrupt the process, even if the screen remains black for a long time.

    • Typical errors and their solutions:

      Error Cause Solution
      Error 7 in TWRP Incompatibility of firmware with the device Check the model and firmware version. Use a patch to bypass (for example, remove the line assert in updater-script).
      Stuck on logo Partitions are not cleared correctly or are missing vendor Return to TWRP, repeat Wipe and flash vendor.img separately.
      No OS installed The partition is damaged system Flash the firmware again or restore the backup.

      If the firmware requires additional steps (for example, installation firmware or kernel separately), follow the instructions from the topic on XDA. For devices Samsung you may need to flash BL, AP, CP and CSC via Odin.

      ๐Ÿ’ก

      Always check the hash sum (MD5) of the downloaded firmware before installation. A damaged file can lead to a boot loop or errors in the system.

      Working with root access after flashing

      If you installed the firmware with a pre-rooted kernel (for example, LineageOS for microG), root access may already be active. In most cases, they need to be obtained separately via Magisk.

      Installation instructions Magisk:

      1. Download the latest Magisk-v26.4.zip from GitHub.
      2. B TWRP select Install and flash ZIP file.
      3. Reboot the device.
      4. Install the APK file Magisk and check the status of root access in the application.

    To hide root access from banking applications (for example, SberBank Online or Google Pay):

    • Enable MagiskHide in settings Magisk (called Enforce DenyList in new versions).
    • Add applications to the hide list.
    • Restart the device.
    โš ๏ธ Attention: On Android 12+ and newer devices (for example, Samsung Galaxy S23) Magisk may not work due to protection AVB 2.0 and RMM. In this case, the modified firmware is required boot.img via fastboot.

    Check the functionality of root access with the command in the terminal:

    su
    

    id

    If you see in response uid=0(root), which means the rights were obtained successfully.

    Solving problems after flashing

    Even with proper installation, problems may occur. Let's consider typical scenarios:

    1. The device does not turn on (soft brick)

    Symptoms: the screen is black, vibrates when buttons are pressed, but does not boot.

    Solutions:

    • ๐Ÿ”Œ Try booting into TWRP (hold Power + Vol Up).
    • ๐Ÿ”„ If TWRP available - restore the backup or flash the firmware again.
    • ๐Ÿ’ป If TWRP not available - flash the stock firmware via fastboot or Odin (for Samsung).

    2. The mobile network or Wi-Fi does not work

    Reasons:

    • Absent modem/firmware (relevant for Samsung and Xiaomi).
    • Incompatible version of radiomodule.

    Solutions:

    • Flash the file separately modem.img or firmware from the stock firmware.
    • Check the APN settings (for mobile data).

    3. Cyclic reboot (bootloop)

    Symptoms: the device constantly reboots at the logo.

    Solutions:

    • ๐Ÿ”ง Delete files /data/.dalvik-cache i /cache via TWRP.
    • ๐Ÿ”„ Flash the core (boot.img) from stock firmware.
    • ๐Ÿ“ฑ If the problem is after installation Magisk โ€”delete it via TWRP (flash Magisk-uninstaller.zip).
    • To diagnose errors, use the logs:

      adb logcat > log.txt

      Look in the log for lines with E/ (errors) or F/ (fatal failures).

      What to do if TWRP does not see the internal memory?

      This is a typical problem for devices with encryption FBE (File-Based Encryption). Solutions:

      1. Enter your password/pin code in TWRP (if prompted).

      2. Format data to ext4 (all data will be deleted!).

      3. Use OrangeFox Recovery instead of TWRP โ€”it works better with FBE.

      FAQ: answers to frequently asked questions

      Is it possible to reflash Android without unlocking the bootloader?

      No, unlocking the bootloader required for installing custom firmware or TWRP. The exception is official updates via OTA or Smart Switch (for Samsung), but they do not require root access.

      How to return the warranty after flashing?

      Technically, you cannot return the warranty, but you can hide it traces of hacking:

      1. Flash the stock firmware via Odin/fastboot.
      2. Close the bootloader with the command fastboot oem lock (on some devices this will reset the data!).
      3. Delete Magisk and that's it modifications.

      However, manufacturers (for example, Samsung or Xiaomi) can check the status of KNOX or RMM, which can only be reset by a full reset through the service center.

      Which firmware is better for games: stock or custom?

      For games, stock firmware with root access is preferable, since custom ones often have problems with:

      • Graphics drivers (for example, Adreno on Qualcomm).
      • Technologies like Game Turbo (on Xiaomi) or Game Launcher (on Samsung).

      If you want custom firmware for games, choose projects with performance optimizations, for example CrDroid or DerpFest.

      Why doesn't the camera work after flashing the firmware?

      This is a typical problem when using custom firmware on devices with proprietary drivers (for example, Samsung Exynos or Huawei Kirin). Solutions:

      • Install an additional module GCam or a patch for the camera.
      • Flash vendor and firmware from the stock firmware.
      • Check whether your model supports custom firmware with a working camera (look for information on XDA).
      Is it possible to flash Android through a computer without TWRP?

      Yes, using fastboot or apps like Odin (for Samsung) or Mi Flash Tool (for Xiaomi). However, this method is only suitable for official firmware. For custom firmware you will still need TWRP or a similar recovery.