What is required to Root an Android phone? - Android Software/Hacking General [Developers Only]

I have been rooting/jailbreaking phones for years now. For me it is something I cannot live without anymore.
I know there are tons of people that are constantly working on finding new exploits and I'm very appreciative of their time.
In all of my time doing this I have never fully understood what is required to root a phone. It seems like now the devs are so good they'll make a one click root, or 3 click root/nand unlock GUI for us. Which is nice, and saves me time. But I would really like to understand it better and maybe start contributing a little more. I've searched in a couple forums for just a good explanation on what needs to be done and havent found anything. I'd like to know where would someone even start to look for an exploit, what they would do with that exploit, why some exploit would/would not work, etc. Also once that exploit is found, what needs to be changed to allow file modifications, etc.
Does someone mind explaining, or linking me somewhere to read more about what the full process is?? I realize every phone is different. But for the most part it is the same thing that has to happen on every phone.
TIA.

The root exploits I have looked at all show finagling with root permissions.
That is, you need to launch a process that you can access that has root permissions.
So if telnetd gets launched and there's no check on authentication for logging in....
or if the binary for su gets changed so that it permits you to call it from non-root accounts....
Anyway, I'd welcome a clear explanation too.
-wigout

Related

[Q] Rooting Question...

"Give a man a fish and he will eat for a day. Teach a man to fish and he will eat for a lifetime.”
What i am trying to say is if someone can lay down the foundation of Rooting an Android Device. I am not talking about any specific device, or the different Methods of Rooting (i.e. through recovery, through script, etc.) I am speaking about what file systems/files are being modified, replace, etc?
From what i understand Android release their OS's rooted, then third parties, (i.e. Samsung, Moto, Tmobile etc) take those releases and make changes. What changes do they make besides the themed, and service ones? the changes that unroot the phone.
If you wish you can lay down the foundation of sudo/su thats cool. However, i am not asking for the history of it.
Side Note:
Pls no trolling.
Posting comments like- "you shouldn't try this..", "Leave it to the experts..", and "You're going to break your device..." are Un-Welcome.
Thanx.
Rooting my touch 4g benefits or drawbacks
I wanted to find out if there are things that work differently like the market or other things if you root a phone. What are some of the benefits to rooting? I want to use my phone as a wifi hotspot for our computer without paying for it. Is that only possible with a rooted phone? Is a phone able to be unrooted if it needs to be? Thank you for your help.
rooted the HTC BEE WILDFIRE CDMA
i have rooted the HTC BEE WILDFIRE CDMA. it is different than the HTC BUZZ WILDFIRE GSM. using the [APP]SuperOneClick v1.5.5 (Root, Unroot, Enable Non-Market App, Get UNLOCK code)
now i cant find a recovery img that will work can any one point me the right way. there is no thread in for this phone.
There's nothing fundamentally changed when you root your phone. Make yourself familiar with Linux security and you're (almost) done. Your phone executes under the control of this model, be it rooted or not. In an unrooted phone, there are nevertheless a lot of processes running with root privileges so of course there's a "root" in an unrooted phone. But it is not available to the normal user, only to system processes.
The only difference is that on a rooted phone there is a way for a non-root process to acquire root privileges, i.e. run as root. That's just about all. Except for some, umhh, minor thing: You cannot install the program required to do so (e.g., su) as long as you're non-root. Only root can install any piece of code which changes the current user into root. Apps run as their own user (to each app, a separate user "account" is assigned, none of those having root privileges) and so can't install such a thing, at least not normally.
Some trick is needed (running an exploit, changing the ROM) to achieve this and this is what makes rooting such a tricky thing.
The fundamental thing to understand what is changed when you root your phone (and that barely anything changes really) is the Linux user/group security concept. It's all open, there's no hidden secret.
mizch said:
There's nothing fundamentally changed when you root your phone. Make yourself familiar with Linux security and you're (almost) done. Your phone executes under the control of this model, be it rooted or not. In an unrooted phone, there are nevertheless a lot of processes running with root privileges so of course there's a "root" in an unrooted phone. But it is not available to the normal user, only to system processes.
The only difference is that on a rooted phone there is a way for a non-root process to acquire root privileges, i.e. run as root. That's just about all. Except for some, umhh, minor thing: You cannot install the program required to do so (e.g., su) as long as you're non-root. Only root can install any piece of code which changes the current user into root. Apps run as their own user (to each app, a separate user "account" is assigned, none of those having root privileges) and so can't install such a thing, at least not normally.
Some trick is needed (running an exploit, changing the ROM) to achieve this and this is what makes rooting such a tricky thing.
The fundamental thing to understand what is changed when you root your phone (and that barely anything changes really) is the Linux user/group security concept. It's all open, there's no hidden secret.
Click to expand...
Click to collapse
thanx for taking the time to write this but i am hoping for something alittle more descriptive.
I've got an HTC Desire and want to root it in order to install some lag-fix to make smoother.
Question is: will rooting affect the updates I get from HTC?
Sent from my HTC Desire using XDA App

