{"record":{"id":"4fcce7977bb14bf8","repo":"skylot/jadx","slug":"unknown-type-of-resource-file-resfile-getorigin","errorCode":null,"errorMessage":"Unknown type of resource file: ${resFile.getOriginalName()}","messagePattern":"Unknown type of resource file: (.+?)","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/api/ResourcesLoader.java","lineNumber":162,"sourceCode":"\n\t\t\tdefault:\n\t\t\t\treturn ResContainer.resourceFileLink(resFile);\n\t\t}\n\t}\n\n\tpublic IResTableParser decodeTable(ResourceFile resFile, InputStream is) throws IOException {\n\t\tif (resFile.getType() != ResourceType.ARSC) {\n\t\t\tthrow new IllegalArgumentException(\"Unexpected resource type for decode: \" + resFile.getType() + \", expect '.pb'/'.arsc'\");\n\t\t}\n\t\tIResTableParser parser = null;\n\t\tfor (IResTableParserProvider provider : resTableParserProviders) {\n\t\t\tparser = provider.getParser(resFile);\n\t\t\tif (parser != null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (parser == null) {\n\t\t\tthrow new JadxRuntimeException(\"Unknown type of resource file: \" + resFile.getOriginalName());\n\t\t}\n\t\tparser.setBaseFileName(resFile.getDeobfName());\n\t\tparser.decode(is);\n\t\treturn parser;\n\t}\n\n\tprivate static ResContainer decodeImage(ResourceFile rf, InputStream inputStream) {\n\t\tString name = rf.getDeobfName();\n\t\tif (name.endsWith(\".9.png\")) {\n\t\t\ttry (ByteArrayOutputStream os = new ByteArrayOutputStream()) {\n\t\t\t\tRes9patchStreamDecoder decoder = new Res9patchStreamDecoder();\n\t\t\t\tif (decoder.decode(inputStream, os)) {\n\t\t\t\t\treturn ResContainer.decodedData(rf.getDeobfName(), os.toByteArray());\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tLOG.error(\"Failed to decode 9-patch png image, path: {}\", name, e);\n\t\t\t}\n\t\t}","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/api/ResourcesLoader.java#L144-L180","documentation":"Thrown by ResourcesLoader.decodeTable() when iterating all registered IResTableParserProviders yields no non-null parser for the given ARSC ResourceFile. decodeTable() first asserts the type is ARSC, then asks each provider.getParser(resFile); if none returns a parser, jadx has no way to parse that resource table and throws a JadxRuntimeException naming the file. This usually indicates a missing or disabled ARSC provider.","triggerScenarios":"Calling decodeTable() on a ResourceFile of type ARSC (a .arsc or .pb table) when no registered IResTableParserProvider.getParser() returns a non-null parser for it.","commonSituations":"The Android resource table provider plugin is not on the classpath (jadx-core without the Android modules); a provider that only handles legacy .arsc but the file is the newer protobuf .pb format (or vice versa); a custom setup that removed the default providers; a provider whose getParser incorrectly returns null for a supported format.","solutions":["Ensure the Android resource modules (providing the ARSC/protobuf table parsers) are on the classpath.","Register an IResTableParserProvider that handles the specific format (.arsc vs .pb) of your file.","Confirm resFile.getType() is actually ARSC before calling decodeTable().","If you ship a custom provider, verify its getParser() returns a parser for the formats you need."],"exampleFix":"// before\nIResTableParser parser = resLoader.decodeTable(resFile, is);\n\n// after\nif (resFile.getType() != ResourceType.ARSC\n        || resTableParserProviders.stream().noneMatch(p -> p.getParser(resFile) != null)) {\n    LOG.warn(\"No ARSC parser available for {}, skipping\", resFile.getOriginalName());\n    return;\n}\nIResTableParser parser = resLoader.decodeTable(resFile, is);","handlingStrategy":"validation","validationCode":"// Before calling decodeTable, confirm a provider can handle this ARSC file.\nif (resFile.getType() != ResourceType.ARSC) {\n    throw new IllegalArgumentException(\"Not an ARSC resource: \" + resFile);\n}\nboolean hasParser = resTableParserProviders.stream()\n        .anyMatch(p -> p.getParser(resFile) != null);\nif (!hasParser) {\n    LOG.warn(\"No registered parser for ARSC file {}, skipping\", resFile.getOriginalName());\n    return;\n}","typeGuard":null,"tryCatchPattern":"try {\n    parser = resLoader.decodeTable(resFile, is);\n} catch (JadxRuntimeException e) {\n    if (e.getMessage().startsWith(\"Unknown type of resource file\")) {\n        LOG.warn(\"No ARSC parser provider for {}\", resFile.getOriginalName());\n        return;\n    }\n    throw e;\n}","preventionTips":["Ensure the Android ARSC/protobuf table parser modules are on the classpath.","Register an IResTableParserProvider that covers both .arsc and .pb formats.","Pre-check that some provider returns a parser before calling decodeTable()."],"tags":["resources","plugins","android","configuration"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}