157
Guide (Beginner's guide) - Root - ROM's - Recoveries - Kernel's

  1. thisguysayswht
    Ice Cream Sandwich May 12, 2014

    thisguysayswht , May 12, 2014 :
    I decided to write this guide because I've seen a lot of people that are confused about the relationship between various types of custom android software (given that this is a cyanogen phone). Feel free to add any suggestions for amendment, or ask any unanswered questions in the comments.

    What is root?

    Root privileges allow the user to modify system files. This includes, adding/removing/changing any file, adding/removing/changing directories, and changing file permissions. On android (or most other "mobile OS"), this is not usually possible in the stock software state. Root permissions on android, are usually acquired by "copying" the permissions of an essential system application, then applying those permissions to the application of your choice. This means that if you grant "root" to an application, it will have all permissions possible in your system. For the sake of the simplicity of this guide, you can compare it to administrative privileges in windows. Anyone with experience with a Linux distribution should feel at home with the concept. Here is a more detailed explanation via Wikipedia.

    http://en.m.wikipedia.org/wiki/Superuser

    Why do I want to root my android phone?

    The reason people root there android devices varies widely depending on the user. For some its the ability to write application data to the SD card, another may want to enable a WiFi hotspot on a phone that didn't come with the software capability, but has the supported hardware. Some of the more common things are simple UI mods such as centering you status bar clock, or changing the color of your battery indicator, all the way down to full blown theme's.

    Are there any risk's involved with rooting my android phone?

    Yes, anyone who tells you otherwise is a liar. Modifying system files on any operating system is dangerous to varying degrees (usually directly related to the knowledge the individual has of what exactly they are modifying). Root privileges on android does not only carry the risk of damaging your system thru modification's, but also a security risk. This is why most one click root tools come with there own permission manager. It is also good general procedure to keep adb debugging enabled, to keep open the bridge between your PC, and android device, should you need to push or pull files, add or remove directories, change file permissions, etc., while your device is on the operating table. Leaving adb debugging on comes with its own security disadvantages as well, not only in situations of rogue/malicious applications, but in situations of physical security attacks.

    Will rooting my android phone void my warranty?

    Yes, it probably will, but in a lot of situations you will be able to install the software that came with the phone, with no traces that anything has been done to the system. This is not true for all devices though, and I suggest you cheek out your devices forum on xda for more information regarding your devices specific warranty, and factory restore options.

    XDA developers:


    http://www.xda-developers.com

    What is a custom ROM?

    ROM stands for "read only memory", your microwave has a ROM, your TV has a ROM, your DVD player, and even you washer, drier, oven, etc., may or may not have "ROM". If it has a display that can show information based off of user input, and its not designed to be modified from its factory configuration, then it's probably "got a ROM". So when your talking about android, a "custom ROM" is software that was made by someone (or a group of people), other than the OEM. This includes, but is not limited to, modified android operating systems based off AOSP... Such as, paranoid android, AOKP, jellyBAM, miui, or cyanogenMOD (although cyanogenMOD is a bit farther away from other AOSP based ROM's. For example, you cannot flash an AOSP kernel, on a cyanogen ROM). A custom ROM can even be composed of completely ground up software, such as Firefox OS, and Ubuntu touch based systems. It can even refer to a stock AOSP (android open source project), based ROM, that has been compiled for a device with ROM's that come custom with the device (sence, touchwiz, etc.). Android ROM's sometimes come with there own kernels built in, which is why when flashing a ROM/kernel combo, it is done by first flashing a ROM, and then flashing a kernel "over it". I would also like to point out here that although it usually requires root to install a custom ROM, a custom ROM is not necessarily rooted, and you may have to flash the SU binary scrip "over" the ROM, to regain root access (although most custom ROM's come prerooted).

    "ROM" is usually a misnomer on android, since the flash memory modules in most smartphones is of the read/write kind (but, for the sake of simplicity, I Shall call them "read only memory software", or "ROM" since, "ROM's" usually replace files with "read only permissions", and most of the android community calls them, "ROM's" ((although its "wrong", or "slang"...)). It should also be pointed out that ROM's are device specific, so don't flash a ROM for a gs3, on a gs4, or a nexus 5, it won't turn out pretty, you have been warned. (Please don't flash you "fridge", with a "microwave" ROM/kernel/recovery, your fridge won't know what temperature to chill at if its reading 100% radiation for 60 seconds, and your microwave doesn't even know how to "lower degrees". I'm not responsible for broken microwaves, or hot fridges... ;))


    What is a custom recovery?

    Most android phones come out of the box with a stock recovery, it is used to factory reset your device, or install the factory operating system should something go horribly wrong with an ota. A custom recovery, is a recovery designed by an individual (or teams of individuals), that are not the OEM's, that is designed with special features baked in. For example I'm a TWRP fan (team win recovery project), other people swear by CWM (clock work mod), but most recovery's have the same base features, you can take full system backups, (when I say full I mean the entire system, user data, boot image, etc.). So say something goes horribly wrong, and a rouge root application crashes your system, and you can't get the device to boot, what do you do?, You boot into your custom recovery (usually a hardware key combination), erase the primary corrupted system, then proceed to restore the system with the previously created backup image. Its always a good idea to have at least one recent backup on your device if you are running custom software of any kind. Custom recoveries can also install custom software/mods, by bypassing the signature verification of stock recoveries. Some also have root file explores built in. These are also device specific.

    What is a custom kernel?

    A custom kernel, is a kernel that, like a custom ROM, or recovery, is developed by someone other than the OEM of the device. Custom kernels will usually grant the user hardware specific settings such as, but not limited to, frequency control for the GPU, and CPU, control over minum/maximum brightness values, full rgb color correction, custom touchscreen software, and some hardware specific features, such as double tap to wake, and sweep to sleep. Also things like USB otg Y, host mode charging, and USB DAC sound, would all be examples of custom kernel features. Like ROM's, and recoveries, kernel's are device specific.

    I should also point out here that changing kernel settings is serious business, you can cause permanent hardware damage by overclocking, or undervolting your CPU/GPU. Changing kernel setting should not be taken lightly, make sure you know exactly what your doing before modifying kernel settings/flashing custom kernels. :)



    XDA developers link for the oneplus one (per request of @Masoom):

    http://forum.xda-developers.com/oneplus-one

    I'm sure as soon as the phone is out, this will contain a wealth of information ^.:)

    How to root and install TWRP on the oneplus one:

    https://forums.oneplus.net/threads/how-to-root-the-oneplus-one-twrp-dl-link.22291/
    :)

    Hope some of you find this useful, and it clears up the confusion on cyanogenMODS's relationship with custom android software.
     
    Last edited: Jul 9, 2014

    #1
    aris, jtalexandre, Ceasedd and 154 others like this.
  2. FilthNasty
    Honeycomb May 12, 2014

    FilthNasty , May 12, 2014 :
    We know whst a root is or how you can root it, and wvat you do is illegal just copying it! I just wanna help you.
     

    #2
  3. thisguysayswht
    Ice Cream Sandwich May 12, 2014

    thisguysayswht , May 12, 2014 :
    Um... I just wrote this dude, its not illegal. Not everyone on these forms has this knowledge, I know from experience... I'm just trying to help the forum out...
    ______________________________________________________________

    Edit: Common questions, and answers:

    1. Question: "
    Do we have to wait till they make Custom Roms for the one plus one or will we be able to us one's for like the Nexus since it runs stock android ..."

    1. Answer: We I'll have to wait till some developers port custom ROM's (although cyanogen started out as a "custom ROM":)), every ROM is coded for the model/make/hardware of each device. Most of the time, once the stock sources get released, the most well known ROM's will get ported shortly after. Do NOT flash anything, NOT made for the oneplus one, on a oneplus one, this will apply for all android phones, never flash any of the above mentioned things (excluding the SUbinary), on a device that it was not specifically designed for. CyanogenMOD is not sock android. if that's what you mean? Nexus devices run pure AOSP builds, cyanogenMOD is not AOSP, CyanogenMOD is loosely based off AOSP, with numerous system modification's.:)

    2. Question: "Anyone know if CyanogenMod 11s comes rooted? I assume so, since it is CyanogenMod, but since it's a stock phone OS and rooting could potentially harm the phone, it may not. Or it may need to be an option like installing 3rd party apps."

    2. Answer: The oneplus one is the only phone right now with cyanogenMOD 11s, and does not come rooted. So, no cyanogenMOD 11s is not rooted. You cannot sell a device that comes prerooted with google's services on it.:)

    3. Question: "Yes anyone can root/jailbreak anything.. the kicker is what do you do now? most people don't have any idea of how to protect their phones while zll they wanted to do is changing icons.. "

    3. Answer: There a lot of ways one can secure a rooted phone. Encryption is a good start, and there's a lot of security features that can be added to a device via modifying, such as larger lock patterns (up to 6×6 instead of 3×3 max), adb paranoia mode (reboots device upon detection of unknown computer, while on the lock screen), and completely disabling the power menu on the lock screen, so you can track a suspected thief... You just need to be extra careful what you install, what you download, and how you go about securing you phone.

    As far as...

    3. A- Question: what to do with root?

    3. A- Answer: I would check out the xposed framework. There are a lot of really cool, really useful modules for it. It is similar to the cydia substrate for Iphones, but is hooked on a lower level, making it much more powerful. I recommend that you read my guide on the Xposed framework before proceeding:

    http://forums.oneplus.net/threads/guide-xposed-framework-what-how-why.15726/

    Xposed framework link:

    http://forum.xda-developers.com/xposed/framework-xposed-rom-modding-modifying-t1574401

    4. Question: "1. SU mode is pretty risky from what I've heard, so is it possible to like, flash something into the ROM or whatever it is, and then "log out" or something out of the SU mode, and still be able to use it as a regular user? Perhaps able to use other SU features?
    2. If someone got a hold of a rooted device, could they just use the SU privilege to do anything they want? And I heard even flashed things, which should be permanent, at least as far as I've heard, can be removed, using this SU privilege.
    3. Isn't the ROM the kind of thing which shouldn't really be edited/cleared/otherwise, which is why it's read only?"

    4. Answer: SU is the permission of the given file/user/program. Once you grant an application root, or change a files permission as root, or with SU permissions (same thing), thru the superuser permission manager application, the application/file you just granted SU, has a full permission set. If its SU, it can do whatever said "root" or "superuser" application sees fit to your system. Usually when rooting a phone it is by "copying" the permissions of a fundamental system application. So once you grant root to an application, you have granted all permissions possible, to the application you granted root to (it now has all of the permissions of the most fundamental, powerful application possible on your phone, you just let that application out of its "cage", and allowed it to do whatever it wants to your system). You can disable an application's root permissions thru your preferred superuser permission manager, after you have granted it root, or you can require it to request permission on every root action. Root, in and of its self, is only a security problem if you grant root permissions to a malicious application. Its only really dangerous if you /remove/modify a file/directory, or modify a files permission, in the system with root permissions. But as I said in the guide, you want to leave adb debugging enabled in case anything happens to your device, and this opens the device up to physical penetration attacks such as dictionary (word list attacks), and rainbow table attacks. Yes, the flash memory modules in your smartphone are of the read/write kind... "ROM" is pretty much slang, but for the purpose of keeping the guide simple, I explained what it actually is, and what it stands for in android communities. Since you are usually replacing files with read only permissions, while flashing custom operating systems, it is referred to as "flashing a ROM". Yes, you can write to, and delete any file with root permission on an android phone. Android memory is not "ROM", so android "ROM", is usually a misnomer.

    4. A- Question response: "Well isn't the point of rooting to modify some files and stuff?
    Thanks for the adb debugging tip.
    And what's Rainbow Table?

    Anyways, thanks. ^^"


    4. A- Answer response: Yes, and that's why its inherently dangerous. If you were logged in as a root user in Linux, you would not have to open all your application from the command line, with root permissions, if you open a file manager, you can write directly to the system with the file manager (since you opened it, and your root), because your logged in as root (on Linux, as a normal user, if you wanted a root file manager, you would have to open the program thru the command line for root, like the file manager in kubuntu is "desudo konqueror", to open as a root file explorer, if your logged in as a normal user.). On android you have to grant root permission to each individual program/application (like a normal Linux user, your cannot "log in as root" on android to my knowledge), for instance if you opened up a command line on android, and you type "su", your permission manager will prompt you "would you like to grant root to terminal emulator, yes or no". Some superuser permission managers also have "temporary unroot" modes.

    4. B- Question response: "And what's Rainbow Table?"

    4. B- Answer response: A rainbow table it a precomputed file containing password hashes. Passwords are stored with different encryption algorithms as "one way" lol, password "hashes". When trying to "attack" a password it can be done by attacking the actual char of the password (the numbers/letters), attacks like these are usually performed by dictionary (Word list) attacks (because its/there slow, since it has to convert every password attempt into a hash, to check against the encrypted password file ((SlOW)). It can also be attacked, by attacking the hash of the password, this is done with a precomputed "rainbow table" with all hashes for a particular char set/length, and particular encryption algorithm (FAST)... (This is soooo not related to said subject tho, lol)

    5. Question: "So now that I know what rooting is, how do I do it?"

    5. Answer: I would search for your device on-

    XDA developers Forms:

    http://forum.xda-developers.com

    or Android forums:

    http://androidforums.com

    It's important that you find the recommend method for your device, people have probably already figured out the safest, and most secure way to root your device. I should also point out that the process is not the same for every device, some devices also have flash counters, encrypted bootloaders, etc.:)
     
    Last edited: May 20, 2014

    #3
  4. FourZer0
    Ice Cream Sandwich May 12, 2014

    FourZer0 , May 12, 2014 :
    Ehh there are already tons of guides just a google search away, but it's not like most people on this forum are familiar with "searching" so thanks for posting!
     

    #4
    Andy.w, DomaDART, Joyyy and 2 others like this.
  5. Jordi92
    Gingerbread May 12, 2014


    #5
  6. thisguysayswht
    Ice Cream Sandwich May 12, 2014

    thisguysayswht , May 12, 2014 :
    Ya, I see a lot of people asking a lot of the same questions about rooting, and custom android software, so I decided to write this, searched for a similar relevant guide already on the forum, and couldn't find any. I was bored, so here's a guide for people who don't fell like digging thru Google, and its large amount of disinformation.;)

    (I'm also not a fan of "this is how you do it, don't worry about the details, threads/guides", which are very relevant in Google searches:( that leads to a lot of oops... I just bricked my 2 day old opo, flashing color os from the oppo find 5 threads, and nobody likes those threads, there sad).:(
     
    Last edited: May 13, 2014

    #6
  7. Suneth
    Honeycomb May 12, 2014


    #7
    why, Haverholm, WhoKnew and 1 other person like this.
  8. kakasaka
    Honeycomb May 12, 2014

    kakasaka , May 12, 2014 :
    This is very useful information for those who are new to the world of rooting.
    Thanks for posting!
     

    #8
    Ceasedd, sarahsull and thisguysayswht like this.
  9. wtfhsf
    KitKat May 12, 2014

    wtfhsf , May 12, 2014 :
    Agreed
     

    #9
    thisguysayswht likes this.
  10. Masoom
    Honeycomb May 13, 2014

    Masoom , May 13, 2014 :
    Agreed x2. It will others who are new to rooting, especially useful in these forums as the phone is so rooting friendly. Some people may not even know that they can do that with a phone, I know the rest of my family don't and most of my friends don't.

    Maybe you could point people to this thread once the phone is in a lot of peoples hand.:
    http://forums.oneplus.net/threads/one-plus-one-thread-on-xda-developers.10846/
     

    #10
    thisguysayswht likes this.
  11. thisguysayswht
    Ice Cream Sandwich May 13, 2014

    thisguysayswht , May 13, 2014 :
    it's in the op, thanks for the recommendation.:)
     
    Last edited: May 13, 2014

    #11
    Ceasedd likes this.
  12. cruxjc138
    Gingerbread May 13, 2014

    cruxjc138 , May 13, 2014 :
    Anyone know if CyanogenMod 11s comes rooted? I assume so, since it is CyanogenMod, but since it's a stock phone OS and rooting could potentially harm the phone, it may not. Or it may need to be an option like installing 3rd party apps.
     

    #12
  13. Masoom
    Honeycomb May 13, 2014

    Masoom , May 13, 2014 :
    A mention in the first post for pointing it out would be nice :p
     

    #13
  14. Waterdroid
    Community Veteran May 13, 2014


    #14
    thisguysayswht likes this.
  15. D_luvin
    Gingerbread May 13, 2014

    D_luvin , May 13, 2014 :
    Just been Team iPhone and always jailbreak so this will be my first android phone. I was reading that each phone has to have it's own type of Roms .... Do we have to wait till they make Custom Roms for the one plus one or will we be able to us one's for like the Nexus since it runs stock android ... Sorry if it a dumb question
     

    #15
  16. thisguysayswht
    Ice Cream Sandwich May 13, 2014

    thisguysayswht , May 13, 2014 :
    We I'll have to wait till some developers port some ROM's, every rom is coded for that model/make of phone. Most of the time when once sources get released, the most well known ROM's will get ported shortly after. Do NOT flash anything NOT made for the oneplus one, on a oneplus one, this will apply for all android phones. No question is stupid, and your smart enough to ask, instead of doing it then ending up bricked, then asking for answers like so many others.;)
     

    #16
  17. wilbarger
    Jelly Bean May 13, 2014

    wilbarger , May 13, 2014 :
    It does not come rooted. You will have to learn and root it yourself if that is what you want to do. This is a VERY well written thread and you can learn a lot for the beginner here and then go to XDA for more detailed how to's.
     

    #17
    GoIrish and thisguysayswht like this.
  18. wilbarger
    Jelly Bean May 13, 2014

    wilbarger , May 13, 2014 :
    One thing that I would add to this for the Apple users here is that rooting gives you infinitely more power than jailbreaking does. Never assume anything else. Be careful and listen to people that have the knowledge like @thisguysayswht I have been rooting and testing custom rom's for several years and I still occasionally screw something up. I have just learned how to recover from almost anything I break. LOL
     

    #18
    networkdood and thisguysayswht like this.
  19. thisguysayswht
    Ice Cream Sandwich May 13, 2014

    thisguysayswht , May 13, 2014 :
    Ran out of room:), nice post though, I agree. Root privileges have greater responsibilities, compared to jailbreaking, in in terms of power/security.;)
     
    Last edited: May 13, 2014

    #19
  20. Accelevi
    Ice Cream Sandwich May 13, 2014

    Accelevi , May 13, 2014 :
    iPhone jailbreak is just stuff that already exists you use more or less, and rooting is a bit more dangerous, iirc, but it's more open.
     

    #20
    thisguysayswht likes this.