[Q] About Root

First of all this isn't a "what is root!??!!??" nor a "OMG I BRICKED MY PHONE SOMEONE HALP!" type of question.
This is more of a "I want to understand what's going on under the hood" type of question.
I'm asking this because I haven't seen the answer anywhere and it'd probably take me several days putting together a bunch of tidbits of information about this to understand it.
What does getting root on an Android device involve? I've used 1-click tools, flashed kernels that include root (CF-Root, for example), used adb and nvflash. What goes on at the OS level?
Thanks in advance to any helpful soul that replies!
pretty much its granting sysadmin rights to your phone.
It gives you admin level access to the operating system. You can customize apps, looks, performance and a good host of other things including backups, flashing ROMs etc..
Thanks guys, but like I said, I know what rooting is and what it's for. I have both of my android devices rooted (Galaxy S and Asus Tablet).
What I want to know is, when you root a device, what's modified, what does rooting actually involve, under the hood.
Root is a Linux term. In Linux based operating systems there is a predefined user account called root. When a device I shipped to you, the manufacturer has prevented you from being able to be root user for safety, and to prevent you to add, remove or modify things at a system level. When you perform the procedure of rooting your device, you change the su binary in the system directory, usually through a security exploit, to remove these restrictions that the manufacturer has bestowed upon your device, and now you have full access to anything on your phone
Hope this is helpful, and I case you do not read my awesome signature, please hit the thanks button to show your appreciation if this helped
Root is a Linux term. In Linux based operating systems there is a predefined user account called root. When a device I shipped to you, the manufacturer has prevented you from being able to be root user for safety, and to prevent you to add, remove or modify things at a system level. When you perform the procedure of rooting your device, you add su binary in the system/bin directory, usually through a security exploit, to remove these restrictions that the manufacturer has bestowed upon your device, and now you have full access to anything on your phone
Hope this is helpful, and in case you do not read my awesome signature, please hit the thanks button to show your appreciation if this helped
Thanks again but, again that's not what I'm asking. OK here goes again:
- I know what rooting is
- I know what root is for
- Both my phone and my eePad are rooted
- I know what su is. I've used Linux and UNIX
What I want to know is, what is actually modified on the android OS when rooting the phone!
Is the kernel modified?
are permissions modified?
Is it an API thing?
Sent from my Transformer TF101 using Tapatalk
Rooting usually consists of 2 parts, the vector and payload:
All those rooting apps use various exploits to insert the payload. On devices that can install custom recoveries without rooting (ie unlocked bootloaders) they can merely use the recovery to directly install the payload.
There's dozens of vectors including making a 'superboot' kernal which include the payload and installs it on the first boot (i think?)
The payload is minimally the SU binary and the superuser app. Both are made by the same guy.
On the Dell Streak (which has an unlocked bootloader) rooting is just flashing an update.zip containing the SU binary and superuser app. A simple copy to /system. Newer rooting apps also include patches to plug up the exploit that they used themselves. Gingerbreak includes a dummy /system/bin/profile that plugs up the exploit used to install itself(?)
If the kernel is modified it's prob at runtime and not a hard patch, if it modifies it at all (i dont know), my assumption is that the linux kernal in android retains hooks that SU uses to link up with the system and normally it's simply not enabled by not including a SU binary. The superuser app of course just more or less a front end to SU (settings and logging)
Unlocked bootloader devices are likely the most reliable to root since they dont depend on exploit vectors, as updates plug them up they have to find a new vector or modify them, which means that there are open vectors that actual malware can use. Using a custom recovery to flash is the intended purpose of having an unlocked bootloader.
I'm very new to this so please forgive this old man. I'm 60 years old and bought a brand new Viewsonic G Tablet. Then after getting it I searched the internet on how to make it better. Seems everything depends upon "rooting" the device. I spent the day and now it's 11pm searching the net, watching youtube videos and reading about but no one actually gives you a step by step answer. I'm hoping one of you fine people help me out, please.
I guess I was wrong. Not one person has stepped forward to help me. Thank you so very much. I know what rooting is but what I don't know is how to root my Viewsonic G Tablet 2.2. You'd think I was asking for the code to a Swiss Bank Account. LOL With PC's I'm a wiz, or was until I reached 55 or so and then things were just going so fast and over my head. But when it comes to this, I'm like a brand new student trying to learn Japanese. All I need is for someone to please give me a step by step instruction on how to do it. If you'd like, I'll Paypal you some money for helping me.
Thank you
Philip Bock CSM US Army (Retired)
Thanks Manil! That's what I was looking for! It seems that most devices have a locked bootloader, and now I understand why it takes a bit longer (more than a few hours) to root each new device,
Sent from my Transformer TF101 using Tapatalk
pabock said:
I'm very new to this so please forgive this old man. I'm 60 years old and bought a brand new Viewsonic G Tablet. Then after getting it I searched the internet on how to make it better. Seems everything depends upon "rooting" the device. I spent the day and now it's 11pm searching the net, watching youtube videos and reading about but no one actually gives you a step by step answer. I'm hoping one of you fine people help me out, please.
I guess I was wrong. Not one person has stepped forward to help me. Thank you so very much. I know what rooting is but what I don't know is how to root my Viewsonic G Tablet 2.2. You'd think I was asking for the code to a Swiss Bank Account. LOL With PC's I'm a wiz, or was until I reached 55 or so and then things were just going so fast and over my head. But when it comes to this, I'm like a brand new student trying to learn Japanese. All I need is for someone to please give me a step by step instruction on how to do it. If you'd like, I'll Paypal you some money for helping me.
Thank you
Philip Bock CSM US Army (Retired)
Click to expand...
Click to collapse
I searched for "Viewsonic G Tablet 2.2 root" and found this http://droidpirate.com/2010/11/27/how-to-root-your-viewsonic-g-tablet/
Looks promising, no garantees though.

