Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-01-2012, 03:02 PM   #46
ixtab
0x2A
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,903
Karma: 6677427
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
I'm afraid not. The browser is entirely WAF, not Java.

(Update): wait... how did the rotation work (when it worked)? Was it using the "launcher" orientation stuff, or something else?

Last edited by ixtab; 05-01-2012 at 03:10 PM.
ixtab is offline   Reply With Quote
Old 05-01-2012, 03:11 PM   #47
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,066
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Quote:
Originally Posted by ixtab View Post
But how on earth can yours run on the main partition in 5.1.0, if they removed data.tar.gz extraction logic from that version? Or am I getting something completely wrong here?
Hmm... I thought that I upgraded my K5 to 5.1.0. I just looked in device settings and see 5.0.4.

Now I do not KNOW if my method works booted from main. But I think it should work from diags...

EDIT: Now installing 5.1.0 update... Hmm... update error 006. I only have yifanlu's jailbreak and simple usbnet, and x11vnc on here. Any suggestions? I do not have time to reflash 5.0.0 right now to try updating from 5.0.0 to 5.1.0. Maybe later... (maybe now -- uploading 5.0.0 to k5 /mnt/us now...)

EDIT 2: Now this is strange. All I did was delete /etc/upstart/launcher.conf, but after reboot from diags SSH to main, the launcher menu still works. And now the update to 5.1.0 also worked. The only difference was the launcher.conf file. After the 5.1.0 update the launcher menu is no more...

EDIT 3: On 5.1.0, my data.tar.gz only INSTALLS with ENABLE_DIAGS, but then after a reboot it will run RUNME.sh from main boot or from diags boot. I have a RUNME.sh that can be added to the data.tar.gz that automatically changes to bootmode main and reboots.



Last edited by geekmaster; 05-01-2012 at 05:17 PM.
geekmaster is offline   Reply With Quote
Old 05-01-2012, 03:14 PM   #48
silver18
THE NOOB
silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.silver18 ought to be getting tired of karma fortunes by now.
 
silver18's Avatar
 
Posts: 690
Karma: 1545625
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
I suspected it...
Thanks anyway and thanks for your work!!!

PS Any help is welcome...
http://www.mobileread.com/forums/sho...d.php?t=176296

PPS Yep, it worked with the launcher....It still works if you send the correct commands.
But not in browser and WAF in general. It seems like something is preventing the rotation!
silver18 is offline   Reply With Quote
Old 05-01-2012, 07:04 PM   #49
ixtab
0x2A
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,903
Karma: 6677427
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Support all orientations throughout the Java UI

OK, thanks silver18 for your other post about the orientation, which inspired this patch.

Here is a patch which allows to use *all* orientations (including upside-down) in the reader, the home screen, and even Apps (Kindlets). It does not require any changes to the system configuration. (except the jbpatch; download in first post of this thread).

Note: it does not affect WAF apps such as the browser.

Source code is here.

UPDATE: This file is already included in newer versions, so there is no need to download it.

Last edited by ixtab; 07-25-2012 at 08:26 PM.
ixtab is offline   Reply With Quote
Old 05-01-2012, 08:02 PM   #50
acajac
Junior Member
acajac began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2012
Device: Kindle Touch
Thank you for ur work

Quote:
Originally Posted by ixtab View Post
OK, thanks silver18 for your other post about the orientation, which inspired this patch.

Here is a patch which allows to use *all* orientations (including upside-down) in the reader, the home screen, and even Apps (Kindlets). It does not require any changes to the system configuration.

Note: it does not affect WAF apps such as the browser.

Source code is here.

I have a question. How can I find the directory "jbpatch"? I can't find it.
acajac is offline   Reply With Quote
Old 05-01-2012, 08:33 PM   #51
ixtab
0x2A
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,903
Karma: 6677427
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
You have to install jbpatch first, as described in the very first post of this thread
ixtab is offline   Reply With Quote
Old 05-01-2012, 10:05 PM   #52
ixtab
0x2A
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,903
Karma: 6677427
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
OK, here's another one. This one popped up after enabling the rotation stuff. Turns out that the menu may not be large enough to hold all entries in landscape mode. There is a scrollbar, but:

a) it's deactivated, and doesn't have any effect, so essentially it's impossible to change pages, and
b) it's much too thin. There's almost no chance to even hit it with the finger. (This is also something that I realized in Font Hack: the scrollbars were useless).

This patch fixes both of these issues. The scrollbar is now 66px (instead of 22), and it actually does something in the menus. Note that dragging the scrollbars doesn't seem to work correctly: you need to tap on the scrollbar, in the direction where you want to go. But that's good enough to be usable.

