yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy Nexus] anil76:
locking bootloader ?

I rooted my Gnex. However I was wondering if I can revert back to locked bootloader. I think the device should retain the root as su is now in place. But does it wipe data (like unlock does) ?

My rooting experience on windows7 & ubuntu 12.04 :-

fastboot mode was not working on windows 7 (64 bit) and ubuntu 12.04 (64 bit) . 'fastboot devices' was not listing my device.

Windows7 could not find fastboot driver but the link (for driver) provided in OP worked for me and I could unlock my boot loader.
[Samsung Galaxy Nexus] chrone:
hello efrant,

a quick question, do we really need to backup efs partition??

i'm not planning flashing any other ROMs except for the back to official factory reset one.

any shed of light on this would be much appreciated. :)
[Samsung Galaxy Nexus] 3rdstring:
Your efs partition includes your imie infoand as I've seen a few posts from people who have lost their imie so I would suggest it's a good idea to keep a backup. It's only @20MB and only takes a few seconds.
[Samsung Galaxy Nexus] efrant:
What 3rdstring said is correct: the efs partition contains your IMEI.

It doesn't hurt to back it up, but you cannot change that partition using fastboot. You can only possibly mess it up if you have root access, and go in and play around with it. If you are only planning on flashing stock ROMs, there is no need to back it up.
[Samsung Galaxy Nexus] chrone:
Can I back it up without root access?

Thanks for replying though. :)

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] anil76:
restoring stock recovery ?

Before I flash custom recovery (cwm 6.0.1) , I wanted to know how can I revert it back to stock recovery if needed ? My device is unlocked & rooted on stock JB.

<EDIT>

Or will it work if I just do (without really modifying the recovery ) :-

1)fastboot boot cwm.img (appropriate version)

2) do nandroid backup through cwm

3) reboot

and if I have to restore the backup :

1)fastboot boot cwm.img

2) restore backup through cwm

3) reboot

Another question :-

If I copy a bad bootanimation which causes bootloop or never ending boot process (it happend to me once on galaxy s) , I dont think I can get into adb shell as the phone would not have been booted. Is there any other way to modify system files (e.g. bootanimation.zip in this case) assuming I am on stock recovery ?
[Samsung Galaxy Nexus] efrant:
That will work.

Just boot into CWM again (like you did above), and replace the file. CWM has access to the Android file system via ADB.
[Samsung Galaxy Nexus] chrone:
hey 3rdstring and efrant!

just rooted my nexus and backed up my efs.img using your command line from adb shell. it was a success. thanks for the command line you posted in one of someone's thread.

the question is, how to restore back if something messy happens using the command line? how to restore the efs.img using command line if something messy happens with the original efs? i didn't have my luck to be able to use the EFS Pro tool somehow.

i do hope you make a guide how to backup and restore efs.img like the one of your back to factory image reset guide. or at least a link about this EFS thing in your 101. :)
[Samsung Galaxy Nexus] efrant:
Yeah, eventually I'll add something about the efs partition. But for now:

To back it up to /sdcard, the command is:

dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/sdcard/efs.img

To restore it from /sdcard:

dd if=/sdcard/efs.img of=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs

Not sure what you mean by: "how to restore back if something messy happens using the command line?" What can happen to the command line?? :confused:
[Samsung Galaxy Nexus] chrone:
thanks for the command line! much appreciated. :)

i'm sorry for my bad english, what i meant is how to restore the efs.img using command line if something messy happens with the original efs. hehe
[Samsung Galaxy Nexus] anil76:
possible additions to OP

1) Ubuntu users may need to use sudo before fastboot.

$ sudo fastboot devices

2) how to use adb interface through wifi network

I use wifi adb widget & then adb connect <IP>:<port>
[Samsung Galaxy Nexus] woot_galaxy_nexus:
thanks for this!
[Samsung Galaxy Nexus] googlex3:
very detailed .Thank you
[Samsung Galaxy Nexus] 2LoT:
Some words about SIM Lock?

This post is a god send. Thank you very much. Can you please add some entries related to carrier locked phones?

1- Methods used by carriers to lock the phone

2- If I unlock my bootloader, does that mean I have also unlocked the SIM card?

3- If I flash a custom ROM or replaced the carrier's ROM by the Google stock ROM, does that mean I have also unlocked the SIM card?

4- If I flash a custom ROM or replaced the carrier's ROM by the Google stock ROM, does that mean I can no longer unlock the SIM card?

