yashsingh1/xdaforums huggingface dataset:
[Nexus One Android Development] futango:
The classical way involves the phone to be off then do this. Where as quick boot you just open the app and click Recovery, wait 5 seconds and your phone reboots into recovery for you.

ADB Reboot recovery involves being connected to a computer. Are you going to be connect to a computer 24/7? I think not.

Quick boot also gives the options to just reboot the the phone or get into bootloader. Awsome app.
[Nexus One Android Development] jmbrown32:
I'm also getting permission denied when I try to run freenexus.

after i adb shell and cd to /tmp, I got this
[Nexus One Android Development] dolomiti7:
You did something wrong with pushing freenexus to the device. Somehow you created a directory named freenexus and did not transfer the file. Either you delete the directory

Adb shell rm -rf /data/local/tmp/freenexus

And push the freenexus file again (it should be around 12kb)

Or you push the file with another name

Adb push freenexus /data/local/tmp/freenex2

And then continue with the new name (chmod,etc.)

Before you should check if you have the 12k sized file in your tools directory on the pc. Maybe you have a directory named freenexus there by accident
[Nexus One Android Development] krohnjw:
Are you in /tmp or /data/local/tmp? I am going to assume the latter as the files are there.

The d in front of freenexus permissions (drwxr-xr-x) indicates it is a directory - so definitely not executable.

$ ls -l
-rwxr-xr-x shell shell 1926944 2010-03-22 20:29 busybox
-rwxrwxrwx shell shell 26248 2010-07-22 10:20 su
-rwxrwxrwx shell shell 27688 2010-07-22 10:19 Superuser.apk
drwxr-xr-x shell shell 2010-07-30 12:50 freenexus
$ ./freenexus
./freenexus: permission denied

Remove freenexus and push the file again:

adb push freenexus /data/local/tmp/freenexus
adb shell chmod 755 /data/local/tmp/freenexus

This is what you should see:

-rwxr-xr-x shell shell 1926944 2010-03-22 20:29 busybox
-rw-rw-rw- shell shell 26248 2010-07-22 10:20 su
-rw-rw-rw- shell shell 27688 2010-07-22 10:19 Superuser.apk
-rwxr-xr-x shell shell 11917 2010-07-26 20:00 freenexus

Then try to execute it again.
[Nexus One Android Development] drzplaya1121:
confirmed working. Tmobile USA
[Nexus One Android Development] aelole:
Hi

Sorry for maybe asking stupid questions but i am noob so i want to make sure that this method will work for me

I own an unlocked N1 (works with any carrier) . Does this mean that bootloader is unlocked?

Well in bootloader menu i see the following info

hboot- 0.33.0012

microp 0b15

radio 5.08.00.04

In settings i see :

Cytamobile-Vodafone

Android version :2.2

Baseband version 32.41.00.32U_5.08.00.04

kernel version 2.6.32.9-27227-g3c98b0d haley@m4-dev#1

Build number FRF91

Will this method work on my phone? I dont want to brick it as i recently bought it :)

some other questions. how much free space i need on sdcard for this method?

does it matter what filesystem i have on sdcard and if yes how can i see what filesystem is sdcard formatted?

.is there a way to make a complete backup of my current stock installation before i get root? can i use nandroid for that?

Thanx in advance

I desperately need to root my phone and your help would be appreciated.If that works for me i will donate

After rooting i would love to try cyanogenmod rom
[Nexus One Android Development] ilostchild:
No all nexus are SIM unlocked, The Bootloader is still locked, this method skips the unlock bootloader step so you get to keep warranty
[Nexus One Android Development] futango:
Your bootloader is not unlocked.

Yes this method will work for your phone

This uses very little sdcard space. Maybe a MB, if even.

the filesystem should be FAT32.

If you are using a NEW sdcard just format with the phone.

To use nandroid you need a custom recovery. I believe if you do this method then you will have root before a custom recovery.
[Nexus One Android Development] aelole:
Thanx for the quick replies.I am currently backup my data and i am ready to start :) Hope it will be easy. wish me good luck
[Nexus One Android Development] jmbrown32:
yeah you're right. i pushed a folder titled freenexus instead of the file. I'm having trouble removing the directory from tmp. How would I do that? I'm on a mac. I tried "rm freenexus" but got a message saying I couldn't do that because freenexus is a directory.
[Nexus One Android Development] IamJAX:
Hi,

I am getting the following the I give 'flash_image recovery /sdcard/recovery-RA-nexus-v1.7.0.1.img' command.

What does this mean? I am on frf91. HBOOT is 0.33

