Tuesday, August 31, 2010

Wireless Tether (Mobile Hotspot)

Maybe you thought that you needed an Evo 4G or a Droid X or some other "new" smart phone to do things like wireless tether (mobile hotspot). Well you don't. Your HTC Hero for Sprint supports wireless tether... you just need to root it first.

To root your HTC Hero for Sprint, read my "rooting" posts. They are all in the August 2010 archive on the right side of this page.

Once you have root privileges on your phone, you can run apps that "normal" Hero users cannot. One such app is Wireless Tether for Root Users by Müller, Lemons and Buxton. Just go to the Android app market with your rooted HTC Hero, download and install this gem and...


...vwala!

This app works great. While I haven't spent enough time using it to tell you how hard it is on your battery (without a doubt, it's hard on it), I can tell you that the connection speeds are zippy enough for casual web browsing and the tether is pretty "tight" (i.e. not a lot of packet loss). This app would be great for doing some work on the train or the passenger seat of a car. Best of all, this is a FREE mobile hotspot / wireless tether app. There are not additional fees associated with using this!

UPDATE (9/21/2010): I just found out that Sprint actually charges users an additional monthly fee to access mobile hotspot on supported phones! This wireless thether app for mobile hotspot is free and there are no fees. The joys of root.

In future posts, I will explore a wide variety of root user apps as well as custom ROMs.

Backups and Recoveries: Using Nandroid

Because we rooted our HTC Hero for Sprint using the unrevoked method, we still have not made it possible to use Nandroid to make backups, run recoveries, and install custom ROMs. If you want to run a custom ROM, you'll need to be able to use Nandroid and so, you'll want to read through this post.

Please Note: If you haven't rooted your HTC Hero for Sprint yet, you'll want to read my Rooting Option 1 post. The following is only possible with a rooted phone.

So, we want to be able to use Nandroid. Nandroid is something like a BIOS and you'll need it to change boot settings, wipe your device, load ROMs, do backups, restores, etc.

How to's:

