Although any android phone is complete with its Android OS and the Kernel, and a Bootloader that boots up the phone, there always needs a maintenance environment in every advanced operating system.
The Recovery menu in android is essentially this maintenance runtime.
What kind of maintenance does Android need?
Well, if you are an average user, you may face the terrible scene where you forgot your pattern or password and needed to send your phone in the service center to reset the lock, with all your valuable data inside. Stock Recovery, that comes preloaded with a phone exists for this. You can enter the Recovery menu via various button combination, then wipe all your data in such emergency. Also, sometimes you need recovery to apply software updates that you get for your phone. This is pretty much all for the stock recovery.
So you don’t need to worry about this now, do you?
Yes you do need to know this, if you are an advanced user and want to root your phone or apply some mods to boost your phone or even flash a custom ROM. A custom recovery has much more features that allow you to do more; for example, to backup and restore your phone’s state if you have done something wrong after rooting your phone and playing with some risky settings.
Android Recovery Explained
But first of all, you need to know how this Recovery works.
Recovery is a lightweight environment that is separate from the operating system.
- What is an environment?
It is a state of your phone (and computers and other smart devices) when you use it after turning it on. When you use your phone normally, taking photos, surfing web or anything you do after you start your phone, you are in the Android environment.
Recovery is such environment that is separate from the OS. You can still have Recovery even if you wipe out the Android OS from your phone completely. So, any damage you do to the OS doesn’t effect Recovery and you then can use this tool to try to fix your phone.
In Recovery menu, every partition in your device is kept read-write. When you have rooted your phone and gain control of partitions (system partition, data partition etc), you can mount them read-write. That means you get control to modify those partitions. In Recovery, you get the same thing, which is required to flash SuperSU to gain root, or other tweaks, or flash custom ROMs and Kernels.
That doesn’t mean you can readily just boot into Recovery and flash any file. As you would expect, the stock recovery of every phone comes with some security checking (called Signature Verification). You can only flash files if they are from the manufacturer of your phone, like official updates. Other files won’t get successfully flashed because they do not contain the digital “signature” of your phone’s manufacturer.
Custom Recovery allows you to flash Custom ROMs, SuperSU to root your phone and custom Kernels; Backup and Restore your phone’s entire OS; Format and repair different partitions and storages; Run commands etc.
This is the reason Android developers made custom Recoveries like TWRP, ClockworkMod or Philz.
Flashing SuperSU or a custom ROM or kerel or any kind of shit is possible via custom recivery. They also give you many additional functions. You can copy (“backup”) every file related to the OS and store them in your storage. So even after hundreds of experiments you do to your phone, if you restore that backup, your phone goes to exact same state as it was before backing up.
This also allows you to clone your phone entirely to another similar.
These Recoveries get you access to your phone’s filesystem and a shell, so even if you cannot turn on your phone, you can still copy files between a computer and that phone.
Those are just a few options to what a custom recovery does. The list is always growing large. But that does not suppress the main purpose of it: the emergency maintenance system if something goes wrong with your phone’s OS.