I tried rebooting and it was new recovery. I tried making a nandroid backup.

Also since I got the error, I didnt run the remaining commands

I have root and everything looks like working fine. Is there any issue with that error and not giving the two commands?
[Nexus One Android Development] aelole:
That was very sweet.I am root in under 5 minutes.Thanx author for his method and also the friends here who answered my questions
[Nexus One Android Development] krohnjw:
rm -rf will remove the dir and sub directories.
[Nexus One Android Development] DeFiant*X:
Worked great for me in less than 10 mins! Who wants to trim their battery anyway?
[Nexus One Android Development] dolomiti7:
Ok, I guess the problem of pushing a directory is caused when people extracted the zip file accidently to an automatically created folder /android-sdk-windows/tools/freenexus. And afterwards they tried to move the files from the freenexus folder to the tools folder, which will work for all files except the freenexus file as it has the same name than the folder. To be honest, if you did this really by accident, ok. But if you don't know what's going on here and don't know what "adb push" means, you should really think twice about if you really want to root your phone. Rooting is about more than just installing CM6. Anyway.

You have to extract the files directly to /android-sdk-windows/tools!!!!

if you have already pushed a folder "freenexus" to your phone, there are several ways to correct this.

1. delete the folder /freenexus in your tools directory

2. extract freenexus.zip again, this time the content directly to tools folder

3. try do delete the folder on your phone

adb shell rm -rf /data/local/tmp/freenexus

4. if this didn't work try to push freenexus with a different name:

adb push freenexus /data/local/tmp/newname

5. then continue the tutorial and replace freenexus with newname

i.e. adb shell chmod 755 /data/local/tmp/newname

6. if all this doesn't work, i guess that the file freenexus is already on your phone within a subfolder. So:

adb shell

cd /data/local/tmp

chmod 755 freenexus/freenexus

./freenexus/freenexus

toggle wifi

...

I have added a big red hint in the tutorial to avoid that from the beginning in the future...

@aelole: if your bootloader was already unlocked you would know it and you would also see it every time you boot the phone by the small open-lock-icon on the display. Your phone is only sim-lock-free which I think are all Nexus One. This has nothing to do with the bootloader. Also when you don't know how your SD Card is partitioned it contains with a probability of 99,99% one big FAT32 partition which is ok. The procedure to root itself doesn't affect your SD Card at all. It doesn't matter how much space you have left. The first point where the SD Card is used is when you copy the recovery image to the SD-Card before you flash it. This is about 4MB in size.
[Nexus One Android Development] dolomiti7:
I didn't see this error message myself, but I think this is really a bad block in the flash memory. Normally yaffs2 file system should handle bad blocks and avoid them in the future. Maybe try to flash the recovery again. The two "rm" commands are not critical though. you can execute them nevertheless. If your recovery sticks, I guess there are no such files anyway and the "rm" commands will result in a "no such file" error.
[Nexus One Android Development] apeironer:
Sorry i made a mistake and figured it out.
[Nexus One Android Development] jmbrown32:
Finally got it working! Thanks for all the help!
[Nexus One Android Development] IamJAX:
Thanks for replying. Root works great. Thanks a lot.

Tried flashing again and got the same error. But I can boot into recover. Didn't tried flashing any rom yet. Will it be a corrupt recovery that got flashed?
[Nexus One Android Development] Goonish:
This new method saved my bacon after the older technique wouldn't work due to a signature failure error.

Thanks very much to the people responsible for this!
[Nexus One Android Development] dolomiti7:
I wouldn't rely on the recovery working properly. I am not sure how to handle this. Here are just a few ideas:

- Try downloading the clockworkmod recovery which is smaller and flash it manually. if you are lucky the bad blocks are not affected due to the smaller size:

http://koush.tandtgaming.com/recoveries/recovery-clockwork-2.5.0.1-passion.img

- I am not sure, but maybe bootloader handles bad blocks when flashing a complete PASSIMG. So the idea would be to put e fresh EPE76 "PASSIMG.zip" or similar to the sd and reflash the device with a stock rom, then root again and try to reflash recovery.

- Third idea: make a dump of the recovery and compare it with the original file to see what has really been flashed:

adb shell

cd /sdcard

dump_image recovery img

split -b 4042752 img (replace the figure by the exact size of the recovery, if you flashed clockwork size is 2914304)

then you will find a file xaa on your sdcard

compare this binary with the original on your pc (windows: fc file1 file2 /b)

don't forget to remeove the files img, xaa, xab from the sdcard

