Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 4fbd24fc authored by Simon Chan's avatar Simon Chan
Browse files

fix(adb): fix connecting old devices in server mode

parent 06b3f476
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -89,13 +89,8 @@ export class AdbSubprocessShellProtocol implements AdbSubprocessProtocol {
    constructor(socket: AdbSocket) {
        this.#socket = socket;

        // Check this image to help you understand the stream graph
        // cspell: disable-next-line
        // https://www.plantuml.com/plantuml/png/bL91QiCm4Bpx5SAdv90lb1JISmiw5XzaQKf5PIkiLZIqzEyLSg8ks13gYtOykpFhiOw93N6UGjVDqK7rZsxKqNw0U_NTgVAy4empOy2mm4_olC0VEVEE47GUpnGjKdgXoD76q4GIEpyFhOwP_m28hW0NNzxNUig1_JdW0bA7muFIJDco1daJ_1SAX9bgvoPJPyIkSekhNYctvIGXrCH6tIsPL5fs-s6J5yc9BpWXhKtNdF2LgVYPGM_6GlMwfhWUsIt4lbScANrwlgVVUifPSVi__t44qStnwPvZwobdSmHHlL57p2vFuHS0

        let stdoutController!: PushReadableStreamController<Uint8Array>;
        let stderrController!: PushReadableStreamController<Uint8Array>;

        this.#stdout = new PushReadableStream<Uint8Array>((controller) => {
            stdoutController = controller;
        });
+6 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ import type {
} from "@yume-chan/struct";
import {
    BigIntFieldType,
    EMPTY_UINT8_ARRAY,
    SyncPromise,
    decodeUtf8,
    encodeUtf8,
@@ -92,7 +93,11 @@ export class AdbServerClient {
        return SyncPromise.try(() => stream.readExactly(4))
            .then((buffer) => {
                const length = hexToNumber(buffer);
                if (length === 0) {
                    return EMPTY_UINT8_ARRAY;
                } else {
                    return stream.readExactly(length);
                }
            })
            .then((valueBuffer) => {
                return decodeUtf8(valueBuffer);