yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy Nexus] monkeypaws:
Sorry but I followed the instructions to the t and did do it Before hitting restore. The script error floods the cmd and on the phone it just sits there on that same restore screen. I even went back and saw if I set up adb correctly and drivers. Should I type c\ or cd\ to get into root folder. Sorry but as much as I am tech savvy the a dB instructions I found aren't very clear.
[Samsung Galaxy Nexus] efrant:
Did you see a bunch of lines in the command prompt which stop shortly after you click restore on your device?

That is what is supposed to happen, but the "flooding" should stop after a while.

At the C:> prompt (or whatever it is for you), type: adb devices

If it returns with a bunch of numbers, adb is recognizing your device. If it shows no number, your drivers are not installed properly.
[Samsung Galaxy Nexus] wictor1992:
Since he managed to run fakerestore on his device I suggest that his drivers are fine.

Are you sure that you typed in the exploit line correctly? Including the while part and the brackets? Every single symbol is important.
[Samsung Galaxy Nexus] barqers:
Thank you for your reply! I do see a bunch of numbers/letters when I do adb devices.

Secondly, the "flooding" stops as soon as I hit restore, the phone then gives me some toast notifications saying it's restoring, then again that it's finished. At that time I type "adb reboot".

Currently what I do to type the adb shell while line, is I copy it, right click in cmd and hit paste. I've tried a cmd window with highered privileges as well as one without.

My device is in Canada, could that be an issue? It is network unlocked (like every version of the phone I believe) so that shouldn't be an issue causing it.

Edit::

The only thing I can use to explain the issue is that the exploit does not seem to be putting my phone into emulator mode. There's no lag/screen flicker after rebooting.
[Samsung Galaxy Nexus] efrant:
Good point about the drivers.

And yeah, a cut and paste of the while line would be better.

Hmm. So it's obviously not creating the local.prop file.

Not sure yet what is the problem. Certainly not because your device is Canadian, because I have the same.
[Samsung Galaxy Nexus] barqers:
Yeah I tried using adb shell ls to list the files/folders where the local.prop should be, and it isn't there. So that must be the issue is that it isn't creating the local.prop. As per why, that's the limit of my knowledge ;)

I'll try and give you some useful information, maybe :P

Model Number: Galaxy Nexus

Android Version: 4.1.1

Baseband version: I9250UGLH1

Kernel Version: 3.0.31-g6fb96c9 android-build@vbps1 ) #1 SMP PREEMPT Thu Jun 28 11:02:39 PDT 2012

Build Number: JRO03c.I9250UGLH1

I'll give it another shot in about an hour. Thank you for your help so far!
[Samsung Galaxy Nexus] barqers:
Just as an aside, I'm reading the code in Bin4ry's script. Will this not work with the Nexus? It doesn't seem like there's any adb commands specific to Xperia, maybe only the remount as rw part, that's all I can see being different as we may use different blocks for /system.

I'll give his script a shot, modify it a bit to fit the Nexus. I'll post back.

Edit:: No dice :(

As I go through the steps, I made it through but at the end same thing, permission denied. There's no local.prop file.

I'll try posting in the other thread.
[Samsung Galaxy Nexus] efrant:
His script is what I based this thread on, so you should get the same result ;)

He's also using older versions of su and Superuser.apk, which I think were cause GNex users issues.

I've been thinking about your issue, and I'm still stumped...
[Samsung Galaxy Nexus] barqers:
Only thing I can think of is all these links I found in google by searching the while command show the script running this line:

stuff\adb.exe shell "rm -r /data/data/com.android.settings/a"

I'm not really sure what folder that is, but I don't know if I really want to delete it. I'll try making a backup and see how it affects my phone.

Edit:: No luck, permission denied trying to delete /data/data/com.android.settings/a

Guess I'm just SOL :(
[Samsung Galaxy Nexus] monkeypaws:
So i tried uninstalling the drivers manually and rebooted the PC. Tried installing drivers and still cmd would say there were no devices . I know this is bad but since i had the gnex toolkit already downloaded i installed the drivers that way and then did "adb devices" and it recognized it. I then followed the steps word by word and it worked. Thanks.
[Samsung Galaxy Nexus] r0b2186:
I was running into the same problem as monkeypaws. I didn't really change anything, though. I just tried again and it worked like a charm...weird. Wish I could be more help to people who run into that problem besides "try it again" but that worked for me.