5- How to unlock a SIM card?

6- Is it possible to unlock a SIM card without rooting or unlocking the bootloader? i.e. keeping the original Android OS installed by the carrier.

Hope that those questions are relevant to the topic.

Thanks in advance
[Samsung Galaxy Nexus] efrant:
That's a good idea. I will add that info when I have some time. for the time being, here are the answers to your questions:

1) Not sure, but they probably just flash the efs partition which contains the lock.

2) No!

3) No!

4) No!

5) If you mean how to SIM-unlock a GNex, look at this.

6) Can you SIM-unlock without either an unlocked bootloader or root: NO. Can you SIM-unlock, and "un-root" and re-lock the bootloader: YES.
[Samsung Galaxy Nexus] 2LoT:
Hi efrant,

Merci beaucoup.

1- From what I read, the carrier either locks the SIM card or if the phone is CDMA (which doesn't have a SIM card), the carrier flashes directly the lock info into the phone ROM. This is vague, and I would like to better understand. For example, what does the phone do to know if the SIM is locked? People said "SIM Lock", but then to unlock it, we must unlock the phone instead of unlocking the SIM card itself. I suppose the locking mechanism is inside the phone, not in the SIM card. So when you add the answer to this Q1 in your FAQ, can you please explain the workflow of the SIM lock mechanism?

2, 3, 4: all NO ?!?! (crap! is it that tough?) I will wait for the updated version of your FAQ, hopefully there will be some technical elements to help me to find the answers

This raises a new Question 3B: When you buy the GNex from Google, Is it carrier independant? If I take that phone and put the SIM card of a carrier X to it, would my generic GNex becomes locked to that carrier X? If yes, that's criminal and how can they do that? If no, then back to Q3. If I replace the carrier's ROM by the Google stock ROM, I suppose my GNex is identical than the generic one bought from Google. Am I correct? If yes, then how come the phone is still SIM-locked (b/c you answered No for Q3)?

5,6- The post you mention to unlock the GNex is a little bit tough to digest for now. Wind Mobile gives the unlock code after 3 months. I don't know how to apply this unlock code. But I assume that everybody can apply the unlock procedure b/c the carriers "sell" you the unlock code without requiring your phone to be serviced by their technicians. Question then: How come the lambda user can unlock the SIM card using the unlock code without knowing and without doing the complicate unlocking bootloader or rooting the file system?
[Samsung Galaxy Nexus] efrant:
A few points that I think you missed:

1) There is no such thing as a locked SIM card. When people say SIM-locked, it means that the device is locked to a specific carrier. It only means that only a SIM card from that carrier will work in that particular phone.

2) All GNex devices sold in Canada are SIM-unlocked, i.e., you can use them on any carrier.

3) The unlock procedure I linked to was to show you how to unlock a SIM-locked device WITHOUT knowing the unlock code.

4) If you know the unlock code, all you have to do is put a SIM in it from another carrier, and the first time you do, it will ask you to enter the unlock code. No root required. But as I said, Canadian GNex's are sold unlocked.

5) As I mentioned, the "lock" is stored in the efs partition, and that particular partition is unique for every single device, and is not typically flashed by the user. When you flash a stock ROM onto a Device, it does NOT flash the efs partition - it remains untouched.
[Samsung Galaxy Nexus] 2LoT:
Thanks, this clarifies a lot. now I think I get it.
[Samsung Galaxy Nexus] Euzhan:
Great work! :D
[Samsung Galaxy Nexus] wcoaster:
A few questions about root and unlocked bootloader

I have a Canadian GSM Nexus. It had JB4.1.1 on it when I got it, it looks like it was an OTA update.

I did a backup using adb. I unlocked the boot loader using fastboot. I restored all my apps data etc, (very cool even my desktop folders were replaced), I manually replaced the backed up contents of my sdcard.

So after too much reading, I see many how to's talking about a recovery image. Do I need one? I thought I already have a backup and the phone has a recovery of the stock image should I need to get back to stock? Am I correct?

I really don't want to mess around with roms, I'd kinda like to just tweak stock, forinstance get CNAP (name display) working but I have to read up to see if I can just push packages that someone else has fixed onto my phone to accomplish little fixes like that.

It seems at the moment there really isnt much in the way of jelly bean thats much better for me. Am I wrong?

Do I really need to do/flash any more of a backup/recovery? if I intend to dabble as stated above?