Install as usual.

This one is a tad more complex than most of the previous patches. Here's the source code.

UPDATE: This file is already included in newer versions, so there is no need to download it.

Last edited by ixtab; 07-25-2012 at 08:26 PM.
ixtab is offline   Reply With Quote
Old 05-01-2012, 11:00 PM   #53
acajac
Junior Member
acajac began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2012
Device: Kindle Touch
Thanks for ur help. I've done. but...

Quote:
Originally Posted by ixtab View Post
You have to install jbpatch first, as described in the very first post of this thread
A thousand thanks~!

I installed "jbpatch" and "allrotations" successfully.

But, I want to let u know that u need to edit the README.txt file of jbpatch.

In the section of "Installation", See no. 3.
-------------------------------------------------------------------
3. to actually take advantage of the "pluggable" patches, create the
directory "/mnt/us/opt/jpatch/" ---> jbpatch
-------------------------------------------------------------------

Because of this, I had tried several times to install it but I failed.
If I had common sense about this, It wouldn't not be the problem.
Anyway, I've installed successfully. So, I thanks again for ur help.

However, still I have a problem. Could u check the attached file that is an image I captured.

Do I need to remove the Ads?
Attached Thumbnails
Click image for larger version

Name:	screenshot_2012-05-01T22_24_09-0400.gif
Views:	250
Size:	19.3 KB
ID:	85957  

Last edited by acajac; 05-02-2012 at 02:30 PM.
acajac is offline   Reply With Quote
Old 05-01-2012, 11:27 PM   #54
ixtab
0x2A
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,903
Karma: 6677427
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by acajac View Post
A thousand thanks~!
But, I want to let u know that u need to edit the README.txt file of jbpatch.

In the section of "Installation", See no. 3.
-------------------------------------------------------------------
3. to actually take advantage of the "pluggable" patches, create the
directory "/mnt/us/opt/jpatch/" ---> jbpatch
-------------------------------------------------------------------

Because of this I tried to several time to install it but I failed.
Ooops, thanks a lot for the info. You're right of course. Dreaded typos!

Quote:
Originally Posted by acajac View Post
However, still I have a problem. Could u check the attached file that is a image I captured.

Do I need to remove the AD?
Hmmm... yeah, that's pretty much what can be expected. There simply isn't enough space for everything, so things get squished together. I guess this is one of the reasons why landscape isn't officially supported on the home screen. I'm sure there's a way to fix this as well... but not right now
ixtab is offline   Reply With Quote
Old 05-03-2012, 06:13 PM   #55
ixtab
0x2A
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,903
Karma: 6677427
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Version 1.1.0

Version 1.1.0 is out.

There have been quite a few changes under the hood, but from a user perspective, the most important one probably is that now, non-geeks can install it as well.

My personal recommendation for everyone who uses an older version is to upgrade.

Let me know if there are any problems....
ixtab is offline   Reply With Quote
Old 05-04-2012, 03:59 AM   #56
diba
Addict
diba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolate
 
Posts: 395
Karma: 33660
Join Date: Jul 2011
Device: Kindle 3, Kindle 4, Kindle PW, Nexus7 3G
Updated without any problems. Thought about uninstalling the previous version first, but decided not to be a coward.
diba is offline   Reply With Quote
Old 05-05-2012, 09:10 AM   #57
ixtab
0x2A
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,903
Karma: 6677427
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
How to write your own patches - by example

This post shows how to develop a simple patch from the ground up.

It is written in a tutorial style, showing the individual steps in a rather detailed way. The entire procedure took me about one hour, of which most of the time spent was actually documenting it (i.e., writing this text).

In this case, the goal is to modify the displayed TTS options on a Kindle that is localized to german, to support visual indication of the language that the voices can read. For the purpose of this patch, I will stick with the most common pattern, namely that a user would replace one voice with a german one, and keep the other one english. The display should allow for 2 different variants:

1. "Weiblich (englisch)/Männlich (deutsch)"
2. "Weiblich (deutsch)/Männlich (englisch)"

(Weiblich=female, Männlich=male, for those non-german-speaking people out there)

Note that, of course, this only affects the display of the options, not the underlying TTS files themselves. These have to be manually adapted, for example by using the information from this post.

So, how do we go about this?

The very first step is to find which file we actually need to modify. A useful method in this case involves finding the class containing the string "Weiblich". To achieve this, it is very useful to copy all the jar files from your Kindle to your computer, and to extract them in a common folder. I leave this as an exercise to you. Once we have this, let's give it a shot:

Code:
~/kindle-touch/java/classes$ grep -r Weiblich .
Übereinstimmungen in Binärdatei ./com/amazon/ebook/booklet/reader/plugin/tts/resources/TTSResources_de.class.
The next step is to decompile that class. Because I'm lazy, I'm using Eclipse with the jadclipse plugin. Below is a screenshot of how the decompiled class looks; the things we're looking for are on lines 42-45 in the editor window.

Click image for larger version

Name:	screen1.png
Views:	328
Size:	191.8 KB
ID:	86105

Now where and how is that data used? The containing class (transitively) extends ResourceBundle, so I'll bet that something, somewhere, uses the key "tts.speaking.voice.display.list" to fetch the data. Let's quickly verify this:
Code:
~/kindle-touch/java/classes$ grep -r tts.speaking.voice.display.list .
Übereinstimmungen in Binärdatei ./com/amazon/ebook/booklet/reader/plugin/tts/TTSController.class.
Übereinstimmungen in Binärdatei ./com/amazon/ebook/booklet/reader/plugin/tts/resources/TTSResources_pt.class.
Übereinstimmungen in Binärdatei ./com/amazon/ebook/booklet/reader/plugin/tts/resources/TTSResources_de.class.
Übereinstimmungen in Binärdatei ./com/amazon/ebook/booklet/reader/plugin/tts/resources/TTSResources_it.class.
Übereinstimmungen in Binärdatei ./com/amazon/ebook/booklet/reader/plugin/tts/resources/TTSResources.class.
Übereinstimmungen in Binärdatei ./com/amazon/ebook/booklet/reader/plugin/tts/resources/TTSResources_es.class.
Übereinstimmungen in Binärdatei ./com/amazon/ebook/booklet/reader/plugin/tts/resources/TTSResources_fr.class.
Übereinstimmungen in Binärdatei ./com/amazon/ebook/booklet/reader/plugin/tts/resources/TTSResources_en_GB.class.
If you decompile TTSController, you will find this snippet of code:
Code:
a = (String[])(String[])rb.getObject("tts.speaking.voice.display.list");
By now, we have a pretty good understanding of what we should do to modify the functionality to suit our needs: we have to patch the TTSResources_de class (more specifically, its getObject() method), and to intercept the call if the requested key is "tts.speaking.voice.display.list". Wait. There is no getObject() method defined in that class; rather, it's defined in ResourceBundle class directly, and it's declared as final. So no luck going down this route. In this particular case, the solution is much simpler: we're not trying to modify any code, but merely replacing a few constants. In any case, let's postpone the decision on how to actually implement this a bit further, and start by writing our patch. Here is the very first attempt at it:
Code:
package com.mobileread.ixtab.patch;

import serp.bytecode.BCClass;

import com.mobileread.ixtab.jbpatch.Descriptor;
import com.mobileread.ixtab.jbpatch.Patch;

public class TTSGermanDescriptionPatch extends Patch {

	protected Descriptor[] getDescriptors() {
		return new Descriptor[] { new Descriptor(
				"com.amazon.ebook.booklet.reader.plugin.tts.resources.TTSResources_de",
				new String[] { "?" }) };
	}

	public String perform(String md5, BCClass clazz) throws Throwable {
		return "unimplemented";
	}

}
Yes, it's as simple as that. We can already deploy this patch. .jbpatch files are nothing but raw compiled class files (with their extension renamed), so I'm now copying it to the Kindle, as shown below.
Note: classes must have unique names. The fully-qualified class name is "lost" when renaming the file to .jbpatch, but it is still present inside the actual file, and is considered while patches are loaded. In other words: when writing your own patches, you should take precautions to prevent name conflicts with other classes. A reasonable way could be to use a package name such as com.mobileread.<your_username>.patch (as I do for my patches).
Code:
### ON THE COMPUTER:
scp bin/com/mobileread/ixtab/patch/TTSGermanDescriptionPatch.class root@kindle:/mnt/us/opt/jbpatch/ixtab_tts_de-5.1.0.jbpatch

### ON THE KINDLE:
[root@kindle jbpatch]# pwd
/mnt/us/opt/jbpatch
[root@kindle jbpatch]# echo ixtab_tts_de-5.1.0.jbpatch >> CONFIG.TXT 
[root@kindle jbpatch]# killall cvm; tail -f /tmp/jbpatch.log 
Sat May 05 11:30:54 GMT 2012
=== Patching class loader initialized.  ===

