A โ€‹โ€‹forgotten pattern, PIN code or Google account that cannot be restored are situations familiar to many owners of Android devices. When the phone is locked and the data inside is critical, flashing it is often the only option. However, this process requires caution: incorrect actions can turn the gadget into a โ€œbrick.โ€ In this article, we will look at legal and technically safe ways to flash your smartphone at home, even if it is completely locked. Android-smartphone at home, even if it is completely locked.

It is important to understand: flashing is not a universal solution. On some models (especially those with FRP protection or hardware encryption), it may not work without additional manipulations. In addition, the process erases all data on the device, so if your goal is to save photos or messages, first try alternative unlocking methods (for example, through ADB or service centers).

We will consider three main scenarios: firmware via Fastboot mode (for devices with unlocked bootloader), using custom recovery (TWRP), and bypassing the lock through official manufacturer tools (for example, Samsung Odin or Xiaomi Mi Flash). Each method has its own nuances, so before you start, be sure to determine the phone model and version Android.

1. Preparation: what you need to know before flashing

Flashing a locked phone is always a risk. Even if you follow the instructions, there is a possibility of data loss, damage to system files, or activation of protection FRP (Factory Reset Protection). Before you begin, answer three key questions:

  • ๐Ÿ” Is the bootloader unlocked? On most modern smartphones (for example, Samsung, Xiaomi, Google Pixel), the bootloader is locked by default. Unlocking it erases all data and may require authorization through the manufacturer's account.
  • ๐Ÿ“ฑ Is there a backup copy? Flashing deletes all user data. If there were important files on the phone, try first extracting them via ADB (if debugging is enabled) or contact a service center.
  • ๐Ÿ”ง Is the firmware suitable for your model? Installing the wrong software version can lead to permanent loss of IMEI or damage to the communication module. Always check with official sources or trusted forums (for example, XDA Developers).

Also prepare the necessary tools:

  • ๐Ÿ’ป Computer with Windows, macOS or Linux (depending on the selected method).
  • ๐Ÿ”Œ Cable USB Type-C/Micro-USB (original or high quality).
  • ๐Ÿ“‚ Firmware for your model (official or custom).
  • ๐Ÿ› ๏ธ apps: ADB and Fastboot, phone drivers, Odin (for Samsung) or Mi Flash (for Xiaomi).
โš ๏ธ Attention: On devices with Android 10+ and hardware encryption (for example, Samsung Knox or Google Titan M), flashing can lead to irreversible locking of the bootloader. Before you start, check whether your model supports unlocking via fastboot oem unlock.
๐Ÿ“Š What phone do you have?
Samsung
Xiaomi/Redmi
Google Pixel
Huawei/Honor
Another brand

2. Method 1: Flashing via Fastboot (for devices with an unlocked bootloader)

The method is suitable for phones where the bootloader is already unlocked (for example, after previous manipulations with the software) or it can be unlocked through a command. This is the most reliable method, but it requires preliminary preparation.

