X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/e8b1d1095bd7c2b3d0fb6c0ffa3e27f8ad54a74b..b1bccba13c57eb08858404e92ccd39041110da25:/AaptAssets.cpp diff --git a/AaptAssets.cpp b/AaptAssets.cpp index 4d2d046..2b2ec7b 100644 --- a/AaptAssets.cpp +++ b/AaptAssets.cpp @@ -685,13 +685,11 @@ bool AaptGroupEntry::getMncName(const char* name, if (*c != 0) return false; if (c-val == 0 || c-val > 3) return false; - int d = atoi(val); - if (d != 0) { - if (out) out->mnc = d; - return true; + if (out) { + out->mnc = atoi(val); } - return false; + return true; } /* @@ -893,6 +891,11 @@ bool AaptGroupEntry::getDensityName(const char* name, return true; } + if (strcmp(name, "xhdpi") == 0) { + if (out) out->density = ResTable_config::DENSITY_MEDIUM*2; + return true; + } + char* c = (char*)name; while (*c >= '0' && *c <= '9') { c++; @@ -1825,6 +1828,16 @@ ssize_t AaptAssets::slurpResourceTree(Bundle* bundle, const String8& srcDir) continue; } + if (bundle->getMaxResVersion() != NULL && group.version.length() != 0) { + int maxResInt = atoi(bundle->getMaxResVersion()); + const char *verString = group.version.string(); + int dirVersionInt = atoi(verString + 1); // skip 'v' in version name + if (dirVersionInt > maxResInt) { + fprintf(stderr, "max res %d, skipping %s\n", maxResInt, entry->d_name); + continue; + } + } + FileType type = getFileType(subdirName.string()); if (type == kFileTypeDirectory) {