DexFileLoader: Preserve some old overloads for app-compat (part 2)
Also add ArtDexFileLoader::Open
Change-Id: I2f7eb6abeaa2d23c6b7a90a73b5b34822de6714d
diff --git a/libdexfile/dex/art_dex_file_loader.cc b/libdexfile/dex/art_dex_file_loader.cc
index 3a15e90..bfad8c8 100644
--- a/libdexfile/dex/art_dex_file_loader.cc
+++ b/libdexfile/dex/art_dex_file_loader.cc
@@ -118,4 +118,28 @@
return false;
}
+std::unique_ptr<const DexFile> ArtDexFileLoader::Open(
+ const uint8_t* base,
+ size_t size,
+ const std::string& location,
+ uint32_t location_checksum,
+ const OatDexFile* oat_dex_file,
+ bool verify,
+ bool verify_checksum,
+ std::string* error_msg,
+ std::unique_ptr<DexFileContainer> container) const {
+ return OpenCommon(base,
+ size,
+ /*data_base=*/nullptr,
+ /*data_size=*/0,
+ location,
+ location_checksum,
+ oat_dex_file,
+ verify,
+ verify_checksum,
+ error_msg,
+ std::move(container),
+ /*verify_result=*/nullptr);
+}
+
} // namespace art
diff --git a/libdexfile/dex/art_dex_file_loader.h b/libdexfile/dex/art_dex_file_loader.h
index 9806c46..7d849fa 100644
--- a/libdexfile/dex/art_dex_file_loader.h
+++ b/libdexfile/dex/art_dex_file_loader.h
@@ -58,6 +58,20 @@
std::string* error_msg,
int zip_fd = -1,
bool* only_contains_uncompressed_dex = nullptr);
+
+ // Don't shadow overloads from base class.
+ using DexFileLoader::Open;
+
+ // Old signature preserved for app-compat.
+ std::unique_ptr<const DexFile> Open(const uint8_t* base,
+ size_t size,
+ const std::string& location,
+ uint32_t location_checksum,
+ const OatDexFile* oat_dex_file,
+ bool verify,
+ bool verify_checksum,
+ std::string* error_msg,
+ std::unique_ptr<DexFileContainer> container) const;
};
} // namespace art