View Single Post
Old 03-30-2021, 06:24 PM   #29
tryol
Warm Lighting Enthusiast
tryol ought to be getting tired of karma fortunes by now.tryol ought to be getting tired of karma fortunes by now.tryol ought to be getting tired of karma fortunes by now.tryol ought to be getting tired of karma fortunes by now.tryol ought to be getting tired of karma fortunes by now.tryol ought to be getting tired of karma fortunes by now.tryol ought to be getting tired of karma fortunes by now.tryol ought to be getting tired of karma fortunes by now.tryol ought to be getting tired of karma fortunes by now.tryol ought to be getting tired of karma fortunes by now.tryol ought to be getting tired of karma fortunes by now.
 
tryol's Avatar
 
Posts: 91
Karma: 754136
Join Date: Dec 2020
Device: Kindle Oasis 3 (jailbroken)


This took considerably longer than expected. Unfortunately, even though I made a KUAL extension for it, I won't be able to release it.

Let me explain:

There are 3 different .jar files that need to be modified in order to make this work.
  • The buttons' icons are stored in /opt/amazon/ebook/lib/searchbar-assets.jar.
  • The labels below the buttons are stored in /opt/amazon/ebook/lib/searchbar-kaf-(your locale).jar.
  • The functionality (what to start when pressed) is stored in /opt/amazon/ebook/lib/kaf.jar which is (as far as I can tell) responsible for pretty much all the system UI.

The kaf.jar and kaf-(your locale).jar files have .class files inside them. I only needed to change strings in them, that was possible without recompilation.

With .class files, each string's length must match the number in the byte before it. If you enter a string, and its length doesn't match up with the preceding byte, the .class file will probably break the original kaf.jar file.
This could easily result in your system unable to display the UI on boot.


That's why I went and created custom .class files with correct strings for both buttons and all languages. I shouldn't have done this because as I found out later, these files are not only different in each firmware version, they are also different in every device on the same version.

To release a script that works everywhere, I'd either need to make .class files for every firmware/device combination or make my script inject bytes straight into the .class files.
The former would take an impossibly long time, the latter would be too dangerous considering how much these .class files vary. The strings can be at completely different places based on locale, firmware, device and I don't want to risk possibly bricking other people's Kindles by messing one up by 1 byte.

So basically I've made a script that works perfectly on a KOA3 5.12.4 and nothing else.

If there is demand, I can see myself writing a tutorial to do this manually, but doing it won't be easy.

Last edited by tryol; 04-01-2021 at 10:02 AM.
tryol is offline   Reply With Quote