[Q] question about how the app "superuser" works... (behind the scenes)

Hello,
I have a question about how the "superuser"-app works behind the scenes.
As far as i know: The "superuser"-app can be used to grant root-permissions only to the programs, that I want. All other programs are still not running in root. Is this right?
If I'm right on that... Why does only the app super-user does have root after rooting the phone via e.g. the zergrush-exploit and other apps still not have root permissions although the phone has been rooted? Isn't there a security gap ?
In my point of view it could be possible, that any other app could take the root-rights just like the app "superuser" does it. If I'm not right, I don't get it, why only "superuser" gets root and all other apps can't get root unless "superuser" gives them root...
Isn't it a security gap? I just don't get it... how is this achieved?
Is it absolutely (or nearly absolutely) safe, that no other programs can get root-permissions when I use "superuser"? As I already said before, I'm really curious about, why or how this can be achieved and "guaranteed"...
Thanks in very much advance.
Kind regards
mr. salt
I think it's barely possible, that I'm the only one who is interessted how this app is working or wondering about the same security issues, which come along with my questions above?
I would appreciate an sophisticated answer very much!
greetings
mr. salt
sea_salt said:
Hello,
I have a question about how the "superuser"-app works behind the scenes.
As far as i know: The "superuser"-app can be used to grant root-permissions only to the programs, that I want. All other programs are still not running in root. Is this right?
If I'm right on that... Why does only the app super-user does have root after rooting the phone via e.g. the zergrush-exploit and other apps still not have root permissions although the phone has been rooted? Isn't there a security gap ?
In my point of view it could be possible, that any other app could take the root-rights just like the app "superuser" does it. If I'm not right, I don't get it, why only "superuser" gets root and all other apps can't get root unless "superuser" gives them root...
Isn't it a security gap? I just don't get it... how is this achieved?
Is it absolutely (or nearly absolutely) safe, that no other programs can get root-permissions when I use "superuser"? As I already said before, I'm really curious about, why or how this can be achieved and "guaranteed"...
Thanks in very much advance.
Kind regards
mr. salt
Click to expand...
Click to collapse
Ok let me see if I can explain this the best way I can. When you root your phone you are giving yourself the ability to run apps that require root. This ability is turned off by default in android. Now lets compare this to Linux, when you run an app as root you have t run the sudo command and then enter your password each and every time you want to run it with rooted rights. SuperUser is an app that when prompted will remember the selection you choice so you dont have to allow it every time you run the app and with out opening a terminal to type the commands to allow it to run as root.
You are looking at the app of super user more as a stand alone app instead of being a front end UI for the commands that you would have to run to get the same out come.
As for the security, to be honest the best security is common sense. As it is a simple fact that PC, phone, internet, server ect security is only as good as the hacker trying to get into it. If he/she really wants your info they are gonna get it. Take a look at what happened to the US DOD and they have a far more secure setup then anything on the market.