I had been avoiding rooting the GNex out of little more than sheer stubbornness and laziness (yet I didn't mind running various custom ROMs on my old EVO and Thunderbolt...go figure), but this waiting around for the JB OTA to finally roll out in my area was the last straw.
[Samsung Galaxy Nexus] efrant:
@barqers: just do an adb backup, unlock your bootloader, and restore the backup. Then getting root becomes trivial.
[Samsung Galaxy Nexus] barqers:
Thanks efrant! Did not think of that.
[Samsung Galaxy Nexus] oldblue910:
Efrant, this is a top quality guide. Can't believe I missed this! This worked perfectly for applying the JRO03O OTA.
[Samsung Galaxy Nexus] segv11:
I'm too busy to get on XDA for a couple of weeks, and I miss this! Great find, efrant.

To those who are having trouble, this is a race-condition hack, which Google will of course fix very soon. Exploits of race conditions are notoriously finicky; you may need to run this more than once to get it right...

Sent from my Jelly Beaned "toro" Galaxy Nexus.
[Samsung Galaxy Nexus] outerlimit:
Thank you very much. It worked the second time. :)

The first time setting the permissions for su did not work. The command came back without an error, but the permissions were not set correctly.

They should be "-rwsr-sr-x". You can check with

"cd /system/bin"

"ls -l"
[Samsung Galaxy Nexus] rguinot:
Hi,

i confirm that the approach works. i've been able to successfully root my Nexus S (stock Jelly Bean 4.1.1) without needing to wipe the data. Thanks for the guide !

However, it looks like it won't let me boot into recovery menu anymore, instead if i enter that menu i have an android with a red triangle.

Is this because of the addition of the superuser stuff in /system ? is there a way to fix without needing to wipe data ?
[Samsung Galaxy Nexus] efrant:
Not sure about the Nexus S, but on a GNex, the Android with the red triangle is the stock recovery. (If you've updated via an OTA update, it placed two files in /system that re-flash the stock recovery on every boot. Delete them: /system/etc/install-recovery.sh and /system/recovery-from-boot.p and then re-flash CWM.)
[Samsung Galaxy Nexus] rguinot:
Hi,

Well in the recovery menu there is usually a menu. (e.g. search "android recovery menu" in google images, not enough posts for an external link).

However in my case there if i enter the recovery menu there is just a "dead" android with a red triangle. i have to remove the battery to reboot the phone.

I don't think i can flash cwm since my bootloader is still locked - i avoided the unlocking to avoid the data wipe. can i still flash it even if locked ?

I'm fine with getting back the stock recovery menu too, but somehow it's no longer showing up.

Do you see what i mean ?
[Samsung Galaxy Nexus] efrant:
The Android with the red triangle is the main screen of the stock recovery. To access the menu, you hold power and then press volume up.

Yes, you can flash CWM if you have root. Download CWM to the same directory as your adb.exe file and rename it to cwm.img. Open a command prompt in that directory and type the following:

adb shell

su

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

EDIT: sorry, forgot you had a nexus S. The path will be different for you.
[Samsung Galaxy Nexus] rguinot:
Thanks for your reply, much appreciated.

Just to make sure, assuming i find the right path for the nexus S, if i do the dd (presumably when the phone is started), if i reboot that will :

- not lose root

- not wipe all my data (as e.g. a fastboot oem unlock would)

- not revert anything to factory default

correct ?

Many thanks.
[Samsung Galaxy Nexus] efrant:
Correct on all counts. You could also use segv11's app that I linked to in the first post to unlock your bootloader now that you have root -- it won't wipe anything.

Edit: Again, forgot you had a Nexus S... :)
[Samsung Galaxy Nexus] rguinot:
Thanks,

i'll try that tomorrow and let you know.
[Samsung Galaxy Nexus] archer007:
https://www.virustotal.com/file/980...a5088b8b110d1db872c9d88f9e19f890ee4/analysis/

It looks like Superuser.apk might be infected... Is this a false positive?
[Samsung Galaxy Nexus] monkeypaws:
Don't know if its just me but three times now in two days since I've done this I keep getting continuous notifications saying "shell has been granted permission" or something similar and it completely slows down my phone. It lasts about 5 or so mins before it goes back to normal. Should u be worried?
[Samsung Galaxy Nexus] njatb:
I tried that on my Nexus7 and got to step 6 without trouble. But when I click on "Restore" on my tablet, the exploit in the command prompt just wont stop running, thus I can't reboot the tablet. Any idea?
[Samsung Galaxy Nexus] mayurjango:
wow.. finally this worked after trying couple of times. Thanks a lot efrant. :)

