Monday, December 13, 2010

Unlocking the iPhone (and lessons learned)

Phone: iPhone 3GS

Started: iOS 4.1 / Baseband ??.??.?? / Jailbroken & not unlocked

Finished Product: iOS 3.1.3 / Baseband 6.15.0 / Jailbroken & unlocked running T-Mobile

Tools: iReb-4.0.x-4.1, redsn0w 0.9.6b, iTunes 9.2.1 & 10.1, ultrasn0w 1.2, TinyUmbrella, XP & 7

Picked up a iPhone 3GS on Craigslist for my dad in India this weekend. It was jailbroken on iOS 4.1 but not unlocked which meant it couldn't be used outside AT&T in the US. What started out as a quick hack to do the carrier unlock turned into a dedicated weekend project resulting in the phone being nearly bricked.

The Cult of saurik
For those who have never jailbroken an iPhone before (like me), it is a challenging and a very good learning experience. Unlike the first iPhones which needed a hardware unlock, today's jailbreak and unlock is just a software hack. All the tools that you need are available on Web (and free). Unless you have no idea what you're doing, there shouldn't be a need to pay someone to unlock one.

The basics: Jailbreaking is done to run any code on the iPhone, not just authorized software from Apple over iTunes. Unlocking an iPhone is the process by which you can run the phone on any carrier, not just AT&T (in the US). Jailbreaking affects the iOS by patching the phone firmware whereas unlocking is done by exploiting vulnerabilities in the baseband or the modem firmware. However, to unlock an iPhone it is necessary to first jailbreak it and install Cydia, the rogue app store. Once Cydia is setup, ultrasn0w can be downloaded to unlock the iPhone.

Current State: iOS 4.1 / Baseband ??.??.?? / Activated / Jailbroken & not unlocked

Rookie Mistakes & Panic Attack #1
After getting the iPhone home the I immediately noticed that it was jailbroken and running ultrasn0w but couldn't figure out why it wouldn't accept my T-Mobile SIM card. The reason, I found out later, is that ultrasn0w does not unlock all versions of the baseband. Figuring that jailbreaking again couldn't harm the phone, I downloaded redsn0w 0.9.6b and tried unlocking the phone. My source so far was just Youtube videos made by 13 year olds. I must've not done the process correctly as my iPhone went into recovery mode showing only the Apple logo on the screen.

Not knowing what happened, I googled this and it took me to a website which suggested that I reboot the phone and let iTunes restore it from recovery mode. Here's where I made my first mistake - letting iTunes download the latest version of iOS (4.2.1) and install that on the phone. Once that happened, the phone went into the unactivated state and would only accept an AT&T SIM to activate it.

Current State: iOS 4.2.1 / Baseband 5.14.04 / Un-activated

Saturday morning, I went to the AT&T store to see if I could get a pre-paid SIM to activate the phone. The rep informed me that pre-paid SIM could not be used to activate an iPhone and I'd need a new 2 year plan (which I believe is untrue). I decided to make the $25 investment on the pre-paid SIM as the last resort and see if could hacktivate the phone in any other way.

Here's where I learnt something very interesting. You can download all the versions of iPhone's firmware from Apple's website to be used by redsn0w to jailbreak your phone. But jailbreaking without activating the phone is useless. Also, once iOS 4.2.1 is setup on the phone, Apple will NOT allow you to downgrade to a lower version. To do that, you will need a software called TinyUmbrella which fools iTunes to authenticating locally instead of the downgrade getting rejected by Apple's servers. I could go on for hours about I had to resurrect an old machine running XP to use TinyUmbrella, but I will spare you that for now.

Even after downgrading to iOS 4.1, the phone would not activate without an official Apple SIM. After some additional research, I found a website with an activated version of iOS 3.1.3. To get this firmware on the iPhone, I needed to have TinyUmbrella for the Apple server caching and iTunes 9.2.1. It took a while but it worked! I had an activated & jailbroken iPhone running iOS 3.1.3. But Apple doesn't give up that easily. When I first upgraded to iOS 4.2.1 I must've unwittingly upgraded my baseband to 5.14.04 which is not unlockable by ultrasn0w.

