{"id":284,"date":"2011-10-13T22:02:00","date_gmt":"2011-10-13T20:02:00","guid":{"rendered":"https:\/\/www.fussylogic.co.uk\/blog\/?p=284"},"modified":"2012-08-31T09:23:27","modified_gmt":"2012-08-31T08:23:27","slug":"installing-cyanogenmod-on-htc-desire","status":"publish","type":"post","link":"https:\/\/www.fussylogic.co.uk\/blog\/?p=284","title":{"rendered":"Installing Cyanogenmod on HTC Desire"},"content":{"rendered":"<p>I mentioned a while ago that I was becoming unhappy with Google\u00e2\u20ac\u2122s attitude to openness with Android phones. I felt that I would end up rooting and installing a more open ROM at some point. That point has arrived; triggered by Google automatically upgrading Google Market on my phone, using up the tiny bit of spare space that is on the HTC Desire (it\u00e2\u20ac\u2122s one major flaw is the dependence on a relatively tiny internal flash memory). It\u00e2\u20ac\u2122s particularly galling because I have loads of space on the attached SD card. HTC have also moved on to other phones and left the Desire languishing on version 2.2 of Android; while 2.3 is well into it\u00e2\u20ac\u2122s development cycle.<\/p>\n<p>Advantages:<\/p>\n<ul>\n<li>Gingerbread is faster than Froyo.<\/li>\n<li>Fancy graphical effects.<\/li>\n<li>More free memory and storage. Both the manufacturer and the carrier (Orange, I\u00e2\u20ac\u2122m looking at you) add their own junk to the phone. While HTC\u00e2\u20ac\u2122s Sense interface is very nice; there is a lot of other stuff you really don\u00e2\u20ac\u2122t need.<\/li>\n<li>I\u00e2\u20ac\u2122m more in control. The gatekeepers have been fired.<\/li>\n<\/ul>\n<p>Disadvantages:<\/p>\n<ul>\n<li>Your warranty is likely void if you do this. Since we\u00e2\u20ac\u2122re talking about HTC Desires \u00e2\u20ac\u201d yours probably is too, since it\u00e2\u20ac\u2122s about two years old now.<\/li>\n<li>It\u00e2\u20ac\u2122s not for the faint of heart. Equally, it\u00e2\u20ac\u2122s not rocket science either.<\/li>\n<li>If things really did go badly, it\u00e2\u20ac\u2122s not impossible that you could brick your phone. I\u00e2\u20ac\u2122m not saying it\u00e2\u20ac\u2122s likely, but the possibility is there. The possibility that you drop it down the toilet is there as well of course; it\u00e2\u20ac\u2122s just not particularly likely. I think you\u00e2\u20ac\u2122d have to try quite hard to permanently brick your phone.<\/li>\n<\/ul>\n<p>That\u00e2\u20ac\u2122s the justification; here then is how I installed Cyanogenmod 7.1 on my HTC Desire. There are an awful lot of \u00e2\u20ac\u0153howtos\u00e2\u20ac\u009d out there already, but they all seem to leave out bits and aren\u00e2\u20ac\u2122t clear about some steps, leaving them to a single sentence. \u00e2\u20ac\u0153Backup your phone\u00e2\u20ac\u009d. Great, how do I do that? I\u00e2\u20ac\u2122ve tried to be thorough here, so it\u00e2\u20ac\u2122s long, but hopefully it\u00e2\u20ac\u2122ll leave you knowing what to expect and hence reduce the scariness factor.<\/p>\n<h2 id=\"rooting\">Rooting<\/h2>\n<p>The whole process begins with rooting. Rooting is the process of getting superuser permissions on your phone, which gives you a whole lot more access. This step is the one that is phone specific; it mostly relies on exploiting a security hole in the particular phone. Once you\u00e2\u20ac\u2122ve got root, the process of installing Cyanogenmod would be pretty similar for any phone.<\/p>\n<p>On a HTC Desire (and in fact a number of other HTC phones), there is a very nice one-click rooter called <a href=\"http:\/\/unrevoked.com\/#desire\">Unrevoked<\/a>. It\u00e2\u20ac\u2122s cross-platform and includes a built in <code>recovery<\/code> image (see below for information about a recovery image). Download it, extract it, and run the single executable (I had to run it with root permissions to get at the USB, <code>kdesudo .\/reflash<\/code>). I used the Linux version, but there are versions for Windows and OSX too.<\/p>\n<p>Until we have root we can\u00e2\u20ac\u2122t use any of the backup tools either, so this is the only step that needs a leap of faith. Take a deep breath then, <a href=\"http:\/\/www.youtube.com\/watch?v=iXWm8262iMU\">watch it happen on video first<\/a>, and go for it.<\/p>\n<p>Once Unrevoked is running, activate \u00e2\u20ac\u0153USB Debugging\u00e2\u20ac\u009d on your phone. <em><code>Applications-&amp;gt;Development-&amp;gt;USB Debugging<\/code><\/em>. Make sure you have some free space (I think 20MB is needed) on the internal phone memory, Unrevoked will use it as a staging area. Unrevoked will pop up a box after it detects the phone, this is your last chance to abort. Once this is running <em>do not pull the cable, do not close the application<\/em>. Unrevoked will try hard not to do anything until the last minute, and it will try not to leave your phone half rooted, but it\u00e2\u20ac\u2122s better not to mess around when flashing is in progress.<\/p>\n<p>Unrevoked will push the files it needs to the phone; reboot; then run the exploit, allowing it to get root on the next boot (this is what gets you root on demand); it will reboot again and use the new root facility to set up to install the recovery image; then it will reboot one final time and will show you <em>ClockworkMod Recovery<\/em> actually installing to the recovery partition of the phone. You should touch nothing and do nothing with the phone until you get the \u00e2\u20ac\u0153This was a triumph\u00e2\u20ac\u009d message from Unrevoked.<\/p>\n<p>I had a bit of trouble with my wife\u00e2\u20ac\u2122s phone (yes I did hers too), it failed the first time with a \u00e2\u20ac\u0153failed to get root, is your firmware too new\u00e2\u20ac\u009d. I set the USB mode to \u00e2\u20ac\u0153disk drive\u00e2\u20ac\u009d; activated <em>Applications from unknown sources<\/em> and tried again and it worked fine. Who knows?<\/p>\n<p>Once you have your phone back in your control, you can disable USB debugging and pull the cable. We\u00e2\u20ac\u2122ll be working mostly with the phone only for a while now.<\/p>\n<p>(If you\u00e2\u20ac\u2122re not using Unrevoked, and you got root another way, you can download the <em>ROM Manager<\/em> app once you have root and flash ClockworkMod recovery that way).<\/p>\n<h2 id=\"backups\">Backups<\/h2>\n<p>It\u00e2\u20ac\u2122s tempting to run straight for the new install. Not yet though. We\u00e2\u20ac\u2122ve got to backup what we\u00e2\u20ac\u2122ve got now while it\u00e2\u20ac\u2122s in a known-good condition.<\/p>\n<ul>\n<li>Firstly, we want to be able to go back to where we started if everything goes horribly wrong (or you just don\u00e2\u20ac\u2122t like CyanogenMod).<\/li>\n<li>Secondly, we want get our apps and settings back to the greatest extent we can manage once we are done and faced with a blank phone.<\/li>\n<\/ul>\n<p>Apart from the apps installed on it; the SD card goes unmolested during the upgrade process, so we can use it to store our backups. There are two separate backups we perform.<\/p>\n<ul>\n<li>A byte-for-byte copy of the partitions on the phone. This is the one that will get us back to exactly where we are now. This backup is done using the ClockworkMod recovery image that got flashed during our rooting process.<\/li>\n<li>An operating system level backup, per application of the application and application settings. This is what we\u00e2\u20ac\u2122ll use to get our currently installed apps and settings into CyanogenMod later. We\u00e2\u20ac\u2122ll use a new application called <a href=\"https:\/\/market.android.com\/details?id=com.keramidas.TitaniumBackup&amp;hl=en\">Titanium Backup<\/a> to do this. Titanium Backup requires root privileges, which is why we couldn\u00e2\u20ac\u2122t use this until we had rooted the phone. Note: a lot of the apps on your HTC phone are HTC-specific applications (they\u00e2\u20ac\u2122re also a lot of bloat); we will not be restoring them, but we will back them up.<\/li>\n<\/ul>\n<h3 id=\"clockworkmod-backup\">ClockworkMod Backup<\/h3>\n<p>Let\u00e2\u20ac\u2122s use the best of our new facilities: ClockworkMod recovery. This is a small program that runs instead of the main phone operating system. Because it isn\u00e2\u20ac\u2122t running under the operating system it wants to backup, it can safely access every byte of the phone as a perfect snapshot.<\/p>\n<p>Reboot your phone; while it is switching on hold the <em>Power<\/em> and <em>Volume Down<\/em> buttons. This gets you into the phone ROM boot menu, a program called HBOOT.<\/p>\n<div class=\"figure\">\n<img decoding=\"async\" src=\"http:\/\/r3dux.org\/wp-content\/uploads\/2010\/07\/HTC-Desire-Software-Version-Information.jpg\" alt=\"HBOOT\" \/><\/p>\n<p class=\"caption\">HBOOT<\/p>\n<\/div>\n<p>From this menu, you can run the recovery image. Follow the on-screen instructions, press <em>&lt;Vol Down&gt;<\/em>, and then push <em>&lt;Power&gt;<\/em> to run <em>\u00e2\u20ac\u0153Recovery\u00e2\u20ac\u009d<\/em>. This will get you a similar style of menu from ClockworkMod.<\/p>\n<div class=\"figure\">\n<img decoding=\"async\" src=\"http:\/\/www.dkszone.net\/wp-content\/uploads\/2010\/12\/clockworkmod_recovery_nexus_s.jpg\" alt=\"ClockworkMod Top\" \/><\/p>\n<p class=\"caption\">ClockworkMod Top<\/p>\n<\/div>\n<p>Be very careful here; with great power comes great responsibility. There is plenty we can do with ClockworkMod, but at the moment we\u00e2\u20ac\u2122re performing a backup. Use the <em>&lt;Vol Down&gt;<\/em> button to scroll down to <em>\u00e2\u20ac\u0153backup and restore\u00e2\u20ac\u009d<\/em>; this time use the optical track button to select. Now choose <em>\u00e2\u20ac\u0153Backup\u00e2\u20ac\u009d<\/em>.<\/p>\n<div class=\"figure\">\n<img decoding=\"async\" src=\"http:\/\/www.androidpolice.com\/wp-content\/uploads\/2010\/04\/image71.png\" alt=\"ClockworkMod Backup\" \/><\/p>\n<p class=\"caption\">ClockworkMod Backup<\/p>\n<\/div>\n<p>You\u00e2\u20ac\u2122ll get a little text window reporting on the backup process. This takes a while as it copies everything on the phone\u00e2\u20ac\u2122s internal flash, and the <code>.android_secure<\/code> directory of your SD card into a dated directory under <code>\/clockworkmod\/backup\/<\/code> also on your SD card.<\/p>\n<p>Now, breathe a little sigh of relief. Your phone data is now safer than it has ever been. (In fact, you can now reboot into the full phone mode and copy that backup onto your PC if you want some extra peace of mind.) With this snapshot in place, you can now return to this phone state whenever you like. If you wanted to stop now, you\u00e2\u20ac\u2122ve already done yourself a lot of good.<\/p>\n<p>You\u00e2\u20ac\u2122ll be returned to the ClockworkMod top menu, where you should \u00e2\u20ac\u0153reboot system now\u00e2\u20ac\u009d.<\/p>\n<h3 id=\"sms-backup\">SMS Backup+<\/h3>\n<p>You should already have this installed and running, it doesn\u00e2\u20ac\u2122t need root and is very handy as it puts your SMS messages in email form into your GMail account.<\/p>\n<p>If you haven\u00e2\u20ac\u2122t already, <a href=\"https:\/\/market.android.com\/details?id=com.zegoggles.smssync&amp;hl=en\">set it up<\/a> to point at its own folder in your GMail account and backup your SMS messages and call log. These are worth backing up separately because you\u00e2\u20ac\u2122ll be moving from HTC apps to Android\/Cyanogen apps for these functions and so Titanium Backup can\u00e2\u20ac\u2122t restore settings across application types (it seems to say it can in the menu, but it didn\u00e2\u20ac\u2122t work for me, so do it with <a href=\"https:\/\/market.android.com\/details?id=com.zegoggles.smssync&amp;hl=en\">SMS Backup+<\/a> for safety. This\u00e2\u20ac\u2122ll take a while, so put a film on. My wife had over 5,000 messages and it took hours \u00e2\u20ac\u201d wtf?<\/p>\n<h3 id=\"titanium-backup\">Titanium Backup<\/h3>\n<p>Go to the market and search for and install <a href=\"https:\/\/market.android.com\/details?id=com.keramidas.TitaniumBackup&amp;hl=en\">\u00e2\u20ac\u0153Titanium Backup\u00e2\u20ac\u009d<\/a>. This is another star application, and if all you got out of your rooting was access to this application then you\u00e2\u20ac\u2122ve also done well. It can backup individual applications and settings on your SD card, again leaving your data much safer. Titanium Backup needs \u00e2\u20ac\u0153USB Debugging\u00e2\u20ac\u009d and \u00e2\u20ac\u0153Install from Unknown Sources\u00e2\u20ac\u009d activating.<\/p>\n<p>Go to the \u00e2\u20ac\u0153Backup\/Restore\u00e2\u20ac\u009d tab and have a look at all the individual apps you could backup one at a time. Don\u00e2\u20ac\u2122t bother though; instead push the menu button and choose \u00e2\u20ac\u0153Batch\u00e2\u20ac\u009d, then \u00e2\u20ac\u0153Backup all user apps + system data\u00e2\u20ac\u009d.<\/p>\n<h2 id=\"cyanogenmod\">CyanogenMod<\/h2>\n<p>The install for CyanogenMod is done using ClockworkMod. You should be able to see in the screenshot of the menu from above an option labelled \u00e2\u20ac\u0153install zip from sdcard\u00e2\u20ac\u009d. We\u00e2\u20ac\u2122ll be needing to put a zip on our SD card.<\/p>\n<p>The CyanogenMod images are built for specific phones, we (in the UK) want the <a href=\"http:\/\/download.cyanogenmod.com\/?type=stable&amp;device=bravo\">HTC Desire GSM<\/a> image. At time of writing, the latest stable is <a href=\"http:\/\/download.cyanogenmod.com\/get\/update-cm-7.1.0-Desire-signed.zip\">7.1<\/a> released just a few days ago. Go grab it.<\/p>\n<p>Cyanogen aren\u00e2\u20ac\u2122t allowed to distribute the Google applications with their release. No matter, they are easily available from a <a href=\"http:\/\/android.modaco.com\/topic\/335141-addoncm7-updated-more-google-apps-2011-08-15\/\">number<\/a> of <a href=\"http:\/\/goo-inside.me\/gapps\/\">places<\/a>. Sniff around for a recent archive. You can also get individually wrapped applications; but to be honest there is plenty of space on the system partition that they\u00e2\u20ac\u2122re going to get installed to, so it\u00e2\u20ac\u2122s not really worth being that precious about space; just get the lot.<\/p>\n<p>You should also get the latest copy of the <a href=\"http:\/\/forum.xda-developers.com\/showthread.php?t=687464\">radio chip\u00e2\u20ac\u2122s firmware<\/a> as the later versions of Cyanogen won\u00e2\u20ac\u2122t work with really early radio firmwares. It\u00e2\u20ac\u2122s just another zip as far as we\u00e2\u20ac\u2122re concerned.<\/p>\n<p>Copy these three zips to your SD card, just as you would copy any other file.<\/p>\n<p>Here we go then; check you\u00e2\u20ac\u2122re backups are where you think they are. Check they\u00e2\u20ac\u2122re all a reasonable size. Check your SMS messages and call log are in the right place in your GMail account. Take a note of any icon and widget placements that are important to you, as they won\u00e2\u20ac\u2122t be restored. Your Wi-Fi access points got backed up by Titanium Backup, so you needn\u00e2\u20ac\u2122t worry about finding those passwords again (thank goodness).<\/p>\n<p>Reboot to ClockworkMod as you did last time, <em>&lt;Vol Down&gt;<\/em> and <em>&lt;Power&gt;<\/em> during reboot. Follow the <a href=\"http:\/\/wiki.cyanogenmod.com\/wiki\/HTC_Desire_%28GSM%29:_Full_Update_Guide\">official instructions<\/a> if you wish; but it boils down to this:<\/p>\n<ul>\n<li>Select \u00e2\u20ac\u0153wipe data\/factory reset\u00e2\u20ac\u009d. This is the biggie; your phone is blank after doing this. Don\u00e2\u20ac\u2122t worry though: you could get it back using the restore option from the backup you made earlier. You don\u00e2\u20ac\u2122t want it back though, you want it upgraded.<\/li>\n<li>Select \u00e2\u20ac\u0153wipe cache partition\u00e2\u20ac\u009d. Not strictly necessary, a cache doesn\u00e2\u20ac\u2122t have anything vital in it.<\/li>\n<li>Select \u00e2\u20ac\u0153install zip from sdcard\u00e2\u20ac\u009d<\/li>\n<li>Select \u00e2\u20ac\u0153choose zip from sdcard\u00e2\u20ac\u009d<\/li>\n<\/ul>\n<p>This last option loads whatever zip you pick. You will use this option repeatedly. Do them in this order:<\/p>\n<ul>\n<li>Radio firmware<\/li>\n<li>CyanogenMod<\/li>\n<li>Google apps<\/li>\n<\/ul>\n<p>These will all be pretty quick; once done you can reboot into your new operating system. Your first indication will be the CyanogenMod skateboarding android. Don\u00e2\u20ac\u2122t worry that the first boot takes a long time, it is simply that the caches are being repopulated. Future boots will be back to being as fast as they ever were.<\/p>\n<h2 id=\"initialisation\">Initialisation<\/h2>\n<p>As with the first time you got your phone; you will be prompted for your Google account details. Go through the motions. When you\u00e2\u20ac\u2122re asked about installing some apps from the market, just cancel the process. You\u00e2\u20ac\u2122re restoring from backups so don\u00e2\u20ac\u2122t need to do that.<\/p>\n<p>Once your account details are entered, the phone will sync your contacts and calendar automatically.<\/p>\n<h2 id=\"restoration\">Restoration<\/h2>\n<p>This is primarily done from Titanium Backup. I suggest you first restore the Wi-Fi backup and you\u00e2\u20ac\u2122re back to roaming around your friend\u00e2\u20ac\u2122s Internet connections. Next restore <em><a href=\"https:\/\/market.android.com\/details?id=com.zegoggles.smssync&amp;hl=en\">SMS Backup+<\/a><\/em> and then restore your call log and messages. Then your phone is back to being a phone. While the messages are being restored, <em>don\u00e2\u20ac\u2122t<\/em> restore any messaging replacement app (like Handcent); you can bust the time and date stamps.<\/p>\n<p>Your biggest problem on the HTC Desire is internal phone memory. Titanium Backup can help you in this area, but you have to set an option. Use <em><code>menu-&amp;gt;preference-&amp;gt;restore backups to...<\/code><\/em> and select \u00e2\u20ac\u0153Original location\u00e2\u20ac\u009d or \u00e2\u20ac\u0153External media\u00e2\u20ac\u009d.<\/p>\n<p>Strangely, this is the step that will take you the most time, and requires a bit of care. You won\u00e2\u20ac\u2122t want to blindly install everything that got backed up. Certainly avoid restoring anything with HTC in the name; also avoid restoring anything that has an equivalent already on the phone. My suggested strategy is to restore the apps you know you got from the market straight away; then only restore on an as needed basis, i.e.\u00c2\u00a0when you notice something is missing. This will prevent you from ending up with a load of non-functional HTC apps taking up your valuable space.<\/p>\n<p>\u00e2\u20ac\u201d Update<\/p>\n<p><a href=\"http:\/\/www.unlockroot.com\/unlockroot.php\">Handy<\/a> multi-device rooting software.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I mentioned a while ago that I was becoming unhappy with Google\u00e2\u20ac\u2122s attitude to openness with Android phones. I felt that I would end up rooting and installing a more open ROM at some point. That point has arrived; triggered by Google automatically upgrading Google Market on my phone, using up the tiny bit of\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.fussylogic.co.uk\/blog\/?p=284\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[9,6],"_links":{"self":[{"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/284"}],"collection":[{"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=284"}],"version-history":[{"count":4,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/284\/revisions"}],"predecessor-version":[{"id":608,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/284\/revisions\/608"}],"wp:attachment":[{"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fussylogic.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}