Edit: Does this process works with Nexus 7 too?
[Samsung Galaxy Nexus] archer007:
Tried multiple times on a Sprint CDMA Nexus (toroplus) with 4.1.1, JRO03U.L700FH05. Didn't work. I rebooted my phone and re-pushed the su and apk files each time as well, too. Any word on that VirusTotal detected virus? The list of su/superuser files seems to indicate the the md5 of the files in the zip file provided don't match the official md5 sums. It makes me think we might be dealing with an infected version of su here.
[Samsung Galaxy Nexus] njatb:
Some reported that it does (a few pages back and on a French forum), but I can't make it work on mine. Stuck at Step 6/7. I have a stock Nexus7, latest OTA.
[Samsung Galaxy Nexus] mayurjango:
Even I was stuck at the very same step yesterday but today it worked. I've also posted about it on my site, you can check there.
[Samsung Galaxy Nexus] efrant:
False positive.

That is not related to this procedure. It may be related to the version of Superuser -- I've occasionally experience this as well (before doing this procedure). I had to reboot to fix it. It happened twice to me in the past.

No idea. Maybe try a few more times.

Yes

It is not infected. I downloaded the file myself from ChainsDD's site and uploaded it here. If you are concerned, just download it yourself from his site. Or use Chainfire's SuperSU.
[Samsung Galaxy Nexus] oldblue910:
Speaking of this methodology working on other Google-experience devices, I can confirm this works on the Verizon Xoom as well...but only to a point. You can use it to get root access on the stock ROM, but if you flash a custom ROM or a custom recovery, your bootloader will go into an error state since it's locked. This is because Motorola does locked bootloaders correctly while Samsung never has. If a bootloader is locked, it should check for signed recoveries and boot images. When they don't (*cough* Samsung *cough*), what's the point of even having the ability to lock or unlock a bootloader? Yeah, if you unlock a bootloader, it wipes data. Big deal, clearly you can exploit it, or this thread wouldn't exist. ;)
[Samsung Galaxy Nexus] efrant:
Yeah, agree.

But if you are looking at it from a security-of-personal-information perspective it makes no difference if there is NAND lock (like Moto devices) or not: if one can gain root, one has access to all personal information stored on the device, irrespective of the lock state of the bootloader, and irrespective of the NAND lock. The only thing that having a NAND lock (like Moto devices) does is irritate XDA devs... :D
[Samsung Galaxy Nexus] oldblue910:
Fair enough, my friend. It just goes to show that no matter how much security and lockdown you put on something, someone will always find a way around it. My only point is, Samsung shouldn't even offer a lock/unlock state on their bootloaders because it really serves no purpose. If you're going to have an actual locked and unlocked state, it seems Motorola's approach makes the most logical sense.
[Samsung Galaxy Nexus] segv11:
It's not really a lock on the G-Nex, it's just a preference setting for fastboot: regular mode or advanced mode. That's why the pref is stored on param, where it is convenient to modify using root. ;)

Sent from my Jelly Beaned "toro" Galaxy Nexus.
[Samsung Galaxy Nexus] stealthj:
adb: unable to connect for backup

oh well, it was worth a shot! good for you guys who got it working.
[Samsung Galaxy Nexus] drenigma:
Confirmed working on Verizon after OTA 4.1.1 update

I just registered so I could thank you for this - I had previously used the 4.0.2 exploit to root without unlocking, and was back to non-root after the OTA jellybean update. Thanks SO much for posting this - it took me a while to get ADB going on my mac, but after that your instructions were excellent and I'm now rooted again. This type of community sharing is what makes the internet amazing. THANKS AGAIN!
[Samsung Galaxy Nexus] efrant:
You probably don't have your drivers set up properly.
[Samsung Galaxy Nexus] njatb:
Hurray! I tried it this morning after a good night sleep and it worked like a charm for my Nexus7!

It seems my PC needed a reboot (maybe the tablet too, and so did I), and it went flawlesly. Checked with Root Checker : I have root access :laugh:

Efrant, you're a genius!
[Samsung Galaxy Nexus] njatb:
If it's okay with you efrant, I created a topic on the Nexus7 forum here on XDA to confirm it's working too. I obviously given you the credits you deserve and redirected towards this topic.
[Samsung Galaxy Nexus] efrant:
By all means. I'd prefer this thread be GNex only anyway.
[Samsung Galaxy Nexus] Wilks3y:
Quick question, if you use this method to Root your device, if you ever want a custom rom and need to unlock bootloader, will this have any negative effects? OR will the bootloader process work as normal? Thankyou :)
[Samsung Galaxy Nexus] Mach3.2:
Not any that I know of.

