05-07-2012, 11:07 AM | #61 | |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
I had specifically chosen that symbol instead of the text "active", in order to be as language-neutral as possible... Last edited by ixtab; 05-10-2012 at 03:51 PM. Reason: serif -> sans serif |
|
05-10-2012, 03:50 PM | #62 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Shamelessly bumping this thread.
Now that a few more people seem to be interested in it, here goes the question again: Did someone come up with new patches, or new ideas for such? There certainly are some more annoyances that can be fixed with this... |
Advert | |
|
05-10-2012, 07:49 PM | #63 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
UPDATE: Please download the updated version.
Here's another HOWTO for writing a patch. Important Notes:
So let's get our hands dirty. This time, the goal is to remove the banner on the home screen for KSO kindles. This won't affect the screensaver, it will simply clean up the home screen. (Update: actually, depending on when you apply the patch, it may also completely disable ads. This is more of an accident than the original intention . See below for details). I'm writing this as I go, and I have (at this moment) no idea where we are going to end up. The first step is in trying to find out where to begin. We don't really have a starting point yet (and we can't use simple methods like grepping for some unique strings). How about this: We enable verbose logging on the Kindle, then tap on the banner. Pretty sure there will be some usable hint. Just did that, and while scrolling through a long list of log messages, there is a usable one: Code:
120510:210921 cvm[6389]: D GestureDispatcher:DebugInfo::GestureDispatcher MousePressed - Source=com.amazon.kindle.home.view.browse.ImageBanner Button=1 Loc=java.awt.Point[x=335,y=57] ForwardTo=null The ImageBanner class isn't terribly helpful yet. We look through it, seeing that it extends JComponent, and we see some references to com.amazon.kindle.ad.AdUnit (another interesting class name). So much for now. Let's see where ImageBanner is used: Code:
~/kindle-touch/java/classes$ grep -r ImageBanner . Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/view/browse/ImageBanner$1.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/view/browse/ImageBanner.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/view/browse/ImageBanner$BoundedImage.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/view/browse/ImageBanner$ViewAdDetailsAction.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/controller/AdPanel.class. ~/kindle-touch/java/classes$ grep -r AdPanel . Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/controller/e.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/controller/AdPanel.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/controller/q.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/c/h.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/c/i.class. Code:
~/kindle-touch/java/classes$ grep -r AdManager . Übereinstimmungen in Binärdatei ./com/amazon/kindle/ad/manager/AdDisplayStrategy.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/ad/manager/AdManager.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/booklet/ad/controller/AdDisplayController.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/booklet/ad/action/ViewAdDetailsAction.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/view/b/j.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/view/a/j.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/view/searchresults/q.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/view/archive/j.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/view/c/j.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/view/browse/BrowseContentCell.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/view/browse/n.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/view/browse/BrowseDisplayController$BrowseMenuManager.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/view/browse/u.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/view/d/j.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/controller/j.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/controller/e.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/controller/AdPanel.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/c/t.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/c/x.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/home/HomeBooklet.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/restricted/ad/controller/q.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/restricted/ad/manager/e.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/restricted/ad/manager/q.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/restricted/ad/manager/a.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/restricted/ad/manager/i.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/restricted/ad/manager/AdManagerImpl.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/restricted/ad/todo/j.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/restricted/ad/todo/AdPackageToDoHandler.class. Übereinstimmungen in Binärdatei ./com/amazon/kindle/restricted/ad/todo/AdResetToDoHandler.class. Now wee see a few things related to ads, like the A() and H() methods, where the booklet registers itself as an AdEventListener, and most notably the method D(AdEvent) implementing that interface. So how about... we make this method do nothing? Let's try it. The first step is to write a "skeleton patch", which does not include the MD5 sum or any functionality, and to deploy it to the device. This serves to make sure that the patch is considered, and to find out the required MD5 at the same time. This procedure is exactly as in the other HOWTO. Then we try to (only) replace the AdEventListener interface by removing the entire code therein, except for the return statement: Code:
BCMethod m = clazz.getDeclaredMethod("D", new String[] {"com.amazon.kindle.ad.event.AdEvent"}); Code c = m.getCode(false); c.beforeFirst(); for (int i=0; i < 35; ++i) { c.next(); c.remove(); } c.calculateMaxLocals(); c.calculateMaxStack(); The approach is again very similar as above, and the code is checked in, so you can study the source if you want. The result is: yep, the banner is not shown anymore. Mission accomplished? Not really, IMO: something somewhere still seems to think that the banner is shown, and "reserves" the space on the home screen: only 7 items are shown, where there should be 8. So, one more round, now with the heavy equipment. Let's take a look at AdManager itself (or actually, its implementation, namely com.amazon.kindle.restricted.ad.manager.AdManagerI mpl). I'll let you poke around in it a bit. Even though it's obfuscated, it is relatively straightforward to find that the method m() is a crucial one. It returns a boolean indicating whether the device is ad-activated. Applying the same procedure again, we patch the code to always return false (again, refer to the source code for how it's implemented). And voilà: After a reboot, the home screen is fully usable, and the ads have disappeared. In fact, while I only wanted to remove them from the home screen, but keep them for the screensaver, there is another effect of this patch: If you activate the patch before you register your Kindle with Amazon (or if you remove /var/local/adunits in whichever way you please, either manually or through a factory reset), no ads will be downloaded anymore. Note that the above text was essentially a "log" of what I did. The entire procedure took about two hours (including writing this text). I have ended up in some dead end streets (and documented it), and I have written some code which is no longer required. In fact, only the last of the 3 approaches is needed. Code for the other 2 is still kept in the source code, but it's not "active" in the patch. The procedure, as always, involves a bit of intuition. This time we were lucky, because at least most of the class names were still making sense, which helps with the intuition. But even if the framework was fully obfuscated, we would have ended up where we wanted to go, sooner or later. Anyway, here is the source code, and the binary is attached. Install as usual (i.e.: unzip, copy the .jbpatch file to opt/jbpatch, and insert a line with the file name into CONFIG.TXT). UPDATE: There is a more recent version ! Last edited by ixtab; 07-25-2012 at 08:26 PM. |
05-10-2012, 07:50 PM | #64 | |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
UPDATE: I just released version 1.1.1. It fixes this issue by introducing a different format for the device info screen, and it also fixes a minor bug. Upgrade recommended. Last edited by ixtab; 05-10-2012 at 09:44 PM. |
|
05-11-2012, 01:39 AM | #65 |
Addict
Posts: 396
Karma: 33660
Join Date: Jul 2011
Device: Kindle 3, Kindle 4, Kindle PW, Nexus7 3G
|
Idea for a patch:
Routine for reinstalling the dev.cert for the font hack after logging in/out from an account to another. This requests to update the dertificate. Put it in the font-hack post as well. |
Advert | |
|
05-11-2012, 11:30 AM | #66 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Excellent idea. I had also thought about these annoying certs -- I even thought about disabling them completely, but that felt a bit too unsafe to me, and would actually be quite a hassle to implement. But your idea is great, I'll see how this can be done. Don't hold your breath though, I'm planning to introduce a few major new features to the framework itself (which will directly benefit this upcoming patch).
|
05-12-2012, 01:54 PM | #67 | |
Connoisseur
Posts: 51
Karma: 9502
Join Date: Oct 2010
Location: California
Device: Kindle 3 WiFi, Kindle 4 Touch
|
Quote:
https://www.mobileread.com/forums/sho...d.php?t=173840 Do you have any hints on where the event handler is for a collection being opened? I browsed the classes a bit, but my Java experience is sorely lacking. Any hints would be appreciated! --- edit --- Found a promising class in /booklet/home.jar, called CollectionDisplayController Unfortunately my java experience is too limited. Ixtab, would you be interested in helping out with this tweak? I've asked around, demand for a clean solution for password protecting collections definitely exists. Last edited by vaniaspeedy; 05-12-2012 at 03:19 PM. |
|
05-12-2012, 03:37 PM | #68 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Version 1.2.0 released
I just released version 1.2.0.
This version includes a lot of new functionality, but (as is usual for frameworks) much of the development concerns features "under the hood". Nevertheless, here are some highlights of the new version:
If you have a previous installation of jbpatch, I suggest to replace the entire opt/jbpatch directory with the one provided in the download, because the new CONFIG.TXT obsoletes a few older patches, and includes up-to-date documentation. If you did install the "no-ads" patch, you can simply re-add it. Of course all the older patches are still working fine with this version. Last edited by ixtab; 05-12-2012 at 04:17 PM. |
05-12-2012, 04:09 PM | #69 | |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
I don't know what you're really looking for, but if you want to control access to specific items (contained in a collection or not), you'd probably want this "access control" on the item itself, not on the collection. Or did I get something wrong? |
|
05-12-2012, 04:45 PM | #70 |
Addict
Posts: 396
Karma: 33660
Join Date: Jul 2011
Device: Kindle 3, Kindle 4, Kindle PW, Nexus7 3G
|
Happy to have now only "Englisch" und "Deutsch" in my TTS options. Worked like charme, thx!
|
05-12-2012, 05:54 PM | #71 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
|
05-12-2012, 07:26 PM | #72 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
So depending on whether the intended meaning was that it worked "gracefully", or that it worked "like magic", the word "charme" may actually be more technically correct in this case (although perhaps by accident). Last edited by geekmaster; 05-12-2012 at 07:29 PM. |
|
05-17-2012, 02:35 PM | #73 | |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
This one was quite a challenge to get right (source code, if you're interested), and actually required a few changes in the framework itself (hence the new version). Update: I just found out how to install them without requiring a restart. Since 1.3.0 had only been downloaded 2 times, I simply repackaged it with the fixed certificates patch as version 1.3.1. Last edited by ixtab; 05-17-2012 at 04:04 PM. |
|
05-18-2012, 02:40 AM | #74 |
Addict
Posts: 396
Karma: 33660
Join Date: Jul 2011
Device: Kindle 3, Kindle 4, Kindle PW, Nexus7 3G
|
Great! First I expected having a launcher menu item to choose, was even starting to write, but then just unregistered and started FontHack after the usual message "No test kindle" or something like that and it installed the devcert.
After registering again to my account, I got a weird message about "die Anwendung wurde nicht richtig beendet, Neustart in 5 Sekunden" and it took quite a long time to reboot, 3 or 4 screenflashes, thought I got it bricked. But everything is working excellent, as expected btw ... ;-) |
05-18-2012, 05:06 PM | #75 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Just FYI, I'm currently working on the next feature: password protection.
It is still in a very early stage, far from being usable, but here's a screenshot from the development version, giving an idea of what it might look like in the end. (UPDATE: screenshot removed. See below for the released version.) If you are interested in this... I don't know. Since there's (fortunately) no "Like" or "+1" button here, you could just click on the Karma button instead. Even better, you could reply to this post. I'm just interested in some feedback about whether this is just wasted time, or if it's indeed something that could be useful to a wider audience. Last edited by ixtab; 05-20-2012 at 05:29 AM. |