If the bootloader is locked, first unlock it:

  1. Turn off the phone and hold down the key combination to enter Fastboot (usually Volume down + Power).
  2. Connect the device to the PC and enter in the terminal:
    fastboot oem unlock

    On some models (for example, Xiaomiyou will need to link your account Mi:

  3. fastboot oem unlock-go
  4. Confirm unlocking on the phone screen (if prompted).

After unlocking the bootloader, you can proceed to firmware:

  1. Download the official firmware for your model (for example, from the site Xiaomi, Google or LineageOS for custom assemblies).
  2. Unpack the archive with the firmware into the folder with fastboot.
  3. Open the terminal in this folder and execute the firmware command. For Google Pixel this could be:
    flash-all.bat

    For other models, use:

    fastboot flash boot boot.img
    

    fastboot flash system system.img

    fastboot flash recovery recovery.img

    fastboot reboot

โš ๏ธ Attention: On devices with Dynamic Partition (for example, Pixel 3+, OnePlus 7+) instead of individual commands, use fastboot update --skip-secondary file_name.zip. Otherwise, the phone may freeze on the logo.

Download the official firmware for your model|

Install ADB/Fastboot drivers on your PC|

Unlock the bootloader (if locked)|

Create a backup copy of your data (if possible)|

Charge the phone at least 50%-->

3. Method 2: Installing a custom recovery (TWRP) to bypass the lock

If the bootloader is locked, but the phone has custom recovery installed (for example, TWRP), you can flash the device without completely unlocking it. This method is suitable for old models or devices with root access.

Instructions:

  1. Download the image TWRP for your model from the official website twrp.me.
  2. Download the phone into mode Fastboot and flash the recovery:
    fastboot flash recovery twrp-3.7.0_9-0-lavender.img

    (replace lavender with your model code).

  3. Immediately after flashing, press Volume up + Powerto enter TWRP (otherwise the system will overwrite the recovery).
  4. V TWRP select Wipe โ†’ Format Data (this will delete all data, including locking).
  5. Download the firmware to an SD card or connect the phone to the PC in MTP via mode, then flash the ZIP file via TWRP, then flash the zip file via Install.

The advantage of this method is the ability to bypass FRP (protection after reset) on some devices. However, on new smartphones (for example, Samsung Galaxy S22+ or Google Pixel 6) TWRP may not work due to hardware limitations.

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

If after installing TWRP the internal memory is not mounted, try:

1. In the TWRP menu, go to Mount โ†’ Enable MTP.

2. Connect the phone to the PC and copy the firmware manually.

3. If that doesn't help, use an OTG cable and a flash drive with firmware.

On some devices (for example, Xiaomi c MIUI 12+) you may need to disable encryption via Format Data โ†’ F2FS (risk of data loss!).

4. Method 3: Official tools of manufacturers

Some brands provide their own utilities for firmware that can bypass the lock without unlocking the bootloader. Let's look at the most common ones:

Brand Tool Features Download link
Samsung Odin Flashes official and custom software, but requires files in format .tar.md5. On new models it can be blocked Knox. odindownload.com
Xiaomi/Redmi/Poco Mi Flash Tool Works only with official firmware in the format .tgz. Requires authorization in Mi Account to unlock. Xiaomi Official Website
Google Pixel Android Flash Tool Official web tool for flashing. Supports unlocking the bootloader and installing factory images. flash.android.com
Huawei/Honor HiSuite or eRecovery On new models, firmware is only possible through eRecovery (keyboard combination at boot). HiSuite does not bypass the lock. Huawei Official Website

Example of firmware via Odin for Samsung:

  1. Download the firmware in format .tar.md5 (for example, with samfw.com).
  2. Run Odin, connect the phone in the mode Download Mode (Volume down + Bixby + Power).
  3. In Odin select the firmware files in the appropriate fields (BL, AP, CP, CSC).
  4. Click Start and wait until it finishes (the phone will reboot automatically).
โš ๏ธ Attention: On Samsung s One UI 4.0+ firmware via Odin can reset Knox to 0x1, which voids the warranty and blocks Samsung Pay, Secure Folder etc. functions.
๐Ÿ’ก

If after flashing via Odin the phone is stuck on the logo, try re-flashing with the option Home_CSC instead CSC - this will save user data (but does not always work on locked devices).

5. Bypassing FRP (Factory Reset Protection) after a reset

If you have successfully flashed your phone, but after turning it on, it requires you to enter data from your previous Google account (FRP blocking), additional steps will be required. On new versions Android (11+) it is almost impossible to bypass FRP legally, but for older devices there are ways.

Bypass methods (do not work on all models):

  • ๐Ÿ”‘ Through Wi-Fi settings: When connected to the network, on the lock screen, tap on the input field password, then go to Additional settings โ†’ Send feedback. In the browser window that opens, download FRP Bypass APK.
  • ๐Ÿ“ž Via emergency call: Dial ##4636##, then go to Usage statistics โ†’ Settings i disable FRP.
  • ๐Ÿ–ฅ๏ธ Via ADB: If debugging is enabled, connect the phone to the PC and do:
    adb shell am start -n com.google.android.gsf.login/
    

    adb shell am start -n com.google.android.gsf.login.LoginActivity

On devices with Android 9+ and hardware protection (for example, Samsung Knox or Google Titan) these methods do not work. The only way out is to contact the service center with proof of ownership (receipt, box, linked SIM card).

๐Ÿ’ก

FRP blocking is not a bug, but a security feature. On devices with Android 10+ its bypass often requires physical intervention (for example, resoldering EEPROM), which is not available at home.

6. Risks and how to minimize them

Flashing is always a compromise between restoring the phone's functionality and potential problems. Main risks:

  • ๐Ÿ’€ "Brick" (inoperative device) - occurs when a process is interrupted, incompatible firmware or errors in Fastboot.
  • ๐Ÿ“ต Loss of IMEI - on some models (for example, MediaTek) the firmware erases the module data communication.
  • ๐Ÿ”’ Account blocking - on Xiaomi or Samsung after the firmware, authorization at the service center may be required.
  • ๐Ÿ›ก๏ธ Loss of warranty โ€”unlocking the bootloader or installing custom software will void the warranty of most brands.

How to reduce risks:

  • Use only official firmware or proven custom builds (for example, LineageOS).
  • Before flashing, check the hash of the downloaded file (for example, via MD5 Checker).
  • Do not interrupt the process, even if it is frozen. The average firmware time is 5-15 minutes.
  • On devices c Qualcomm use QFil or EDL mode to recover from unsuccessful firmware.
โš ๏ธ Attention: On phones with processors MediaTek (for example, Redmi Note 8, Realme 5), incorrect firmware can damage DA file (Download Agent), which will make the device unsuitable for recovery without specialized equipment.

7. Alternative unlocking methods (if the firmware did not help)

If you were unable to reflash your phone or you are afraid of the risks, consider alternative unlocking methods:

  • ๐Ÿ”„ Reset via Find My Device: If a Google account is linked to your phone, go to findmydevice.google.com and select โ€œErase device.โ€ This will delete the lock, but also all data.
  • ๐Ÿ“ž Contacting the service center: Official centers (for example, Samsung Service or Xiaomi Authorized) can unlock the phone using documents (passport, check). Cost - from 1000 to 5000 rubles.
  • ๐Ÿ’ณ Paid online services: There are sites that generate unlock codes for money (for example, for Samsung FRP). The risk of fraud is high - use only trusted resources.
  • ๐Ÿ”ง Hardware intervention: On some models (for example, Huawei or Meizu) the blocking can be removed through Test Point (closing the contacts to board). Requires a soldering iron and experience.

If the phone is locked due to pattern key or PIN codeand ADB enabled, try deleting the lock file via command:

adb shell rm /data/system/gesture.key

adb shell rm /data/system/password.key

adb reboot

This method only works on Android 5โ€“7. On new versions, the locking data is stored in an encrypted section.

FAQ: Frequently asked questions about flashing locked phones

โ“ Is it possible to flash a phone without losing data?

No, flashing always erases user data. If you need to save the files, try to extract them via ADB pull (if debugging is enabled) or contact a service center to remove the memory chip (eMMC).

โ“ Why Odin shows an error FAIL!?

Frequent reasons:

  • Incompatible firmware version (for example, firmware for Galaxy S10 on S10e).
  • Locked bootloader (required OEM Unlock in developer settings).
  • Damaged USB cable or port.
  • Lack of drivers Samsung USB Driver.

Solution: check your phone model, download the correct firmware and use the original cable.

โ“ How to find out if the bootloader is unlocked?

Turn off the phone and hold down the combination to enter Fastboot. If there is an inscription at the bottom of the screen Device State: Unlocked the bootloader is unlocked. If Locked โ€”unlocking is required.

โ“ Is it possible to flash a phone via an OTG cable without a PC?

Theoretically yes, but in practice it is extremely difficult. You will need:

  • OTG cable and USB flash drive with firmware.
  • Custom recovery (TWRP), installed in advance.
  • Knowledge of commands for manual firmware via adb sideload.

Without a PC, this method only works on older devices (for example, Samsung Galaxy S5).

โ“ What to do if there is no network after flashing the firmware?

This means that the firmware is not compatible with the modem of your device. Solutions:

  • Flash the file separately modem.bin or NON-HLOS.bin via Odin/Fastboot.
  • Install the firmware with the same region (CSC) as the original one.
  • On MediaTek check IMEI via *#06#. If it is reset, restore it via Maui META or SN Writer.