[EVO 4G Q&A, Help & Troubleshooting] BooDaddy:
In my endeavor to get rooted on my newly aquired Evo, I learned the RSA keys can easily be jacked up by flashing the wrong stuff to your phone. So, before I went flashing, and rooting away, I wanted a good way to backup the RSA keys on my phone. There are numerous threads out there about where the keys are located, and why some software jacks them up, but this is a good way to get a dump of the keys for safe keeping.

If anyone has any suggestions, feel free to PM me or reply below and I will update the thread as needed!

I am going to assume you are coming from a stock un-rooted phone. This should also work with any other Rom out there as well.

If you have already rooted your phone, you can still grab your RSA keys. See the instructions at the bottom if you have already rooted.

Prerequisites:

You will need to install the USB drivers for the phone. You can find several threads on the forum about getting the proper drivers for the phone. The way I did it was install HTC Sync from this site: http://www.htc.com/us/support/evo-sprint/downloads/

This will install two sets of programs, one will be your driver package, and the other is the actual HTC Sync program. You can go into add/remove programs and remove the HTC Sync program, but leave the HTC Device drivers.

You will also need a copy of adb in order to open a shell to the phone. This runs on your Windows machine, and connects to the phone via USB and lets you send commands to the phones shell. You can find adb all over the forums, but I have included a copy here:

http://gigahype.net/files/adb_shell.zip

Download that and extract it somewhere on your system. Something like C:\adb_shell will be fine. For simplicity, we will use this location in this tutorial.

Now, lets get started:

1. First, enable USB debugging by going to Settings > Applications > Development > and checking USB Debugging.

2. Grab and install z4root onto your Evo from this thread:

http://xdaforums.com/showthread.php?t=833953

Once you have z4root installed, run it, and choose Temporary root. This will take a few seconds to complete so be patient. It will come to a screen that says temp root was a success.

3. Connect your phone using the USB cable. Make sure you select USB Charging mode on the screen.

4. Open a command prompt window from your PC and navigate to where you extracted adb_shell.zip to. In this example, we have extracted it to c:\adb_shell

5. type the following into the command line:

adb shell
su

Once you type the su command, your phone will prompt asking you to click to allow superuser. Go ahead and click Allow superuser. This will allow the adb shell to get temporary root access.

6. Once you click Allow superuser, your adb shell (in your command window) should now be at a root command line prompt. You can tell if you are at a root command line by the # symbol being displayed. If you see a $ or something other than # then you are not at a root command prompt. GO back and try again :(

7. If you do indeed have a # then proceed by running the following command. Please type it exactly as you see it. If you are familiar with Linux command strings, this will look familiar.

busybox sed -n '/BEGIN CERTIFICATE/,$p' /dev/mtd/mtd0 > /sdcard/rsa_OEM.key

8. Your done! :D

This will dump the RSA keys to a file on your SD Card named rsa_OEM.key

Mine was about 4575 KB in size, but the size could vary.

You can disconnect the phone now. Go ahead and switch the phone's USB connection over to "Disk Drive" and then browse to your SD Card and verify that the file rsa_OEM.key is indeed on the card.

If You have already rooted your phone the process is much easier:

1. Connect your phone using the USB cable. Make sure you select USB Charging mode on the screen.

2. Open a command prompt window from your PC and navigate to where you extracted adb_shell.zip to. In this example, we have extracted it to c:\adb_shell

3. type the following into the command line:

adb shell

That will immediately drop you to a root command on your phone. You will see the # indicating you are at a root command prompt.

4. Proceed with the sed command below:

sed -n '/BEGIN CERTIFICATE/,$p' /dev/mtd/mtd0 > /sdcard/rsa_OEM.key

NOW PAY ATTENTION. Once the command completes succesfully, you will not get any reports of it completing. It will simply drop back to the # prompt.

If you get an error that states something similar to "sed command not found" then you do not have busybox running on your phone. That's ok, its not the end of the world. Keep reading, were going to modify the command a little.

Run this command

only

if you received an error stating "sed command not found" or something similar:

busybox sed -n '/BEGIN CERTIFICATE/,$p' /dev/mtd/mtd0 > /sdcard/rsa_OEM.key

5. Your done!

This will dump the RSA keys to a file on your SD Card named rsa_OEM.key

Mine was about 4575 KB in size, but the size could vary.

You can disconnect the phone now. Go ahead and switch the phone's USB connection over to "Disk Drive" and then browse to your SD Card and verify that the file rsa_OEM.key is indeed on the card.

CONGRATS! You have just grabbed a backup of your RSA keys! Put these in a safe place :)

Again, if anyone has any suggestions, please feel free to let me know! Hope this helps!