Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 03-31-2014, 04:17 AM   #1
dsmid
Linux devotee
dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.dsmid ought to be getting tired of karma fortunes by now.
 
dsmid's Avatar
 
Posts: 598
Karma: 2069047
Join Date: Feb 2011
Device: Kindle 3, Kindle 4B, Kindle PW2
Java Bytecode Editor + Method Tools

Ando Saabas' JBE is very popular here because it allows user to modify features like margins width, tweak font size selection list, enable few hidden menu items (PDF reflow, Wi-Fi on/off,...), etc.

I have added two new classes to JBE: ExportMethod and ImportMethod.
The purpose of these tools is to avoid unnecessary clicking when performing bytecode changes.
Besides that I've also fixed two JBE bugs that prevented JBE from being able to eat its own dog food.

Usage:
java eu.smidovi.david.methodtools.ExportMethod <class file> [<method>] [<method signature>]
If <method> is not specified, <init> (the constructor) is used.
If <method signature> is not specified, the first method with the name <method> is used.
Method bytecode is printed on the standard output, e.g.:
Code:
java eu.smidovi.david.methodtools.ExportMethod ReaderResources_en_GB.class > ReaderResources_en_GB.bytecode
This will dump the class constructor to the given file.

Usage of ImportMethod is very similar:
java eu.smidovi.david.methodtools.ImportMethod <class file> [<method>] [<method signature>]
This reads bytecode from the standard input and replaces given method's code in the class file with the bytecode.
E.g.:
Code:
java eu.smidovi.david.methodtools.ImportMethod ReaderResources_en_GB.class < ReaderResources_en_GB.bytecode
On Linux, you can use included helper scripts em and im (I recommend creating symlinks in your path):
Code:
em ReaderResources_en_GB.class > ReaderResources_en_GB.bytecode
Bugs fixed:
  • JBE was not able to parse byte constants greater than 127, but happily produced them on output.
  • JBE was not able to parse multiline string constants it produced. I've fixed that by C-style escaping of special characters, <LF> included.
Attached Files
File Type: zip jbe_mt.zip (2.12 MB, 827 views)
dsmid is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Mobi Metadata Editor gluggy Amazon Kindle 90 10-29-2016 02:51 AM
Java Mobi Metadata Editor thomass Kindle Formats 0 03-25-2012 01:48 PM
IQ Best rooting method? ebookof PocketBook 0 12-19-2011 07:48 PM
Sharing EE Method keng2000 enTourage Archive 1 01-03-2011 11:58 PM
[Apple]Java Embedding Plugin 0.9.2: Force java to run in browsers other than Safari Zire Lounge 4 05-24-2005 09:12 PM


All times are GMT -4. The time now is 04:05 AM.


MobileRead.com is a privately owned, operated and funded community.