[Droid Incredible Android Development] ban_dover:
Current Status 7/14

Without the NAND being unlocked, we are unable to re-write to the recovery partition. Other than that everything is working good. Unlocked NAND=One Click Root!

This method is directly based on the new root process for the Eris released on xda.

Original thread can be found here

The following information is taken directly from the thread mentioned above with some small modifications by me for the Incredible.

Big thanks to tereg for the toolkit and the guys who rooted the EVO with a file write/chmod race condition exploit that gave me the idea for this.

jcase noticed that a race isn't actually nessisary to exploit the chmod 777 on the file I've been working with, simplifying the script alot.

I used the files from the adb development pack that Tereg put together. Download them here. You don't need them for this root process as long as you have a working adb install.

You will need adb access. Install the android sdk for your platform (macos, windows, linux) get it for your OS here.

If you don't know how to install the sdk, search xda, there are a ton of howtos for that.

Files to download:

hack-v5-DINC.zip

A ROM file

Android SKD (skip if you have a working adb)

Instructions for linux/OSX.

Have adb in your path, or move the files contained in hack-v5-DINC.zip into your sdk/tools directory so your pushes will work properly.

FOR ALL OS's Make sure your phone has Applications->Development->USB Debugging turned on.

Do NOT have your phone in Disk Drive Mode, have it in Charge Only.

Open a terminal window in your /tools/ directory. Type this at the prompt.

sh runinlinux.sh

This will take a few minutes, follow the instructions on your screen.

If you get adb: command not found, edit runinlinux.sh and change every

#/bin/bash
adb push flash_image /data/local/
adb push recovery.img /data/local/
adb push testfile /data/local/
etc...

to

./adb push flash_image /data/local/
./adb push recovery.img /data/local/
./adb push testfile /data/local/
etc...

Instructions for windows (thanks tereg!)

Download the hack.zip file and extract it to the desktop. So, you have a folder on the desktop called hack. I would recommend moving or copying those files (EDIT: that are contained in the hack folder) to the C:\android-sdk-windows\tools folder. Why? Because the script runs "adb ____" commands, and unless you've set up adb to be able to run anywhere within the command prompt, the script won't run. So, it will universally work if the files in the hack folder are placed in C:\android-sdk-windows\tools

So, open a command prompt by pressing WindowsKey+R, or going to Start-Run (in WinXP) and typing

cmd

in the text box there and press OK

If you are in Windows Vista/Windows 7, go to the Start Menu, then type in

cmd

in the search bar in the lower right-hand corner of the start menu and press enter, and locate Command Prompt in the search results, or go to Start -> All Programs -> Accessories -> Command Prompt

Type

cd C:\android-sdk-windows\tools

and press enter

Now, I recommend pushing the ROM you want to flash to the SD card now.

adb push ROM.zip /sdcard

Then, type

runindos.bat

to execute the script.

You might have to run it 2 or 3 times for it to work. If it fails, just reboot the phone normally, then run

runindos.bat

again once the phone is booted back up and you're ready.

----------(Thanks again tereg!)

It will scan for a long time, give it at least 5 minutes. If it doesn't come back after 5 minutes cntrl +c to stop it, start the process again. MOST PEOPLE HAVE TO RUN THIS AT LEAST TWICE!

If your device reboots into a new screen with options on it, you now have root in recovery mode. At this point you will be flashing your Incredible's brains, so YOUR PHONE WILL BE BLANK AFTER LOADING A NEW ROM! All of your apps/numbers will be gone from the phone.

I suggest a nand backup first.

Download and copy one of these ROM's to your sdcard as update.zip and flash it with flash zip from sdcard by selecting "Install zip from sdcard".

The first boot after loading a new ROM takes quite a while to show any activity to the screen. Give it a good 5 minutes before you start wondering if it's ever going to come back.

---

runinlinux.sh

---

#/bin/bash
adb push recovery.img /data/local/
adb push flash_image /data/local/
adb shell chmod 777 /data/local/recovery.img
adb shell chmod 777 /data/local/flash_image
adb shell rm /data/local/rights/mid.txt
adb shell ln -s /dev/mtd/mtd1 /data/local/rights/mid.txt
echo "Files copied and permissions set, rebooting HTC Andriod 2.1"
adb reboot
echo "Your phone will now reboot into normal mode, then reboot into recovery mode. If it does not reboot the second time, wait 10 minutes and manually reboot and begin again."
echo "Your phone is now rebooting in Rooted Recovery mode, do a backup and load your ROMs"
adb wait-for-device
adb shell /data/local/flash_image recovery /data/local/recovery.img
adb reboot recovery

---

runindos.bat

---

@echo off
adb push recovery.img /data/local/
adb push flash_image /data/local/
adb shell chmod 777 /data/local/recovery.img
adb shell chmod 777 /data/local/flash_image
adb shell rm /data/local/rights/mid.txt
adb shell ln -s /dev/mtd/mtd1 /data/local/rights/mid.txt
echo "Files copied and permissions set, rebooting HTC Andriod 2.1"
echo "Your phone will now reboot into normal mode, then reboot into recovery mode. If it does not reboot the second time, wait 10 minutes and manually reboot and begin again."
adb reboot
adb wait-for-device
echo "Your phone is now rebooting in Rooted Recovery mode, do a backup and load your ROMs"
adb shell /data/local/flash_image recovery /data/local/recovery.img
adb reboot recovery

This thread is intended to be an think-tank, similar to the one on the eris forums where I got the idea from. Let the ideas flow!