X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/f1f3915b08588cb11eaca5b9d0b5bae293646fdc..141b9860bd1ef8a5294425a500e9d5203d12b1dd:/ResourceTable.cpp diff --git a/ResourceTable.cpp b/ResourceTable.cpp index 68c3892..f3ca23d 100644 --- a/ResourceTable.cpp +++ b/ResourceTable.cpp @@ -1963,10 +1963,11 @@ uint32_t ResourceTable::getResId(const String16& ref, bool onlyPublic) const { String16 package, type, name; + bool refOnlyPublic = true; if (!ResTable::expandResourceRef( ref.string(), ref.size(), &package, &type, &name, defType, defPackage ? defPackage:&mAssetsPackage, - outErrorMsg)) { + outErrorMsg, &refOnlyPublic)) { NOISY(printf("Expanding resource: ref=%s\n", String8(ref).string())); NOISY(printf("Expanding resource: defType=%s\n", @@ -1979,7 +1980,7 @@ uint32_t ResourceTable::getResId(const String16& ref, String8(name).string())); return 0; } - uint32_t res = getResId(package, type, name, onlyPublic); + uint32_t res = getResId(package, type, name, onlyPublic && refOnlyPublic); NOISY(printf("Expanded resource: p=%s, t=%s, n=%s, res=%d\n", String8(package).string(), String8(type).string(), String8(name).string(), res)); @@ -3208,7 +3209,7 @@ status_t ResourceTable::Entry::assignResourceIds(ResourceTable* table, const String16 id16("id"); mParentId = 0; if (mParent.size() > 0) { - mParentId = table->getResId(mParent, &style16, NULL, &errorMsg); + mParentId = table->getResId(mParent, &style16, NULL, &errorMsg, false); if (mParentId == 0) { mPos.error("Error retrieving parent for item: %s '%s'.\n", errorMsg, String8(mParent).string()); @@ -3220,7 +3221,7 @@ status_t ResourceTable::Entry::assignResourceIds(ResourceTable* table, const String16& key = mBag.keyAt(i); Item& it = mBag.editValueAt(i); it.bagKeyId = table->getResId(key, - it.isId ? &id16 : &attr16, NULL, &errorMsg); + it.isId ? &id16 : &attr16, NULL, &errorMsg, false); //printf("Bag key of %s: #%08x\n", String8(key).string(), it.bagKeyId); if (it.bagKeyId == 0) { it.sourcePos.error("Error: %s: %s '%s'.\n", errorMsg, @@ -3705,7 +3706,9 @@ sp ResourceTable::getPackage(const String16& package) { sp p = mPackages.valueFor(package); if (p == NULL) { - if (mIsAppPackage) { + if (mBundle->getIsOverlayPackage()) { + p = new Package(package, 0x00); + } else if (mIsAppPackage) { if (mHaveAppPackage) { fprintf(stderr, "Adding multiple application package resources; only one is allowed.\n" "Use -x to create extended resources.\n");