Quote:
Originally Posted by ixtab
The easiest solution may be to simply overwrite the main class (com.lab126.linux.arm.LuigiServiceProvider) in start.sh with, say, com.mobileread.ixtab.jbpatch.bootstrap.K3Startup (or so). This class would do all the required wiring, and then call the LuigiServiceProvider main() method.
Should be about 10 lines of code...
|
Here's some code:
Code:
package com.mobileread.ixtab.jbpatch.bootstrap;
import java.lang.reflect.Method;
public class K3Startup {
public static void main(String[] args) {
try {
// set up JBPatch classloader
PatchingClassLoader.inject();
new Stage2().run();
// invoke "real" startup class
Class startup = Class.forName("com.lab126.linux.arm.LuigiServiceProvider");
Method main = startup.getMethod("main", new Class[] {String[].class});
main.invoke(null, new Object[] {args});
} catch (Throwable t) {
t.printStackTrace();
}
}
}
Give this a try, it might even work
Of course, this requires the framework startup script to be changed to use com.mobileread.ixtab.jbpatch.bootstrap.K3Startup as the main class, and the jbpatch jar to be in the classpath (I suggest /opt/amazon/ebook/lib/jbpatch.jar)
If the framework starts up normally, you can then check /tmp/jbpatch.log to see if JBPatch is working correctly.