MCPcopy Create free account
hub / github.com/firebase/firebase-tools / extractAppIdentifiersAndroid

Function extractAppIdentifiersAndroid

src/appUtils.ts:305–324  ·  view source on GitHub ↗
(fileContent: string)

Source from the content-addressed store, hash-verified

303 * @return a list of mobilesdk_app_id and package_name values.
304 */
305export 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.

Callers 1

appUtils.spec.tsFile · 0.90

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…