* 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)
| 115 | * @return The path of the source code file. |
| 116 | */ |
| 117 | function 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. |
no outgoing calls
no test coverage detected