Add support for opening classes.dex file from zip, jar, apk
Adding new ZipArchive class and test
src/zip_archive.h
src/zip_archive.cc
src/zip_archive_test.cc
build/Android.common.mk
Change from host only use of build dex file for libcore to using host
and target core.jar containing classes.dex files. This requires
setting up an ANDROID_DATA directory to containing an art-cache file
for the extracted dex files, similar to the dalvik-cache for odex
files. A unique ANDROID_DATA and art-cache is created and cleaned up
for each test run (similar to vogar).
src/common_test.h
Add dependency for libcore jar files to test targets to support
RuntimeTest use of core.jar
Android.mk
Extract common includes to ART_C_INCLUDES when adding zlib dependency
build/Android.common.mk
build/Android.libart.mk
build/Android.test.mk
Adding TODO regarding unordered map for ClassLinker::classes_ table.
src/class_linker.h
Adding DexFile::OpenZip (also changed OpenFile to take
src/dex_file.cc
src/dex_file.h
Adding kPageSize of 4096, validated by Runtime::Init
src/globals.h
src/runtime.cc
Updated to use kPageSize where it seemed appropriate.
src/jni_compiler.cc
src/jni_compiler_test.cc
src/space.cc
src/thread.cc
src/thread_x86.cc
Changed thread_list_ and class_linker_ to be declared in Runtime::Init
initialization order.
src/runtime.h
Change-Id: Id626abe5b6c1990e4f93598256ee0fae000818f6
diff --git a/src/dex_file.h b/src/dex_file.h
index c8f8afa..e8f415d 100644
--- a/src/dex_file.h
+++ b/src/dex_file.h
@@ -204,7 +204,10 @@
};
// Opens a .dex file from the file system.
- static DexFile* OpenFile(const char* filename);
+ static DexFile* OpenFile(const std::string& filename);
+
+ // Opens a .jar, .zip, or .apk file from the file system.
+ static DexFile* OpenZip(const std::string& filename);
// Opens a .dex file from a new allocated pointer
static DexFile* OpenPtr(byte* ptr, size_t length);