View Single Post
Old 01-01-2012, 09:03 AM   #4
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Ah whatever, I found some old project for the Kindle and reused that.



Source code and .azw2 are attached. READ ON BEFORE INSTALLING, though:

This will NOT work out of the box.
From within your Kindlet, you get a com.amazon.kindle.kindlet.KindletContext. The standard implementation of it, com.amazon.kindle.kindlet.internal.StandardKindlet Context, includes three additional methods beyond those defined in the interface: getOrientationController(), getToolbar(), and setScreenUpdateMode().

So while these methods are actually available in the implementation, they are not declared in the interface. This is probably a glitch.

Now, you can't just cast the instance to the actual class, because the Kindlet class loader does not allow you to access these. In fact, it'll simply give you a ClassNotFoundException. The (only) classes which you are allowed to access are listed in the resource com/amazon/kindle/kindlet/internal/security/whiteListedClassNames (contained in KindletImplementation-2.0.jar). You will have to break out of this classloader first in order to get full access to your device.

This is what the json_simple-1.1.jar is there for. It allows to escape the restrictive class loader, and also allows you to do other nifty things, like gaining additional permissions to write to the file system, read additional properties etc. You have to copy this one into /opt/amazon/ebook/lib as well.

This is actually a project which I did for the Kindle 3 about a year ago, but never released it. Now that I see it's actually required to get some fundamental stuff done on the K-Touch, I'll probably make it public.


PS: You can use the keystore from here: https://www.mobileread.com/forums/sho...d.php?t=152294
Attached Files
File Type: zip hellokindle.RENAME_TO_azw2.zip (28.5 KB, 399 views)
File Type: zip hellokindle-src.zip (2.49 MB, 395 views)
File Type: zip json_simple-1.1.RENAME_TO_jar.zip (28.4 KB, 414 views)
ixtab is offline   Reply With Quote