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 06-04-2016, 03:40 AM   #1
sguerrini97
Enthusiast
sguerrini97 began at the beginning.
 
Posts: 27
Karma: 12
Join Date: Jan 2016
Device: KT2
File I/O permissions

Hi, I'm developing a kindlet and I would like to access the Kindle root file system. When I try to read a file I get a Java I/O persmission error in the "crash.log" file. I thought it was due to the fact that the cvm doesn't have root permissions so I try to access the user storage ("/mnt/us") but I got the same crash. Is it possible to access the file system from within a kindlet?
I read about a patch for root permissions when I started looking for informations about kindlet but I can't find it anymore.
sguerrini97 is offline   Reply With Quote
Old 06-04-2016, 03:44 AM   #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
It changed its name, it is included as part of the MKK package.
Check NiLuJe's snapshot thread for the most recent build.
Check our Wiki for extensive directions.
Check the "Where Do I Start" sticky thread to find the Wiki page and other content on the subject.
knc1 is offline   Reply With Quote
Advert
Old 06-04-2016, 06:21 AM   #3
sguerrini97
Enthusiast
sguerrini97 began at the beginning.
 
Posts: 27
Karma: 12
Join Date: Jan 2016
Device: KT2
Thumbs up

Yep that's what I was talking about
So it turned out MKK is already installed on my Kindle. I tried importing ixtab's KindletJailbreak into my project, I can call the "isAvailable()" method in Jailbreak class with success, same for the "requestPermission()" method.

But I can't access file system.. This is the full crash log:

Edit: rewritten code:
Checks in Main.java:
Code:
if (jailbreak.isAvailable())
{
	if (((TestsJailbreak)jailbreak).requestPermissions())
	{
		pane.add( new JLabel("JB requestPermissions OK!") );
		File directory = new File("/tmp");
		File[] listOfFiles = directory.listFiles();

		for( int i=0; i<listOfFiles.length; i++ )
		{
			pane.add( new JLabel( listOfFiles[i].getName() ) );
		}
	}
	else
	{
		pane.add( new JLabel("JB requestPermissions FAILED!") );
	}
}
else
{
	pane.add( new JLabel("JB not available!") );
}
crash.log:
Code:
[04/06/16 12:39] Tests (v. 1)

java.security.AccessControlException: access denied (java.io.FilePermission /tmp read)
	at java.security.AccessControlContext.checkPermission(Compiled Method)(Unknown Source)
	at java.security.AccessController.checkPermission(Compiled Method)(Unknown Source)
	at java.lang.SecurityManager.checkPermission(Compiled Method)(Unknown Source)
	at java.lang.SecurityManager.checkRead(Compiled Method)(Unknown Source)
	at java.io.File.list(Compiled Method)(Unknown Source)
	at java.io.File.listFiles(Compiled Method)(Unknown Source)
	at local.samu.tests.Main.initUi(Main.java:40)
	at local.samu.tests.Main.onCreate(Main.java:25)
	at ixtab.jailbreak.SuicidalKindlet.create(SuicidalKindlet.java:86)
	at ixtab.jailbreak.SuicidalKindlet.create(SuicidalKindlet.java:83)
	at com.amazon.kindle.kindlet.internal.lifecycle.m.call(cgf:1632)
	at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(Compiled Method)(FutureTask.java:178)
	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(Compiled Method)(ThreadPoolExecutor.java:1029)
	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:547)
	at java.lang.Thread.run(Compiled Method)(Unknown Source)
	at java.lang.Thread.startup(Compiled Method)(Unknown Source)

Last edited by sguerrini97; 06-04-2016 at 06:40 AM.
sguerrini97 is offline   Reply With Quote
Old 06-04-2016, 06:48 AM   #4
encol
Evangelist
encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 765432
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
Have you read this?
encol is offline   Reply With Quote
Old 06-04-2016, 08:14 AM   #5
sguerrini97
Enthusiast
sguerrini97 began at the beginning.
 
Posts: 27
Karma: 12
Join Date: Jan 2016
Device: KT2
Thank you! That's very clear, I got it working ^^
sguerrini97 is offline   Reply With Quote
Advert
Old 06-04-2016, 08:56 AM   #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
Quote:
Originally Posted by sguerrini97 View Post
Yep that's what I was talking about
- - - - -
Too bad it didn't occur to you to say so in your first post.

Context is important to any question.
knc1 is offline   Reply With Quote
Old 06-04-2016, 09:20 AM   #7
sguerrini97
Enthusiast
sguerrini97 began at the beginning.
 
Posts: 27
Karma: 12
Join Date: Jan 2016
Device: KT2
Quote:
Originally Posted by knc1 View Post
Too bad it didn't occur to you to say so in your first post.

Context is important to any question.
I meant to say that the MKK package it's the patch I was talking about, but I didn't know it's name so i didn't know I had it installed. I meant "thank you for pointing me that", sorry for any misunderstanding
sguerrini97 is offline   Reply With Quote
Old 06-04-2016, 09:49 AM   #8
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,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Yeah, you need the "project-side" Kindlet Jailbreak lib added to your projects to be able to use it .
NiLuJe is offline   Reply With Quote
Old 06-04-2016, 10:34 AM   #9
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
Not a problem here, encol was able to guess what the O.P. needed.
A good thing too, I had forgotten that link / write-up.
knc1 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
No permissions to run johnnyd2 Devices 0 04-09-2013 11:22 PM
PRS-T1 Fixing Permissions? Holtor Sony Reader Dev Corner 3 05-03-2012 02:39 AM
Permissions in epub... markjoseph ePub 1 12-29-2010 09:32 AM
file permissions question troymc Calibre 4 09-05-2009 12:38 PM
eBook Library Error: Permissions. Icarusbop Sony Reader 1 01-02-2008 09:33 AM


All times are GMT -4. The time now is 01:15 PM.


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