(fileContent: string)
| 303 | * @return a list of mobilesdk_app_id and package_name values. |
| 304 | */ |
| 305 | export function extractAppIdentifiersAndroid(fileContent: string): AppIdentifier[] { |
| 306 | const identifiers: AppIdentifier[] = []; |
| 307 | try { |
| 308 | const config = JSON.parse(fileContent); |
| 309 | if (config.client && Array.isArray(config.client)) { |
| 310 | for (const client of config.client) { |
| 311 | if (client.client_info?.mobilesdk_app_id) { |
| 312 | identifiers.push({ |
| 313 | appId: client.client_info.mobilesdk_app_id, |
| 314 | bundleId: client.client_info.android_client_info?.package_name, |
| 315 | }); |
| 316 | } |
| 317 | } |
| 318 | } |
| 319 | } catch (e) { |
| 320 | // Handle parsing errors if necessary |
| 321 | console.error("Error parsing google-services.json:", e); |
| 322 | } |
| 323 | return identifiers; |
| 324 | } |
| 325 | |
| 326 | /** |
| 327 | * Detects files matching a pattern within a directory, ignoring common dependency and build folders. |
no test coverage detected
searching dependent graphs…