Android k9-mail with a different Icon

Monday, February 21. 2011

My Android mobile (HTC desire) runs k9-mail, a dilligently updated, configurable, imap-capable application well prepared to handle lots of mail but struck with an esthetically challenged icon. The head of a robot dog featured in a british cult tv series from the sixties - let's say you either love it or hate it. Judging by the number of hits this article gets I'm not alone with my irritation.

The little pic caused many discussions and every now and then someone creates a more suitable alternative and dares to propose it to the development team, but apparently this is like chewing rocks

OK, so either you leave it as it is or you change it yourself. But it is not completly trivial to change the icon of an android app, simply using an ressource editor and paste another icon into the file won't do. This is because Android apps are signed and if you change them after the signing they stop running.

On the other hand: it's open source, isn't it? So, create a project folder and on the command line type:
git clone
That done we follow the steps of 'How to build K-9 Mail' and if you happen to have set up an Android-Development Environment already, it takes but minutes and you see k9 running in the emulator. Nice, now for the icons. 

Our friend, the lovely dog, lives in two places within the ressources, at  
k-9/res/drawable/icon.png and k-9/res/drawable-hdpi/icon.png respectively.
In both places we replace it (.png, 72x72) with an image of our choice and proceed to create a new k9mail.apk with eclipse's File/Export/Android/Export android Application.

Now don't try to install the freshly built and signed k9-mail over the existing one, cause it won't. The AppInstaller starts up, displays the loading-grphs for a moment but it soon stops with nothing but a laconic message: Not installed. Searching the logs on my android didn't make me any wiser as to what was happening. 

So I tried adb which was far more eloquent. Started it as root:
sudo su
cd /opt/android-sdk-linux_86/platform-tools
./adb kill-server
./adb start-server
./adb devices

and it outputs:
List of devices attached 
emulator-5554   device
HT03ZPL02277    device

I closed the emulator with a click to make sure adb doesn't get confused about where to install in the next step and then input at the command line:
 ./adb install -r /path/to/git/proj/k9/apk/k9mail.apk

and it tells me all I need to know about the nature of the problem:
304 KB/s (2591136 bytes in 8.312s)
        pkg: /data/local/tmp/k9mail.apk

Doh! The original app was signed with a totally different keys than my own built all that signing serves to keep some bad guy to silently change an app - of course it wouldn't install. Somewhat incomfortable but I had to uninstall the original app in order to install my own built. Don't forget to backup your settings! 

Sort of breaking the dog on a wheel but it works and is a nice exercise, too. There is a con though: it probably breaks the updating so you'll need to check for new versions and build them manually. Alternative approaches do exist though I didn't try them.

Addendum re: k9 and documentation: it is rather sporadic and they are in search of people to help them writing it. But there is a Wiki a FAQ and a much needed explanation re: folder classes and how to use them

And another addendum, not that related to the above but I wanted to put the link somewhere: About installing Certificates

Oh, and then there is Kaiten Email. Dogless Icon included in the feature set, costs about 4€.



Trackback specific URI for this entry
    No Trackbacks


    #1 christian on 11/19/11 at 01:34 PM
    Sure! The icon sucks. I love the simple icon of the standard email app. Thanks for share this solution.

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.