From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "behavior" |
|---|
| subject | "Format:AXML" |
|---|
| claim | "When decoding binary XML, Apktool prefers the attribute's resource id (from the RES_XML_RESOURCE_MAP chunk, resolved through the resource table) over the name in the string pool, because obfuscated apps put misleading names in the pool; it falls back to the pool string if the id does not resolve. For an id that does not resolve it then also tries to inject a dummy 'attr' spec for it into the main package (or the android package), using the pool name or a generated dummy name, unless it is told to skip unresolved references or the id belongs to another package. A flagged-extension attribute is named featureFlag. It also skips RES_NULL_TYPE chunks between nodes, and skips chunk types outside 0x0100-0x017F." |
|---|
| scope | | level | "tool" |
|---|
| applies_to | "Tool:Apktool" |
|---|
| observed_in | |
|---|
|
|---|
| data | | trigger | "getAttributeName in BinaryXmlResourceParser" |
|---|
| effect | "uses mTable.resolve(nameId).getName() when nameId != ResId.NULL, else mStringPool.getString(attr.name)" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "the source comment 'Android prefers the resource table value over what the string pool has' with the app:state_collapsed vs app:d2 example; nextChunk skipChunk for RES_NULL_TYPE; doNext range check." |
|---|
| repo | "https://github.com/iBotPeaches/Apktool" |
|---|
| commit | "fd9d5d4dc7e45fa7f984698ded7a03c554d0a7b3" |
|---|
| path | "brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/BinaryXmlResourceParser.java" |
|---|
| lines | "313-327, 668-715" |
|---|
|
| type | "source" |
|---|
| detail | "getAttributeName: featureFlag case, mTable.resolve(nameId).getName(), pool fallback, then the unresolved-id branch with mSkipUnresolved / pkgId check / addEntrySpec dummy" |
|---|
| repo | "https://github.com/iBotPeaches/Apktool" |
|---|
| commit | "fd9d5d4dc7e45fa7f984698ded7a03c554d0a7b3" |
|---|
| path | "brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/BinaryXmlResourceParser.java" |
|---|
| lines | "303-372" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Apktool resolves attribute names from the resource map" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T06:36:22.976Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T07:28:13.073Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read Apktool BinaryXmlResourceParser.java 295-380 and 660-720 at fd9d5d4: featureFlag, resource-table name first, pool fallback, dummy attr injection with mSkipUnresolved / pkgId check, RES_NULL_TYPE chunk skip, chunk range check." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T06:51:52.408Z" |
|---|
| summary | "The fallback is not the last step: when the attribute has a resource id that does not resolve, getAttributeName continues and may inject a dummy attr spec into the main (or android) package and use…" |
|---|
| changed | |
|---|
|
|
|---|