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
- Via fastboot for devices with unlocked bootloaders
- Mediatek devices via mtkclient
for more guides see these posts mtk/spflash tools
Via Fastboot for Devices with Unlocked Bootloaders
What you need
- ADB and fastboot platform-tools
- The files for the ROM (usually ending in .bin or .img)
- Sometimes you will need drivers (usually on windows)
Unlocking the Bootloader
- On your phone go to Settings > About and tap on build number 7 times to open Developer Options
- Go to setting > System > More Options > Developer Options and find OEM unlock, toggle it to unlocked (it may say already unlocked)
- 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
- Once in fastboot mode open a command prompt window in platform-tools and run
fastboot flashing unlock
oroem unlock
(depending on the device). A confirmation sequence may pop up on the phone. - 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)
- 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 commandfastboot flash vbmeta --disable-verity --disable-verification vbmeta.img
- 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
- 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)
- Follow this guide for setup on windows (no need if using the livedvd)
flashing the rom
- Run mtkclient
- 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.
- Once it’s recognized press the “unlock bootloader” button on mtkclient
- 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.
- 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.