Beamed from my Grouper.
[Samsung Galaxy Nexus] Raisone:
Done in a Nexus 7 on the first attempt without problems.

Thank you so much!

If you don´t mind, i´ll do a guide in spanish, mentioning you and this thread.

Thank you so much!
[Samsung Galaxy Nexus] jordanishere:
I can get this far but after trying step 5, i get an error saying file not found :/

Would anyone happen to have a video walkthrough of this process? If not maybe i can figure it out here.

Thanks!
[Samsung Galaxy Nexus] efrant:
Please do not quote the first post in any replies. (I update it occasionally, and those changes do not get reflected in the quote.)

As for your issue, you probably did not type the command in exactly as is. Just copy and paste it into your command prompt (including the quotes).
[Samsung Galaxy Nexus] efrant:
On a GNex, you don't even need to unlock the bootloader to flash a custom ROM. You can also unlock the bootloader without wiping (using segv11's app as mentioned in the OP). But to answer your question: everything will work as normal.
[Samsung Galaxy Nexus] efrant:
Sure, no problem.
[Samsung Galaxy Nexus] mayurjango:
Hi efrant, I used this method to root my GNex and later on unlocked the bootloader using Segv's BootUnlocker app.

But there seems some issue with write permissions in bootloader mode as I'm unable to flash custom recovery (can temporarily boot into custom recovery though). When I tried flashing CWM via ROM Manager, then it worked perfectly. I guess either the device doesn't has full root access or bootloader is not unlocked (shows unlocked though). What say?

Thanks.
[Samsung Galaxy Nexus] efrant:
What problems are you having? Are you saying that cwm won't stick? If so, it is because you Prob updated via an OTA update and forgot to delete /system/etc/install-recovery.sh which flashes the stock recovery every time you boot.

It has nothing to do with unlocking using segv11's app or with getting rooting this way. Getting root and unlocking via this method gives you the exact same result as using fastboot oem unlock and flashing an su zip.
[Samsung Galaxy Nexus] mayurjango:
Yes, whenever I flash custom recovery what I see is Android with red triangle which is stock recovery. Yes, I updated from ICS to JB via OTA update but before performing the rooting and unlock procedure. Please tell how to delete /system/etc/install-recovery.sh ?

Thanks. :)
[Samsung Galaxy Nexus] efrant:
Easiest way is to use a file manger with root access (like Root Explorer, ES File Explorer, File Expert, Root Browser, etc.), navigate to the file, and delete it (making sure that the partition is mounted as r/w so you can actually delete it... :) ).

Or you can do it in ADB:

adb shell

su

mount -o remount,rw -t ext4 /dev/block/mmcblk0p1 /system

rm /system/etc/install-recovery.sh
[Samsung Galaxy Nexus] mayurjango:
Yay.. That worked! Thanks a lot efrant, specially for the easiest way. :P
[Samsung Galaxy Nexus] zarish:
Thanks! worked perfect for my stock Nexus 7. Confirmed via Es File Explorer and Stickmount. su also showed in apps list.

Unfortunately did not seem to work for my stock HTC Amaze 4G. Got through all the steps just fine but after the reboot for 18, by 19 su is gone. Android 4.0.3 (ICS). No root confirmed via ES File Explorer and lack of su in apps list. Also going through steps 1-9 again and then doing and then doing an "ls /system/bin" shows no su available.
[Samsung Galaxy Nexus] efrant:
It doesn't work because I wrote this up for the GNex, not the Amaze 4G. The mounting point for the system partition is not the same.

Try this one:

mount -o remount,rw -t ext4 /dev/block/mmcblk0p29 /system
[Samsung Galaxy Nexus] zarish:
Understood, not complaining, just making an observation.

Your guide was very well written and easy to follow. Most excellent and as I said worked beautifully and easily for the Nexus 7. Thank you again.

Just figured it worked so well I'd give it a shot. No luck with the other mount point either. Not really worried about it. With the Nexus 7 by my side phone will see whole lot less use anyway. Clicked the link you had to Bin4ry's profile then to his thread and loked through that seems I'm not alone in not getting it to work on the Amaze and a few other HTC devices. Based on further reading in that thread revealed the explanation for the HTC Amaze and other HTC devices (first matched my experience):

