Amazon Kindle is a very good device for reading, but not limited to. It actually provides us a development platform based on a tailored Linux system. I got my kindle last November and since then I have been eager to do something more than reading books with it. Days ago I began to look into jailbreaking it and found that people have been playing with for a while so I collected some information and wrote this 101 guide. I tried to put the scattered information together here and make the process as clear as possible, including the necessary resource. All the steps presented here are under Windows XP SP2 system and the Kindle I used is Kindle 3G US (6'). Note that a lot of information here are from MobileRead forum/wiki and Adrew de Quincey's blog.
Now let's begin developing our own Kindlets!
Step 1. Get Full Control of Your Kindle

Whenever we plug Kindle into computer, we could see some folders, like 'documents', 'audible'. 'music' and so on. Well these are only directories under a mounted volume in kindle, not the real layout of its file system. Some people discovered some 'holes' in kindle's system and successfully made a jailbreak update image of the firmware which could expose the root privilidge of the system.

1.1 Apply jailbreak

Connect your kindle to PC. Download the jailbreak zip from here. This package contains jailbreak updates for different versions of kindle. Below is the list for kindle version and jailbreak matching.
  • "update_jailbreak_0.4.N_k2_install.bin" - Kindle 2 US
  • "update_jailbreak_0.4.N_k2i_install.bin" - Kindle 2 International
  • "update_jailbreak_0.4.N_dx_install.bin" - Kindle DX US
  • "update_jailbreak_0.4.N_dxi_install.bin" - Kindle DX International
  • "update_jailbreak_0.4.N_dxg_install.bin" - Kindle DX Graphite
  • "update_jailbreak_0.4.N_k3g_install.bin" - Kindle 3 3G US
  • "update_jailbreak_0.4.N_k3w_install.bin" - Kindle 3 WiFi
  • "update_jailbreak_0.4.N_k3gb_install.bin" - Kindle 3 3G UK
Find the correct file for your kindle version and copy it to kindle's Home directory. This directory is the root directory for documents, music subdirectories alike, as shown in Figure 1. Files postfixed with _install are for jailbreaking and those with _uninstall are for undo jailbreaking. Since now we are to jailbreak only, just copy only the *_install image to kindle. In my case, it should be update_jailbreak_0.4.N_k3g_install.bin.
Picture
Figure 1. Applying the correct jailbreak
After copy is done, unplug kindle and goto [Menu] -> [Settings] -> [Menu] -> [Update Your Kindle]. If this menu item is greyed out, the most probable issue is that the jailbreak file mismatched the version of your kindle. Reboot kindle and ... Alas! the jailbreak is done.

1.2 Configure Kindle with USBNetwork

Though we now have root privilege, we still cannot access kindle through console. So we need to run a ssh daemon on kindle. Installing this daemon program is a similar process to the the previous one. Get the zip of usbnetwork updates here. Find the correct update image and copy it to the Home directory of Kindle. Then unplug kindle, goto [Menu] -> [Settings] -> [Menu] -> [Update Your Kindle]. Reboot kindle. Now  the ssh daemon is installed on kindle and we can now connect to it through USBNetwork. But still there is some trivial work to do in order to make it actually work.

Start the ssh daemon on kindle by the debug command ~usbNetwork . At kindle's Home screen, press any alpha-num key to activate the bottom search bar. Then type the console commands in this search bar. As for this usbnetwork case, type         

;debugOn

To enter debug mode. Then type

~usbNetwork

to start the ssh daemon. (Just type it again to stop it if not using anymore).

Then

;debugOff

to exit debug mode. Note that every command should be followed by Return key.

Now suppose that the usbNetwork ssh daemon is turned on on kindle. Connect kindle to your PC you may notice that Windows no longer treats kindle as a mass storage media. Instead it prompted that a new hardware is discovered. Think of the kindle with usbNetwork as a normal network endpoint with the only difference that the underlying media is USB interface instead of Ethernet interface.

Now follow this article (Setting up USBnet) to install the usbNetwork support on Windows XP. But one thing to notice that by default kindle will assume that the connected PC to have an IP address of 192.168.2.1 and itself 192.168.2.2. So be sure to statically set the IP address of the newly created usbNetwork connection to 192.168.2.1.

1.3 Accessing Kindle

After usbNetwork is successfully setup on Windows, we could get connected to the device by any client that supports ssh. SSH Secure Shell for Windows is one of them. Now just log in kindle with the ssh client, given port 22 username 'root' and password leaving blank and have fun! At this point there might be some little problem with access to internet on windows if you are using some PPPoE like ADSL (which often use 192.1681.* network segment for local side), if this ever happens, just take a look at the route table on windows with command 'route print'. If in previous step we set the IP address and the default gateway manually the default route (0.0.0.0) might point to our newly added gateway with some lower metrics (higher priority), just remove it and add a static route pointing to the kindle. Just Google it if you have no idea of how to configure static route in Windows.

Now the only thing left there is how to transfer files to and fro between kindle and Windows. Since kindle's system is naturally a linux it support scp intrinsically but here is a better stuff: WinSCP, a GUI client that supports SFTP and FTP. It has a Total Commander style UI which makes it very convenient to transfer files to kindle! As shown in Figure 2.
Picture
Figure 2. Browsing Kindle with WinSCP
Step 2. Setup the Development Environment

Kindlets are no more than Java jars, with extention .azw2. To develop Kindlets, we will need a proper Java SDK and some libs to link to. First connect your Kindle with WinSCP or some other file transfer clients, and get /opt/amazon/ebook/lib/Kindlet-1.1.jar and /opt/amazon/ebook/sdk/lib/*.jar to your PC and add them to your Jar path, so that we have the Kindle Development Kit. As Kindles are palm devices, we will need J2ME with proper PBP for development. J2ME is just a tailored version of J2SE which makes it possible to develop and run Java appliacations for resource restrained devices. Lots of basic standard Java APIs are the same in J2ME and J2SE. Here are more resource about J2ME (CDC/PBP). We will mostly reference this PBP 1.1.2 documentation  and this Amazon's KDK API.

Now that we have the KDK development environment setup and documentation to reference, we can start our first Kindlet, KHello. Open your favorite IDE and type in the following code, in my case, Eclipse. A basic kindle program will derive from a Kindlet interface.

I WILL STOP HERE, TO BE CONTINUED
 


Comments

jay
07/17/2011 22:06

doesn't work for 3.2.1
did Y's jailbreak, followed instructions
also unable to wifi ssh in even with correct key file (+ edit in Vi) still wants a password, I give up!

Reply
jeff
07/24/2011 11:04

Hi, Jay, i am sorry to hear that it doesn't work. Wifi ssh? never tried it.
USBNetwork connection is different from wifi i think in that it simulated the networking protocol upon USB instead of using the real packet device. Did you try to cable with usb?

Reply
10/02/2011 02:42

I think the post is good for us.r to your PC and add them to your Jar pat

Reply
11/23/2011 10:28

Could you please make a youtube video for this,

Please let me know if you already have a channel,

will subscribe.

Reply
02/07/2012 02:41

Just tried on my UK K3 Wifi, currently v3.3 (611680021). "The update was not successful". Do we need newer jb files?

Reply
Jeff
02/21/2012 18:15

To Devarshi,

Sorry I don't have a channel or a plan to open one on Youtube. This is what I tried out in my spare time just for fun. Thank you for the comment :)

Reply
Jeff
02/21/2012 18:19

Hi Ken,

Sorry to hear that. I never tried it on UK K3 Wifi before. It's been a long time ago and I have already moved away from developing on kindle. Maybe try newer jailbreak will help?
Not sure.

Reply
05/23/2012 17:48

Hey,i like your post.It's helpful for me.Because you,now I can really address the problem of how to complete themselves.Nice blog,I am so interested in it.thanks.

Reply
05/23/2012 17:51

This is amazing posts.After studying you site, your internet site is extremely useful for me.I am willing to read it, thank you it brings me happiness.

Reply



Leave a Reply