{"record":{"id":"46f7e5a86352bce9","repo":"skylot/jadx","slug":"unexpected-input-file","errorCode":null,"errorMessage":"Unexpected input file: ","messagePattern":"Unexpected input file: ","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/core/clsp/ClsSet.java","lineNumber":127,"sourceCode":"\t\tk = 0;\n\t\tfor (ClassNode cls : list) {\n\t\t\tClspClass nClass = getCls(cls, names);\n\t\t\tif (nClass == null) {\n\t\t\t\tthrow new JadxRuntimeException(\"Missing class: \" + cls);\n\t\t\t}\n\t\t\tnClass.setParents(makeParentsArray(cls));\n\t\t\tclasses[k] = nClass;\n\t\t\tk++;\n\t\t}\n\t}\n\n\tprivate static ClspClassSource getClspClassSource(ClassNode cls) {\n\t\tString inputFileName = cls.getClsData().getInputFileName();\n\t\tint idx = inputFileName.indexOf(':');\n\t\tString sourceFile = inputFileName.substring(0, idx);\n\t\tClspClassSource source = ClspClassSource.getClspClassSource(sourceFile);\n\t\tif (source == ClspClassSource.APP) {\n\t\t\tthrow new JadxRuntimeException(\"Unexpected input file: \" + inputFileName);\n\t\t}\n\t\treturn source;\n\t}\n\n\tprivate List<ClspMethod> getMethodsDetails(ClassNode cls) {\n\t\tList<MethodNode> methodsList = cls.getMethods();\n\t\tList<ClspMethod> methods = new ArrayList<>(methodsList.size());\n\t\tfor (MethodNode mth : methodsList) {\n\t\t\tprocessMethodDetails(mth, methods);\n\t\t}\n\t\treturn methods;\n\t}\n\n\tprivate void processMethodDetails(MethodNode mth, List<ClspMethod> methods) {\n\t\tAccessInfo accessFlags = mth.getAccessFlags();\n\t\tif (accessFlags.isPrivate() || accessFlags.isSynthetic() || accessFlags.isBridge()) {\n\t\t\treturn;\n\t\t}","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/clsp/ClsSet.java#L109-L145","documentation":"Thrown by ClsSet.getClspClassSource when an input class's source file identifier maps to ClspClassSource.APP, meaning the class's input file name does not match any known framework JAR (android.jar, android.car.jar, org.apache.http.legacy.jar). This check ensures only framework/system classes are included when building the classpath (.jcst) export, not application classes.","triggerScenarios":"Calling ClsSet.loadFrom(root) (which calls getClspClassSource for each class) where a class's input file name lacks a ':' delimiter or the prefix before ':' does not match a recognized framework jar name. The method splits the input file name at the first ':' and passes the source portion to ClspClassSource.getClspClassSource, which returns APP for anything unrecognized.","commonSituations":"Attempting to build a classpath export from an APK that contains application classes (which should not be in the framework classpath). Using a custom input format where the input file name convention (source:offset) is not followed. Mismatched JAR name for a framework library that jadx does not recognize (e.g., a newer Android system library not yet in the enum).","solutions":["Ensure ClsSet.loadFrom is only called with framework/system classes from recognized JAR sources, not application classes.","If building a custom classpath from a new Android system JAR, add its name to the ClspClassSource enum and rebuild jadx-core.","Verify the input file naming convention: the class data's getInputFileName() must be 'jarName:offset' where jarName matches a ClspClassSource entry.","Filter the root's class list to only framework-sourced classes before calling loadFrom."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Filter the root's class list to only framework-sourced classes\nList<ClassNode> allClasses = root.getClasses(true);\nSet<String> knownJars = Set.of(\"android.jar\", \"android.car.jar\", \"org.apache.http.legacy.jar\");\nList<ClassNode> frameworkOnly = allClasses.stream()\n    .filter(cls -> {\n        String inputFile = cls.getClsData().getInputFileName();\n        String sourceFile = inputFile.substring(0, inputFile.indexOf(':'));\n        return knownJars.contains(sourceFile);\n    })\n    .collect(Collectors.toList());","typeGuard":"static boolean isFrameworkSourced(ClassNode cls) {\n    String inputFile = cls.getClsData().getInputFileName();\n    int idx = inputFile.indexOf(':');\n    if (idx < 0) return false;\n    String sourceFile = inputFile.substring(0, idx);\n    return sourceFile.equals(\"android.jar\")\n        || sourceFile.equals(\"android.car.jar\")\n        || sourceFile.equals(\"org.apache.http.legacy.jar\");\n}","tryCatchPattern":null,"preventionTips":["Only pass framework/system classes to ClsSet.loadFrom, not application classes.","Verify the input file naming convention: 'jarName:offset' where jarName matches a ClspClassSource entry.","If adding a new framework JAR, add its name to the ClspClassSource enum and rebuild jadx-core."],"tags":["classpath","clst","source","validation"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}