{"record":{"id":"b811555966f243cf","repo":"Tencent/tinker","slug":"unknown-section-type-type","errorCode":null,"errorMessage":"unknown section type: ${type}","messagePattern":"unknown section type: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"third-party/aosp-dexutils/src/main/java/com/tencent/tinker/android/dex/TableOfContents.java","lineNumber":150,"sourceCode":"                return codes;\n            }\n            case SECTION_TYPE_STRINGDATAS: {\n                return stringDatas;\n            }\n            case SECTION_TYPE_DEBUGINFOS: {\n                return debugInfos;\n            }\n            case SECTION_TYPE_ANNOTATIONS: {\n                return annotations;\n            }\n            case SECTION_TYPE_ENCODEDARRAYS: {\n                return encodedArrays;\n            }\n            case SECTION_TYPE_ANNOTATIONSDIRECTORIES: {\n                return annotationsDirectories;\n            }\n            default: {\n                throw new IllegalArgumentException(\"unknown section type: \" + type);\n            }\n        }\n    }\n\n    public void readFrom(Dex dex) throws IOException {\n        readHeader(dex.openSection(header));\n        // special case, since mapList.byteCount is available only after\n        // computeSizesFromOffsets() was invoked, so here we can't use\n        // dex.openSection(mapList) to get dex section. Or\n        // an {@code java.nio.BufferUnderflowException} will be thrown.\n        readMap(dex.openSection(mapList.off));\n        computeSizesFromOffsets();\n    }\n\n    private void readHeader(Dex.Section headerIn) throws UnsupportedEncodingException {\n        byte[] magic = headerIn.readByteArray(8);\n        api = DexFormat.magicToApi(magic);\n","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/Tencent/tinker/blob/1b7ea02c239840f563ea64fb5bd286eb98d4011e/third-party/aosp-dexutils/src/main/java/com/tencent/tinker/android/dex/TableOfContents.java#L132-L168","documentation":"Thrown by the switch-based getSection(short type) in TableOfContents when a map_list entry's type code is not one of the known SECTION_TYPE_* constants (header, stringIds, typeIds, protoIds, fieldIds, methodIds, classDefs, mapList, typeLists, annotationSetRefs, annotations, encodedArrays, annotationsDirectories). The map list is the dex's self-describing section index; an unknown code means unrecognized or corrupt input.","triggerScenarios":"readMap() iterating a map_list whose type field contains a value this vendored copy doesn't know (e.g. newer format sections like call sites / method handles in dex 038+) or garbage from a misaligned read.","commonSituations":"Feeding an API 26+-style dex (with CALLSITE_ID / METHOD_HANDLE map items) into this older aosp-dexutils snapshot during Tinker patch generation; corrupted map offsets after manual binary edits.","solutions":["Regenerate/re-dex the input with a toolchain matching what this library supports, or strip newer sections (the D8 `--min-api` flag nudges the format down).","Update the vendored aosp-dexutils to a revision whose SECTION_TYPE_* set covers the map items present in your dexes.","Validate with dexdump from the same SDK level as the library expectations to confirm where the unsupported item appears."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"static final Set<Short> KNOWN_MAP_TYPES = Set.of((short)0x0000,(short)0x0001,(short)0x0002,(short)0x0003,(short)0x0004,(short)0x0005,(short)0x0006,(short)0x1000,(short)0x1001,(short)0x1002,(short)0x1003,(short)0x1004,(short)0x1005,(short)0x2000,(short)0x2001,(short)0x2002,(short)0x2003,(short)0x2004,(short)0x2005,(short)0x2006);\n// reject before parse: read map types, ensure all in KNOWN_MAP_TYPES","typeGuard":null,"tryCatchPattern":"catch (IllegalArgumentException e) with 'unknown section type' -> classify as unsupported-format and route the dex to a newer toolchain instead of retrying","preventionTips":["Match library version to the maximum dex format version your min/target SDK toolchain emits.","Gate CI on parsing a representative dex through this library so format drift fails the build, not release."],"tags":["dex","map-list","section","version-skew","tinker"],"backgroundTag":null,"analyzedSha":"1b7ea02c239840f563ea64fb5bd286eb98d4011e","analyzedAt":"2026-08-14T15:16:52.110Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}