Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 02-09-2016, 04:22 PM   #1
Xandaros
Junior Member
Xandaros began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2016
Device: Kindle PW3 G090 G105
Java security disabler

Hello,

I made a KUAL script which disables the java security manager. (Well, it technically just tells it to allow everything.)

If you don't know what this means and you weren't told to get this, you don't need it - move along

I am working on a kindlet which is going to require this, so I thought I'd release it early.

This is my first KUAL script, any comments are greatly appreciated.

PS: I only tested it on my PW3, I don't know if it works on any other hardware.
Attached Files
File Type: gz disablesecurity.tar.gz (772 Bytes, 61 views)
Xandaros is offline   Reply With Quote
Old 02-09-2016, 04:28 PM   #2
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by Xandaros View Post
Hello,

I made a KUAL script which disables the java security manager. (Well, it technically just tells it to allow everything.)

If you don't know what this means and you weren't told to get this, you don't need it - move along

I am working on a kindlet which is going to require this, so I thought I'd release it early.

This is my first KUAL script, any comments are greatly appreciated.

PS: I only tested it on my PW3, I don't know if it works on any other hardware.
Isn't that what the MKK package does?

That package was bundled with the JB and installed at the same time.

KUAL would not be able to run under the Java security model unless that was 'jailbroken' also.
knc1 is offline   Reply With Quote
Old 02-09-2016, 04:31 PM   #3
Xandaros
Junior Member
Xandaros began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2016
Device: Kindle PW3 G090 G105
If it does mess with the actual security manager, it doesn't change a lot.
In my particular case, I want to use sockets, which is not allowed by default. Replacing the java.policy file with the java_permissive.policy file (which is what this does), allows your kindlet to do anything. (For better or for worse)
Xandaros is offline   Reply With Quote
Old 02-09-2016, 04:35 PM   #4
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
I'm fairly sure someone at least one used the Kindlet JB for just that .

(Because we don't like messing with the rootfs if we don't have to ^^).
NiLuJe is offline   Reply With Quote
Old 02-10-2016, 12:07 PM   #5
Xandaros
Junior Member
Xandaros began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2016
Device: Kindle PW3 G090 G105
Right, that does look like it does what I want. So - how do I find things like that?
I did look around to see if something like that existed, but didn't find anything.

Actually, I'm having a hard time finding anything. It took me like 30 minutes to figure out how to change the orientation...
Xandaros is offline   Reply With Quote
Old 02-10-2016, 12:12 PM   #6
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
We have the Wiki - at least partial indexed by the prefix index (see: sticky -> where do I start thread).

There are some hints about finding things here:
https://www.mobileread.com/forums/sho...d.php?t=237083

And of course - start a thread on what you want to know about, and hope someone remembers what has been learned about the topic.
knc1 is offline   Reply With Quote
Old 02-10-2016, 02:08 PM   #7
Xandaros
Junior Member
Xandaros began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2016
Device: Kindle PW3 G090 G105
Well, I've obviously looked at the wiki and the "where do I start" thread. Neither of them seem to cover kindlet development in any detail. Heck, even the beginner's guide which explains how you compile and sign your azw2 didn't work. (It forgot to mention that you need to target Java 4. It even gave an example of the call to javac, but it left out -target and -source flags)

I've also seen the FAQ you linked. As far as I can tell, it doesn't even mention kindlets and focuses on more general user-oriented problems.

Opening a thread for every minor thing is not very appealing to me, but having to figure out every tiny bit is also annoying. (Especially since I don't usually do java. I've considered writing a native app instead, but I'm not good with GUI programming, either. Plus, it requires me to build a cross compiler toolchain which is a pain in the butt)
Xandaros is offline   Reply With Quote
Old 02-10-2016, 03:49 PM   #8
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by Xandaros View Post
Well, I've obviously looked at the wiki and the "where do I start" thread.

Neither of them seem to cover kindlet development in any detail.
Heck, even the beginner's guide which explains how you compile and sign your azw2 didn't work. (It forgot to mention that you need to target Java 4. It even gave an example of the call to javac, but it left out -target and -source flags)

I've also seen the FAQ you linked.

As far as I can tell, it doesn't even mention kindlets and focuses on more general user-oriented problems.

Opening a thread for every minor thing is not very appealing to me, but having to figure out every tiny bit is also annoying. (Especially since I don't usually do java.

I've considered writing a native app instead, but I'm not good with GUI programming, either.

Plus, it requires me to build a cross compiler toolchain which is a pain in the butt)
I can't see where it is obvious.

Did you fix the errors you found?
We don't have a staff of editors, it is the users who write (and correct) the wiki.

I mentioned the search hints in the FGA thread.

Pick something you already know if learning and asking questions is too much bother.

git clone the Buildroot repo -
make

OR

Download the pre-built toolchain in NiLuJe's snapshots thread.
knc1 is offline   Reply With Quote
Old 02-10-2016, 05:26 PM   #9
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@knc1: I only ship ct-ng configs, not a pre-built binary TC. Also, the current config is currently utterly broken, but that's another can of worms ^^.

@Xandaros: The Kindlet dev docs most decidedly suck. And it used to be even worse . Your best bet is to start from a known, working Kindlet and go from there for inspiration. I guess that more or less means KUAL or CM nowadays.
I vaguely remember *one* thread being more or less up to date (or at least amended in comments), but I might be dreaming that one up . No idea if it's properly indexed, though.

Last edited by NiLuJe; 02-10-2016 at 05:35 PM.
NiLuJe is offline   Reply With Quote
Old 02-10-2016, 10:39 PM   #10
Xandaros
Junior Member
Xandaros began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2016
Device: Kindle PW3 G090 G105
@knc1: It's a post, not a wiki page. I even linked to it.

@NiLuJe: Luckily there's javap, which eventually allowed me to figure it out. I did actually look at KUAL, which is how I figured out that AWT stuff, but it didn't include orientation changes, which was what I was after.
We have a wiki, but the documentation on kindlet development seems lacking. I'm going to start a new page on that topic tomorrow if I can find the time, which will include basically everything I've figured out so far.
I'll even try to document the KDK 2.2. It doesn't look like it's very big, so it shouldn't be too much of an issue.
1.0, 1.3 and 2.0 do seem to have docs, though how to do the orientation change in 2.0 is beyond me. (Not that I could test it - I don't have 2.0)

That said, I don't really use java, so a lot of things I struggle with are probably not even problems of developing for the kindle.
For example, the beginner's guide I linked earlier (the one that is not a wiki page) tells you to just extract the KDK into your project. While it works, it seems awfully hacky to me, but I don't know how to do it the 'proper' way.
(I can write a class loader to dynamically load the KDK at runtime, but I have no idea how to tell it to statically include it. Seems somewhat ironic to me :P)
Xandaros is offline   Reply With Quote
Old 02-11-2016, 01:34 AM   #11
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Sticky -> 'Where do I start?' -> Kindlet ->
https://wiki.mobileread.com/wiki/Kindlet_Developer_HowTo
knc1 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Story HD Mod: Hyphenation Disabler (07 Feb 2012) frostschutz iRiver Story 3 02-07-2012 10:24 PM
Java security, launching applications from a kindlet bubnikv Kindle Developer's Corner 3 03-07-2011 03:05 AM
[Apple]Java Embedding Plugin 0.9.2: Force java to run in browsers other than Safari Zire Lounge 4 05-24-2005 09:12 PM


All times are GMT -4. The time now is 09:28 AM.


MobileRead.com is a privately owned, operated and funded community.