MCPcopy Create free account
hub / github.com/APKLab/APKLab / functionToPath

Function functionToPath

src/tools/quark-engine.ts:117–136  ·  view source on GitHub ↗

* Convert function name to the path of the source code file. * @param srcDir The source directory to search in. * @param func The function object with class name. * @return The path of the source code file.

(srcDir: string, func: QuarkFunction)

Source from the content-addressed store, hash-verified

115 * @return The path of the source code file.
116 */
117function functionToPath(srcDir: string, func: QuarkFunction): string {
118 outputChannel.appendLine(`Searching smali file: ${func.class}`);
119 let srcPath = glob.sync(`${srcDir}/smali*/${func.class}.smali`, {});
120
121 if (func.class[0] === "L") {
122 srcPath = glob.sync(
123 `${srcDir}/smali*/${func.class.substring(1)}.smali`,
124 {},
125 );
126 }
127
128 if (srcPath.length === 0) {
129 outputChannel.appendLine(
130 `Warning: No smali file found for ${func.class}`,
131 );
132 return "";
133 }
134
135 return srcPath[0];
136}
137
138/**
139 * Find a specific function in the segment of the given text document.

Callers 1

navigateSourceCodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected