Android init. rc BOOTCLASSPATH

Source: Internet
Author: User

No jar package path is added to the BOOTCLASSPATH. After the system is started, the related classes of the custom JAVA-layer system services cannot be found. This is because the custom system service jar package is the basic library file required by Dalvik. If no related path is added, the following error is returned:

W/dalvikvm (2582): Unable to resolve superclass of Lcom/android/server/yourdir/yourService; (1633)
W/dalvikvm (2582): Link of class 'lcom/android/server/yourdir/yourService; 'failed'
D/dalvikvm (2582): DexOpt: unable to opt direct call 0x276b at 0x258 in Lcom/android/server/ServerThread;. run

Three mandatory principles:

Android
Class implementation-System Basics

Preparation of Dalvik Analysis

Dalvik analysis-Class loading


Init. rc:
Export BOOTCLASSPATH/system/framework/core. jar:/system/framework/bouncycastle. jar:/system/framework/ext. jar:/system/framework. jar:/system/framework/android. policy. jar:/system/framework/services. jar:/system/framework/core-junit.jar
BOOTCLASSPATH =/ango/system/framework/core. jar:/ango/system/framework/bouncycastle. jar:/ango/system/framework/ext. jar:/ango/system/framework. jar:/ango/system/framework/android. policy. jar:/ango/system/framework/services. jar:/ango/system/framework/core-junit.jar

D:/linux/linuxkernel/WORKING_DIRECTORY/android-omap-20111108-gingerbread/dalvik/vm/Init. c
// Getenv of classpath and BOOTCLASSPATH configed by init. rc
Static void setCommandLineDefaults ()
Putenv ("BOOTCLASSPATH =/ango/system/framework/core. jar:/ango/system/framework/bouncycastle. jar:/ango/system/framework/ext. jar:/ango/system/framework. jar:/ango/system/framework/android. policy. jar:/ango/system/framework/services. jar:/ango/system/framework/core-junit.jar ");
EnvStr = getenv ("BOOTCLASSPATH ");
If (envStr! = NULL)
GDvm. bootClassPathStr = strdup (envStr );
Else
GDvm. bootClassPathStr = strdup (".");


D:/linux/linuxkernel/WORKING_DIRECTORY/android-omap-20111108-gingerbread/dalvik/vm/oo/Class. c
/*
* Prepare a ClassPathEntry struct, which at this point only has a valid
* Filename. We need to figure out what kind of file it is, and
* Everything other than directories we need to open it up and see
* What's inside.
*/
Static bool prepareCpe (ClassPathEntry * cpe, bool isBootstrap)
/*
* Convert a colon-separated list of directories, Zip files, and DEX files
* Into an array of ClassPathEntry structs.
*
* During normal startup we fail if there are no entries, because we won't
* Get very far without the basic language support classes, but if we're
* Optimizing a DEX file we allow it.
*
* If entries are added or removed from the bootstrap class path,
* Dependencies in the DEX files will break, and everything doesn't
* Very first entry will need to be regenerated.
*/
Static ClassPathEntry * processClassPath (const char * pathStr, bool isBootstrap)
/*
* Initialize the bootstrap class loader.
*
* Call this after the bootclasspath string has been finalized.
*/
Bool dvmClassStartup (void)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.