10-12-2012, 08:43 AM | #826 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
|
10-12-2012, 10:52 AM | #827 |
Enthusiast
Posts: 36
Karma: 41848
Join Date: Mar 2011
Device: iRex
|
I finally got everything to compile at least. One issue I was the following:
conf\ConfigurableSetting.java:36: error: cannot find symbol public abstract SettingPanel getPanel(SettingChangeListener listener); ^ symbol: class SettingChangeListener location: class ConfigurableSetting The problem is: - JBPatch core files depend on "ConfigurableSettings", - which in turn depends on "ConfigurableSetting", - which depends on the UI component of the conf component, - which of course I removed as it won't work on K3. How do I cleanly decouple the UI part from the configuration part of the code? Is it ok to just comment out the following line? (Plus the corresponding imports at the top of the code...) Code:
public abstract SettingPanel getPanel(SettingChangeListener listener); Last edited by arikfunke; 10-12-2012 at 11:40 AM. |
Advert | |
|
10-12-2012, 11:42 AM | #828 |
Enthusiast
Posts: 36
Karma: 41848
Join Date: Mar 2011
Device: iRex
|
Good news: it appears JBPatch works with some minor adjustments to the code on K3.
/tmp/jbpatch.log: Code:
Log start timestamp: Fri Oct 12 15:36:54 GMT 2012 Bootstrap OK, PatchingClassLoader instantiated Packages still handled by original ClassLoader: - com.mobileread.ixtab.jbpatch.bootstrap JBPatch version 2.4.0: initializing patches I: Directory synchronization thread started I: (builtin) DeviceInfo registered for com.amazon.kindle.settings.dialog.Device InfoDialog I: Patch policy initialized |
10-12-2012, 11:43 AM | #829 | |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
Java loads classes on demand (=when they are first requested). If nobody requests the UI part of JBPatch, the corresponding classes will never actually be loaded. No, I didn't want to scare you away. Chances are that everything just works. I'm not just posting random code - in fact, I believe that it will work. But I won't guarantee that it will (quite simply: I couldn't test it), and there is always some risk, until somebody actually tries it. From what I understand, you are willing to try it - and I assume that you also know the risks, and that you can handle them (and that you know how to get your device back into a working state, in case something fails). But this is your duty, not mine. |
|
10-12-2012, 02:21 PM | #830 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Hmm.. well at the risk of being a Kindle Martyr
@arikfunke I will test it if you would like... Batter up. Sling me a copy. KK at the ready. Last edited by twobob; 10-12-2012 at 02:24 PM. Reason: @arikfunke |
Advert | |
|
10-12-2012, 02:40 PM | #831 | |
Enthusiast
Posts: 36
Karma: 41848
Join Date: Mar 2011
Device: iRex
|
Quote:
Obviously nothing interesting happens as there are no patches yet. You want a copy anyways? I will take a look at how to write those over the next few days to see whether the patching works as expected. |
|
10-12-2012, 03:09 PM | #832 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
yep definitely want a copy mate. pls.
|
10-12-2012, 03:26 PM | #833 |
Official Lurker
Posts: 1,050
Karma: 7096675
Join Date: Apr 2012
Device: Kindle 3.4
|
|
10-12-2012, 09:19 PM | #834 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
|
10-14-2012, 05:52 AM | #835 |
Enthusiast
Posts: 36
Karma: 41848
Join Date: Mar 2011
Device: iRex
|
JBPatch works on K3
Good news for those who have been waiting for JBPatch on K3: after writing a small dummy patch I can confirm that JBPatch appears to work perfectly on K3. (Obviously less the UI component.)
Rough recipe for compiling JBPatch for K3:
Note: the deletions were necessary in my case due to missing dependencies. If you have them, it should not be necessary to delete anything from the source three. Copy the JAR to the kindle as described by ixtab in his post. I have also created a dummy patch that prefixes "abcXYZ" to any search string entered in the browser's URL bar for Google searches: Code:
package com.mobileread.arikfunke.patch; import java.util.Map; import serp.bytecode.BCClass; import serp.bytecode.lowlevel.Entry; import serp.bytecode.lowlevel.UTF8Entry; import com.mobileread.ixtab.jbpatch.Patch; import com.mobileread.ixtab.jbpatch.PatchMetadata; import com.mobileread.ixtab.jbpatch.PatchMetadata.PatchableClass; public class K3BrowserGoogleMobileSearchPatch extends Patch { private static final String CLASS = "com.amazon.ebook.booklet.browser.resources.BrowserResources"; private static final String MD5_BEFORE = "6c8c6e226e2f60e134fa7ccec784c4ce"; private static final String MD5_AFTER = "96d802f5b0cef88cdf54a2407e263af8"; private final String[] ORIGINAL = new String[] { "search.internet.url.pattern", "http://www.google.com/search?q={0}" }; private final String[] REPLACEMENT = new String[] { "search.internet.url.pattern", "http://www.google.com/search?q=abcXYZ{0}" }; public int getVersion() { return 20121013; } protected void initLocalization(String locale, Map map) { if (RESOURCE_ID_ENGLISH.equals(locale)) { map.put(I18N_JBPATCH_NAME, "Use Google Mobile Search in Browser"); map.put(I18N_JBPATCH_DESCRIPTION, "This is a proof of concept patch. It changes the browser's search-bar behaviour. abcXYZ is prefixed to any search string."); } } public PatchMetadata getMetadata() { PatchableClass pc = new PatchableClass(CLASS).withChecksums(MD5_BEFORE, MD5_AFTER); return new PatchMetadata(this).withClass(pc); } public String perform(String md5, BCClass clazz) throws Throwable { if (md5.equals(MD5_BEFORE)) { patchBrowserResources(clazz); return null; } return "unsupported MD5: "+md5; } private void patchBrowserResources(BCClass clazz) { String[] replacement = REPLACEMENT; 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; } } } } } } Restart the framework with the modifications described in this post by ixtab. (Note: due to changes in the naming of the classes you need to use "app=com.mobileread.ixtab.jbpatch.bootstrap.K3Star tup" rather than "app=com.mobileread.ixtab.jbpatch.bootstrap.Startu p" .) Hope this is useful to somebody. Many thanks to ixtab for the great work with JBPatch! Last edited by arikfunke; 10-14-2012 at 06:02 AM. |
10-14-2012, 10:53 AM | #836 |
Junior Member
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: Kindle Touch
|
Noob question here. Installed JBpatch today (Kindle Touch 5.1.2, JBpatch 2.4.1). Works nicely. How can I configure it, so home screen would always stay in portrait mode? After applying JBpatch it started "following" reading screen mode. I tried disabling "Enable all Screen Rotations" patch, but home screen still goes album, if i choose it while reading.
|
10-15-2012, 12:19 PM | #837 | |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
But you forgot one fundamental thing: "all changes that you make to patch settings generally require a restart of the framework before they come into effect." |
|
10-15-2012, 01:19 PM | #838 | |
Junior Member
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: Kindle Touch
|
Quote:
|
|
10-18-2012, 02:53 AM | #839 |
Connoisseur
Posts: 88
Karma: 7087
Join Date: May 2009
Device: Kindle PW2
|
Hey guys, I'm confused a bit about the models here and could not find in the sticky pages which is which... this topic is marked K5, does that $69 kindle qualify or it is out of the question? It is K4?
|
10-18-2012, 03:03 AM | #840 | |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
So, your K4 does not "qualify" for the "happy camper" package (JBPatch core and all the described patches - that's K5 only). However, if you scroll back a few posts, you'll see that JBPatch as such has been ported to (and is known to work on) the K3. There is no reason why it wouldn't work on the K4, but nobody tried to make it run on that Firmware yet. |
|
Tags |
jbpatch, kindle touch hacks |
Thread Tools | Search this Thread |
|