Current State: iOS 3.1.3 / Baseband 5.14.04 / Activated but locked

Bricks and stones may break my iPhone ...
The only way out now was to upgrade to the iPad baseband 6.15.0. The iPhone dev team has big warnings about this - do not upgrade to this version yet as there is no way to come back to v5. Also, this voids the warranty on the phone (doesn't concern me). Still, there wouldn't be a good story to tell if I didn't do it. But somewhere along the process, everything froze and all I got was the iPhone back in the recovery mode. Restoring to iOS 3.1.3 firmware again, I realized that the iPad baseband did not get patched correctly and my Wi-Fi, bluetooth and cellular functions were all disabled. I was running a glorified iPod touch.

Current State: iOS 3.1.3 / Baseband **Broken**

Upgrading back to the factory 4.2.1 was not helpful. The phone would not even show the activation screen and stayed on the Apple logo. Now, I had a semi-bricked iPhone in my hands. iReb could not put the phone on DFU mode for some iTunes could not restore the phone even to the unactivated state. Rebooting everything helped but iOS could be restored to its original state.

Current State: Bricked?

Finally after some research, I found a custom 4.2.1 firmware which worked and brought the iPhone back to the activation screen. It still wouldn't show the IMEI number which meant that the baseband was still messed up. Next, jailbreaking using redsn0w and restoring the iPad baseband back to 6.15.0 (it worked this time) got me to the activation screen showing the IMEI number. The only thing that would hacktivate my iPhone at this point was downgrading to 3.1.3 which I did as outlined before. Finally, installing ultrasn0w unlocked the 6.15.0 baseband and voila! I had an iPhone 3GS running on T-Mobile.

Current State: iOS 3.1.3 / Baseband 6.15.0 / Jailbroken & unlocked running T-Mobile (Yay!)

For now, I'm going to stick with iOS 3.1.3. Hacktivated iOS 4.1 is supposed to have battery drain issues and I don't think my father will miss multi-tasking too much.

Lessons learnt:
1. Learn thy jargon. I'm usually pretty thorough about this but before I started toying with the iPhone, I had no idea that the firmware was different from the baseband. I did not know which which basebands could be restored by ultrasn0w. I also did not know that you could do a custom restore of the iOS by clicking Shift + Restore on iTunes. Had I known these things, the unlock process would have gone much smootly.

2. Trust the hackers. When the iPhone dev team advises you to not upgrade to the 6.15.0, DON'T UPGRADE TO 6.15.0. At the same time, I had no choice given that the phone had already upgraded to baseband 5.14.04 for which there is no known unlock.

3. Know thy tools. I was surprised to see that there are dozens of tools out there depending on what you want. iReb, limera1n, purplera1n, blackra1n, TinyUmbrella, redsn0w, ultrasn0w, sn0wbreeze ... the list goes on. Most of them are pretty easy to use.

4. Youtube is the new Google. There are dozens of videos on Youtube showing you how to unlock the iPhone. Produced by 13 year olds and wannabe R&B artists, they're the next best thing to iPhone forums.

Update (12/26/2010): Got Backgrounder from Cydia. Bye Bye iOS 4.1

Thursday, July 29, 2010

A first look at Ubuntu Netbook Edition 10.04

I had Ubuntu 8.04 LTS (Hardy Heron) installed on my Eee PC soon after I purchased it in 2008. Netbooks had just started appearing in the marketplace and Asus was a pioneer with the Eee 701 and then with the Eee 901. At that point Hardy Heron was not designed to be used on netbooks and I had a constant struggle between feature limitations of Linux vs the lack of responsiveness in Windows XP. There was talk of a netbook version of Linux and several vendors (Canonical, Intel) were various stages of development.

Cut to April 2010, Ubuntu is finally out with its 10.04 netbook edition. My frustration with my XP on my Eee PC is mounting on a daily basis and I use it primarily to remote to my Windows 7 HTPC box so that I can use it in my study. Watching Flash videos on Windows is a nightmare and multitasking is next to impossible. I am afraid to update Ubuntu 8.04 as the WiFi drivers break every time a major update is made. Having some spare time, I finally decided to make the switch to the new version of Ubuntu.

Try it before you buy use it!
One of my favorite things about Linux is the ability to try it without having to install it on your system. Ubuntu 10.04 (Lucid Lynx) has made it much easier to download the image to a Live CD / flash drive with complete instructions on their website. My first impressions with the Live CD were really good. The OS booted up in less than a minute. WiFi worked right out of the box and I was able to play around with some of the pre-installed applications.

One of the first things you will notice in the Netbook Edition is the menu bar which makes it very easy to navigate around to different sections of the OS. The mouse is a little difficult to use on the menu screen with a single click on a icon automatically opening up the application instead of highlighting it. All open applications are shown as icons in the top pane and the abundance of keyboard shortcuts makes it very easy to switch around between applications and the main menu.

Wifi Drivers
One big pain with the prior versions of Ubuntu was the lack of default WiFi drivers. Once Linux was installed you would have to manually download and install the drivers over an Ethernet connection. Though the MadWifi drivers worked quite well they would get uninstalled with every major update. The 10.04 drivers now work right out of the box as I mentioned before and I was easily able to connect to my WPA enabled router. Updates did not break the wireless drivers either.

Move over Firefox, Chrome is here
The default Firefox browser was one of my biggest gripes with Hardy Heron (and with 10.04). It was a great replacement for IE when it first came out in 2002/03 but over the years has turned slow and clunky consuming a lot of memory. I tried installing Google Chrome on 8.04 but the lack of latest updates which I refused to install because of the WiFi issue (see above) would result in Chrome crashing as soon as it started. Although Firefox is the default browser in Ubuntu, users can easily download Google Chrome and it works wonderfully in 10.04.

Chat, Mail & Social Networking
An integrated communication icon now allows users to setup new mail, chat and social networking accounts. Evolution is still carried over from previous versions of Linux but has a much easier setup procedure and I was able to quickly connect to my Gmail account via IMAP and synchronize my email. Empathy IM, the default messenger application, has a much slicker interface compared to Pidgin which I was using in 8.04 and supports Google Talk, Yahoo!, MSN and Facebook Messenger.

Skype – choppy sound?
Although I did not get a full chance to test Skype on 10.04, the sound quality was choppy while making a test call and I could not see the video of the other person although they could see me. Something to investigate and I believe should be fixable.

Steve Jobs is right about this one. Although it revolutionized Web content delivery for desktops, Flash is not meant for meant for small Internet devices. Flash is optional to install on Ubuntu but the responsiveness while watching Youtube videos on my netbook was much better than Windows, where I would have to wait until the whole video loaded before I could watch it.

Productivity Software
Since Oracle took over Sun, Openoffice has undergone quite a revolution. Openoffice 3.2 starts much faster, has a consistent look and feel and I believe will be a smoother transition for existing Windows users. Note: Much of this review was written on OpenOffice Writer.

Bridging the Geek / Novice Gap
One of the great things about Ubuntu is what it has done to bridge the geek / novice gap for Linux. Their design philosophy has made it much simpler for beginners to start using Linux and provided a much needed alternative to Windows. Personally, I believe the three major items that are needed to get Linux to mainstream are:
  • OS / Applications working right out of the box
  • OS does not need technical expertise to use
  • Large software ecosystem that is easy to get and use.
Ubuntu addresses the first point quite well. I have not had a chance to use it in different hardware but the advent of open source drivers has made it compatible across multiple platforms. The adoption of version numbers as opposed to code names (Gutsy Gibbon, Lucid Lynx) has given Ubuntu a more mainstream feel with users. On point two, Linux as a whole is still generally behind the curve. Ubuntu has made great strides on making Linux simpler to use but simple things like different terminology and the lack of “familiar” use and feel keeps new users away from it. Also the lack of pre-packaged applications due to the various flavors of Linux results in having to download the source and install it - which doesn’t sit well with novice users.

Other thoughts
If you need to connect to a Windows machine, rdesktop works quite well although I have not been able to get a working GUI version of it. Ubuntu 10.04 does not support Netflix either - or should it be the other way around? Overall, the new version is really usable and I would definitely recommend it for netbook users who want to make a switch.