I'd like to install root, I think I need to... to do what I want..so do I just push the 2 superuser files to the sdcard using adb..I'm sure I saw a guide on this but they always talk about installing CWM too and this is where I get confused as to my goals.

thx alot..

salut
[Samsung Galaxy Nexus] anil76:
>> I'd like to install root, I think I need to... to do what I want..so do I just push the 2 superuser files to the sdcard using adb..I'm sure I saw a guide on this but they always

>> talk about installing CWM too and this is where I get confused as to my goals.

You just need to boot into CWM recovery (without really replacing your stock recovery) to flash super user zip files (which will install the files in the right place). This way you be rooted with all stock (including recovery). Just follow efrants guide.

>> It seems at the moment there really isnt much in the way of jelly bean thats much better for me. Am I wrong?

Personally I am fine with stock rom with root access but I do miss some nice CM features. However I like the stability of stock rom.
[Samsung Galaxy Nexus] efrant:
The "recovery" partition is like a mini-ROM that allows you to perform a limited amount of functions related to backing up, wiping etc. If you've flashed the images from Google, you would have flashed the stock recovery. The stock recovery is more limited in the functions it can perform, vs. a custom recovery like CWM. As was mentioned, you do not need to flash CWM to get root, but using it (i.e., booting it) makes gaining root very simple.

See here for how to get root and see here for some background on different partitions on the device.
[Samsung Galaxy Nexus] strumcat:
A "nandroid" backup is by far the best, safest, most complete, and easiest-to-restore kind of backup you can have. It restores your phone to the exact condition it was in when you made the backup.

Making a nandroid backup requires a custom recovery like CWM. That's the fundamental value of CWM. All the other stuff it can do is just gravy.

I think the best advice anyone could give you is to make a nandroid backup before you do any dabbling.
[Samsung Galaxy Nexus] :
Great guide for Noobs @efrant . I already know all this but noobs would find it useful
[Samsung Galaxy Nexus] wcoaster:
Stock Rom with root

Hi Thanks for the reply...

When you say boot into CWM recovery, is this different than the phones recovery state using vol and power buttons and adb commands to push the files and then fastboot? to flash(same as install?)? Or does the CWM recovery create the stock recovery image with root installed?

I have the clockwork ROM manager, but I dont don't have root yet..so I dont know what else this app does.

Its uncharted territory for me, thanks..
[Samsung Galaxy Nexus] kyokeun1234:
Why isn't this a sticky yet? Another awesome work Efrant! This will help a lot of people! Thanked!
[Samsung Galaxy Nexus] AndroidFan23:
Look around on youtube under clockworkmod galaxy nexus. I've found some useful and intuitive videos on how to use the Gnex toolkit. Don't over complicate yourself. The toolkit is loaded with everything you need to unlock bootloader, root, backup, flash rom, etc etc. Following the steps is as easy as 123. Check it out if you're having a hard time understanding the procedures efrant wrote up.
[Samsung Galaxy Nexus] efrant:
Please do not discuss toolkits in this thread. Toolkits go against everything I intended to cover with this thread -- they are shortcuts which have no place in the learning process. Once you learn how to do things yourself, then use a toolkit if you want.

Learn how to add and subtract before using a calculator.
[Samsung Galaxy Nexus] Zepius:
as bobby bushay's momma would say "toolits are the devil!"
[Samsung Galaxy Nexus] efrant:
When I say boot into CWM, that means get a custom recovery loaded into RAM. So, if you have CWM flashed, then yes, you can turn off your device and hold vol up and vol down and press power, then select recovery, and you will be booted into CWM. Or you can boot directly from a terminal on your computer, by typing fastboot boot name-of-recovery.img.

Recovery has nothing to do with fastboot other than you can use fastboot to flash or boot a recovery.

Yes, "flash" is similar to install, although I would describe it more as "writing to the NAND memory". When you "flash" CWM, you are writing the image to the recovery partition of your device. (I guess you could call it installing, but it wouldn't be entirely correct.)

I don't understand what you are saying. You use CWM to flash a zip file that contains the files needed to root. Info was already given, in the first post, and a few posts up.

Root, CWM, and ROM manger are different things.

CWM allows you to easily get root.

ROM Manager allows you to easily flash CWM if you have root.
[Samsung Galaxy Nexus] AndroidFan23:
Sorry, didn't mean to offend you or anyone. I was just trying to help a guy that seemed to be having a hard time.:o
[Samsung Galaxy Nexus] efrant:
No offence taken! :) But you wouldn't be helping him -- you would be hindering him from learning.
[Samsung Galaxy Nexus] AndroidFan23:
You are absolutely right about that. And that is why I am here as well. I jumped the gun and went the easy route when I should have taken my time to learn the process. So, here I am reading page after page and asking questions along the way. Thanks for the great write up and all the knowledge you share!
[Samsung Galaxy Nexus] wcoaster:
Ok I understand that CWM recovery is just an advanced recovery interface better than stock.

