View Single Post
Old 12-25-2009, 05:27 PM   #1
ericshliao
Guru
ericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enough
 
Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
Hacking the Mobipocket Reader

I don't like the font resizer of Mobipocket Reader on iLiad because I want more sophiscated size change. Sometimes, I just want the font size increase (or decrease) a little bit larger (or smaller).

Afer peeking into "mobipocket.jar", I found the place to modify:
In "cl.class" (it's java bytecode, a java-decompiler is required to turn it back to source code), the available font size is set to "5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32". To me, 5 and 6 are too small, and 28 and 32 are too large, so I want to set it to "7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 24".

It's been two years since I wrote my last java program for iLiad. All development environment is cleared, so I have to rebuild it. Hope I still remember how to re-setup it again.

Because mobipocket reader is not open source code, posting any of its source code may get me into trouble. If anybody is interested in the mod, maybe I can provide the difference between original and modded .class files.

Added:
It does work. Here is some note on creating the mod:
1. Copy "mobipocket.jar" in dir "/home/intent" and unpack it in a Linux desktop. My Windows XP does not accept "a.class" and "A.class" in the same dir, so I have to unpack it in Linux. ".jar" is actually ".zip" format.
2. Use a java decompiler to decompile "cl.class" back to source code. It can be done in Linux or Windows XP.
3. In "cl.java", find some line with "5,6,7,....28,32" and modify it to fit your need.
4. Copy the modified source code, "cl.java" to the dir that "mobipocket.jar" is unpacked. Remove the original "cl.class" in that dir.
5. In that dir, execute "javac -source 1.3 -target 1.3 cl.java", and then a new "cl.class" will be generated. I am using jdk1.6 of Sun.
6. Repack all files in that dir back to "mobipocket.jar" and replace the original "mobipocket.jar".

Last edited by ericshliao; 12-26-2009 at 08:46 AM.
ericshliao is offline   Reply With Quote