X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/4a93e01489808190cfeccd619ec3c6b288496497..d6ecd33ad35cff96758b2d5adf553ebbb791d95a:/ZipEntry.cpp diff --git a/ZipEntry.cpp b/ZipEntry.cpp index a0b54c2..b575988 100644 --- a/ZipEntry.cpp +++ b/ZipEntry.cpp @@ -42,12 +42,12 @@ status_t ZipEntry::initFromCDE(FILE* fp) long posn; bool hasDD; - //LOGV("initFromCDE ---\n"); + //ALOGV("initFromCDE ---\n"); /* read the CDE */ result = mCDE.read(fp); if (result != NO_ERROR) { - LOGD("mCDE.read failed\n"); + ALOGD("mCDE.read failed\n"); return result; } @@ -56,14 +56,14 @@ status_t ZipEntry::initFromCDE(FILE* fp) /* using the info in the CDE, go load up the LFH */ posn = ftell(fp); if (fseek(fp, mCDE.mLocalHeaderRelOffset, SEEK_SET) != 0) { - LOGD("local header seek failed (%ld)\n", + ALOGD("local header seek failed (%ld)\n", mCDE.mLocalHeaderRelOffset); return UNKNOWN_ERROR; } result = mLFH.read(fp); if (result != NO_ERROR) { - LOGD("mLFH.read failed\n"); + ALOGD("mLFH.read failed\n"); return result; } @@ -81,7 +81,7 @@ status_t ZipEntry::initFromCDE(FILE* fp) hasDD = (mLFH.mGPBitFlag & kUsesDataDescr) != 0; if (hasDD) { // do something clever - //LOGD("+++ has data descriptor\n"); + //ALOGD("+++ has data descriptor\n"); } /* @@ -90,7 +90,7 @@ status_t ZipEntry::initFromCDE(FILE* fp) * prefer the CDE values.) */ if (!hasDD && !compareHeaders()) { - LOGW("warning: header mismatch\n"); + ALOGW("warning: header mismatch\n"); // keep going? } @@ -200,7 +200,7 @@ status_t ZipEntry::addPadding(int padding) if (padding <= 0) return INVALID_OPERATION; - //LOGI("HEY: adding %d pad bytes to existing %d in %s\n", + //ALOGI("HEY: adding %d pad bytes to existing %d in %s\n", // padding, mLFH.mExtraFieldLength, mCDE.mFileName); if (mLFH.mExtraFieldLength > 0) { @@ -280,50 +280,50 @@ void ZipEntry::setDataInfo(long uncompLen, long compLen, unsigned long crc32, bool ZipEntry::compareHeaders(void) const { if (mCDE.mVersionToExtract != mLFH.mVersionToExtract) { - LOGV("cmp: VersionToExtract\n"); + ALOGV("cmp: VersionToExtract\n"); return false; } if (mCDE.mGPBitFlag != mLFH.mGPBitFlag) { - LOGV("cmp: GPBitFlag\n"); + ALOGV("cmp: GPBitFlag\n"); return false; } if (mCDE.mCompressionMethod != mLFH.mCompressionMethod) { - LOGV("cmp: CompressionMethod\n"); + ALOGV("cmp: CompressionMethod\n"); return false; } if (mCDE.mLastModFileTime != mLFH.mLastModFileTime) { - LOGV("cmp: LastModFileTime\n"); + ALOGV("cmp: LastModFileTime\n"); return false; } if (mCDE.mLastModFileDate != mLFH.mLastModFileDate) { - LOGV("cmp: LastModFileDate\n"); + ALOGV("cmp: LastModFileDate\n"); return false; } if (mCDE.mCRC32 != mLFH.mCRC32) { - LOGV("cmp: CRC32\n"); + ALOGV("cmp: CRC32\n"); return false; } if (mCDE.mCompressedSize != mLFH.mCompressedSize) { - LOGV("cmp: CompressedSize\n"); + ALOGV("cmp: CompressedSize\n"); return false; } if (mCDE.mUncompressedSize != mLFH.mUncompressedSize) { - LOGV("cmp: UncompressedSize\n"); + ALOGV("cmp: UncompressedSize\n"); return false; } if (mCDE.mFileNameLength != mLFH.mFileNameLength) { - LOGV("cmp: FileNameLength\n"); + ALOGV("cmp: FileNameLength\n"); return false; } #if 0 // this seems to be used for padding, not real data if (mCDE.mExtraFieldLength != mLFH.mExtraFieldLength) { - LOGV("cmp: ExtraFieldLength\n"); + ALOGV("cmp: ExtraFieldLength\n"); return false; } #endif if (mCDE.mFileName != NULL) { if (strcmp((char*) mCDE.mFileName, (char*) mLFH.mFileName) != 0) { - LOGV("cmp: FileName\n"); + ALOGV("cmp: FileName\n"); return false; } } @@ -413,7 +413,7 @@ status_t ZipEntry::LocalFileHeader::read(FILE* fp) } if (ZipEntry::getLongLE(&buf[0x00]) != kSignature) { - LOGD("whoops: didn't find expected signature\n"); + ALOGD("whoops: didn't find expected signature\n"); result = UNKNOWN_ERROR; goto bail; } @@ -506,17 +506,17 @@ status_t ZipEntry::LocalFileHeader::write(FILE* fp) */ void ZipEntry::LocalFileHeader::dump(void) const { - LOGD(" LocalFileHeader contents:\n"); - LOGD(" versToExt=%u gpBits=0x%04x compression=%u\n", + ALOGD(" LocalFileHeader contents:\n"); + ALOGD(" versToExt=%u gpBits=0x%04x compression=%u\n", mVersionToExtract, mGPBitFlag, mCompressionMethod); - LOGD(" modTime=0x%04x modDate=0x%04x crc32=0x%08lx\n", + ALOGD(" modTime=0x%04x modDate=0x%04x crc32=0x%08lx\n", mLastModFileTime, mLastModFileDate, mCRC32); - LOGD(" compressedSize=%lu uncompressedSize=%lu\n", + ALOGD(" compressedSize=%lu uncompressedSize=%lu\n", mCompressedSize, mUncompressedSize); - LOGD(" filenameLen=%u extraLen=%u\n", + ALOGD(" filenameLen=%u extraLen=%u\n", mFileNameLength, mExtraFieldLength); if (mFileName != NULL) - LOGD(" filename: '%s'\n", mFileName); + ALOGD(" filename: '%s'\n", mFileName); } @@ -549,7 +549,7 @@ status_t ZipEntry::CentralDirEntry::read(FILE* fp) } if (ZipEntry::getLongLE(&buf[0x00]) != kSignature) { - LOGD("Whoops: didn't find expected signature\n"); + ALOGD("Whoops: didn't find expected signature\n"); result = UNKNOWN_ERROR; goto bail; } @@ -675,22 +675,22 @@ status_t ZipEntry::CentralDirEntry::write(FILE* fp) */ void ZipEntry::CentralDirEntry::dump(void) const { - LOGD(" CentralDirEntry contents:\n"); - LOGD(" versMadeBy=%u versToExt=%u gpBits=0x%04x compression=%u\n", + ALOGD(" CentralDirEntry contents:\n"); + ALOGD(" versMadeBy=%u versToExt=%u gpBits=0x%04x compression=%u\n", mVersionMadeBy, mVersionToExtract, mGPBitFlag, mCompressionMethod); - LOGD(" modTime=0x%04x modDate=0x%04x crc32=0x%08lx\n", + ALOGD(" modTime=0x%04x modDate=0x%04x crc32=0x%08lx\n", mLastModFileTime, mLastModFileDate, mCRC32); - LOGD(" compressedSize=%lu uncompressedSize=%lu\n", + ALOGD(" compressedSize=%lu uncompressedSize=%lu\n", mCompressedSize, mUncompressedSize); - LOGD(" filenameLen=%u extraLen=%u commentLen=%u\n", + ALOGD(" filenameLen=%u extraLen=%u commentLen=%u\n", mFileNameLength, mExtraFieldLength, mFileCommentLength); - LOGD(" diskNumStart=%u intAttr=0x%04x extAttr=0x%08lx relOffset=%lu\n", + ALOGD(" diskNumStart=%u intAttr=0x%04x extAttr=0x%08lx relOffset=%lu\n", mDiskNumberStart, mInternalAttrs, mExternalAttrs, mLocalHeaderRelOffset); if (mFileName != NULL) - LOGD(" filename: '%s'\n", mFileName); + ALOGD(" filename: '%s'\n", mFileName); if (mFileComment != NULL) - LOGD(" comment: '%s'\n", mFileComment); + ALOGD(" comment: '%s'\n", mFileComment); }