1:序言
深入理解插件化-Dalvik虛擬機(jī)對(duì)Dex的加載過(guò)程(一)
Java層的dex加載可以先看下這個(gè)摩渺,這篇文章主要說(shuō)Native層的加載
2:DexFile
路徑:\libcore\dalvik\src\main\java\dalvik\system/DexFile
public DexFile(String fileName) throws IOException {
mCookie = openDexFile(fileName, null, 0);
mFileName = fileName;
guard.open("close");
//System.out.println("DEX FILE cookie is " + mCookie);
}
3:openDexFile
/*
* Open a DEX file. The value returned is a magic VM cookie. On
* failure, an IOException is thrown.
*/
private static int openDexFile(String sourceName, String outputName,
int flags) throws IOException {
return openDexFileNative(new File(sourceName).getCanonicalPath(),
(outputName == null) ? null : new File(outputName).getCanonicalPath(),
flags);
}
openDexFileNative
路徑:\dalvik\vm\native\dalvik_system_DexFile.cpp