!Packages still handled by original loader:
com.mobileread.ixtab.jbpatch.bootstrap
===========================================

I: Registered (builtin) DeviceInfo for com.amazon.kindle.settings.dialog.DeviceInfoDialog
I: Directory synchronization thread started
I: Registered ixtab_legal-5.1.0.jbpatch for com.amazon.kindle.settings.menu.SettingsMenuItemFactory$5
I: Registered ixtab_tts-5.1.0.jbpatch for com.amazon.ebook.booklet.reader.plugin.tts.TTSProvider$TTSAction
I: Registered ixtab_orient-5.1.0.jbpatch for com.amazon.kindle.restricted.device.impl.ScreenRotationServiceImpl
I: Registered ixtab_scroll-5.1.0.jbpatch for com.amazon.agui.swing.plaf.kindle.KindleTheme
I: Registered ixtab_scroll-5.1.0.jbpatch for com.amazon.agui.swing.PagingContainer
I: Registered ixtab_tts_de-5.1.0.jbpatch for com.amazon.ebook.booklet.reader.plugin.tts.resources.TTSResources_de
I: Patched com.amazon.agui.swing.plaf.kindle.KindleTheme (26150e376f27cf44484e788e35af8829) using ixtab_scroll-5.1.0.jbpatch
I: Patched com.amazon.kindle.restricted.device.impl.ScreenRotationServiceImpl (ee50633a567ab87e2521df075d5fd9db) using ixtab_orient-5.1.0.jbpatch
W: ixtab_tts_de-5.1.0.jbpatch does not support MD5 cd9041a3105c19c2de0f61dd012872d3 for com.amazon.ebook.booklet.reader.plugin.tts.resources.TTSResources_de
I: Patched com.amazon.agui.swing.PagingContainer (c3b30042a1bbab39b1c5cb33a5603dde) using ixtab_scroll-5.1.0.jbpatch
Note how I was lazy and didn't include the MD5 checksum of the (unaltered) class in my code above. I'll fix that now, using the one from the warning message.
At the same time, I'll play around with the actual functionality a bit. In the source code of JBPatch, there is a class that I use to quickly test the effect of the patch I'm currently developing (test.TestCurrentGoal). Right now, I modified that file so its testAndDump() method reads:
Code:
//		BCClass cls = new Project().loadClass(new File(System.getProperty("user.home")+"/kindle-touch/java/classes/com/amazon/agui/swing/PagingContainer.class"));
		BCClass cls = new Project().loadClass(TTSResources_de.class);
		new TTSGermanDescriptionPatch().perform("cd9041a3105c19c2de0f61dd012872d3", cls);
		cls.write(new File("/tmp/test.class"));
You can use either method (first or second line) to load a class; it's usually easier to use the second variant, but in some cases, Kindle classes cannot be loaded into the host JVM, so then the first line is required. Anyway, all this code does is load the "target" class, apply the patch, and write it out to /tmp/test.class. You can then use "jad -o -a test.class" to decompile the result and to see whether it looks correct. This way, you can be at least reasonably sure that a patch will have the desired outcome when actually performed on the device, before even testing it there.

Back to our patch: in this particular case, we do not actually want to replace functionality (for examples on that, see essentially every other patch released before), but only two constant strings. Without further ado, below is the code to achieve that. Some useful pointers:
Code:
package com.mobileread.ixtab.patch;

import serp.bytecode.BCClass;
import serp.bytecode.lowlevel.Entry;
import serp.bytecode.lowlevel.UTF8Entry;

import com.mobileread.ixtab.jbpatch.Descriptor;
import com.mobileread.ixtab.jbpatch.Patch;

public class TTSGermanDescriptionPatch extends Patch {

	private final String[] ORIGINAL = new String[] {"Weiblich", "Männlich"};
	private final String[] REPLACEMENT_1 = new String[] {"Weiblich (englisch)", "Männlich (deutsch)"};
	private final String[] REPLACEMENT_2 = new String[] {"Weiblich (deutsch)", "Männlich (englisch)"};
	
	protected Descriptor[] getDescriptors() {
		return new Descriptor[] { new Descriptor(
				"com.amazon.ebook.booklet.reader.plugin.tts.resources.TTSResources_de",
				new String[] { "cd9041a3105c19c2de0f61dd012872d3" }) };
	}

