| 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, |