Merge "Track libziparchive API change."
This commit is contained in:
@@ -146,7 +146,7 @@ jobject StrictJarFile_nativeFindEntry(JNIEnv* env, jobject, jlong nativeHandle,
|
|||||||
|
|
||||||
ZipEntry data;
|
ZipEntry data;
|
||||||
const int32_t error = FindEntry(reinterpret_cast<ZipArchiveHandle>(nativeHandle),
|
const int32_t error = FindEntry(reinterpret_cast<ZipArchiveHandle>(nativeHandle),
|
||||||
ZipString(entryNameChars.c_str()), &data);
|
entryNameChars.c_str(), &data);
|
||||||
if (error) {
|
if (error) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,9 +120,8 @@ std::unique_ptr<const ApkAssets> ApkAssets::LoadImpl(
|
|||||||
std::unique_ptr<ApkAssets> loaded_apk(new ApkAssets(unmanaged_handle, path));
|
std::unique_ptr<ApkAssets> loaded_apk(new ApkAssets(unmanaged_handle, path));
|
||||||
|
|
||||||
// Find the resource table.
|
// Find the resource table.
|
||||||
::ZipString entry_name(kResourcesArsc.c_str());
|
|
||||||
::ZipEntry entry;
|
::ZipEntry entry;
|
||||||
result = ::FindEntry(loaded_apk->zip_handle_.get(), entry_name, &entry);
|
result = ::FindEntry(loaded_apk->zip_handle_.get(), kResourcesArsc, &entry);
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
// There is no resources.arsc, so create an empty LoadedArsc and return.
|
// There is no resources.arsc, so create an empty LoadedArsc and return.
|
||||||
loaded_apk->loaded_arsc_ = LoadedArsc::CreateEmpty();
|
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 {
|
std::unique_ptr<Asset> ApkAssets::Open(const std::string& path, Asset::AccessMode mode) const {
|
||||||
CHECK(zip_handle_ != nullptr);
|
CHECK(zip_handle_ != nullptr);
|
||||||
|
|
||||||
::ZipString name(path.c_str());
|
|
||||||
::ZipEntry entry;
|
::ZipEntry entry;
|
||||||
int32_t result = ::FindEntry(zip_handle_.get(), name, &entry);
|
int32_t result = ::FindEntry(zip_handle_.get(), path, &entry);
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ ZipEntryRO ZipFileRO::findEntryByName(const char* entryName) const
|
|||||||
|
|
||||||
data->name = ZipString(entryName);
|
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) {
|
if (error) {
|
||||||
delete data;
|
delete data;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -34,9 +34,8 @@ AssertionResult ReadFileFromZipToString(const std::string& zip_path, const std::
|
|||||||
<< "': " << ::ErrorCodeString(result);
|
<< "': " << ::ErrorCodeString(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
::ZipString name(file.c_str());
|
|
||||||
::ZipEntry entry;
|
::ZipEntry entry;
|
||||||
result = ::FindEntry(handle, name, &entry);
|
result = ::FindEntry(handle, file.c_str(), &entry);
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
::CloseArchive(handle);
|
::CloseArchive(handle);
|
||||||
return AssertionFailure() << "Could not find file '" << file << "' in zip '" << zip_path
|
return AssertionFailure() << "Could not find file '" << file << "' in zip '" << zip_path
|
||||||
|
|||||||
Reference in New Issue
Block a user