	public String perform(String md5, BCClass clazz) throws Throwable {
		String[] replacement = REPLACEMENT_1;
		
		Entry[] entries = clazz.getPool().getEntries();
		for (int e=0; e < entries.length; ++e) {
			if (entries[e] instanceof UTF8Entry) {
				UTF8Entry entry = (UTF8Entry) entries[e];
				for (int r = 0; r < ORIGINAL.length; ++r) {
					if (ORIGINAL[r].equals(entry.getValue())) {
						entry.setValue(replacement[r]);
						break;
					}
				}
			}
		}
		return null;
	}
}
Decompiling the result of the patch suggests that it should be ok. We can simply copy the patch to the device now, and verify that it works as expected (it does).

The final thing to consider is that for this particular patch, we want to be able to support two UI variants ("female=english, male=german", and the other way around). A slightly unorthodox, but working, way, is to include this tiny bit of information in the patch filename itself: patches can access their own "id" (which is the filename), so that should do as a discriminator. This final version is not reproduced here, but already checked in.

For convenience, I'm attaching the resulting binary patch, ready for installation, as well.

I hope this was helpful to give some insight, and to encourage others to start looking around and developing some patches as well

Last edited by ixtab; 07-25-2012 at 08:26 PM.
ixtab is offline   Reply With Quote
Old 05-05-2012, 12:38 PM   #58
diba
Addict
diba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolatediba is generous with chocolate
 
Posts: 395
Karma: 33660
Join Date: Jul 2011
Device: Kindle 3, Kindle 4, Kindle PW, Nexus7 3G
OK ixtab, read quickly through and realised, ... I have to dive in to understand ...

What i.e. is necessary to further modify this patch. I would play around with this patch to learn. So I would like i.e. to get rid of "Weiblich" and "Männlich" just having the language. I tried it with notepad, but obviously, this did not work.

I have to download the TTSGermanDescriptionPatch.java and do it there ... correct I assume. And how is it to be compiled pls?

Probably stupid questions, but thats always the way doing it the first time. Second time I am already a tutor ;-)

Last edited by diba; 05-05-2012 at 12:49 PM.
diba is offline   Reply With Quote
Old 05-05-2012, 01:37 PM   #59
ixtab
0x2A
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,903
Karma: 6677427
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
@diba:

thanks for commenting... at least you're reassuring me that this doesn't go totally unnoticed

Yes, even in this rather simple case, it's unfortunately not as simple as editing some file with a text editor.

So first things first, you need to have the development environment ready for this: get a Java Delevopment Kit [JDK] (NOT only a Java Runtime Environment [JRE]) from http://www.oracle.com/technetwork/ja...ads/index.html

Since Oracle has bought Sun, the site has become a mess but you should still find your way through.

Second, you probably want to get Eclipse, which is an Development Environment for Java. Get it from http://www.eclipse.org/downloads/pac...pers/indigosr2

Third, if you have never used any of these tools, create a "hello world" project for yourself (I'm not kidding), and make sure that you get to compile and run a "Hello World" application.

Fourth (... and that is indeed a huge leap from "third"), make sure that you can import the project from git. That involves having git installed in the first place, and cloning and synchronizing to the remote repository from your local installation. The procedure to do so is not complicated, but it really depends on your local configuration, so I can't give any boilerplate instructions here.

Fifth , you have to make sure that the JBPatcher project actually has its dependencies satisfied. Essentially, that only means that you must have a "User Library" called "Kindle Touch 5.1.0", which includes all the jar files from the KT5.1.0. If you have a copy of your Kindle's /opt/amazon/ebook/ on your computer (strongly recommended), then that should do. You only have to set up that User Library once.

Once you have the JBPatcher project "error-free", you should be able to follow the instructions without any problem, and actually to write your own patches

Last edited by ixtab; 05-05-2012 at 01:55 PM.
ixtab is offline   Reply With Quote
Old 05-06-2012, 08:13 PM   #60
franco1387
Junior Member
franco1387 has a spectacular aura aboutfranco1387 has a spectacular aura aboutfranco1387 has a spectacular aura aboutfranco1387 has a spectacular aura aboutfranco1387 has a spectacular aura aboutfranco1387 has a spectacular aura aboutfranco1387 has a spectacular aura aboutfranco1387 has a spectacular aura aboutfranco1387 has a spectacular aura aboutfranco1387 has a spectacular aura aboutfranco1387 has a spectacular aura about
 
Posts: 2
Karma: 4480
Join Date: May 2012
Device: Kindle Touch
I have a problem

I installed the patch but when i look in device info, there are strange numbers "2699" instead the gear that is in the sample image of the first post. Is that a problem? I have KT 5.1.
franco1387 is offline   Reply With Quote
Reply

Tags
jbpatch, kindle touch hacks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump


All times are GMT -4. The time now is 09:00 PM.


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