Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71e79a23 authored by Elliott Hughes's avatar Elliott Hughes Committed by Gerrit Code Review
Browse files

Merge "Track libziparchive API change."

parents 30fc8829 7a6cc0c0
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -100,16 +100,8 @@ jlong StrictJarFile_nativeStartIteration(JNIEnv* env, jobject, jlong nativeHandl
  }

  IterationHandle* handle = new IterationHandle();
  int32_t error = 0;
  if (prefixChars.size() == 0) {
    error = StartIteration(reinterpret_cast<ZipArchiveHandle>(nativeHandle),
                           handle->CookieAddress(), NULL, NULL);
  } else {
    ZipString entry_name(prefixChars.c_str());
    error = StartIteration(reinterpret_cast<ZipArchiveHandle>(nativeHandle),
                           handle->CookieAddress(), &entry_name, NULL);
  }

  int32_t error = StartIteration(reinterpret_cast<ZipArchiveHandle>(nativeHandle),
                                 handle->CookieAddress(), prefixChars.c_str(), "");
  if (error) {
    throwIoException(env, error);
    return static_cast<jlong>(-1);
+1 −2
Original line number Diff line number Diff line
@@ -206,9 +206,8 @@ bool ApkAssets::ForEachFile(const std::string& root_path,
    root_path_full += '/';
  }

  ::ZipString prefix(root_path_full.c_str());
  void* cookie;
  if (::StartIteration(zip_handle_.get(), &cookie, &prefix, nullptr) != 0) {
  if (::StartIteration(zip_handle_.get(), &cookie, root_path_full, "") != 0) {
    return false;
  }

+1 −4
Original line number Diff line number Diff line
@@ -149,11 +149,8 @@ bool ZipFileRO::startIteration(void** cookie) {
bool ZipFileRO::startIteration(void** cookie, const char* prefix, const char* suffix)
{
    _ZipEntryRO* ze = new _ZipEntryRO;
    ZipString pe(prefix ? prefix : "");
    ZipString se(suffix ? suffix : "");
    int32_t error = StartIteration(mHandle, &(ze->cookie),
                                   prefix ? &pe : NULL,
                                   suffix ? &se : NULL);
                                   prefix ? prefix : "", suffix ? suffix : "");
    if (error) {
        ALOGW("Could not start iteration over %s: %s", mFileName != NULL ? mFileName : "<null>",
                ErrorCodeString(error));