MCPcopy
hub / github.com/yume-chan/ya-webadb / pushAndInstallStream

Method pushAndInstallStream

libraries/android-bin/src/pm.ts:329–352  ·  view source on GitHub ↗
(
        stream: ReadableStream<MaybeConsumable<Uint8Array>>,
        options?: Partial<PackageManagerInstallOptions>,
    )

Source from the content-addressed store, hash-verified

327 }
328
329 async pushAndInstallStream(
330 stream: ReadableStream<MaybeConsumable<Uint8Array>>,
331 options?: Partial<PackageManagerInstallOptions>,
332 ): Promise<string> {
333 const fileName = Math.random().toString().substring(2);
334 const filePath = `/data/local/tmp/${fileName}.apk`;
335
336 const sync = await this.adb.sync();
337
338 try {
339 await sync.write({
340 filename: filePath,
341 file: stream,
342 });
343 } finally {
344 await sync.dispose();
345 }
346
347 try {
348 return await this.install([filePath], options);
349 } finally {
350 await this.adb.rm(filePath);
351 }
352 }
353
354 async installStream(
355 size: number,

Callers 1

installStreamMethod · 0.95

Calls 7

installMethod · 0.95
toStringMethod · 0.80
randomMethod · 0.80
syncMethod · 0.80
rmMethod · 0.80
writeMethod · 0.65
disposeMethod · 0.65

Tested by

no test coverage detected