diff options
author | 2017-10-10 11:54:29 -0700 | |
---|---|---|
committer | 2017-10-11 14:47:06 -0700 | |
commit | 79c87da9d4698ec58ece65af0065eebd55a1cfe0 (patch) | |
tree | 399797f37712da9d20829d5b5059b6c84943cb02 /runtime/vdex_file.cc | |
parent | 656e97f949df4081fba908113406b32915174502 (diff) |
Add DexFileLoader class
Added DexFileLoader class, moved functionality from DexFile there:
- Multidex loading logic
- DexFile opening logic for Zip and etc
- Some other helpers
Bug: 63756964
Test: test-art-host
Change-Id: Ic3dfa458947d4b69912dea5cdd836e7e8f55061c
Diffstat (limited to 'runtime/vdex_file.cc')
-rw-r--r-- | runtime/vdex_file.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/runtime/vdex_file.cc b/runtime/vdex_file.cc index b95522062e..55bc9ecac5 100644 --- a/runtime/vdex_file.cc +++ b/runtime/vdex_file.cc @@ -25,6 +25,7 @@ #include "base/stl_util.h" #include "base/unix_file/fd_file.h" #include "dex_file.h" +#include "dex_file_loader.h" #include "dex_to_dex_decompiler.h" namespace art { @@ -151,15 +152,15 @@ bool VdexFile::OpenAllDexFiles(std::vector<std::unique_ptr<const DexFile>>* dex_ size_t size = reinterpret_cast<const DexFile::Header*>(dex_file_start)->file_size_; // TODO: Supply the location information for a vdex file. static constexpr char kVdexLocation[] = ""; - std::string location = DexFile::GetMultiDexLocation(i, kVdexLocation); - std::unique_ptr<const DexFile> dex(DexFile::Open(dex_file_start, - size, - location, - GetLocationChecksum(i), - nullptr /*oat_dex_file*/, - false /*verify*/, - false /*verify_checksum*/, - error_msg)); + std::string location = DexFileLoader::GetMultiDexLocation(i, kVdexLocation); + std::unique_ptr<const DexFile> dex(DexFileLoader::Open(dex_file_start, + size, + location, + GetLocationChecksum(i), + nullptr /*oat_dex_file*/, + false /*verify*/, + false /*verify_checksum*/, + error_msg)); if (dex == nullptr) { return false; } |