You may come across the Android terms Clean flash and Dirty flash, referred when flashing through TWRP recovery. TWRP can flash zip files to your system storage. Everything from ROM to features on device distributed as zip files to flash called as Flashable zips. To Know whether to perform a Clean flash or Dirty flash, Once should classify the zip file, accordingly as a ROM zip or an Add-on zip file. Flashing is nothing but installing a required component, often referred as Flash in short. Ex: Flash a zip, Flash Su zip..etc.
- Add-on Zip’s are additional zip files which provide additional functionalities for the ROM on your device. So, these are flashed up on your existing ROM on your device, without WIPING system partition. Most often, we flash add on zip files using TWRP recovery. Few examples of these zip files include GApps, Xposed Framework, Magisk, Supersu, Flashable boot logos, dm-verity….etc.
- ROMs are most important things to boot your device. Users can change the ROMs/ Update to a new build by flashing a new ROM zip. However, make sure that you are flashing a correct ROM zip suitable for your device model.
Clean Flash:Simply, Clean flash is performed while flashing a New ROM zip file, after Factory resetting/wiping out the all the components like Internal partition and system. A clean flash should be performed when you are changing to a new Custom ROM. In a Clean Flash, the present Operating System will be completely erased, along with all your data present in the system partition.
The sequence to perform a Clean Flash:Go to TWRP >> Wipe / Factory reset >> Flash custom firmware and kernels(if Any, or else SKIP) >> Flash the new Custom ROM zip files >> Clear Cache/Dalvik >> Reboot system.
Note: while some custom ROMs didn’t require Custom firmware or kernels, some may need the Firmware and kernel changes. You should confirm this from the XDA Developers forum of the Custom ROM, as we previously mentioned about kernels.