Step 1: Plug your rooted HTC Hero for Sprint into the computer that you put the Android SDK on and set it to "Disc Drive" (Don't have the android SDK? Read my "What You'll Need" post to get it.) Make sure you turn USB Debugging ON (on your phone: Home-> Menu-> Settings-> Applications-> Development-> USB debugging.)

Step 2: Download the android recovery-RA-heroc image here and save it to your phone's sim card at the root directory. In other words, save it to the sim card but don't put it in any folders. It should be in the main directory along with all your other folders.

Now we're really going to start hacking at your phone. Remember that you are doing this at your own risk.

All computer command line calls will be in blue, bold, and italics.

Step 3: On you computer, launch your command prompt (terminal for linux users and I don't really care what it is for apple people). If you don't know how to launch a command prompt, just go to the "start button" and run "cmd" (for XP users) or just type "cmd" in the search field for Vista/Win 7 users.

Step 4: Now we want to change directories so that we are hanging around our Android SDK tools. In your command prompt type: cd C:\...\android-sdk-windows\tools
and hit "Enter". The "..." is whatever path leads to your android sdk folder. If this is new to you or you don't understand this, I highly recommend you stop now and enjoy your rooted phone as it is.

Your command prompt should now read: C:\...\android-sdk-windows\tools>_

Step 5: We now want to launch some shell code but first we want to confirm that our SDK tools see your phone. In your command prompt, type: adb devices
and hit Enter
You
should see a List of attached devices and your device's serial number.

Step 6: We launch our shell: adb shell
and hit Enter

You should now see a $ and a cursor

Step 7: We switch to root user: su
and hit Enter

You should now see a # and a cursor. Note: if you don't see a #, look at your phone and see if it is prompting you to give any permissions. If it is, allow.

Step 8: Now we want to flash the recovery image that we put on the sdcard back in Step 2. To do this, we're going to envoke some root power after we hop onto our phone's microSD care: cd sdcard
and hit Enter

You should now see a #

Step 9: A good way to make sure that we are in the right place is to list the directories and files where we are. We'll do that my calling for a list: ls
and hit Enter

Command Prompt should list the local directories and files for the sdcard root folder. You should see "recovery-RA-heroc-v1.2.3.img" among them. If not, go back to Step 2 and be sure that you've placed this image on your phone's sdcard.

Step 10: We are now going to flash this recovery image in order to create our Nandroid directory: flash_recovery recovery-RA-heroc-v1.2.3.img
and hit Enter

Nothing too exciting will happen. Command prompt might return this call in text form and then should just leave you again with a # awaiting your next command.

Step 11: Now, we will are going to visit our newly created nandroid folder by forcing our phone to boot into it: reboot recovery
and hit Enter

Your phone will reboot into the nandroid interface. From here you will be able to make backups of your phone, restore your phone from these backups, wipe system data and, most importantly, install custom ROMs. I will cover all of this in a later post.

If any of this didn't work, please let me know in the comments field or, if you know me, let me on Facebook or something.

Rooting Option 1:

WARNING: by rooting your phone, you are choosing to void your phone's warranty. Proceed at your own risk. Know that you are choosing to do this. No one is making you. Further, you are the one doing this, not me.

Ok, so now that we have successfully migrated to build 2.27.651.5 our HTC Hero for Sprint is "vulnerable" to rooting. The rooting option that we will explore in this post is the "unrevoked" option. This is, by far, the easiest option for rooting the phone. I will explore a more "hands on" or traditional exploit in a later post for anyone who is interested in how to exploit 2.27.651.5's vulnerability from the command line.

For now, let's root our HTC Hero using the unrevoked method.

IMPORTANT NOTE: if you have not already migrated to build 2.27.651.5 or have no idea what I'm talking about, click here. You will NOT be able to root your phone using this method if you have not reverted to 2.27.651.5.

If you know that you are running 2.27.651.5 then move on to Step 1.


Step 1: Plug your phone into your computer using your USB cable.

Step 2: Set your phone to "Charge Only".

Step 3: On your phone, navigate to http://unrevoked.com/m/

Step 4: Tap to download the unrevoked exploit.

Step 5: Once the download is complete, install the unrevoked app.

Step 6: Once the unrevoked app is installed, go to your apps collection and run the unrevoked app.

Step 7: Tap "Start" and let the app exploit your phone's vulnerability.

After Step 7, you should get confirmation that your phone has been rooted.

Step 8: Go to your apps tray. Inside you should find the "Super User" app (Little Ninja with a Gun). Tap this app and you will be asked to set a permission. Approve it and your phone is officially rooted.

While it's true that your phone is rooted and that you can take advantage of apps that require root privileges there are some further steps that you need to take in order to get the most of your rooted HTC Hero.

In the next post, we will look at Nandriod, making backups and restoring backups. Knowing how to work with Nandroid is absolutely essential for loading custom ROMs.

If Software Number > or = 2.27.651.6 Then:

Sprint or HTC or someone patched the vulnerability in the HTC Hero for Sprint that we want to exploit in order to gain root access. Lucky for us, when we read the "What You'll Need" post on this blog, we went and got the "vulnerable" build (2.27.651.5) and, so, will not be bothered by this patch because we are going to "upgrade" our HTC Hero down to a more vulnerable state (vulnerable to rooting that is).

It should also be noted that this is a standard upgrade procedure. When upgrading an android device, the device itself may prompt you to upgrade (which all you have to do is tap accept, or go, or whatever) or you can download the upgrade to a computer and follow the instructions below. The only difference between a standard upgrade and what we will be doing is that with a standard upgrade, you are migrating to a newer software version whereas we want to migrate to an older version. The how-to's, however, do not change.

2.27.651.6 Workaround

Step 1: Plug your phone into your computer using the USB cable that came with it.

Step 2: Set your phone to "Charge Only".

Step 3: On your computer, navigate to the HTC Sprint Hero MR 2.27.651.5.exe that you downloaded (haven't downloaded it? do that now by clicking here: HTC Sprint Hero MR 2.27.651.5.exe).

Step 4: Run HTC Sprint Hero MR 2.27.651.5.exe and follow the prompts. This piece of software will walk you through "Upgrading" your phone down to the vulnerable build.

Please Note
1) This software will most likely fail to load the "bootloader" (you'll know what I mean when it happens). Just unplug your phone and plug it back in and run the software again.

2) This software will most likely fail somewhere else along the way. Just unplug your phone and plug it back in and run the software again. It WILL work, it simply requires a few shots at it. Do not worry, you are NOT bricking your phone.

3) Once there is success, your phone will reboot. As it's booting, it will run through the normal start up splash screens (HTC, quietly brilliant, Sprint Now Network, etc.) The phone will appear to hang on "NOW" for quite some time; just leave it alone, it will come around and finish up just fine.

Final Note
If you're like me, you might be wondering if your phone will still be able to make and receive calls to your phone number, send texts and do data. It can. My guess is that the phone's radio is matched to the serial number which is, in turn, matched to Sprint's brain. Your phone will work fine for phone duties...

...but is now vulnerable to rooting!

What You'll Need

You'll need a number of things to successfully root your HTC Hero for Sprint.

Things you'll need:
The Android SDK is the Android Developers Platform. It comes with most of the tools that are needed to do development work on the Android system (including building custom ROMs, making apps, etc.). What you'll need it for is gaining access to your phone's "root folder" through your computer. You'll be downloading this to your computer NOT your phone.

IMPORTANT
To determine whether you need this last object, you'll need to have a look at your phone:
From your home screen, press "Menu" and tap "Settings".
Scroll down and tap "About Phone".
Scroll down and top "Software Information".
If your Software Number is: 2.27.651.6 (or higher) download this to your computer NOT your phone:HTC Sprint Hero MR 2.27.651.5.exe

Android SDK
Now that you've downloaded the Android SDK, you'll need to extract it and if you're not comfortable working from the command line, you'll want to extract it to a location on your disc that isn't too dark. A really convenient place to extract the SDK to would be C:\ but for the purposes of these tutorials, I'll always refer to the directory in which the SDK is stored as C:\...\android-sdk-windows (if you're having trouble at this point, I suggest not attempting to root your phone).

Getting Started

This blog will start by focusing on the basics of rooting an HTC Hero for Sprint (cdma Hero) and then move through to more advanced user option with a rooted phone. For example, we'll take a look at loading a custom ROM (user interfaces created in the development community). I will try to answer questions or comments as they appear, though I'll most likely refer questions to the appropriate forum.