Liberating my HTC Desire S

Last year in September, I got myself a HTC Desire S on Orange UK. While I was very happy with the phone, right from the beginning I was very annoyed with all the stuff that was installed on it - partly by HTC, and partly by Orange - and which I couldn't uninstall. HTC Sense had some nice aspects, but I didn't need HTC's version of the Facebook app in addition to Facebook's app, especially after I said goodbye to Facebook. I used K9-Mail for email, so I did not need the stock Android email app, nor the HTC Email app. And so on...

Some of these apps and services I didn't want did always run, which was even more annoying. While I was able to customise my HTC Desire S not to use them, they still were there, and from time to time got into the way. The only solution was to install something else: Cyanogenmod.

Unlocking the bootloader

To do so, I first had to unlock the bootloader. In the end, it was quite easy, but first I was disappointed. Most instructions I found (such as on did not work for me, due to the version of the bootloader that was on my phone. Revolutionary supports bootloader versions 0.98.0000 and 0.98.0002, but my phone was using hboot 2.00-0002.

In the end that wasn't a problem - it just sounded more complicated. If your HTC Desire S has hboot 2.00-0002, you can officially unlock the bootloader using You need to register on the website, and you need to install the Android SDK (I actually only used fastboot). Although it says that you need to use Sun/Oracle Java, it worked well with the openjdk for me - as I said before, I actually only needed one command from the Android SDK, which was fastboot.

Once you have installed the Android SDK, you can follow the instructions on to submit the unlock key. I had to run fastboot as root on my Debian box for it to see my phone, but then it worked fine. Submit the token you get when you follow the instruction, and you will get an email from pretty instantly with a binary unlock code and a link to instructions to complete unlocking the bootloader. Be careful: unlocking the bootloader does also do a factory reset of your phone, so make sure you backup all your data and settings before!

The rest was easy.

Installing Cyanogenmod

Once your bootloader is unlocked, your phone is basically liberated. You can now do with it what you want. So be careful.

1. Install Clockworkmod recovery

Download ClockworkMod Recovery for the HTC Desire S (cwm-, 4.2 MB).  Rename the file to recovery.img, and put it into the same folder of your Android SDK as fastboot - that should be under platform-tools.  Boot into the bootloader, and then into fastboot. Then you can connect the USB cable, and it should recognise this, and now says fastboot usb (you need to enable USB debugging before you do all this, but you needed that anyway to get the unlock token).

Now, as root on your computer (I have no idea with Windows), you run the following command:

fastboot flash recovery recovery.img (or ./fastboot flash recovery recovery.img)

This will now flash ClockworkMod Recovery onto your phone.

You can now reboot, but if you want to proceed to installing Cyanogenmod, you will want to just reboot into the bootloader again.

2. Preparing to install Cyanogenmod

First download CM7.2 ROM and - if you want to - the Google Apps (Market & stuff): and If you want to use Google Play to install Android applications, you will want the Google apps - I didn't want them, so I did not install them.

It is extremely important that you extract the file boot.img from the rom zip - you will need it later. Copy boot.img into the same folder of your Android SDK where you also have fastboot, so that you can later flash it.

Copy the downloaded ROM zip to the SD card. If you also want the Google apps, you need to also put the Google apps zip file onto the SD card.

3. Flashing Cyanogenmod

Boot into the ClockworkMod Recovery. Once the device boots into the ClockworkMod Recovery, use the side volume buttons to move around, and the power button to select.

Optional: Select backup and restore to create a backup of the current installation on the HTC Desire S.

Now it gets a bit scary, because there is no way back.

  1. Select the option to Wipe data/factory reset.

  2. Then select the option to Wipe cache partition.

  3. Select Install zip from sdcard.

  4. Select Choose zip from sdcard.

  5. Select the CyanogenMod

  6. Optional: Install the Google Apps by performing steps 3 - 5 again and choosing the Google Apps

Important: Once done with this, you need to flash the boot partition, otherwise your phone will not boot. First power off your phone, and then boot into the bootloader, and then choose fastboot (this bit still works - you just can't boot normally right now, before you flash your boot partition).

Connect the USB cable (it will now say fastboot usb), then on your computer (as root) run the following command:

fastboot flash boot boot.img (or ./fastboot flash boot boot.img)

Now you are done, and can reboot the phone into Cyanogenmod.

Customising Cyanogenmod

There are a lot of things you can do to customise your Cyanogenmod. I did not install the Google apps initially, but realised later that I needed some of them, which I then installed manually.

I recommend you immediately allow non-market applications to be installed, and install F-Droid from This gives you access to a repository of open source software for Android.

I installed Anton's calendar widget, Firefox, and quite a few more things from the F-Droid repository. I also recommend you add the Guardian Project repository to F-Droid, which will give you access to a few more security related applications via F-Droid.

I initially had a few issues with the calendar, as I had not installed any of the Google apps. However, instead of installing them all, I installed them selectively, following the instructions on the Cyanogenmod Wiki.

While I had installed Birthday Adaptor via F-Droid, which gave me a read-only calendar of all the birthdays I had added to my contacts, I was not able to add any calendar entries. It seemed I needed some Google apps. I extracted the apk files from the Google apps zip file, but then you cannot install them using the package manager, as these are system apps, which need to be in the /system/app folder.

I copied GoogleCalendarSyncAdapter.apk and GoogleServicesFramework.apk to my SD card, and then I did the following, using the Terminal Adaptor app which is part of Cyanogenmod:


mount -o rw,remount /system

mv /mnt/sdcard/<folder to apk files>/*.apk /system/app/

While I was there, I also removed some pre-installed apps, such as the pre-installed brower and mail apps:

mv /system/app/Browser.apk /mnt/sdcard/

mv /system/app/Email.apk /mnt/sdcard/

Moving them this way meant I had a copy which I could easily move back if I needed it. But in any case, you can easily extract the apk files from the Cyanogenmod ROM zip file.

I rebooted my phone after this operation, and gone were the unneeded apps, but also now I could add the Google account which I had created initially before I switched to Cyanogenmod to create a calendar, but I set it to manually syncing and will never sync my calendar to Google - I don't want to give them my data.

One word about the built-in SIP softphone (which was crippled in the Orange ROM): while now I could use it, it seems it doesn't work very well - sound was very choppy when I tried it. So I decided to stick with cSipSimple, which I did use before, and reinstalled it via F-Droid.

I was also using TextSecure, and not the stock messaging app, which I could install using F-Droid. However, I decided to stop using it, as the developer does not want it to be available in F-Droid, even though it is open source (see This means it is now only available in the Google Play store, which I am not using. So unless it will again become available via F-Droid or the Guardian Project repository of F-Droid, I cannot recommend to use it .

In any case, once you have Cyanogenmod, you can take ownership of your phone, and can do pretty much what you want. That's the great thing about Free Software.

(Temporary) Compromises

I made some - hopefully temporary - compromises for now, mostly related to office applications.

As Calligra Active doesn't yet work on Android-2.3 (Cyanogenmod-7.2), and I don't even know whether LibreOffice will ever be available for this version of Android (and isn't available yet for any version), I did look around for a free (as in beer) office suite. What I found in the end was Kingsoft Office, which you can download for free from their website. Unfortunately it only does Micro$ofts proprietary formats, and does not deal with OpenDocument files. At least for OpenDocument text documents, I found an APK of Tom Tasche's OpenOffice Document Reader somewhere (I don't remember where).

Using these is not what I really want, as the former one is not free software (FOSS), and the latter is mainly distributed via the Google Play store, which is annoying (and which I can't use anyway). I hope that Calligra Active will mature also for Android-2.3, or that there soon will be a ROM of Cyanogenmod-9 available for the HTC Desire S. Until then, I will live with these compromises.


Tom Tasche's OpenOffice Document Reader is now installable via F-Droid, so you no longer need to hunt down an apk package from somewhere if you do not want to use the Google Play store.

I updated to CM12.1 a few months ago. This is available from the OpenDesireProject. You will first need to update your Revocery so that it can cope with installing CM12.1 - see here.

If you unlocked your bootloader via as I did in the example above, do not forget to extract the boot.img from the CM12.1 zip and flash it via fashboot flash boot boot.img. Otherwise, your device will not boot.

A note on phone encryption: 

The /data partition of my HTC Desire S did not have the space to allow for encryption (I found that out by looking at logcat via adb). I needed to follow the instructions in this comment to resize the /data partition to get it to work.

Adapt the number of blocks to the output of your device. As in the comment, I deducted 20 blocks, which was sufficient for then later to encrypt using the CM UI.