iBotPeaches/Apktool · error · AndrolibException
Config size < 8
Error message
Config size < 8
What it means
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.
Source
Thrown at brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/BinaryResourceParser.java:474
if (!mPackage.hasEntrySpec(id, index)) {
mPackage.addEntrySpec(id, index, mKeyStringPool.getString(key));
mMissingEntrySpecs.remove(resId);
}
mPackage.addEntry(id, index, config, value);
}
}
// Update the entry count for logging.
entryCount -= indexes.size();
}
}
private ResConfig parseConfig() throws AndrolibException, IOException {
long startPosition = mIn.position();
// ResTable_config
int size = mIn.readInt();
if (size < 8) {
throw new AndrolibException("Config size < 8");
}
int mcc = mIn.readUnsignedShort();
int mnc = mIn.readUnsignedShort();
String language = "";
String region = "";
if (size >= 12) {
language = unpackLanguageOrRegion(mIn.readBytes(2), 'a');
region = unpackLanguageOrRegion(mIn.readBytes(2), '0');
}
int orientation = 0;
int touchscreen = 0;
if (size >= 14) {
orientation = mIn.readUnsignedByte();
touchscreen = mIn.readUnsignedByte();
}View on GitHub (pinned to 79b63384d7)
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.
Defensive patterns
Strategy: validation
Try / catch
try {
parser.parse(in);
} catch (AndrolibException e) {
if ("Config size < 8".equals(e.getMessage())) {
// ResTable_config header corrupt — obtain clean APK
}
} Prevention
- Validate patched arsc files with aapt2 after any resource optimization step.
- Keep original APKs to diff against when size-field corruption appears.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Input file is empty.
- Unexpected chunk:
- Could not decode arsc file.
- Missing type string pool.
- Missing key string pool
AI-assisted analysis of iBotPeaches/Apktool@79b63384d7 (2026-08-14).
Data as JSON: /api/errors/8ddd03d447ff2a2e.
Report an issue: GitHub.