Flashing a ROM with a defect recovery is risky... also flashing the PASSIMG. But on the other hand, if your device has really a flash rom problem you should have no problem to replace it by warranty.
[Nexus One Android Development] jdadroid:
Works a treat. Thanks.
[Nexus One Android Development] jmbrown32:
I also got a bad block error when flashing amon ra's recovery. Everything seems to be going ok so far but I guess I should try to get a recovery on here that installs error free lol.

Edit: I redownloaded and flashed amon ra's recovery and everything worked.
[Nexus One Android Development] aelole:
Well now i need to proceed with a custom rom.probably cyanogenmod.is there any chance of failure with rom manager? Dont vare if the process is maybe not transparent bit if it is safe i will proceed.

As for recovery image are there any problems to switch from clockwork to amon ra f.e in the future?
[Nexus One Android Development] wastegate13:
Followed the guide and everything worked great. I have the Superuser app and always return a # in shell. However I can not flash Amon RA's recovery. I get a permission denied message anytime I try to push it from adb. I also tried flashing it from my SD using a terminal emulator with the same results. Any ideas?
[Nexus One Android Development] IamJAX:
Tried this and again got same error.

Didnt try this as I didnt feel like flashing from a defective recovery.

Thanks a lot. This is the best idea and it solved the issue. dumped the recovery and split it. There was no difference. the MD5 matched. So I believe the recovery is fine. The file system must have taken care of it.

The steps I followed for dumping recovery are

Download dump_image from

http://www.4shared.com/file/-0yByOIb/mzTools.html

Move this file and Set the permission just like flash_image

Then 'dump_image recovery img' from su shell.

I split the file on desktop using a hex editor.
[Nexus One Android Development] Highland3r:
Another confirmation.

Working fine on stock FRF91.

Used instructions as per http://xdaforums.com/showpost.php?p=7392149&postcount=61 for custom recovery. Instructions in the first post seemed to work, but after a couple of reboots the stock recovery re-appeared.
[Nexus One Android Development] bossjerix:
i wish i had done this instead.

sounds easier.

<like>
[Nexus One Android Development] Constrabus:
Obviously it's because when you send in your nexus one, you don't send in accessories with it aka the battery back and the battery), you just send in the core phone. So they won't even have the battery in the first place.

Just sayin'
[Nexus One Android Development] mburt27:
Thanks! Works perfectly.
[Nexus One Android Development] Talderon:
*Wonders why this has not been stickied yet* ;)
[Nexus One Android Development] futango:
I was thinking the same thing.
[Nexus One Android Development] IamJAX:
Same here. This method works great :)
[Nexus One Android Development] osugsxr:
help....have su already

19) In your terminal, type "mount -o rw,remount /dev/block/mtdblock4 /system" and hit Enter

20) In your terminal, type "cat /sdcard/flash_image > /system/bin/flash_image" and hit Enter

21) In your terminal, type "chmod 775 /system/bin/flash_image" and hit Enter

22) In your terminal, type "flash_image recovery /sdcard/recovery-RA-nexus-v1.7.0.1.img" and hit Enter

23) In your terminal, type "rm /system/etc/install-recovery.sh" and hit Enter

24) In your terminal, type "rm /system/recovery-from-boot.p" and hit Enter

Stuck on the last part of this process.....

able to run step 19...get the follwing mount-orw, remount/dev etc.....

now the step 20.... i get the following....cannot create /system/bin/flash_image:read-only file system..... stuck on this part not sure what to do.
[Nexus One Android Development] dolomiti7:
Try to follow the steps in the recovery section on the first page/post of this thread. It is nearly the same but doesn't use system partition and therefore works without remount.
[Nexus One Android Development] osugsxr:
cd /data/local/tmp

(or cd /system/bin if you pushed flash_image there with step 3b)

chmod 755 flash_image

./flash_image recovery /sdcard/recovery-RA-nexus-v1.7.0.1.img

rm /system/etc/install-recovery.sh

rm /system/recovery-from-boot.p

(and if everything worked fine:)

rm flash_image

this is what i typed in.....little confused on this part of the command though

# cd /data/local/tmp

cd /data/local/tmp

# chmod 755 flash.image

chmod 755 flash.image

Unable to chmod flash.image: No such file or directory

# chmod flash.image./flash_image recovery /sdcard/recovery-RA-nexus-v1.7.0.1img

chmod flash.image./flash_image recovery /sdcard/recovery-RA-nexus-v1.7.0.1img

Bad mode

# chmod 755 flash_image./flash_image recovery /sdcard/recovery-RA-nexus-v1.7.0.1

.img

chmod 755 flash_image./flash_image recovery /sdcard/recovery-RA-nexus-v1.7.0.1.i

