General Guide to Flashing ROMs

Intro

Flashing a ROM means putting a new system on your phone, it could be a modified version of the original system, the original system, or a totally different system. This Guide will give you general information on flashing a ROM but keep in mind that specifics can vary from one device to another and ROMs that will work will one may not work with another. Make sure to follow instructions specifically for your device. Most of the time you will be flashing only specific parts of the system; system.img, product.img and vendor.img, which, from android 10 and on, are all inside of the super.img

Methods

There are quite a few methods to flashing, here I will discuss two of them

  1. Via fastboot for devices with unlocked bootloaders
  2. Mediatek devices via mtkclient
    for more guides see these posts mtk/spflash tools

Via Fastboot for Devices with Unlocked Bootloaders

What you need

  1. ADB and fastboot platform-tools
  2. The files for the ROM (usually ending in .bin or .img)
  3. Sometimes you will need drivers (usually on windows)

Unlocking the Bootloader

  1. On your phone go to Settings > About and tap on build number 7 times to open Developer Options
  2. Go to setting > System > More Options > Developer Options and find OEM unlock, toggle it to unlocked (it may say already unlocked)
  3. After unlocking the bootloader you will need get into fastbooot mode, depending on the device you can do that by running adb reboot fastboot OR turning the device on while holding the volume+ or volume- button (depending on the device) OR choosing reboot to fastboot/bootloader from recovery OR using autobooter

Flashing

  1. Once in fastboot mode open a command prompt window in platform-tools and run fastboot flashing unlock or oem unlock (depending on the device). A confirmation sequence may pop up on the phone.
  2. It makes things simpler if the files you are flashing are in the platform-tools folder befor you start flashing (to avoid putting the filepath in the commands)
  3. Run fastboot flash partition partition-file.img replacing “partition” with the partition name (e.g. system) and “partition-name.img” with the file name (e.g. system.img). It is a good idea to first flash vbmeta.img with this command fastboot flash vbmeta --disable-verity --disable-verification vbmeta.img
  4. For flashing super.img or partitions within super.img it may be faster to use fastbootd (it only works for super and partitions within super) by running fastboot reboot fastboot and then running the regular flash commands. Fastbootd may need different drivers.

Mtkclient

What you need

  1. mtkclient (I like to use the livedvd v4, it comes with mtkclient all set up. Use rufus to install the iso file a clean usb)
  2. Follow this guide for setup on windows (no need if using the livedvd)

flashing the rom

  1. Run mtkclient
  2. While your phone is turned off, plug it in to the computer (some phone buttons may need to be pressed, depending on the device) and wait for mtkclient to recognize it.
  3. Once it’s recognized press the “unlock bootloader” button on mtkclient
  4. open the “write” tab on mtkclient and choose the partitions that you want to flash, you will be prompted to select a file for each partition. afterwards press the “write” button and wait for it to complete.
  5. some devices require you to flash the vbmeta file via fastboot with fastboot flash vbmeta --disable-verity --disable-verification vbmeta.img , see the previous guide on how to do that.
1 Like