Ah well, c`est la vie.
[Samsung Galaxy Nexus] sanatox:
Ey, I just registered to thank you.

I needed to make it a couple ot times on my Galaxy Nexus but it worked like a charm.

Elegant and easy.

Thanks again!!
[Samsung Galaxy Nexus] aloefresh:
local.prop created but no emulator mode

I ran this on my GNex but failed. Then I tried to find out what went wrong. I can pull local.prop by doing "adb pull /data/local.prop" and can see there is only one line in this file:

ro.kernel.qemu=1

But GNex boots to a mode that looks nothing special to me and I can't get root with "adb shell".

What do you think is wrong here?
[Samsung Galaxy Nexus] jordanishere:
Thanks for the reply. Below is a screen shot of exactly what goes wrong in step 5. Any advice? I have never used a terminal before. Thanks.
[Samsung Galaxy Nexus] efrant:
No idea. There should only be one line in the local.prop file, and when you reboot, you should have root via adb shell.

That is what's supposed to happen. Then when you click restore on your device, those errors should stop. That is when you reboot your device.
[Samsung Galaxy Nexus] travis:
Just a big thankyou from a member with a Galaxy Nexus and completely broken power key. You have helped me out tremendously.:good::good::good:
[Samsung Galaxy Nexus] costinu:
I have the exact same problem. I've tried it like 20 times. Could it be that I'm using the default windows driver for the phone. I can't seem to get the driver that is on the first post to work no matter what i do. Any ideas?

local.prop has ro.kernel.qemu=1 on the first line and a lot of nul's on the second line
[Samsung Galaxy Nexus] jordanishere:
Thanks Efrant. Worked like a charm. I skipped step 17 by accident but everything appears to be working. Yeah buddy:
[Samsung Galaxy Nexus] The_Engine:
I am having the same issues a few others have indicated.

When I restore the fakebackup.ab I get the restore prompt on the phone. The options are white (active) and it has a line to enter a password in case the restore is encrypted.

Then I run the exploit. The file not found error flood the cmd prompt.

I hit restore on the phone.

At that point the phone just stays on the restore screen the options to restore are grey now, and the file not found error continues to flood the cmd.

No idea what is wrong. I know the driver is correct since it runs the fakebackup.

Any ideas?

---------- Post added at 12:56 PM ---------- Previous post was at 12:33 PM ----------

Disregard. I had to have a typo. When I went back through and Copied each command from teh OP and Pasted it into the CMD Prompt it worked.
[Samsung Galaxy Nexus] monkeypaws:
I'm doing this for someone else. If they wanted to unroot for warranty purposes is there another script or can they use the tool box to do so?
[Samsung Galaxy Nexus] efrant:
All you have to do it remove the files you copied over, and all traces of root will be gone.

Open a command prompt and type the following:

adb shell

rm /data/local/tmp/su

rm /data/local/tmp/Superuser.apk

su

mount -o remount,rw -t ext4 /dev/block/mmcblk0p1 /system

rm /system/app/Superuser.apk

rm /system/bin/su

And there is never any need to use a toolkit... ;)
[Samsung Galaxy Nexus] costinu:
I have now tried to root with win 7 32 bits and

64 bits with default drivers and recommended drivers and i still have no root. I have attached a print screen of my system.

I also tried on 2 different phones but from the same lot and with the same version of JB.
[Samsung Galaxy Nexus] efrant:
Are you sure you are typing in the commands exactly as is? Copy/paste into the command prompt would be better. And make sure you click "Restore" on your device at the right point in the process.
[Samsung Galaxy Nexus] costinu:
I do use only copy/paste and i think i press restore at the right moment (when the console is running the while loop)
[Samsung Galaxy Nexus] efrant:
So when you click restore, the loop doesn't stop for you?

I have no other ideas then. You are running a non-Google build, but I find it hard to believe that would make a difference.
[Samsung Galaxy Nexus] costinu:
The loop stops when i click restore as it should. I'm using the latest ota that i received 3 weeks ago, nothing special... i think.
[Samsung Galaxy Nexus] efrant:
So once the loop stops, and you reboot, and then open another shell, you don't have a # prompt?
[Samsung Galaxy Nexus] costinu:
Nope, I still have $.
[Samsung Galaxy Nexus] costinu:
Can you tahe a look at my local.prop file? I think this is the problem, but I don't know what to do about it.
[Samsung Galaxy Nexus] tatsujin:
anyone tried this already on a Motorola Atrix HD or Razr HD (these are also on 4.0.4 currently) ? thank you for the good work anyway! :)
[Samsung Galaxy Nexus] efrant:
That is the way it's supposed to look.

What I don't understand is that if that line is in local.prop, your device should boot into emulator mode.