feat: use more pipes

This commit is contained in:
Simon Chan 2022-02-16 18:09:20 +08:00
parent 86d518fdab
commit 8b78c9c331
18 changed files with 392 additions and 316 deletions

View file

@ -67,7 +67,8 @@ export class Adb {
): Promise<void> {
await this.backend.connect?.();
this.packetDispatcher.maxPayloadSize = 0x1000;
this.packetDispatcher.calculateChecksum = true;
// TODO: Adb: properly set `calculateChecksum`
// this.packetDispatcher.calculateChecksum = true;
this.packetDispatcher.appendNullToServiceString = true;
this.packetDispatcher.start();
@ -224,7 +225,7 @@ export class Adb {
return this.packetDispatcher.createSocket(service);
}
public async createSocketAndReadAll(service: string): Promise<string> {
public async createSocketAndWait(service: string): Promise<string> {
const socket = await this.createSocket(service);
let result = '';
for await (const chunk of socket.readable) {