{"record":{"id":"144c6b30a1d565ff","repo":"iBotPeaches/Apktool","slug":"entry-spec-pkgid-0x-02x-typeid-0x-02x-entryid-0","errorCode":null,"errorMessage":"entry spec: pkgId=0x%02x, typeId=0x%02x, entryId=0x%04x","messagePattern":"entry spec: pkgId=0x%02x, typeId=0x%02x, entryId=0x%04x","errorType":"exception","errorClass":"UndefinedResObjectException","httpStatus":null,"severity":"error","filePath":"brut.apktool/apktool-lib/src/main/java/brut/androlib/res/table/ResPackage.java","lineNumber":175,"sourceCode":"\n    public boolean hasEntrySpec(int typeId, int entryId) {\n        ResId resId = ResId.of(getId(), typeId, entryId);\n        resId = mAliases.getOrDefault(resId, resId);\n\n        return mEntrySpecs.containsKey(resId);\n    }\n\n    public ResEntrySpec getEntrySpec(int typeId, int entryId) throws UndefinedResObjectException {\n        ResId resId = ResId.of(getId(), typeId, entryId);\n        if (mAliases.containsKey(resId)) {\n            resId = mAliases.get(resId);\n            typeId = resId.typeId();\n            entryId = resId.entryId();\n        }\n\n        ResEntrySpec entrySpec = mEntrySpecs.get(resId);\n        if (entrySpec == null) {\n            throw new UndefinedResObjectException(\n                String.format(\"entry spec: pkgId=0x%02x, typeId=0x%02x, entryId=0x%04x\", getId(), typeId, entryId));\n        }\n        return entrySpec;\n    }\n\n    public ResEntrySpec addEntrySpec(int typeId, int entryId, String name) throws AndrolibException {\n        ResId resId = ResId.of(getId(), typeId, entryId);\n        if (mAliases.containsKey(resId)) {\n            resId = mAliases.get(resId);\n            typeId = resId.typeId();\n            entryId = resId.entryId();\n        }\n\n        ResEntrySpec entrySpec = mEntrySpecs.get(resId);\n        if (entrySpec != null) {\n            throw new AndrolibException(\n                String.format(\"Repeated entry spec: pkgId=0x%02x, typeId=0x%02x, entryId=0x%04x\",\n                    getId(), typeId, entryId));","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/iBotPeaches/Apktool/blob/79b63384d7d7e22917e6ea8b453272da7012515b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/table/ResPackage.java#L157-L193","documentation":"UndefinedResObjectException thrown by ResPackage.getEntrySpec(typeId, entryId) when no ResEntrySpec is registered for the resource id (after alias resolution). Entry specs carry the entry's name and flags; their absence means the table has no entry metadata for that (typeId, entryId) — the id is dangling, or belongs to another package, or aliases point somewhere unregistered.","triggerScenarios":"Resolving a resource id that exists in code/manifest but not in this package's table; obfuscated arsc where entry specs were stripped or renamed; an alias (mAliases) mapping to a final id that itself has no entry spec; calling before addEntrySpec during programmatic builds.","commonSituations":"Decoding obfuscated apps with collapsed/renamed resource names; split APKs where an entry lives in a different split; tools generating resource ids without matching arsc entries.","solutions":["Guard with hasEntrySpec-style check or catch UndefinedResObjectException before proceeding.","Confirm the package id byte of the resource id matches the ResPackage you are querying.","For aliases, verify the chain ends at a real entry: resolveAlias then check the target exists.","Decode base + split APKs together so all entry specs are present."],"exampleFix":"// before\nResEntrySpec spec = pkg.getEntrySpec(typeId, entryId);\n\n// after\ntry {\n    ResEntrySpec spec = pkg.getEntrySpec(typeId, entryId);\n} catch (UndefinedResObjectException e) {\n    // resource id is dangling in this package; skip or report\n}","handlingStrategy":"try-catch","validationCode":"ResId id = ResId.of(pkg.getId(), typeId, entryId);\n// cheap pre-check via public API before getEntrySpec\nboolean exists;\ntry { pkg.getEntrySpec(typeId, entryId); exists = true; }\ncatch (UndefinedResObjectException e) { exists = false; }","typeGuard":null,"tryCatchPattern":"try {\n    ResEntrySpec spec = pkg.getEntrySpec(typeId, entryId);\n} catch (UndefinedResObjectException ex) {\n    // dangling resource id in this package; log id and skip\n}","preventionTips":["Treat UndefinedResObjectException as 'not present', not as fatal","Verify package id byte matches before lookups","Decode base + splits together so entry specs are complete"],"tags":["android","apktool","resource-table","undefined-object","obfuscation"],"backgroundTag":null,"analyzedSha":"79b63384d7d7e22917e6ea8b453272da7012515b","analyzedAt":"2026-08-14T10:43:28.812Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}