"To Root or not to Root?" that's the question...

I don't want to know how to root, I can find my answer for that on Google, however what I don't get is what it does...
I know it unlocks the device somehow, but can't I simply access everything in the system if I compile android from source and install it on the device?
I have downloaded the android source and I believe I can access every possible thing, so why is rooting needed?
If I install an app as a system app, won't it automatically have the permissions to do what I need it to do?
AFAIK rooting is for the people you'd call the end user/consumer or whatever.
If you have a new phone and want to install one of the many custom ROMs around, you simply need a rooted phone.
A custom ROM is in easy terms a custom made User Interface for the phone.
There is lot more complicated stuff going on under the hood, but in general you change the look and feel of you phone's UI.
The phone has to be rooted, because the manufacturers and net providers around pack a lot of useless crap called "bloatware" (like Samsung Shop and Samsung Play and Samsung Sing and Dance and Music and whatnot) on your phone, which often makes it slower than it can be without it.
But naturally the big corps don't want you to be able to get rid of that **** too easily, which is why you don't have access to the system folders as a normal user.
I guess in your case it's possible that you (if you compiled android from source and installed it on your device) so to say have an already rooted phone, since Android itself is rooted by default. Like I said, the manufacturers are the ones to unroot Android in order to dictate which apps their customers might or might not use.
But I'm a noob and am not sure how you would install Android on your phone if it's new (and unrooted by default?) if you haven't rooted it before?
meh, hope that helped a bit at least...
root- you would love to do it after reading this..
Root? what is it?
it is what i call full access to our phone, flash new roms, have dual boot (example- you can have to os like ics and JB), can access the evasive /data folder which holdes the apk/setups of apps installed from playstore and many other things..
If you are concerned about warranty you can unroot your phone and give in your phone for warranty. i have given my phone for warranty like this.
The most important thing i like about root is that i can fix my phone myself (if it is a software problem). any other question please ask, and i will answer it.
Thanks if helped!
I don't have the time for development anymore. I used to play with stuff like that years ago, but life has taken me away from it. I'd still like to be able to access everything on my phone and play with custom roms, and root lets me do that. The end consumer comment is a good one.
As for to root or not root, I tell most people who ask me to root for them what they use their phone for and explain what they would get out of rooting, and explain the risks involved. Seems that people who understand what rooting does are able to do it themselves, and the ones that ask you to do it for them usually decide against it after hearing "there is a tiny chance that your phone could get bricked" lol
If you just want to play emulators etc, how would you benefit from rooting?
IMO rooting is very useful if you want to keep touching system things in a stock rom, optimizing and debloating it, installing other people ROMs, etc... I believe that if you compile your own flavour of android and find no restriction doing whatever you want, you don't need to.
Android phone without root is nothing
McFex said:
AFAIK rooting is for the people you'd call the end user/consumer or whatever.
Click to expand...
Click to collapse
:good:
McFex said:
But I'm a noob and am not sure how you would install Android on your phone if it's new (and unrooted by default?) if you haven't rooted it before?
Click to expand...
Click to collapse
Some phones can just be flashed (for example via usb) which gives you full control, others can be cracked.

