summaryrefslogtreecommitdiff
path: root/libdexfile/dex/dex_file_loader.h
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2023-02-23 18:27:04 +0000
committer David Srbecky <dsrbecky@google.com> 2023-02-23 22:44:13 +0000
commitf8580e524596ee40b19a53fce6b17c3cd2132cfc (patch)
treed75d9dd91a74a592b772aaea904d45aec372dd57 /libdexfile/dex/dex_file_loader.h
parentc2042a191fbaea8f2c51aa76a85f73c4d937a695 (diff)
Refactor zip loading in DexFileLoader
Remove OpenAllDexFilesFromZip and VerifyResult. Both of those can be simplified and inlined. Bug: 266950186 Test: test.py -b --host --optimizing --64 Change-Id: Ia05edf81a70ab24654f92086599c4a3369fc2591
Diffstat (limited to 'libdexfile/dex/dex_file_loader.h')
-rw-r--r--libdexfile/dex/dex_file_loader.h38
1 files changed, 11 insertions, 27 deletions
diff --git a/libdexfile/dex/dex_file_loader.h b/libdexfile/dex/dex_file_loader.h
index a2a29bc44e..0b949508cc 100644
--- a/libdexfile/dex/dex_file_loader.h
+++ b/libdexfile/dex/dex_file_loader.h
@@ -192,12 +192,6 @@ class DexFileLoader {
}
protected:
- enum class VerifyResult { // private
- kVerifyNotAttempted,
- kVerifySucceeded,
- kVerifyFailed
- };
-
bool InitAndReadMagic(uint32_t* magic, std::string* error_msg);
// Ensure we have root container. If we are backed by a file, memory-map it.
@@ -211,27 +205,17 @@ class DexFileLoader {
bool verify,
bool verify_checksum,
std::string* error_msg,
- VerifyResult* verify_result);
-
- // Open all classesXXX.dex files from a zip archive.
- bool OpenAllDexFilesFromZip(const ZipArchive& zip_archive,
- const std::string& location,
- bool verify,
- bool verify_checksum,
- bool allow_no_dex_files,
- DexFileLoaderErrorCode* error_code,
- std::string* error_msg,
- std::vector<std::unique_ptr<const DexFile>>* dex_files) const;
-
- // Opens .dex file from the entry_name in a zip archive. error_code is undefined when non-null
- // return.
- std::unique_ptr<const DexFile> OpenOneDexFileFromZip(const ZipArchive& zip_archive,
- const char* entry_name,
- const std::string& location,
- bool verify,
- bool verify_checksum,
- DexFileLoaderErrorCode* error_code,
- std::string* error_msg) const;
+ DexFileLoaderErrorCode* error_code);
+
+ // Open .dex files from the entry_name in a zip archive.
+ bool OpenFromZipEntry(const ZipArchive& zip_archive,
+ const char* entry_name,
+ const std::string& location,
+ bool verify,
+ bool verify_checksum,
+ DexFileLoaderErrorCode* error_code,
+ std::string* error_msg,
+ std::vector<std::unique_ptr<const DexFile>>* dex_files) const;
// The DexFileLoader can be backed either by file or by memory (i.e. DexFileContainer).
// We can not just mmap the file since APKs might be unreasonably large for 32-bit system.