[HOW TO] Root the GSM/HSPA+ Samsung Galaxy Nexus


  1. scary alien

    scary alien not really so scary Moderator

    Awesome...downloading now...

    LOL, I tried the link before you fixed it with the .zip suffix--figured-it out, though ;).

    I'll incorporate this into the first post.

    Thanks!
    GalaxyNexus likes this.
  2. saulback

    saulback Active Member

    I just installed android-sdk. I have adb, but I can't find fastboot anywhere. I thought it should have been installed with the sdk. How do I find it? I run linux, and all I can find to download are for windows.
    GalaxyNexus likes this.
  3. John Markley

    John Markley Member

    Is there some advantage to having the SuperUser.apk in /system/app, or would it be equally effective to gain root by running

    adb root (restart adbd daemon with root permissions)
    adb remount (remount /system partion in read/write mode)
    adb push su /system/bin (copy su program to the phone)
    adb shell chmod 06755 /system/bin/su (re-secure w/root permission/access)

    and then installing the current SuperUser.apk from Android market after reboot?
    GalaxyNexus and scary alien like this.
  4. scary alien

    scary alien not really so scary Moderator

    John,

    First, welcome to the AndroidForums and glad you signed-up :).

    LOL, I don't think I've ever done it separately, but I'd think you'd need to install it (the Superuser.apk app) like in the above so that the app is owned (and will therefore execute) as root.

    The version of Superuser.apk that I have installed on my Droid X is owned by root vs. system like regular apps are:

    Code:
    # [COLOR="Purple"]ls -a -l Super*[/COLOR]
    -rw-r--r-- root     root               196521 2010-12-18 16:58 SuperUser.apk
    Hope that helps.

    Cheers!
    GalaxyNexus and John Markley like this.
  5. John Markley

    John Markley Member

    Thank you, that does help. The only reason I asked is because in the dev's market description he says

    "Note: App and binary will have different versions. The app is updated more often than the binary is.
    This app cannot be uninstalled if it was installed with your ROM or root. If there is no uninstall option, it's because you placed it in /system/app, not me."
    implying, it seems, that there might be some reason to want to uninstall it, though I cannot think why.
    GalaxyNexus and scary alien like this.
  6. scary alien

    scary alien not really so scary Moderator

    Yeah, I've read this on ChainsDD's Market app description (https://market.android.com/details?id=com.noshufou.android.su) and just now on his web page (Superuser).

    I'm still a little fuzzy on how exactly this would work separately like you originally asked. That's a great question and I'll continue to think about it (and maybe try it when I get my GNex (hopefully this coming Thursday :))).

    I've seen some folks that wanted to be able to remove the Superuser app (which would show up in the app drawer) before turning their device in to make a warranty claim.

    There are various ways to do this (i.e., removing the files we referenced above from an "adb shell" or on-phone terminal emulator session), so if you are savvy-enough (which you very much seem to be ;)), uninstalling these root components should be no problem.

    I hope that helps.

    Cheers!
    GalaxyNexus and John Markley like this.
  7. John Markley

    John Markley Member

    Thanks. I have the same hope (GNex on Thursday...Friday...??). I thought of the desire to remove the app for warranty but, since that would require some adb shell or similar work anyway to remove the su and to relock, it seems irrelevant.
    GalaxyNexus likes this.
  8. teddyearp

    teddyearp A guide with guides Guide

    If I may clarify. Pushing the su binary and then the subsequent chmod of said binary to 6755 (or something similar) is what gives ANY application, process or anything else superuser access to your android phone. Consider the Superuser.apk as the guardian. Without installing Superuser.apk AT THE SAME TIME your phone is vulnerable to ANY app using root privileges without your knowledge. That is why it is ABSOLUTELY IMPERATIVE to install Superuser.apk at the same time as the su binary. Do not let any version numbers, etc. get you confused, or even make you think about putting Superuser.apk in /data/app or anywhere else than /system/app. Please do not even speculate about this.

    After all, those of you that have done this, every single time an app asks for su, Superuser pops up and asks for permission, right? Think about the alternative. Any app could call for su without your knowledge until you decide to install Superuser.apk from the market. And then, Superuser.apk will be installed to /data/app and a simple factory data reset will remove it until you reinstall it, all the while su will remain in /system/xxx wide open.

    I hope this is clear enough and removes all doubt about how important it is to install Superuser.apk AT THE SAME time as the su binary.

    good luck
  9. WormDoes

    WormDoes Well-Known Member

    This is a wonderful guide, Scary! Thanks for organizing everything, it's going to help a lot of people and avoid confusion, hopefully ;). Quick question, if one were to use the "super boot" method to root, would they just need to "fastboot oem unlock" then run the .bat file (Windows PC)?
    scary alien likes this.
  10. scary alien

    scary alien not really so scary Moderator

    Hey WormDoes, thanks for the kind words (it was a lot of work, but you guys are worth it :) ;)).

    Yes, the Superboot method assumes you've already done the "fastboot oem unlock" on your phone before you execute the batch file for your particular platform.

    I'll go back and bold those notes so it stands out a little better (it really doesn't right now).

    Cheers and again, thanks!
    WormDoes likes this.
  11. scary alien

    scary alien not really so scary Moderator

    Teddy,

    I think that you actually can install just the su binary without the Superuser.apk app without any ill-effects or security issues. The reason I say this is these two parts from ChainsDD's website (Superuser) about how the su binary and the Superuser.apk app interact with each other:

    Superuser.apk runs as any other app and gives you, the user, a place to see what apps you have allowed or denied, as well as view a log of what apps have used su when.

    The su binary is what other apps call when they need superuser rights. The binary checks the database maintained by Superuser.apk to determine if you have already granted rights to the requesting app, and if not tells Superuser.apk to display a prompt asking you for permission.


    So, my impression is that if you don't make any su / root requests, then there's nothing to fail. If you do make an su / root request, then that request will fail because the Superuser app has not yet been installed (it won't execute if it can't get permission via the Superuser whitelist app).

    I think this also clears-up John Markley's question about installing the Superuser.apk separately (presumably to support great devs like ChainsDD by downloading the app from the Market).

    That's my take anyways ;).

    Cheers!
  12. headbanger51

    headbanger51 Well-Known Member

    the beauty is, I'm sure it won't be long before there's a video of how to root the SGN on youtube. I'm a tech idiot when it comes to this stuff, even though I rooted my OG Droid. I think I still watched a few vids before I did it.
    Thanks for posting!
  13. teddyearp

    teddyearp A guide with guides Guide

    saul, I have it in my collection:

    http://ted.servepics.com/gnex/fastboot-linux

    I would rather err on the side of caution, as this does not say what su does when there is no database to refer to at all. Something in my mind tells me that su would just go ahead and grant any request since there's nothing saying not to. I guess we could ask ChainsDD, maybe I will.

    That's my take.
  14. scary alien

    scary alien not really so scary Moderator

    Saul,

    Apologies for missing your post :( but thanks to teddyearp catching that and replying.

    You can also find fastboot.exe / fastboot-windows.exe in this FAQ guide:

    http://androidforums.com/faqs/443072-adb-guide-updated-12-04-2011-a.html

    here at AF. I added a "Mini-SDK for Windows" section this past weekend that has an sdk-tools.zip file (downloadable in that page--its also referenced here in this thread in post #2 above (whose contents I'm still tweaking for getting custom recovery installed)).

    The sdk-tools.zip file basically just contains adb.exe and the .dll files that it needs to run and the fastboot executables. Should make it so that you don't actually need to download and install the full Android SDK.

    Let me know if you have any questions.

    Cheers!
  15. teddyearp

    teddyearp A guide with guides Guide

    scary, he wants/needs the linux version. That is why I took it out of one of the packages and linked him to it only.
    scary alien likes this.
  16. scary alien

    scary alien not really so scary Moderator

    Oh, thanks Teddy and apologies again, Saul :eek: :confused: :(...

    I'm gonna go slink away in my little corner now...;) :p :)
    teddyearp likes this.
  17. teddyearp

    teddyearp A guide with guides Guide

    Sorry, scary. I didn't mean to make you feel like you had to 'slink' off . . . . . lol.
  18. scary alien

    scary alien not really so scary Moderator

    LOL, I felt worse that I overlooked Saul's post...and then I missed the important part about Linux :p (I'll half-blame a busy day at work ;)).

    Better now...still catching-up on a lot of PMs and posts.

    Thanks for keeping an eye-out here, too...we all appreciate it :).

    Cheers!
  19. Travillion

    Travillion Well-Known Member

    Hi all,

    I hope this is the proper venue for my question. I am anticipating getting the Verizon G-Nex this week and have been thinking about how to get my data on my existing phone over to my new phone. I have all my existing data backed up with Titanium backup. However, I was hoping to keep my G-Nex as "untinkered" with as possible (since it's a pure(r) Google experience phone, I'm not interested in flashing ROMs and interrupting the updates direct from Google). However, I am going to have to root the G-Nex in order to transfer my app data via Titanium Backup.

    So I guess my real question is: Can I simply unlock and root the G-Nex without flashing an alternative recovery mode, etc., which would allow me to run apps that require root (such as Titanium Backup) but also not interfere with receiving direct updates from Google?

    Thanks in advance.
  20. scary alien

    scary alien not really so scary Moderator

    Travillion,

    Yeah, you should be able to follow one of the above rooting methods... None of these involve installing a custom recovery or re-flashing any of the boot images.

    The rooting methods above basically have you soft-boot (i.e., in memory) the unsecured boot image so that you can remount /system in read/write mode to allow the root binaries (su and Superuser.apk) to be installed on your phone.

    After that, you'll have root and can use TiBu to restore your apps! :)

    Does that help and/or make sense?

    Cheers!

    edit: the stuff in post #2 re. ClockworkMod custom recovery is still under construcution at this point and isn't necessary for rooting. I'll add a little disclaimer in that post :).
    Travillion likes this.
  21. Travillion

    Travillion Well-Known Member

    Yes, that is most helpful! Thank you. My primary concern is to not disqualify myself from the direct updates from Google. As long as I can unlock and root without needing the custom recovery, I don't care about flashing ROMs, etc. I wasn't sure if adding the su binary or superuser.apk would mess with google updates for some reason, but it sounds like it won't.

    Thanks for putting all the time into this thread. It's a great resource!
    scary alien likes this.
  22. iowabowtech

    iowabowtech root@android:/ # Moderator

    Fastboot for Linux/Mac/Windows from Koush:
    Index of /G1

    If anyone needs them.
    scary alien likes this.
  23. Wolfedude88

    Wolfedude88 Well-Known Member

    Not sure what I am doing wrong, Here is the screen shot below. I get adb devices to shows but not fastboot devices to show. Any ideas? I thought I had all the right drivers installed.

    [​IMG]
  24. John Markley

    John Markley Member

    Scary Alien - Am I correct in the context of this thread that if after unlocking, but before rooting, I were to boot, not flash, the cwm .img thusly,

    fastboot boot recovery-clockwork-5.5.0.2-maguro.img

    and run a nandroid backup of the virgin OS, reboot, and then root, that there still would be no residual to derail the condition Travillion wants to achieve ?
    Travillion likes this.
  25. John Markley

    John Markley Member

    Is your fastboot shell by any chance fastboot.exe? If so, try

    fastboot.exe devices

Share This Page