I'll tell you what messed me up, was all the reading I did..I'm all for your efforts, thats why I am where I am, because I want to know, not just press a button. I use to script a bit decades ago.

I have some troubles concentrating, there are just too many guides and issues to get my head around.

The latest being what I read about the superuser permissions getting deleted on reboot with this phone. It ends up being another mind snapping wormhole that may or may not be a concern to me.

Anyway, I have the CWM maguro6.0.1.img file and the CWM-SuperSU-v0.94 zip in my platform tools folder. I hope they are the most recent and compatible.

is this post of yours relevant to me?

http://xdaforums.com/showpost.php?p=26328017&postcount=123

.step 5 says temporarily flash..stuff like this confuddles me.

http://xdaforums.com/showpost.php?p=19583168&postcount=1

So I want to know my next steps, not necessarily the stages in the steps, forinstance

flash CWM to recovery

reboot into CWM recovery

when and where Do I nandroid backup from recovery? Is this backup stored on phone or pc? How big are they? What exactly is this backup used for?

copy the SU zip to /SDCARD/ with adb or CWM recovery?

use CWM to install the zip

reboot and I have root?
[Samsung Galaxy Nexus] fushla:
I wonder.. when gaining root access is so easily (I mean .. it doesn't take a long time..) ... what are toolkits doing in the background :D :D
[Samsung Galaxy Nexus] strumcat:
Probably drinking beer and playing poker.
[Samsung Galaxy Nexus] efrant:
Probably best to stick to one guide that others have said works, and try to understand that one. Don't worry about other guides.

If you want to use my guide (which you linked to in your post), then don't worry about the guide written in your second link. (The only reason I referred to that link was because it had the download link to CWM 5.5.0.2, which is the recovery that, in my experience, is the most stable and compatible, and the one I recommend.)

So, yes, your steps would be

Get the su zip to /sdcard (It doesn't matter how, just get it there. Email it to yourself, download it directly off the site to your phone, copy it over to your phone using Windows explorer, whatever. It doesn't matter. Just get it in /sdcard.)

Flash CWM

Reboot into CWM

No need for a backup. (And yes, a nandroid backup is done via the recovery on the phone. Just navigate the menus to backup. And yes, it saves the backup on your phone in /sdcard/clockworkmod/backup/

Select "install zip from sdcard" or whatever the menu item is called, and navigate the menus until you see your su zip file that you have on your device, and flash it.

Done. (Just like my link says. :) )
[Samsung Galaxy Nexus] wcoaster:
OK I had all that done by the time you posted..barely :)

I read some forums about problems with CWM6 build so I'll get 5.5.0.2 as you recommend, (what about these touch recoverys?) I havent flashed anything yet.

Titanium backup looks pretty good...better than my adb backup..
[Samsung Galaxy Nexus] 2LoT:
Hi Efrant,

Can you please add some more entries to your FAQ:

1- How do I check if my device has bootloader unlocked?

2- How do I check if I have stock or custom recovery?

3- How do I check if my device is rooted?

4- What are busybox, su , superuser? what is the usage of each and the relationship between these?

Thanks
[Samsung Galaxy Nexus] wcoaster:
You can get an app from the app store that tells you if your rooted.

If your the only owner of the phone most likely its still locked.

Google can answer most of these questions.
[Samsung Galaxy Nexus] efrant:
Yes, I will add those to the first post eventually. But for now, here are your answers:

1) If you see a lock icon when you turn on your device, it is unlocked. If you boot into fastboot mode, and on that screen it says "UNLOCKED", then you are unlocked.

2) If you boot into recovery and see an Android lying on its back with an exclamation point above him, you have the stock recovery. Otherwise, you have a custom recovery.

3) Easiest way is to download any app that requires root access and run it. It will tell you.

4a) Busybox is a set of linux tools that allow you to perform various function. A lot of them are not included with Android, so if you need those tools, you need to install busybox.

