{"record":{"id":"a21fc6a2341fcfbd","repo":"iBotPeaches/Apktool","slug":"entry-pkgid-0x-02x-typeid-0x-02x-entryid-0x-04x","errorCode":null,"errorMessage":"entry: pkgId=0x%02x, typeId=0x%02x, entryId=0x%04x, config=%s","messagePattern":"entry: pkgId=0x%02x, typeId=0x%02x, entryId=0x%04x, config=(.+?)","errorType":"exception","errorClass":"UndefinedResObjectException","httpStatus":null,"severity":"error","filePath":"brut.apktool/apktool-lib/src/main/java/brut/androlib/res/table/ResPackage.java","lineNumber":248,"sourceCode":"        return mEntries.containsKey(entryKey);\n    }\n\n    public ResEntry getEntry(int typeId, int entryId) throws UndefinedResObjectException {\n        return getEntry(typeId, entryId, ResConfig.DEFAULT);\n    }\n\n    public ResEntry getEntry(int typeId, int entryId, ResConfig config) 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        Pair<ResId, ResConfig> entryKey = Pair.of(resId, config);\n        ResEntry entry = mEntries.get(entryKey);\n        if (entry == null) {\n            throw new UndefinedResObjectException(\n                String.format(\"entry: pkgId=0x%02x, typeId=0x%02x, entryId=0x%04x, config=%s\",\n                    getId(), typeId, entryId, config));\n        }\n        return entry;\n    }\n\n    public ResEntry addEntry(int typeId, int entryId, ResValue value) throws AndrolibException {\n        return addEntry(typeId, entryId, ResConfig.DEFAULT, value);\n    }\n\n    public ResEntry addEntry(int typeId, int entryId, ResConfig config, ResValue value) 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","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/iBotPeaches/Apktool/blob/79b63384d7d7e22917e6ea8b453272da7012515b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/table/ResPackage.java#L230-L266","documentation":"UndefinedResObjectException thrown by ResPackage.getEntry(typeId, entryId, config) when no ResEntry exists for the (resource id, config) pair (after alias resolution). It means the entry spec may exist, but there is no concrete value for the requested configuration — e.g. the string has values only for other locales, or the drawable only for other densities.","triggerScenarios":"Calling getEntry with ResConfig.DEFAULT when the entry only has config-specific values; requesting a locale/density combination that was never compiled; alias resolution landing on an id/config pair with no entry.","commonSituations":"Localizations where an entry is omitted from the default config; density-split bundles (drawable only in hdpi split); obfuscated tables with sparse entries (note apktool tracks hasSparseEntries for exactly this); programmatic lookups assuming every config has every entry.","solutions":["Check existence for the exact config before getEntry, and fall back through other configs of the type if appropriate.","For sparse/obfuscated tables, iterate the type's entries rather than random-accessing by (id, config).","When decoding splits, load all splits so config coverage is complete."],"exampleFix":"// before\nResEntry entry = pkg.getEntry(typeId, entryId, ResConfig.DEFAULT);\n\n// after\nResType type = pkg.getType(typeId, ResConfig.DEFAULT);\nResEntry entry = type.hasEntry(entryId) ? pkg.getEntry(typeId, entryId, ResConfig.DEFAULT) : null;","handlingStrategy":"try-catch","validationCode":"// Prefer existence check on the type before exact-config lookup\nResType type = pkg.getType(typeId, ResConfig.DEFAULT);\nif (!type.hasEntry(entryId)) {\n    // no value under this config; fall back to another config or skip\n}","typeGuard":null,"tryCatchPattern":"try {\n    ResEntry entry = pkg.getEntry(typeId, entryId, config);\n} catch (UndefinedResObjectException ex) {\n    // entry has no value for this config; iterate other configs of the type\n}","preventionTips":["Check type-level entry existence before exact (id, config) lookups","Handle sparse/obfuscated tables by iteration, not random access","Load density/locale splits together with the base APK"],"tags":["android","apktool","resource-table","undefined-object","configurations","sparse-entries"],"backgroundTag":null,"analyzedSha":"79b63384d7d7e22917e6ea8b453272da7012515b","analyzedAt":"2026-08-14T10:43:28.812Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}