mg

Unable to chmod flash_image./flash_image: No such file or directory

# chmod 755 flash_image

chmod 755 flash_image

# rm /system/etc/install-recovery.sh

rm /system/etc/install-recovery.sh

rm failed for /system/etc/install-recovery.sh, Read-only file system

#
[Nexus One Android Development] IamJAX:
space after flash_image and its flash_image and not flash.image

There is space after flash_image

You have also used flash.image instead of flash_image

the commands should be as follows the # shows is the prompt u get after su. You can copy and past the commands so that u wont make any typing mistakes.

The commands are case sensitive and u have to type exactly as it is.
[Nexus One Android Development] osugsxr:
get the follwing...

su

# cd /data/local/tmp

cd /data/local/tmp

# chmod 755 flash_image

chmod 755 flash_image

# ./flash_image recovery /sdcard/recovery-RA-nexus-v1.7.0.1.img

./flash_image recovery /sdcard/recovery-RA-nexus-v1.7.0.1.img

mtd: not writing bad block at 0x00320000

#
[Nexus One Android Development] jmbrown32:
I got this same thing. I redownloaded the recovery image from amon ra's recovery thread on XDA and reflashed it and it worked.
[Nexus One Android Development] osugsxr:
not sure what I did wrong.....besides probably a few command errors... Anyways I used the following, to cut and paste in command prompt and it worked perfectly.

19) In your terminal, type "mount -o rw,remount /dev/block/mtdblock4 /system" and hit Enter

20) In your terminal, type "cat /sdcard/flash_image > /system/bin/flash_image" and hit Enter

21) In your terminal, type "chmod 775 /system/bin/flash_image" and hit Enter

22) In your terminal, type "flash_image recovery /sdcard/recovery-RA-nexus-v1.7.0.1.img" and hit Enter

23) In your terminal, type "rm /system/etc/install-recovery.sh" and hit Enter

24) In your terminal, type "rm /system/recovery-from-boot.p" and hit Enter

have the recovery image on there now, although its green, prefered the blue one but it works! THANK YOU for your help!!!!
[Nexus One Android Development] SiNJiN76:
I got everything done without error...but at the end when I type su...I get permission denied...tried it several times.

Got Terminal Emulator and typed su...it required superuser permission...

So, I went back to the cmd prompt typed su and the permission request popped up on screen...gave it permission and it worked!

So, maybe add that part....after typing su...you gotta 'allow' from the phone.

Thanks tho for the Tut! Much easier than the other methods!
[Nexus One Android Development] hubono:
Worked as a charm. Thanks
[Nexus One Android Development] osugsxr:
Second nexus one, first one I unlocked the bootloader, kinda nice not having to do so.
[Nexus One Android Development] SiNJiN76:
So, if the Recovery image ever gets updated again...would we have to go through this method...since the bootloader is still locked to replace it? (not sure what the bootloader does or what it's for) Or can we use the commands that's on RA's thread?
[Nexus One Android Development] antikryst:
can someone post instructions on how to do this on a mac? was already able to download and install the sdk for mac to get screenshots.

also... im planning to do this method just for the market hack since i dont get access to the paid market from where i am.. this would do it right?
[Nexus One Android Development] hmanxx:
On this step

12. toggle wifi on

13. you should see something like that:

=> Do we really need to have working AP around to get it to work or just simply toggling the WIFI ON from the power wizard or the Wireless page.?

Root done with the steps on Post 1..FRF91-Singapore set. I can use Root Explorer now.
[Nexus One Android Development] futango:
You dont need a work AP. Just toggle the Wifi ON/OFF with widget or in settings.
[Nexus One Android Development] ilostchild:
the linux version should work the same for MAC's
[Nexus One Android Development] antikryst:
thank you was able to root my nexus just 30 minutes ago.... my problem was that i couldnt get adb to run... this thread helped me:

http://xdaforums.com/showthread.php?t=649663
[Nexus One Android Development] pranks:
Great tutorial, but I'm stuck after step 19!

When I type

$ su

It says "Permission Denied

I followed all previous step properly.. plz help.
[Nexus One Android Development] antikryst:
happened to me also... according to the instructions... type in su again. i did that then it worked the 2nd time.
[Nexus One Android Development] forskin:
After following your instructions, I can't get past "adb devices". usb debugging is activated. I just get "list of devices" and no devices show up. Any help would be appreciated. I tried with "usb storage" both on and off. Thanks
[Nexus One Android Development] futango:
Do you have the drivers installed?
[Nexus One Android Development] IamJAX:
Do u have drivers installed? Did u enabled debugging?
[Nexus One Android Development] IamJAX:
You just need the flashing recovery part.

If u have copied flash_image to /system/bin, u can flash any recovery using the following commands.

recovery-RA-nexus-v1.7.0.1.img has to be replaced by new recovery image.
[Nexus One Android Development] pranks:
Rooted succesfully! My regards to the author.. :)

