{"record":{"id":"8ddd03d447ff2a2e","repo":"iBotPeaches/Apktool","slug":"config-size-8","errorCode":null,"errorMessage":"Config size < 8","messagePattern":"Config size < 8","errorType":"exception","errorClass":"AndrolibException","httpStatus":null,"severity":"error","filePath":"brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/BinaryResourceParser.java","lineNumber":474,"sourceCode":"                    if (!mPackage.hasEntrySpec(id, index)) {\n                        mPackage.addEntrySpec(id, index, mKeyStringPool.getString(key));\n                        mMissingEntrySpecs.remove(resId);\n                    }\n                    mPackage.addEntry(id, index, config, value);\n                }\n            }\n\n            // Update the entry count for logging.\n            entryCount -= indexes.size();\n        }\n    }\n\n    private ResConfig parseConfig() throws AndrolibException, IOException {\n        long startPosition = mIn.position();\n        // ResTable_config\n        int size = mIn.readInt();\n        if (size < 8) {\n            throw new AndrolibException(\"Config size < 8\");\n        }\n\n        int mcc = mIn.readUnsignedShort();\n        int mnc = mIn.readUnsignedShort();\n\n        String language = \"\";\n        String region = \"\";\n        if (size >= 12) {\n            language = unpackLanguageOrRegion(mIn.readBytes(2), 'a');\n            region = unpackLanguageOrRegion(mIn.readBytes(2), '0');\n        }\n\n        int orientation = 0;\n        int touchscreen = 0;\n        if (size >= 14) {\n            orientation = mIn.readUnsignedByte();\n            touchscreen = mIn.readUnsignedByte();\n        }","sourceCodeStart":456,"sourceCodeEnd":492,"githubUrl":"https://github.com/iBotPeaches/Apktool/blob/79b63384d7d7e22917e6ea8b453272da7012515b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/BinaryResourceParser.java#L456-L492","documentation":"While parsing a ResTable_config (the locale/density/... descriptor of each resource type chunk), the leading `size` field must be at least 8 (uint32 size + mcc + mnc). A smaller declared size means the config header is malformed and cannot even be partially read, so parsing aborts.","triggerScenarios":"Decoding an arsc whose ResTable_config struct declares size < 8 — corruption of the config header, an arsc produced by a broken/obsessive optimizer, or deliberate fuzzing of config sizes.","commonSituations":"Resource obfuscation tools (e.g. aggressive arsc shrinkers) that rewrite config headers with wrong sizes; bit-level corruption from bad transfers; experimental arsc generators that don't zero-pad config structs.","solutions":["Cross-check with `aapt2 dump resources` / `aapt dump badging` to confirm the config header is genuinely invalid.","Fetch a clean copy of the APK and compare the arsc bytes around the reported offset.","If you generate arsc files, ensure every ResTable_config is at least 8 bytes (size includes the size field itself).","For protected apps, decode the version distributed via a channel that does not apply the resource obfuscator."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    parser.parse(in);\n} catch (AndrolibException e) {\n    if (\"Config size < 8\".equals(e.getMessage())) {\n        // ResTable_config header corrupt — obtain clean APK\n    }\n}","preventionTips":["Validate patched arsc files with aapt2 after any resource optimization step.","Keep original APKs to diff against when size-field corruption appears."],"tags":["apktool","arsc","config","parsing","corrupt-file"],"backgroundTag":null,"analyzedSha":"79b63384d7d7e22917e6ea8b453272da7012515b","analyzedAt":"2026-08-14T10:43:28.812Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}