MCPcopy Create free account
hub / github.com/callstack/agent-device / detectAndroidArtifactKind

Function detectAndroidArtifactKind

src/daemon/artifact-materialization.ts:112–125  ·  view source on GitHub ↗
(archivePath: string)

Source from the content-addressed store, hash-verified

110}
111
112async function detectAndroidArtifactKind(archivePath: string): Promise<'apk' | 'aab'> {
113 const extension = path.extname(archivePath).toLowerCase();
114 if (extension === '.apk') return 'apk';
115 if (extension === '.aab') return 'aab';
116
117 const entries = await readZipEntries(archivePath);
118 if (entries?.includes('BundleConfig.pb')) return 'aab';
119 if (entries?.includes('AndroidManifest.xml')) return 'apk';
120
121 throw new AppError(
122 'INVALID_ARGS',
123 `Android artifact URLs must resolve to .apk or .aab files, got "${path.basename(archivePath)}"`,
124 );
125}
126
127async function detectIosArtifactKind(archivePath: string): Promise<'app-tar' | 'ipa'> {
128 if (isTarLikePath(archivePath)) return 'app-tar';

Callers 1

resolveAndroidArtifactFunction · 0.85

Calls 1

readZipEntriesFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…