- res = bundle->getResourceSourceDir();
- if (res) {
- type = getFileType(res);
- if (type == kFileTypeNonexistent) {
- fprintf(stderr, "ERROR: resource directory '%s' does not exist\n", res);
- return UNKNOWN_ERROR;
- }
- if (type == kFileTypeDirectory) {
- count = slurpResourceTree(bundle, String8(res));
+ for (size_t i=0; i<dirCount; i++) {
+ const char *res = resDirs[i];
+ if (res) {
+ type = getFileType(res);
+ if (type == kFileTypeNonexistent) {
+ fprintf(stderr, "ERROR: resource directory '%s' does not exist\n", res);
+ return UNKNOWN_ERROR;
+ }
+ if (type == kFileTypeDirectory) {
+ if (i>0) {
+ sp<AaptAssets> nextOverlay = new AaptAssets();
+ current->setOverlay(nextOverlay);
+ current = nextOverlay;
+ }
+ count = current->slurpResourceTree(bundle, String8(res));