[Q] blocking ads in apps

hello all,
i just bought nexus 5.... i am kind of noob when it comes to android.
is there i can block all annoying ads that crops up within apps and browser?
i dont want to risk rooting my phone.
pls suggest me easiest, secure way to do this....
thanks.
You can try opting out from Ads from Google Settings but the only way to get rid of all the ads is to use an app like adaway which needs root. I don't know why you think it's a risk rooting your phone?? You can get back to stock anytime to claim warranty.
vin4yak said:
You can try opting out from Ads from Google Settings but the only way to get rid of all the ads is to use an app like adaway which needs root. I don't know why you think it's a risk rooting your phone?? You can get back to stock anytime to claim warranty.
Click to expand...
Click to collapse
hello
since i am new to android, i dont want to mess up/experiment on my phone. atleast till i get hang of it.
i used play a lot with my N95 before. so, till i get firm grasp on android inner workings, i wouldnt want to do anything with its in built features.
further, rooting is bit too technical for me..... there is no application that can root with just a click like it existed with S60 V3 OS.....
so will wait till such a thing comes up.
Try to find in playstore
lambo98 said:
Try to find in playstore
Click to expand...
Click to collapse
thank u for this grt suggestion.
fyi: all ad blocking apps r removed from playstore. only detectors r whats there.
ags84 said:
further, rooting is bit too technical for me..... there is no application that can root with just a click like it existed with S60 V3 OS.....
so will wait till such a thing comes up.
Click to expand...
Click to collapse
Even though there are tools available to do this (simple search on xda will locate those), you really should take the time to understand the 4-5 (simple) steps involved in rooting. That way, you know exactly what is happening (versus a toolkit that will attempt to do everything for you, and just tell you "all done" - without you having a clue about what really happened). The advantage of understanding these steps is that later, if you want to install an update or want to switch kernels and read a guide that tells you to flash "xyz", or restore from nandroid etc, you will not be clueless. Or if somebody tries to help you with an issue, and asks you to go your recovery, you won't be asking "how do I go to recovery screen"
My suggestion: If you are ever planning to root your Nexus 5, read the first 2 posts at http://forum.xda-developers.com/goo...ide-nexus-5-how-to-unlock-bootloader-t2507905 - especially the parts highlighted in red.
Then, read it again <-- repeat till you understand it. If you have questions, read/search that thread to see if somebody already asked that question - and if not, ask in that thread.
The Nexus is probably the easiest device to root. But don't root till you are comfortable with it, and understand the steps involved.
Since you mentioned in your first post that you didn't want to root, you could try https://adblockplus.org/en/about
I must admit that I tried it once and wasn't able to get it to work right, and so I just installed adaway (that requires root) instead.
jj14 said:
Even though there are tools available to do this (simple search on xda will locate those), you really should take the time to understand the 4-5 (simple) steps involved in rooting. That way, you know exactly what is happening (versus a toolkit that will attempt to do everything for you, and just tell you "all done" - without you having a clue about what really happened). The advantage of understanding these steps is that later, if you want to install an update or want to switch kernels and read a guide that tells you to flash "xyz", or restore from nandroid etc, you will not be clueless. Or if somebody tries to help you with an issue, and asks you to go your recovery, you won't be asking "how do I go to recovery screen"
My suggestion: If you are ever planning to root your Nexus 5, read the first 2 posts at http://forum.xda-developers.com/goo...ide-nexus-5-how-to-unlock-bootloader-t2507905 - especially the parts highlighted in red.
Then, read it again <-- repeat till you understand it. If you have questions, read/search that thread to see if somebody already asked that question - and if not, ask in that thread.
The Nexus is probably the easiest device to root. But don't root till you are comfortable with it, and understand the steps involved.
Since you mentioned in your first post that you didn't want to root, you could try https://adblockplus.org/en/about
I must admit that I tried it once and wasn't able to get it to work right, and so I just installed adaway (that requires root) instead.
Click to expand...
Click to collapse
thank you for the insight.
i am reading it and will root only after i fully understand it.
i did try adblockplus. got it when i searched on google.
as u said, it doesnt work right..... so i thought of asking it here as it is comman problem faced by many android users.
cheers.
ags84 said:
thank you for the insight.
i am reading it and will root only after i fully understand it.
i did try adblockplus. got it when i searched on google.
as u said, it doesnt work right..... so i thought of asking it here as it is comman problem faced by many android users.
cheers.
Click to expand...
Click to collapse
Ad Block Plus got nuked by Google, unfortunately. You need root to do this for all apps and on all connection types.
ags84 said:
i am reading it and will root only after i fully understand it.
Click to expand...
Click to collapse
Good on you to take the time to learn.
Short of rooting your phone and installing an ad-blocker, you would have to pay for "pro" versions of apps you use, which often remove ads from the app as part of the upgrade.
MoaAB hands down is the best add blocker! But u need root...
(Mother of all Add Blockers)
Nothing is going to fully block ads without root. Nope. ?
For unrooted try Andblock (not ABP) http://code.google.com/p/andblock/
You need to import a host file (menu > import), and set Port to 8080
Blocks web ads only
Lord Childe said:
For unrooted try Andblock (not ABD) http://code.google.com/p/andblock/
You need to import a host file (menu > import), and set Port to 8080
Blocks web ads only
Click to expand...
Click to collapse
So just for browsers you mean? If that's the case you can just use AdBlock Plus extensions/addons for your respective browser.
Adblock (unrooted, side load APK) will still work for WiFi just not on a data connection and needs to be setup as a proxy, or is it just for data? Can't remember.
bblzd said:
So just for browsers you mean? If that's the case you can just use Ad Block Plus extensions/addons for your respective browser.
Adblock (unrooted, side load APK) will still work for WiFi just not on a data connection and needs to be setup as a proxy, or is it just for data? Can't remember.
Click to expand...
Click to collapse
It’s plugged as ‘Andblock’, yet the app is named ‘Adblock’ – very confusing. And I’m sure it’s intentional, given the similarities with ABP.
Before I rooted my device I used Andblock (Adblock) – it works with 3g/4g, whereas ABP unrooted only works over wifi. Anyway, standalone ABP for Android is riddled with bugs and inconsistencies – brilliant as a FF addon in Windows, might be good as a browser ext. for Android - but if you're unrooted and use a browser that hasn’t got an ABP ext. then you’re buggered.
A device isn’t completely free of ads even with root - the famed MoaAB doesn't block every app ad.

Categories

Resources