Forgot your pattern key, PIN code or password for your Android smartphone? The screen is locked after an unsuccessful unlock attempt, but a factory reset via Recovery doesn't help? In such cases, flashing via a computer is often the only way to bring the device back to life. However, the process requires caution: incorrect actions can turn the phone into a โbrickโ or lead to loss of warranty.
In this article we will look all stages of flashing from preparing the PC and choosing the appropriate firmware to restoring data after unlocking. We will pay special attention Samsung, Xiaomi, Huawei models to other popular brands, as they have their own nuances. We will also explain why standard methods like Hard Reset may not work and when you cannot do without firmware.
We warn you right away: the procedure is suitable for users with basic PC skills. If you have never encountered ADB, Fastboot or Odin, it is better to contact a specialist - an error at any stage is fraught irreversible loss of IMEI or damage to the bootloader.
1. When is flashing via PC needed, and when can you do without it
Not every blocking requires radical measures. Before you start flashing the firmware, check whether your case is suitable for simpler solutions:
- ๐ Forgot pattern key/PIN โ try unlocking through your Google account (if the device is connected to the network) or service Find My Device.
- ๐ฑ The phone freezes on the logo โmaybe a reset via
Recovery Mode(button combination) will help depends on the model). - ๐ซ The device is locked after an unsuccessful update โ here firmware is often the only way out, especially if the system partition is damaged.
- ๐ง The smartphone is โbrickedโ after rooting โa flashing with bootloader recovery is required (bootloader).
Flashing via PC is necessary in three cases:
- Locked at level bootloader (the phone does not boot even into
Recovery). - Damage to system files, due to which a reset via the recovery menu is impossible.
- Factory Reset Protection is activated, and you do not remember your Google account information. FRP (Factory Reset Protection) and you don't remember your Google account information.
โ ๏ธ Attention: On some models Samsung (for example, series Galaxy S22+) after the firmware the counter may be reset Knoxwhich will void the warranty. Xiaomi the ability to unlock the bootloader is blocked for 7-30 days after the reset.
2. Preparing the computer: what needs to be installed and configured
For the PC to โseeโ a locked phone, you will need special software:
- ๐ฅ๏ธ Drivers for your model - without them, the computer will not recognize it. device in
FastbootorDownload Modemodes. Samsung needed Samsung USB Driver, for Xiaomi โ Mi PC Suite. - ๐ง Firmware tools:
- Odin โfor devices Samsung;
- Fastboot (included in Android SDK Platform-Tools) - for most other brands;
- SP Flash Tool - for Mediatek-chips;
- QFil - for Qualcomm.
- ๐ Firmware (ROM) - must be compatible with your model and bootloader version.
Where to get firmware:
| Brand | Official source | Third-party resources |
|---|---|---|
| Samsung | Sammobile, Frija | SamFW, SamMobile (paid) |
| Xiaomi | Mi Flash Tool (built-in bootloader) | Xiaomi Firmware Updater |
| Huawei/Honor | Huawei Support (requires an account) | Firmware Finder |
| Realme/Oppo | Realme UI Download | Oppo Firmware |
Important: never download firmware from torrents or little-known sites โthere is a high risk of running into viruses or modified versions with backdoors. Official firmware usually has the extension .zip or .tar.md5 (for Samsung).
Install drivers for your model|
Download official firmware (check the version!)|
Unpack Platform-Tools to the root of the disk C:\|
Disable the antivirus (it can block Odin or Fastboot)|
Charge the phone for at least 50%-->
3. Unlocking the bootloader: without this, the firmware will not work
On most modern Android devices, the bootloader (bootloader) is locked by default. This is a protection against unauthorized changes, but also a barrier to the firmware:
- Turn it on on your phone developer mode (if the device still reacts somehow):
Settings โ About phone โ Build number (tap 7 times)Then return to
Settings โ System โ For developersand activateOEM unlockingiUSB debugging. - Connect the phone to the PC and execute the
Fastbootcommand:fastboot oem unlockFor Xiaomi use
fastboot oem unlock-go(after unlocking via Mi Unlock Tool). - Confirm unlocking on the phone screen (if it turns on).
Please note:
- ๐ On Samsung unlocking the bootloader resets Knox and cancels guarantee.
- โณ Xiaomi requires linking an account and waiting (from 7 days) before unlocking.
- ๐ต Some operators (for example, Verizon in the USA) block unlocking at the firmware level.
โ ๏ธ Attention: After unlocking the bootloader of the phone will do full reset (all data, including photos and applications will be deleted). If you need to save the information, try first extracting it via ADB (if debugging was enabled before blocking).
What to do if the phone is not detected in Fastboot?
If the command fastboot devices does not show your device:
1. Check the cable (use the original USB-Type C).
2. Try another USB port (preferably 2.0 on the rear panel). PC).
3. Reinstall the drivers manually via Device Manager (select Android Bootloader Interface).
4. Disable driver signing in Windows (to do this, temporarily switch the system to Test mode).
4. Step-by-step guide: firmware via Fastboot (for most brands)
This method is suitable for devices on chips Qualcomm and Mediatek (except Samsung). Before you start, make sure that:
- ๐ The phone is charged at least 50%;
- ๐ฅ๏ธ Antivirus and firewall are disabled on the PC;
- ๐ The firmware is unpacked into the folder with
fastboot.
Step 1. Put the phone in Fastboot mode
Turn off the device. Then hold:
- For Xiaomi/Redmi/Poco:
Power + Volume Down; - For Google Pixel:
Power + Volume Down(hold for 10 sec); - For OnePlus:
Power + Volume Up.
A robot should appear on the screen Android with the text Fastboot Mode.
Step 2. Checking the connection
Open the command line in the folder c fastboot and enter:
fastboot devices
If the device is detected (its serial number appears), you can continue.
Step 3. Firmware
Commands depend on the type of firmware:
- For full firmware (all sections):
fastboot flash boot boot.imgfastboot flash system system.img
fastboot flash vendor vendor.img
fastboot flash dtbo dtbo.img
fastboot flash vbmeta vbmeta.img
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
fastboot reboot - For updates without data loss (system files only):
fastboot flash system system.imgfastboot reboot
โ ๏ธ Attention: If the firmware contains a filevbmeta.img, it required needs to be flashed with flags--disable-verity, otherwise the phone will go into a loop on loading.
If the firmware weighs more than 4 GB, use fastboot -S 256M before each command - this will speed up the process by increasing the size of transmitted packets.
5. Samsung firmware via Odin: features and nuances
Samsung uses its own firmware protocol, so it will not work here Fastboot. Instead, you need tool Odin (version 3.14.4 or later). You can download it on the forums XDA Developers or SamMobile.
Step 1. Preparing the firmware
Firmware for Samsung usually supplied in the format .tar.md5. Do not unpack them! Odin works with the archive directly. Make sure that the file name contains the abbreviation of your model (for example, SM-G975F for Galaxy S10+).
Step 2. Launch Odin and connect the phone
- Open Odin as administrator.
- Transfer the phone c
Download Mode:Turn off the device โ PressPower + Volume Down + Bixby(orHomefor older models) โ PressVolume upto confirm. - Connect your phone to the PC. A message should appear Odin a message should appear
Added!and the blue indicator in the field should light up.ID:COM.
Step 3. Setting up Odin and flashing
B Odin:
- Click
BLand select fileBL_*.tar.md5(bootloader); - Click
APand select fileAP_*.tar.md5(system + recovery); - Click
CPand select fileCP_*.tar.md5(modem); - Press
CSCand selectCSC_*.tar.md5(if you need a full reset) orHOME_CSC(to save the data).
After downloading all the files, press StartThe process will take 5-15. minutes. When finished, PASS!, and the phone will reboot.
On new models Samsung (for example, Galaxy S23) firmware via Odin may require disconnection VBMeta via command fastboot --disable-verity flash vbmeta vbmeta.img to use Odin.
6. Data recovery after flashing: what can be returned
Flashing via PC almost always leads to the loss of user data. However, some information can be restored:
- ๐ท Photos and videos - if they were stored on
SD cardor in the cloud (Google Photos, Yandex Disk). - ๐ Contact โ synchronize with your Google account after flashing the firmware.
- ๐ Documents โcheck the folder
Downloador the cloud services trash. - ๐ฎ Game Saves โ if the game supports cloud saves (for example, through Google Play Games).
To recover deleted files directly from the internal memory, you can use apps like DiskDigger or EaseUS MobiSaver, but the chances are slim - the firmware often overwrites the data. If the phone was determined in ADB before blocking, try extracting the files with the command:
adb pull /sdcard/ C:\Backup\
For rootusers there are more advanced methods, for example, creating a partition image /data via dd, but this requires deep knowledge.
โ ๏ธ Attention: Do not install data recovery apps on the phone itself immediately after flashing the firmware - they can overwrite the remaining fragments of files. Use another computer or cloud.
7. avoid
Even if you follow the instructions, problems may arise. Let's look at the most common ones:
| Error | Cause | Solution |
|---|---|---|
FAIL! (Auth) c Odin |
Incompatible firmware version or locked bootloader | Check your phone model and version Bootloader. For new Samsung a patch may be required via Magisk. |
fastboot: error: cannot load 'system.img' |
The firmware file is damaged or there are insufficient rights | Download the firmware again and run the command line as administrator. |
| The phone is stuck on the logo after firmware | Not flashed vbmeta or damaged bootsection |
Repeat the firmware with the flag --disable-verity or flash boot.img separately. |
| Odin does not see the device | Missing drivers or incorrect USB port | Install Samsung USB Driver and try the port USB 2.0. |
If after flashing the phone does not turn on or gives an error DM-Verity, try:
- Flash
vbmetawith checking disabled:fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img - Reset via
Recovery(if the phone reacts at least somehow). - Repeat the firmware with a different version of the software (for example, an older one).
FAQ: Answers to frequently asked questions
Is it possible to flash a phone without unlocking the bootloader?
No, on most modern devices (except some Mediatek-chips) firmware without an unlocked bootloader is impossible. The exception is official updates via Odin for Samsung, but they will not help when the screen is locked.
Will I lose the warranty after updating the firmware?
Yes, if you unlock the bootloader. U Samsung the counter is triggered Knox, and Xiaomi โthe ability to re-unlock is blocked for 7-30 days. Warranty centers may refuse to repair if they find traces of the firmware.
How to find the phone model if it does not turn on?
Look at the sticker under the cover (battery) or on the box. You can also determine the model by the serial number through services like IMEI.info (if you know the IMEI).
Is it possible to flash the phone via Mac or Linux?
Yes, but for this you will need to configure Fastboot and the drivers manually. On Mac use Homebrew to install android-platform-tools. For Linux additional rules may be needed udev to recognize the device.
What to do if after the firmware there is no network (IMEI has disappeared)?
This means that the partition is damaged modem or EFS. To restore IMEI:
- Find a backup copy of the folder
/efs(if you made a backup before the firmware). - Flash the original
modem.binvia Odin (for Samsung) orFastboot. - Use tools like ChimeraTool (paid) to repair IMEI.
โ ๏ธ IMEI repair may be illegal in some countries - check local laws.