CustomDroid

How to restore stock firmware and unbrick your phone

A phone that won't boot after a flash is usually not dead. Most “bricks” are recoverable with the manufacturer's own firmware and tools, as long as you work out which kind you have and resist the urge to keep flashing things until something sticks.

Soft brick or hard brick?

  • Soft brick— the phone bootloops, hangs on the logo, or boots straight to recovery, but you can still reach the bootloader (fastboot), Samsung's Download mode, or recovery. This is by far the common case, and stock firmware almost always fixes it.
  • Hard brick — a black screen with no bootloader at all. At most, your computer sees a low-level chip port: Qualcomm HS-USB QDLoader 9008 or a MediaTek preloader/BROM port that appears for a second. Recovering from here needs chip-level tools, covered below.

Not sure? Force a restart, then try your phone's key combination for the bootloader — the install guide for your device lists it. If the computer can't see it in any mode, check the USB driver and cable before assuming the worst.

Before you do anything else

  • Don't relock the bootloader to “fix” it.Locking a phone that can't boot signed firmware is how a soft brick becomes a hard one.
  • Use firmware for your exact model and region. The model number, not the marketing name — carrier and regional variants differ.
  • Never go older than what the phone last ranunless the maker says it's safe. Anti-rollback protection can permanently refuse old bootloaders: Google's factory images page warns that after certain monthly updates, some Pixel models can no longer boot older builds.
  • Charge it. A battery dying mid-flash is its own kind of brick.
  • Download only from the maker or the upstream project.“Unbrick tool” sites are a malware magnet.

The official route, brand by brand

Restoring stock almost always wipes the phone, and anything you didn't back up before flashing is gone. The tool to use depends on the maker:

Google Pixel

Google gives you the best options of any maker. The Android Flash Tool runs in Chrome or Edge (it needs WebUSB), supports Pixel 2 and newer, and according to its documentation can flash a phone that no longer boots, as long as you can get it into fastboot mode. If you prefer the command line, Google publishes the same factory images for flashing with fastboot. Both need an unlocked bootloader and erase the phone.

If the phone still boots to recovery, a full OTA image sideloaded from stock recovery needs neither an unlocked bootloader nor a wipe — Google calls it the easier and safer route. Google also offers a guided Pixel Update and Software Repair tool.

Coming back from GrapheneOS? Its install guide says to remove its verified-boot key with fastboot erase avb_custom_key before flashing stock, so the phone is fully back to its factory state.

Samsung

Start with Samsung's own route: Smart Switch for PC has an Emergency Software Recovery and Initialization option (under More) for phones stuck after a failed update. It's limited — it handles Samsung's own update failures, not every custom-ROM mess — but it's official and costs nothing to try.

Beyond that, nearly every guide uses Odin. Be clear about what it is: Odin is Samsung's internal service tool, and Samsung doesn't publish it for the public. Every copy online is an unofficial, leaked build, so only use the one your model's XDA forum points to, never a random download site. Heimdall is an open-source tool that speaks the same protocol. Whichever you use, the firmware must match your exact model number (the SM-… code in Settings) and region; firmware for a similar-looking model is a classic way to make things worse.

Xiaomi, Redmi and POCO

Xiaomi publishes fastboot ROMs — full stock images — which you flash with its Mi Flash tool. That needs an unlocked bootloader. Mi Flash offers three modes: clean all, save user data and clean all and lock. Choose clean all. The locking option relocks the bootloader as part of the flash, and if anything about the firmware doesn't match your phone you're left with a locked, unbootable device — read relocking the bootloader before you ever pick it.

Xiaomi also uses anti-rollback protection: firmware older than a version the phone has already run can be rejected, and forcing it through is known to hard-brick. Flash the version your model's forum confirms is safe, not simply the oldest one you can find.

OnePlus

OnePlus's last-resort tool is the MSM Download Tool, which its service centres use to reflash phones through Qualcomm's emergency download mode (EDL, the 9008port). OnePlus doesn't publish it for the public; packages circulate in each model's XDA forum, and they are specific to model and region. Newer models may have no public package at all, in which case OnePlus support is the route.

Motorola

Motorola's official repair tool is Software Fix, a Windows app formerly called Rescue and Smart Assistant (you'll still see it downloaded as RSA). It reflashes the phone's official software; Motorola advises backing up your data before you use it.

Sony Xperia

Sony's Xperia Companion for Windows and macOS has a Software repair option, documented in the Xperia help guides for phones that won't start, keep restarting, or broke after an update. Sony warns it reinstalls the software and you may lose personal data, and that you'll need your Google account details afterwards. Reflashing doesn't bring back the DRM keys that unlocking erased.

Last resort: EDL and BROM

Below the bootloader, most phones have a mode burned into the chip itself — Qualcomm's Emergency Download (EDL) mode and MediaTek's BootROM (BROM). They can rewrite every partition, which is why they can revive a phone with no working bootloader, and also why they can finish one off.

  • You need files made for your exact device — for Qualcomm, a signed programmer that matches the phone — and many makers lock these modes behind authorised service accounts. Xiaomi's EDL flashing, for example, needs an account only service centres have.
  • For MediaTek, the open-source mtkclient project is the reputable starting point; it documents which chipsets it supports.
  • Some phones only enter these modes by shorting test points on the board, which means opening the phone.
  • A wrong or full-erase flash at this level can destroy data that exists nowhere else, such as the partitions that hold the IMEI and radio calibration. No stock firmware package can restore those.

When to stop and get it repaired

It's time to hand it to the manufacturer or a repair shop when:

  • No computer sees the phone in any mode, with a known-good cable and port.
  • The only way back is an EDL or BROM flash that needs an authorised account.
  • The phone boots but shows no IMEI or no mobile signal after a low-level flash — that usually means lost calibration data, not a software setting.
  • It gets hot while powered off, or the battery looks swollen. Stop immediately.
  • You're about to pay a stranger for “remote unbrick” or run a tool you can't trace to its author.

An official service centre has flashing tools and accounts you don't. If the bootloader was unlocked the repair may not be covered by warranty, but a paid software reflash is usually far cheaper than a replacement phone.

Next

Back on stock and want to try again? Check the error you hit last time, confirm your codename matches the build, and search your phone for a ROM with an official build for it.