diff options
author | Elliott Hughes <enh@google.com> | 2019-05-06 23:45:16 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-05-06 23:45:16 +0000 |
commit | 32581e1dd217eda6ab0977e7420dc11a1796fe9d (patch) | |
tree | 1c133212a25a839b4da17900a1d0cbd4a6e8626a | |
parent | bdb61f3cf2317c85975fd630193a7d93fec7df1a (diff) | |
parent | b97e737c181d9dec996df6d6d7777b66a1aea946 (diff) | |
download | base-32581e1dd217eda6ab0977e7420dc11a1796fe9d.tar.gz |
Merge "Track libziparchive API change."
-rw-r--r-- | core/jni/android_util_jar_StrictJarFile.cpp | 2 | ||||
-rw-r--r-- | libs/androidfw/ApkAssets.cpp | 6 | ||||
-rw-r--r-- | libs/androidfw/ZipFileRO.cpp | 2 | ||||
-rw-r--r-- | libs/androidfw/tests/TestHelpers.cpp | 3 |
4 files changed, 5 insertions, 8 deletions
diff --git a/core/jni/android_util_jar_StrictJarFile.cpp b/core/jni/android_util_jar_StrictJarFile.cpp index 182a621c6978..a26707eedb28 100644 --- a/core/jni/android_util_jar_StrictJarFile.cpp +++ b/core/jni/android_util_jar_StrictJarFile.cpp @@ -146,7 +146,7 @@ jobject StrictJarFile_nativeFindEntry(JNIEnv* env, jobject, jlong nativeHandle, ZipEntry data; const int32_t error = FindEntry(reinterpret_cast<ZipArchiveHandle>(nativeHandle), - ZipString(entryNameChars.c_str()), &data); + entryNameChars.c_str(), &data); if (error) { return NULL; } diff --git a/libs/androidfw/ApkAssets.cpp b/libs/androidfw/ApkAssets.cpp index 66a547723b2f..47b7d646d79f 100644 --- a/libs/androidfw/ApkAssets.cpp +++ b/libs/androidfw/ApkAssets.cpp @@ -120,9 +120,8 @@ std::unique_ptr<const ApkAssets> ApkAssets::LoadImpl( std::unique_ptr<ApkAssets> loaded_apk(new ApkAssets(unmanaged_handle, path)); // Find the resource table. - ::ZipString entry_name(kResourcesArsc.c_str()); ::ZipEntry entry; - result = ::FindEntry(loaded_apk->zip_handle_.get(), entry_name, &entry); + result = ::FindEntry(loaded_apk->zip_handle_.get(), kResourcesArsc, &entry); if (result != 0) { // There is no resources.arsc, so create an empty LoadedArsc and return. loaded_apk->loaded_arsc_ = LoadedArsc::CreateEmpty(); @@ -160,9 +159,8 @@ std::unique_ptr<const ApkAssets> ApkAssets::LoadImpl( std::unique_ptr<Asset> ApkAssets::Open(const std::string& path, Asset::AccessMode mode) const { CHECK(zip_handle_ != nullptr); - ::ZipString name(path.c_str()); ::ZipEntry entry; - int32_t result = ::FindEntry(zip_handle_.get(), name, &entry); + int32_t result = ::FindEntry(zip_handle_.get(), path, &entry); if (result != 0) { return {}; } diff --git a/libs/androidfw/ZipFileRO.cpp b/libs/androidfw/ZipFileRO.cpp index 6e2ca60cc3d3..44614c11fb14 100644 --- a/libs/androidfw/ZipFileRO.cpp +++ b/libs/androidfw/ZipFileRO.cpp @@ -98,7 +98,7 @@ ZipEntryRO ZipFileRO::findEntryByName(const char* entryName) const data->name = ZipString(entryName); - const int32_t error = FindEntry(mHandle, data->name, &(data->entry)); + const int32_t error = FindEntry(mHandle, entryName, &(data->entry)); if (error) { delete data; return NULL; diff --git a/libs/androidfw/tests/TestHelpers.cpp b/libs/androidfw/tests/TestHelpers.cpp index 9e320a21b534..a81bb6ffab06 100644 --- a/libs/androidfw/tests/TestHelpers.cpp +++ b/libs/androidfw/tests/TestHelpers.cpp @@ -34,9 +34,8 @@ AssertionResult ReadFileFromZipToString(const std::string& zip_path, const std:: << "': " << ::ErrorCodeString(result); } - ::ZipString name(file.c_str()); ::ZipEntry entry; - result = ::FindEntry(handle, name, &entry); + result = ::FindEntry(handle, file.c_str(), &entry); if (result != 0) { ::CloseArchive(handle); return AssertionFailure() << "Could not find file '" << file << "' in zip '" << zip_path |