[Cowlark Logo] cowlark.com
« (previous) A Javascript shell for the Kindle Contents

Hacking the Kindle

Getting started with Kindle development

Jailbreaking the Kindle

The first port of call should be here:

This is the only jailbreak you need to run applications.

Important notes:

The only thing the jailbreak will let you do is to run your own programs on the device (including ones that completely trash it and turn it into a paperweight; You Have Been Warned).

Development tools

Kindle applications are written in Java. It's Personal Basis Profile 1.1 and Java 1.4, both of which are ancient and horrible. It's been heavily customised and there's a set of extra proprietary libraries that give access to things like the e-ink screen and the Kindle's native user interface.

Of course, in order to be able to compile code against the Kindle libraries, you need to get a copy: the easiest way to do that is to pull it off the Kindle. To do this, use the following update. When installed, it will copy the entire contents of the Kindle's library directory into /lib where you can get at it. The only jar you need is Kindlet-1.2.jar but we copy the rest anyway in case something interesting is there.

Once you have this, add it to your build classpath.

Signing applications

The Kindle will only run signed applications, and wants to be able to verify the signatures before it will run anything. This means that:

So, you now need to generate a set of developer keys.

Once you have a developer.keystore, put it somewhere safe and don't lost it. Then install the appropriate public key update package on your Kindle.

Skipping ahead

Right now you should be in a position to be able to build, install, and run applications. However, to save time here's something I prepared earlier:

The above rather meaty package contains everything you need to get started. Unzip, run the ./makekindlet script, and you should end up with a HelloWorld.azw2 ready to deploy onto your Kindle. There might even be some working Eclipse project files.

(The script does assume that your developer private keys and Kindlet-1.2.jar are both in the $HOME/.kindle directory.)

You also get the following extremely handy features:

It might also be possible to bolt on ProGuard. This would shrink the resulting .azw2 file by detecting unused code --- the Retroweaver support libraries in particular are pretty large. However, I don't reckon it's really worth the hassle.

Gotchas

And now some warnings.

There's a reason Amazon don't officially allow homebrew on the Kindle, and I don't think it's business related. The Kindle is a very fragile device. It's incredibly easy to crash; there's no isolation between user applications and the system user interface.

This means:

This means that if you're writing code and testing it on your Kindle, you will see it crash and reboot a lot. So far I haven't lost any data. You may not be so lucky.

In particular, if you run a lot of third party applications, I think you're very likely to see slow bit rot, where the device will slowly destabilise over time until it crashes and reboots, at which point it goes back to normal and then starts to slowly destabilise over time, etc. Remember that the Kindle's normal lifecycle is never to reboot, ever. This means that slow memory leaks over time that you would never notice on a desktop will slowly build up.

So, to summarise: I think the reason Amazon don't officially allow homebrew on the Kindle is because they don't want the blame when people start complaining that their Kindles are unreliable. By requiring all third-party applications to be vetted by them does at least allow them to run some basic checks to see whether the applications are fit for purpose or not.

Thanks

Most of this work's not mine; I'm merely collating and glueing together functionality other people have done. In particular, the hard work in producing the jailbreaks, signing tools etc came from the folks on the excellent Kindle Developer's Corner forum on mobileread.com.

Another surprisingly good source for technical information is the official Amazon development forum... although I'd recommend against posting there.

« (previous) A Javascript shell for the Kindle Contents

Comments on this page

Page last updated: 2011 August 22 © 2008-2009 David Given, unless specified otherwise