{"record":{"id":"fc66b0669b07ee29","repo":"MuntashirAkon/AppManager","slug":"class-definition-for-src-getfullpath-is-not-found-fc66b0","errorCode":null,"errorMessage":"Class definition for + src.getFullPath() + is not found.","messagePattern":"Class definition for \\+ src\\.getFullPath\\(\\) \\+ is not found\\.","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/io/fs/DexFileSystem.java","lineNumber":284,"sourceCode":"    @NonNull\n    @Override\n    protected InputStream getInputStream(@NonNull Node<?> node) throws IOException {\n        ClassDef classDef = (ClassDef) node.getObject();\n        if (classDef == null) {\n            throw new FileNotFoundException(\"Class definition for \" + node.getFullPath() + \" is not found.\");\n        }\n        try {\n            return new ByteArrayInputStream(getDexClasses().getClassContents(classDef).getBytes(StandardCharsets.UTF_8));\n        } catch (ClassNotFoundException e) {\n            throw new IOException(e);\n        }\n    }\n\n    @Override\n    protected void cacheFile(@NonNull Node<?> src, @NonNull File sink) throws IOException {\n        ClassDef classDef = (ClassDef) src.getObject();\n        if (classDef == null) {\n            throw new FileNotFoundException(\"Class definition for \" + src.getFullPath() + \" is not found.\");\n        }\n        try (FileOutputStream os = new FileOutputStream(sink)) {\n            os.write(getDexClasses().getClassContents(classDef).getBytes(StandardCharsets.UTF_8));\n        } catch (ClassNotFoundException e) {\n            throw new IOException(e);\n        }\n    }\n\n    @NonNull\n    private static Node<ClassDef> buildTree(@NonNull DexClasses dexClasses) {\n        Node<ClassDef> rootNode = new Node<>(null, File.separator);\n        List<String> classNames = dexClasses.getClassNames();\n        for (String className : classNames) {\n            ClassDef classDef;\n            try {\n                classDef = dexClasses.getClassDef(className);\n            } catch (ClassNotFoundException e) {\n                classDef = null;","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/io/fs/DexFileSystem.java#L266-L302","documentation":"DexFileSystem.cacheFile writes a class's contents to a sink file. As with getInputStream, if the source Node's ClassDef is null the class definition cannot be resolved in the DEX and a FileNotFoundException naming the node's full path is thrown.","triggerScenarios":"Copying/caching a DEX-VFS node to a real file when node.getObject() (ClassDef) is null — entry missing from the DEX, stale node after DEX change, or a non-class node.","commonSituations":"Batch-exporting all classes from a mounted DEX where some listed paths are not real class defs; exporting after the DEX file changed on disk; wrong class path casing.","solutions":["Filter the node list to nodes with a non-null ClassDef before caching.","Remount the DEX filesystem to rebuild nodes/ClassDefs for the current DEX.","Catch FileNotFoundException per node and skip/report it instead of failing the whole export.","Verify exact class path spelling (package separators map to path separators)."],"exampleFix":"// before\nfor (Path p : dexMount.listFiles()) p.copy(sinkDir);\n// after\nfor (Path p : dexMount.listFiles()) {\n    if (((Node<?>) p.getAttachment()).getObject() != null) p.copy(sinkDir);\n}","handlingStrategy":"try-catch","validationCode":"if (node.getObject() == null) { skip(node); return; }","typeGuard":"static boolean isClassNode(Node<?> n) { return n.getObject() instanceof ClassDef; }","tryCatchPattern":"try {\n    vfs.cacheFile(node, sink);\n} catch (FileNotFoundException e) {\n    // log and continue with next node\n}","preventionTips":["Filter nodes by non-null ClassDef before caching.","Use exact class paths derived from the DEX's own class list.","Remount when the DEX binary has been replaced."],"tags":["filesystem","dex","file-not-found","android"],"backgroundTag":"file-not-found","analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}