Now let's begin developing our own Kindlets!
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
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
To enter debug mode. Then type
to start the ssh daemon. (Just type it again to stop it if not using anymore).
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.
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