MCPcopy
hub / github.com/APKLab/APKLab / findApktoolProjectRoot

Function findApktoolProjectRoot

src/tools/smali-lsp.ts:31–42  ·  view source on GitHub ↗

* Find the APKTool project root by walking up from the given directory.

(startPath: string)

Source from the content-addressed store, hash-verified

29 * Find the APKTool project root by walking up from the given directory.
30 */
31function findApktoolProjectRoot(startPath: string): string | null {
32 let dir = startPath;
33 for (let i = 0; i < 10; i++) {
34 if (fs.existsSync(path.join(dir, APKTOOL_YML_FILENAME))) {
35 return dir;
36 }
37 const parent = path.dirname(dir);
38 if (parent === dir) break;
39 dir = parent;
40 }
41 return null;
42}
43
44/**
45 * Resolve the path to smali-lsp server JAR from user config.

Callers 1

startServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected