From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:Resources.arsc" |
|---|
| claim | "Type chunk (0x0201): header, uint8 id, uint8 flags (0x01 FLAG_SPARSE, 0x02 FLAG_OFFSET16), uint16 reserved, uint32 entryCount, uint32 entriesStart (from chunk start), then a ResTable_config (must be last; its own size field gives its length). After headerSize come the offsets: normal = entryCount uint32 (0xFFFFFFFF NO_ENTRY); OFFSET16 = uint16 values times 4 (0xFFFF = no entry); SPARSE = entryCount uint32 words of {uint16 idx, uint16 offset/4}, sorted by idx." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:Resources.arsc" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "ResTable_type" |
|---|
| size_min | "0x18" |
|---|
| endianness | "little" |
|---|
| fields | | offset | "0x0" |
|---|
| size | 8 |
|---|
| type | "ResChunk_header" |
|---|
| name | "header" |
|---|
|
| offset | "0x8" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "id" |
|---|
|
| offset | "0x9" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "flags" |
|---|
| bits | |
|---|
|
| offset | "0xA" |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "reserved" |
|---|
|
| offset | "0xC" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "entryCount" |
|---|
|
| offset | "0x10" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "entriesStart" |
|---|
|
| offset | "0x14" |
|---|
| size | 0 |
|---|
| type | "ResTable_config" |
|---|
| name | "config" |
|---|
|
|
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "ResTable_type, FLAG_SPARSE (platforms >= O, v26 qualifier), FLAG_OFFSET16 (real_offset = offset * 4u, 0xffff = NO_ENTRY), offset_from16, ResTable_sparseTypeEntry {idx, offset}." |
|---|
| repo | "https://android.googlesource.com/platform/frameworks/base" |
|---|
| commit | "1cdfff555f4a21f71ccc978290e2e212e2f8b168" |
|---|
| path | "libs/androidfw/include/androidfw/ResourceTypes.h" |
|---|
| lines | "1427-1517" |
|---|
|
| type | "source" |
|---|
| detail | "reads sparse (int16 idx, int16 offset*4), offset16 (0xFFFF skipped, *4) and normal int32 offsets; ignores the reserved field because some apps set it nonzero." |
|---|
| repo | "https://github.com/skylot/jadx" |
|---|
| commit | "c4c45fde27b4f3386dc2ff016ff187229a60a716" |
|---|
| path | "jadx-core/src/main/java/jadx/core/xmlgen/ResTableBinaryParser.java" |
|---|
| lines | "258-312" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "ResTable_type" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T06:35:42.411Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T08:48:09.507Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read struct ResTable_type in ResourceTypes.h (lines 1427-1520): header, id, flags (SPARSE 1, OFFSET16 2), reserved u16, entryCount, entriesStart, config last; kResTableTypeMinSize = sizeof(ResTable_type) - sizeof(ResTable_config) + sizeof(config.size) = 0x18; offset_from16 times 4, 0xFFFF = NO_ENTRY; sparse entry {idx u16, offset u16}. Matches." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T08:16:30.588Z" |
|---|
| summary | "size_min 0x14 stopped before the config; the source's kResTableTypeMinSize is sizeof(ResTable_type) minus sizeof(ResTable_config) plus the config's size field, i.e. 0x18." |
|---|
| changed | |
|---|
|
|
|---|