Loading libs/androidfw/ResourceTypes.cpp +211 −195 Original line number Diff line number Diff line Loading @@ -7367,7 +7367,17 @@ void ResTable::print(bool inclValues) const printf("\n"); } // Determine the number of resource splits for the resource types in this package. // It needs to be done outside of the loop below so all of the information for a // is displayed in a single block. Otherwise, a resource split's resource types // would be interleaved with other splits. size_t splitCount = 0; for (size_t typeIndex = 0; typeIndex < pg->types.size(); typeIndex++) { splitCount = max(splitCount, pg->types[typeIndex].size()); } int packageId = pg->id; for (size_t splitIndex = 0; splitIndex < splitCount; splitIndex++) { size_t pkgCount = pg->packages.size(); for (size_t pkgIndex=0; pkgIndex<pkgCount; pkgIndex++) { const Package* pkg = pg->packages[pkgIndex]; Loading @@ -7375,17 +7385,19 @@ void ResTable::print(bool inclValues) const // if this package is a shared library. packageId = pkg->package->id; char16_t tmpName[sizeof(pkg->package->name)/sizeof(pkg->package->name[0])]; strcpy16_dtoh(tmpName, pkg->package->name, sizeof(pkg->package->name)/sizeof(pkg->package->name[0])); strcpy16_dtoh(tmpName, pkg->package->name, sizeof(pkg->package->name)/sizeof(pkg->package->name[0])); printf(" Package %d id=0x%02x name=%s\n", (int)pkgIndex, pkg->package->id, String8(tmpName).string()); } for (size_t typeIndex = 0; typeIndex < pg->types.size(); typeIndex++) { const TypeList& typeList = pg->types[typeIndex]; if (typeList.isEmpty()) { if (splitIndex >= typeList.size() || typeList.isEmpty()) { // Only dump if the split exists and contains entries for this type continue; } const Type* typeConfigs = typeList[0]; const Type* typeConfigs = typeList[splitIndex]; const size_t NTC = typeConfigs->configs.size(); printf(" type %d configCount=%d entryCount=%d\n", (int)typeIndex, (int)NTC, (int)typeConfigs->entryCount); Loading Loading @@ -7452,7 +7464,8 @@ void ResTable::print(bool inclValues) const size_t entryCount = dtohl(type->entryCount); uint32_t entriesStart = dtohl(type->entriesStart); if ((entriesStart&0x3) != 0) { printf(" NON-INTEGER ResTable_type entriesStart OFFSET: 0x%x\n", entriesStart); printf(" NON-INTEGER ResTable_type entriesStart OFFSET: 0x%x\n", entriesStart); continue; } uint32_t typeSize = dtohl(type->header.size); Loading Loading @@ -7568,14 +7581,16 @@ void ResTable::print(bool inclValues) const const uint32_t parent = dtohl(bagPtr->parent.ident); uint32_t resolvedParent = parent; if (Res_GETPACKAGE(resolvedParent) + 1 == 0) { status_t err = pg->dynamicRefTable.lookupResourceId(&resolvedParent); status_t err = pg->dynamicRefTable.lookupResourceId(&resolvedParent); if (err != NO_ERROR) { resolvedParent = 0; } } printf(" Parent=0x%08x(Resolved=0x%08x), Count=%d\n", parent, resolvedParent, N); for (int i=0; i<N && mapOffset < (typeSize-sizeof(ResTable_map)); i++) { for (int i=0; i<N && mapOffset < (typeSize-sizeof(ResTable_map)); i++) { printf(" #%i (Key=0x%08x): ", i, dtohl(mapPtr->name.ident)); value.copyFrom_dtoh(mapPtr->value); Loading @@ -7591,5 +7606,6 @@ void ResTable::print(bool inclValues) const } } } } } // namespace android Loading
libs/androidfw/ResourceTypes.cpp +211 −195 Original line number Diff line number Diff line Loading @@ -7367,7 +7367,17 @@ void ResTable::print(bool inclValues) const printf("\n"); } // Determine the number of resource splits for the resource types in this package. // It needs to be done outside of the loop below so all of the information for a // is displayed in a single block. Otherwise, a resource split's resource types // would be interleaved with other splits. size_t splitCount = 0; for (size_t typeIndex = 0; typeIndex < pg->types.size(); typeIndex++) { splitCount = max(splitCount, pg->types[typeIndex].size()); } int packageId = pg->id; for (size_t splitIndex = 0; splitIndex < splitCount; splitIndex++) { size_t pkgCount = pg->packages.size(); for (size_t pkgIndex=0; pkgIndex<pkgCount; pkgIndex++) { const Package* pkg = pg->packages[pkgIndex]; Loading @@ -7375,17 +7385,19 @@ void ResTable::print(bool inclValues) const // if this package is a shared library. packageId = pkg->package->id; char16_t tmpName[sizeof(pkg->package->name)/sizeof(pkg->package->name[0])]; strcpy16_dtoh(tmpName, pkg->package->name, sizeof(pkg->package->name)/sizeof(pkg->package->name[0])); strcpy16_dtoh(tmpName, pkg->package->name, sizeof(pkg->package->name)/sizeof(pkg->package->name[0])); printf(" Package %d id=0x%02x name=%s\n", (int)pkgIndex, pkg->package->id, String8(tmpName).string()); } for (size_t typeIndex = 0; typeIndex < pg->types.size(); typeIndex++) { const TypeList& typeList = pg->types[typeIndex]; if (typeList.isEmpty()) { if (splitIndex >= typeList.size() || typeList.isEmpty()) { // Only dump if the split exists and contains entries for this type continue; } const Type* typeConfigs = typeList[0]; const Type* typeConfigs = typeList[splitIndex]; const size_t NTC = typeConfigs->configs.size(); printf(" type %d configCount=%d entryCount=%d\n", (int)typeIndex, (int)NTC, (int)typeConfigs->entryCount); Loading Loading @@ -7452,7 +7464,8 @@ void ResTable::print(bool inclValues) const size_t entryCount = dtohl(type->entryCount); uint32_t entriesStart = dtohl(type->entriesStart); if ((entriesStart&0x3) != 0) { printf(" NON-INTEGER ResTable_type entriesStart OFFSET: 0x%x\n", entriesStart); printf(" NON-INTEGER ResTable_type entriesStart OFFSET: 0x%x\n", entriesStart); continue; } uint32_t typeSize = dtohl(type->header.size); Loading Loading @@ -7568,14 +7581,16 @@ void ResTable::print(bool inclValues) const const uint32_t parent = dtohl(bagPtr->parent.ident); uint32_t resolvedParent = parent; if (Res_GETPACKAGE(resolvedParent) + 1 == 0) { status_t err = pg->dynamicRefTable.lookupResourceId(&resolvedParent); status_t err = pg->dynamicRefTable.lookupResourceId(&resolvedParent); if (err != NO_ERROR) { resolvedParent = 0; } } printf(" Parent=0x%08x(Resolved=0x%08x), Count=%d\n", parent, resolvedParent, N); for (int i=0; i<N && mapOffset < (typeSize-sizeof(ResTable_map)); i++) { for (int i=0; i<N && mapOffset < (typeSize-sizeof(ResTable_map)); i++) { printf(" #%i (Key=0x%08x): ", i, dtohl(mapPtr->name.ident)); value.copyFrom_dtoh(mapPtr->value); Loading @@ -7591,5 +7606,6 @@ void ResTable::print(bool inclValues) const } } } } } // namespace android