* Find the APKTool project root from a file path.
(filePath: string)
| 166 | * Find the APKTool project root from a file path. |
| 167 | */ |
| 168 | function findProjectRoot(filePath: string): string | null { |
| 169 | let dir = path.dirname(filePath); |
| 170 | for (let i = 0; i < 10; i++) { |
| 171 | if (fs.existsSync(path.join(dir, APKTOOL_YML_FILENAME))) { |
| 172 | return dir; |
| 173 | } |
| 174 | const parent = path.dirname(dir); |
| 175 | if (parent === dir) break; |
| 176 | dir = parent; |
| 177 | } |
| 178 | return null; |
| 179 | } |
| 180 | |
| 181 | export namespace frida { |
| 182 | /** |