Saturday, January 3, 2015

rom flashing - Why is root access required for a custom ROM?


I'd like to be clear, and as my question indicates, I'm very ignorant of mobile devices in general so my apologies if this is common knowledge.


Say I want to install a custom ROM onto a device, then it would appear I need root access. I'm able to find out from every web page on how I can root a device, but I'm unable to find how why I need to root a device. I understand that rooting a device simply gives me root access on the device, but why is this needed? If I connect the phone to a PC then doesn't that give me access to the entire file system of the device? If so, then why can't I just overwrite the relevant parts of the FS with whatever ROM I want?


Also, why would rooting and using a custom ROM cause a device to be bricked? Couldn't I just overwrite the ROM that was causing the issue with the original one (that I'd thought on to back up! ;)).



Answer



Short answer:



For security and warranty reasons.


Detailed answer:


This is mostly a precaution taken by most (not all!) device manufacturers to save them from too many service requests from "playing kiddies" (and the sort of people who want to try everything, even if they are not understanding anything). So those manufacturers took special actions to avoid "custom ROMs" (or, more precisely, any ROMs not provided by themselves) to be flashed.


As t0mm13b already pointed out in his comments above, by default you do not get physical access to your devices file system simply by connecting it via USB. Depending on device, Android version, and some more criteria, you get only to see parts. This might be the entire SD card (physical, in UMS mode), or even only "logical" access to parts of it via MTP. Some more privileged access can be gained via ADB when enabling USB Debug -- but with a stock ROM, in none of these cases you gain full access.


Now how are updates accomplished then? One very common practice is the use of a special ZIP file (update.zip). This is placed on the SD card, which is inserted into the device, and the device is booted into a special mode (recovery), where the update.zip can be applied from. BUT: the device checks the integrity of that update.zip -- it must be signed with the manufacturers key. For obvious reasons, that key is not freely available -- so no custom ROM can be installed this way on such a stock system.


All these things can be circumvented only with super-user access to the device -- which means: you must root it.


So that's for the WHY part -- while not handling the HOW part of rooting. Exactly as you asked for :)




Update for even more details


As Liam pointed out in his comment that using fastboot would be a method to flash Custom ROMs without the pre-condition of having the device rooted, I did a little more research to find out about this. I will continue looking into this, but still already wanted to add my first results here.



Up to a certain point, Liam is right with this: It seems not only valid to Samsung devices (as I assumed first), but some other devices (not all) also support this method, without root being involved (aside from the fact that most Custom ROMs will ship rooted, of course -- so you will have root available after installing them). However, there are devices which seem to require root even for fastboot flash (see e.g. TheUnlockr concerning the Iconia A100, quote: You must have rooted your device before doing this procedure. -- and yes, they use fastboot flash recovery recovery.img afterwards).


However, even if fastboot works for your unrooted device, there is one crucial point to consider:



To Flash a ROM for your Android device with fastboot you must have an unlocked bootloader or an engineering bootloader



(Flashing Guide - Android - XDA-Developers)


Which means: If your bootloader is locked, you need to unlock it first, which will wipe (factory-reset) your device. So all data will be gone for good this way -- while with root you could have done a complete backup (Nandroid, Titanium Backup) before this step. However, starting with Android 4.0, this is no longer a real problem -- as you can do a full backup via ADB (see: Full Backup of non-rooted devices)




Summary:


There are devices requiring to be rooted before you can flash a Custom ROM. If your device falls into this category, the reasons for Why is root access required to flash a Custom ROM are those mentioned above.



However: There are also devices which can be flashed using fastboot without being rooted before. If your device falls into that category, the question Why is root access required to flash a Custom ROM becomes invalid (the answer not, as ex falso quodlibet sequitur ("from false can follow anything") you can draw any conclusion from a wrong premise :)


That is: IF rooting is required, the above is WHY.


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...