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 07-23-2014, 03:28 PM   #1
Ricky23289
Nameless Being
 
Post Kindle Kindlet Jailbreak (KKJB) - Template project and HOWTO

Hi there,

first of all: I'd like to call it KKJB as "Kindle Jailbreak" and "Kindlet jailbreak" looks too much the same.

This project is based on the source code of KUAL and ixtab's KKJB.

If you simply use the template, read the following
Spoiler:

Todos for using the Project:
- Copy the folder AllPermissionKindletTemplate to your Workspace
- Rename to whatever the name of your new project should be
- import your kindle libraries to the project
- edit the entries in build.properties
-> at least: set the "product.mainclass"-value to a valid one that points to your class
-> decide which signing method you want to use
- extend your main class from com.mobileread.KKJBConnector.KKJBConnector


The things I've struggled with most:(don't get the same problems)
Spoiler:

- the KKJB jar (jailbreak.jar) must be in your project and included in your libraries list
- the three java files (kindletJailbreakAlternative, LauncherKindletJailbreak,OutputObject) must be in your project and referrable from other source files
- All the class-files, that are contained in the KKJB jar must be in your final azw2 file with the structure com/mobileread/ixtab/*.class otherwise you will get a "no main class found"-error


Complete walk-through for binding the KKJB in your Project. Just take the pieces out, that you need
Spoiler:

- create a new project
- (add the kindle-jars to the project)
- create a "libs" folder in your project
- Add the KKJB-jar to the "libs" folder (simply drag&drop it into the project)
- now you can go to project properties -> build path -> libraries -> add jar
and add the KKJB jar
- create a new file "build.xml" in your project (we're going to build our file using ant)
the file should have a content like this (edit the file with your data)
Spoiler:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<project name="xxPROJECTNAMExx.makejar" default="makejar" basedir=".">	
  <property file="build.properties"/>

		<target name ="makejar" description="xxDESCRIPTIONxx">			
			<jar jarfile="xxOUTPUTNAMExx.azw2" includes="*.class" basedir="bin">
			    <manifest>
			    	<attribute name="Implementation-Vendor" value="${sign.aliases}"/>
			    	<attribute name="Extension-List" value="SDK"/>
			    	
			      <attribute name="Implementation-Title" value="${product.filename}"/>
			      <attribute name="SDK-Specification-Version" value="${product.kdk-version}"/>
			      <attribute name="Implementation-Version" value="${product.version}"/>
			      <attribute name="Toolbar-Mode" value="persistent"/>
			      <attribute name="SDK-Extension-Name" value="com.amazon.kindle.kindlet"/>
			      <attribute name="Main-Class" value="${product.mainclass}"/>
			    </manifest>  	
				
				<!-- this includes the KKJB jailbreak (NECESSARY!)-->
				<zipfileset src="libs/jailbreak.jar">
					<include name="**/*.class"/>
				</zipfileset>
				
				<!-- actual program files -->
				<fileset dir="${build.dir}">
					<include name="**/*.class"/>
				</fileset>
			</jar>	
			
			<!--
			 *********************************
			 **** signing the output file ****
			 *********************************
			-->
			 
			<!-- !!!! Use these commands instead, if it works for you !!! -->
			<!--
			<signjar jar="${file}" keystore="${sign.keystore.file}" storepass="${sign.keystore.password}" alias="dk${sign.aliases}"/>
			<signjar jar="${file}" keystore="${sign.keystore.file}" storepass="${sign.keystore.password}" alias="di${sign.aliases}"/>
			<signjar jar="${file}" keystore="${sign.keystore.file}" storepass="${sign.keystore.password}" alias="dn${sign.aliases}"/>
			-->
			<!-- signing jars the exec way, as ant is fucking to stupid to accept my classpath -.-"""" --> 
			
			<exec executable="${sign.jarsigner.path}">
				<arg value="-keystore"/>
				<arg value="${sign.keystore.path}/${sign.keystore.file}"/>
				<arg value="-storepass"/>
				<arg value="${sign.keystore.password}"/>
				<arg value="${file}"/>
				<arg value="dk${sign.aliases}"/>
			</exec>
			<exec executable="${sign.jarsigner.path}">
				<arg value="-keystore"/>
				<arg value="${sign.keystore.path}/${sign.keystore.file}"/>
				<arg value="-storepass"/>
				<arg value="${sign.keystore.password}"/>
				<arg value="${file}"/>
				<arg value="di${sign.aliases}"/>
			</exec>
			<exec executable="${sign.jarsigner.path}">
				<arg value="-keystore"/>
				<arg value="${sign.keystore.path}/${sign.keystore.file}"/>
				<arg value="-storepass"/>
				<arg value="${sign.keystore.password}"/>
				<arg value="${file}"/>
				<arg value="dn${sign.aliases}"/>
			</exec>
			
			
	</target>
</project>

! Make sure that the KKJB-jar is located in the "libs" folder. If not, change the location of the KKJB or edit the entry in the build.xml (at the position "this includes the KKJB jailbreak")
! the build.xml file will also sign the output for you, if you provide a proper path (see next point)

- create a "file build.properties" in your project
- the file should have a structure as follows (edit the content with your data)
Spoiler:

Code:
# do not change these values for compatibility among kindlets
sign.keystore.file=developer.keystore  
sign.keystore.password=password
sign.aliases=test

# the following two are only for using the command-line way to sign your files
sign.jarsigner.path=PATH_TO_JARSIGNER/jarsigner.exe
sign.keystore.path=PATH_TO_DEVELOPER.KEYSTORE

# this Version should point to the Version you're using
product.kdk-version=2.1
product.filename=xxNAME_OF_THE_OUTPUT_FILExx
product.extension=azw2
product.name=xxNAME_THAT_WILL_BE_DISPLAYED_ON_KINDLExx
product.version=1.0


product.vendor=xxPROBABLY_YOUR_NAMExx 
# change the following to match your class
product.mainclass=com.mobileread.KKJBTemplate
#product.image=KindleLauncher.jpg
build.dir=bin
#build.classpath.jdk14=/opt/j2sdk1.4.2_19/jre/lib


- create a new package com.mobileread.ixtab
- copy the following files in there:
Spoiler:

- kindletJailbreakAlternative.java
- LauncherKindlet.Jailbreak.java
- OutputObject.java


at least from here, you should look into the files included in this post. If you mostly know what to do, you can follow the steps on here
- create a new class, that extends SuicidalKindlet in the package com.mobileread.KKJBConnector
- you also need to import the KKJB classes with
Spoiler:

import ixtab.jailbreak.Jailbreak;
import ixtab.jailbreak.SuicidalKindlet;
import com.mobileread.ixtab.LauncherKindletJailbreak;

- create the following method (this is important!):
Spoiler:

Code:
protected Jailbreak instantiateJailbreak() {
		return new LauncherKindletJailbreak();
	}
- if LauncherKindletJailbreak could not be found:
it's declared in "LauncherKindletJailbreak.java". Make sure it is included in your project and imported in the file

- create a method "onstart" that looks at least like this
Spoiler:

Add a boolean variable to the class called "started" (initial value = false)
Code:
public void onStart() 
	{
		// apparently this method gets called various times
		if (started) {
			return;
		}
		super.onStart();
		started = true;
		
		/*** 
			your Code might come here
		***/

	}


- create an onCreateMethod:
Spoiler:

Code:
private KindletContext context;
public void onCreate(KindletContext context)
	{
		super.onCreate(context);		
		this.context = context;		
	}



Where do I find the KKJB?
Spoiler:

ixtab provided a home for it:
https://bitbucket.org/ixtab/kindletjailbreak


Please let me know, if there a any issues with the project. I hope I've removed all the my-computer-specific-stuff.
And it would be nice, if this is helpful for anybody
Attached Files
File Type: zip AllPermissionKindletTemplate.zip (23.7 KB, 141 views)

Last edited by Ricky23289; 08-12-2014 at 04:33 AM. Reason: Forgot to add the project
  Reply With Quote
Old 07-24-2014, 08:10 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
Quote:
Originally Posted by Ricky23289 View Post
Hi there,

first of all: I'd like to call it KKJB as "Kindle Jailbreak" and "Kinklet jailbreak" looks too much the same.

- - - -
Spoil sport!
There goes our #1 "Did user read the directions carefully?" test.

Seriously,
Thanks for the post, it may help others re-use the existing work.

Last edited by knc1; 07-24-2014 at 08:17 AM.
knc1 is offline   Reply With Quote
Old 07-28-2014, 06:14 PM   #3
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
I think the difference between "kindle" and "kinklet" is very noticeable.

How exactly does this test work? How do people fail it?
eschwartz is offline   Reply With Quote
Old 07-28-2014, 07:25 PM   #4
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
But work it does.
It took 4 days for anyone to notice.
knc1 is offline   Reply With Quote
Old 07-28-2014, 07:31 PM   #5
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by knc1 View Post
But work it does.
It took 4 days for anyone to notice.
Yes, and for 4 days I have only been checking my subscriptions. (I've been limited to my Kindle Touch browser on account of traveling.) Now that I went through the backlog, I noticed this first thing.
eschwartz is offline   Reply With Quote
Old 08-12-2014, 04:34 AM   #6
Ricky23289
Nameless Being
 
ok, so now I also added the project, that I forgot in the first place ^_^;
  Reply With Quote
Reply

Tags
kindletjailbreak, permission denied, permissiondenied


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Kindlet Jailbreak" needs a new name! ixtab Kindle Developer's Corner 20 02-14-2014 03:28 PM
Kindlet Jailbreak Required CyKoDeLiC Kindle Developer's Corner 3 08-02-2013 04:30 AM
Kindlet Jailbreak File tmf2 Kindle Developer's Corner 8 01-10-2013 03:51 PM
Kindlet Jailbreak help Firedb Kindle Developer's Corner 1 06-10-2012 04:47 AM
Kindlet Jailbreak route66 Amazon Kindle 7 06-02-2012 07:09 AM


All times are GMT -4. The time now is 12:26 AM.


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