so is it safe to use Rom Manager (clockwork rom manager)? I downloaded it from android market just now..

I think that wud the easiest way to flash custom rom.. or is it risky?
[Nexus One Android Development] dolomiti7:
No, it is not risky. There is only a chance that the recovery you flash with ROM Manager doen't stick and after a reboot stock recovery is back in place. I have used both ROM Manager and manual flash procedure on my Nexus and never ran into any problems. Installing the recovery with ROM Manager worked flawlessly for me and the recovery remained. But as you have read in some of the posts, this doesn't work on all devices. I don't know the reason for that. There are some people who insist that flashing the recovery out of an app like ROM Manager cannot work as a matter of principle. Based on my own experience this is just not true. So you can just try it and test a few times if the recovery sticks after booting to recovery and a (or several) reboot(s).
[Nexus One Android Development] dolomiti7:
Some of you mentioned that this thread should be sticky. I guess this is something decided by the forum admins. Or is there anything I can do about that?
[Nexus One Android Development] SiNJiN76:
oops........
[Nexus One Android Development] duggey:
Worked great

Worked flawlessly... Titanium backup is running now!
[Nexus One Android Development] galaxys:
You can't do it yourself, but you can ask the Admins here:

http://xdaforums.com/showthread.php?t=276306
[Nexus One Android Development] j00m:
Anyone guide me to get root (use this method) without connect my N1 to computer ?
[Nexus One Android Development] dolomiti7:
Well, this method is about rooting your phone WITH access to the computer. When I started this method I also had a quick try to do it directly on the phone, but couldn't get write access to /data/local/tmp which is essential.
[Nexus One Android Development] hmanxx:
Hi,

May I know how to unroot and restore back to Stock ? Is uninstalling Superuser.apk and delete su will revoke the permission ?

thanks
[Nexus One Android Development] j00m:
$ls -l
----rwxr-x system sdcard_rw 1926944 2010-08-03 22:49 busybox
----rwxr-x system sdcard_rw 11917 2010-08-03 22:49 freenexus
----rwxr-x system sdcard_rw 26248 2010-08-03 22:49 su
----rwxr-x system sdcard_rw 27688 2010-08-03 22:50 Superuser.apk
$ ./freenexus
./freenexus: permission denied
$ id
uid=10056(app_56) gid=10056(app_56) groups=1015(sdcard_rw),3003(inet)
$ pwd
/mnt/sdcard

Did you try connectbot shell ("local" method connection)? I am trying as above but not successful. It will nice if get root "no need plugin computer"
[Nexus One Android Development] hubono:
Hello,

I have rooted my t-mobile USA with the above way. it worked flawlessly, thank you.

Then I installed cm rc2, now i want to go back to stock but still keep root. my boot loader isn't unlocked and I want to keep it that way.

I went into rom manager/stock roms and chose frf91 then i checked rooted boot image and superuser 2.2.2.

is that how it should be done or am i doing something wrong?
[Nexus One Android Development] drew_grant:
-> For all Newbies: Take care that you extract the files directly to the tools folder and don't create a new subdirectory freenexus within tools!!! If you did, delete the folder and extract again!!! Check twice that there is no FOLDER freenexus in your tools directory before you continue!!!

How do you extract the file in the tools folder without it automatically creating a folder for what was extracted from the freenexus.zip file? I'm also on a Mac with 10.6 on it.
[Nexus One Android Development] 66o6o:
I've tried it a second time and it still doesn't work.

i;ve gone over the procedure about 4 times now and its still not working.

could there be anything obvious that i am missing.
[Nexus One Android Development] antikryst:
sorry... not really a dev. this is my first experience rooting and it just worked for me. maybe someone else could help you out.
[Nexus One Android Development] drew_grant:
Could someone help me out with #13)B.? Yeah I'm a newbie at Terminal things...
[Nexus One Android Development] Kan-Ru Chen:
Root your Phone with just 1-Click

Hi, I made an apk for the root part.

It's an Android application that inject the su program into your phone.

Continue reading: http:blog.kanru.info/archives/822
[Nexus One Android Development] Gunthy`:
thanks so much!! this enabled me to install custom roms on my device without having to unlock the bootloader (and thus losing my warranty).

will pitch in a donation as soon as the next pay-check comes in ;)