Changing margins and mobi font sizes for dummies
Works with jailbroken Voyage/KPW3/KPW2/KPW1 5.4.x-5.6.x and others (probably). Tested on Voyage 5.6.5, see also
https://www.mobileread.com/forums/sho....php?p=2527653
Not а fish, but а fishing rod.
1. USBNetwork@Windows. You need it to read/write Kindle system jar files.
Spoiler:
See here
https://wiki.mobileread.com/wiki/Kind...USB_Networking
To write files, open PuTTy and write
Quote:
if you need to change anything that is not in /mnt/us, then you will need to first mount the filesystem as RW (readwrite):
mntroot rw
Once you're done, you should put the filesystem back to RO (readonly):
mntroot ro
|
To navigate Kindle filesystem, use WinSCP app.
2. Changing margins
Spoiler:
- Copy file "/opt/amazon/ebook/lib/ReaderSDK-impl-en_GB.jar" from Kindle to you PC using usbnetwork. (For en_GB language or another file for another language)
- Make a backup copy of the original jar file. (And it's a good idea to copy it to Kindle in the same folder, "ReaderSDK-impl-en_GB.jar.bak")
- To edit jar file, unarchive it (I use WinRar) in "ReaderSDK-impl-en_GB" folder.
- To edit jar file, download Java Bytecode Editor here https://www.mobileread.com/forums/sho...d.php?t=236780 , unarchive it, run jbe.bat. Open file "ReaderSDK-impl-en_GB\com\amazon\ebook\booklet\reader\resources\Re aderResources_en_GB.class". In left panel go to "Methods"-"<init>"-"[0] Code". In right panel go to "Code Editor"
- Ctrl+F not working in code editor, so Ctrl+A -> Ctrl+C and paste text to notepad. Once you done edit text, delete text in code editor, paste new text and press "Save method".
- What to edit.
See here for PW1/2 (213 dpi) https://www.mobileread.com/forums/sho....php?p=2699121 For Voyage/PW3 multiply it for 0.4245 see here https://www.mobileread.com/forums/sho...66#post3060466
My examples for 5.6.5 Voyage:
Spoiler:
- Original
Code:
ldc_w "font.wordsperline.margin.list"
aastore
dup
iconst_3
newarray int
iconst_1
dup
pop2
dup
iconst_0
ldc_w 50.94
invokestatic com/amazon/ebook/booklet/reader/resources/ReaderResources_en_GB/pixVal(F)I
iastore
dup
iconst_1
dup_x2
ldc_w 33.96
invokestatic com/amazon/ebook/booklet/reader/resources/ReaderResources_en_GB/pixVal(F)I
iastore
dup
iconst_2
ldc_w 16.98
Edited
Code:
ldc_w "font.wordsperline.margin.list"
aastore
dup
iconst_3
newarray int
iconst_1
dup
pop2
dup
iconst_0
ldc_w 12.74
invokestatic com/amazon/ebook/booklet/reader/resources/ReaderResources_en_GB/pixVal(F)I
iastore
dup
iconst_1
dup_x2
ldc_w 8.49
invokestatic com/amazon/ebook/booklet/reader/resources/ReaderResources_en_GB/pixVal(F)I
iastore
dup
iconst_2
ldc_w 6.38
- Original
Code:
ldc_w "reader.progressbar.margin"
aastore
dup
iconst_1
new java/lang/Integer
dup
ldc_w 13.58
Edited
Code:
ldc_w "reader.progressbar.margin"
aastore
dup
iconst_1
new java/lang/Integer
dup
ldc_w 8.49
- Original
Code:
ldc_w "reader.progressbar.height"
aastore
dup
iconst_1
new java/lang/Integer
dup
ldc_w 8.49
Edited
Code:
ldc_w "reader.progressbar.height"
aastore
dup
iconst_1
new java/lang/Integer
dup
ldc_w 8.49
- Original
Code:
ldc_w "reader.progressbar.footer.height"
aastore
dup
iconst_1
new java/lang/Integer
dup
ldc_w 13.58
Edited
Code:
ldc_w "reader.progressbar.footer.height"
aastore
dup
iconst_1
new java/lang/Integer
dup
ldc_w 8.49
- Original
Code:
ldc_w "reader.content.topMargin"
aastore
dup
iconst_1
new java/lang/Integer
dup
ldc_w 13.58
Edited
Code:
ldc_w "reader.content.topMargin"
aastore
dup
iconst_1
new java/lang/Integer
dup
ldc_w 5.36
- Original
Code:
ldc_w "reader.content.bottomMargin"
aastore
dup
iconst_1
new java/lang/Integer
dup
ldc_w 13.58
Edited
Code:
ldc_w "reader.content.bottomMargin"
aastore
dup
iconst_1
new java/lang/Integer
dup
ldc_w 8.49
Note:"reader.progressbar.footer.height" and "reader.content.bottomMargin" should be the same.
- You should pack back jar file from unpacked folder "ReaderSDK-impl-en_GB". For update jar file using WinRar: open "ReaderSDK-impl-en_GB.jar" file in WinRar, navigate to "ReaderSDK-impl-en_GB.jar\com\amazon\ebook\booklet\reader\resource s" and drag-and-drop your new file "ReaderResources_en_GB.class"
- Copy "ReaderSDK-impl-en_GB.jar" back to your Kindle.
- Unplug and restart your Kindle.
- The values for left & right margin are cached and after first reboot after changing the jar files you have to open Aa menu and press on one of the other two margin icons and then press on the first one. Then the value (and thus the margin size itself) gets updated.
3. Changing mobi font sizes.