4b) su and Superuser.apk (or SuperSU.apk depending if you use Chainfire's app or ChainsDD's app) are the two files that you need to "root" your device. The su file is what elevates you persmissions to userid 0 (or root), while the app acts like kind of a firewall, filtering root-access requests.
[Samsung Galaxy Nexus] Zepius:
cwm touch has had some problems since its based on the original cwm. i tend to avoid cwm now

twrp seems to work fine for me and its all touch.
[Samsung Galaxy Nexus] efrant:
Yes, there are issues with both the touch and non-touch 6-series CWM recoveries and the touch 5-series. But there are also compatibility issues with TWRP. (See here starting at post 313.)

I have yet to see any issues in the non-touch 5-series CWM recoveries. (And I personally like non-touch for my recoveries :) )
[Samsung Galaxy Nexus] Zepius:
Yes there are issues with both but that's why I said seems fine to me since I have not seen any issues. I did however see tons of issues with cwm touch restoring my nandroids
[Samsung Galaxy Nexus] 2LoT:
#3 It would be nice if you can indicate some easy small app to check that. For example, I followed the tips of a blog somewhere I forgot the link, install ConnectBot app and type su command to see if there is a popup screen askingg for root access? Other apps requiring root access I know of are Avast and Titanium Backup. Or is is correct to say "Settings / Apps / All" if there is SuperUser or SuperSU then the device is rooted" ?

#4 Any comment, opinion, comparison between SuperSU and Superuser? FYI I followed a rooting guide, then installed su 3.07 which failed to acquired root access. Then I follow your guide (link #5 in your sig), and replaced it with SuperSU 0.94 which works correctly. Thanks you for the guide. BTW, it is very hard to make the relationship between your link #1 (Basics) and link #5 (Root) to send ADB and fastboot cmd to the device. May be you should improve the rooting guide by giving the command to type, exemple of expected output. how to send the Superuser/SuperSU zip and where to store the zip inside the device.
[Samsung Galaxy Nexus] efrant:
No, not correct. Just because Superuser or SuperSU is installed does not mean you have root access. As I said, the Superuser (or SuperSU) app just manages the requests for root access. Root requires the su binary, and the permissions must be set properly on it.

Nope. They are pretty much the same. Personal preference.

That's probably because 3.07 is an older version and probably not compatible with Jelly Bean.

I will see what I can do.

The easiest way to get the Superuser zip to your device is to open your browser (or XDA app) on your phone and download it... :)
[Samsung Galaxy Nexus] 2LoT:
Hi Efrant,

More works for you. It seems like there are still two new terms: S-ON and S-OFF which I found out the meaning S-ON = bootloader locked and S-OFF = bootloader unlocked. Is it corrected? In anyway, it is worth to add these terms in your FAQ too. BTW, I find this lingo unnecessary complex.
[Samsung Galaxy Nexus] efrant:
No, that is not what they mean. S-OFF and S-ON are specific to HTC devices, not Samsung. They're not relevant to this guide.
[Samsung Galaxy Nexus] j0hnnyth3f0x:
Have you had any problems restoring nandroids from twrp?

Sent from my Galaxy Nexus
[Samsung Galaxy Nexus] Citizen_Snips:
Quick question. I need to send my nexus in to get warranty replaced for hardware issues. Can I copy my nandroid from sdcard/clockworkmod/backup to laptop and restore it on my new device? Thanks in advance
[Samsung Galaxy Nexus] efrant:
Yes. Just don't change the name of the backup folder (i.e., if it is 2012.09.04.1542 leave it named as such).
[Samsung Galaxy Nexus] Zepius:
no, ive not had any problems restoring backups with TWRP.
[Samsung Galaxy Nexus] chrone:
Dear efrant,

Any chance to do to a guide on how to remount /system as in read-write mode from adb command?

I know there's an adb shell command to mount the /system in read-write mode, but there's no copy binary to copy .apk into /system. using adb push also didn't work since the /system is only mount in read-only mode. Perhaps I'm missing something here, care to shed a light?

I also want to know how to backup downloaded/installed apps as in .apk format just for backup and easier reinstallation when flashing new image. on some ROM like MIUI, there's no .apk backup files in /data/app, thus could not be copied to sdcard/PC, so i use ES File Manager > App Manager. Unfortunately ES File Manager could not backup paid apps such as Tapatalk and Root Explorer.

I didn't need this kind of hassle if i'm on stock takju, but as i'm trying MIUI ROM right now, the apps need to be backed up though I have already make full backup using adb command line. Hehe :D

Thanks in advance. Have a nice weekend! :)

Kind regards,

/chrone