How to add a 3rd party jar path in BOOTCLASSPATH?

1,972 views
Skip to first unread message

Eric Zhu

unread,
Aug 20, 2013, 3:11:15 AM8/20/13
to android-...@googlegroups.com
Hi everyone. I've got a Samsung SGS2 flashed with my own rooted kernel. In the init.rc, I changed the BOOTCLASSPATH to:
BOOTCLASSPATH=/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/sec_edm.jar:/system/framework/seccamera.jar:/system/framework/framework-test.jar

framework-test.jar is 3rd-party jar which I'd like to include it in BOOTCLASSPATH. I pushed framework-test.jar to /system/framework/framework-test.jar, and run dextopt-wrapper to generate an .odex file:

dexopt-wrapper /system/framework/framework-test.jar /data/framework-test.odex  "$BOOTCLASSPATH"

The above command ran successfully, but when I rebooted my phone, it failed to boot and reported following errors from logcat repeatedly:

 I/dalvikvm(14681): DexOpt: not all deps represented

E/dalvikvm(14681): /system/framework/org.simalliance.openmobileapi.jar odex has stale dependencies

E/dalvikvm(14681): odex source not available -- failing

W/dalvikvm(14681): threadid=12: thread exiting with uncaught exception (group=0x4122d2a0)

E/android.os.Debug(14681): !@Dumpstate > dumpstate -k -t -z -d -o /data/log/dumpstate_sys_error

E/AndroidRuntime(14681): *** FATAL EXCEPTION IN SYSTEM PROCESS: android.server.ServerThread

E/AndroidRuntime(14681): dalvik.system.StaleDexCacheError: /system/framework/org.simalliance.openmobileapi.jar

E/AndroidRuntime(14681): at dalvik.system.DexFile.isDexOptNeeded(Native Method)

E/AndroidRuntime(14681): at com.android.server.pm.PackageManagerService.<init>(PackageManagerService.java:1383)

E/AndroidRuntime(14681): at com.android.server.pm.PackageManagerService.main(PackageManagerService.java:1203)

E/AndroidRuntime(14681): at com.android.server.ServerThread.run(SystemServer.java:429)

My question is: is it possible to add a new jar path into BOOTCLASSPATH? Thank you very much.

Boyan Vladinov

unread,
Aug 20, 2013, 8:55:35 PM8/20/13
to android-...@googlegroups.com
When preopt is enabled, then this two file lines has to be kept in sync:

BOOTCLASSPATH in system/core/rootdir/init.rc
DEXPREOPT_BOOT_JARS in build/core/dex_preopt.mk
Reply all
Reply to author
Forward
0 new messages