mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-03 09:49:24 +02:00
fix(adb): incorrect endianness in delayed ack
This commit is contained in:
parent
f83ea20291
commit
0424dd703f
5 changed files with 9 additions and 8 deletions
|
@ -4,7 +4,7 @@ import {
|
||||||
delay,
|
delay,
|
||||||
} from "@yume-chan/async";
|
} from "@yume-chan/async";
|
||||||
import {
|
import {
|
||||||
getUint32BigEndian,
|
getUint32LittleEndian,
|
||||||
setUint32LittleEndian,
|
setUint32LittleEndian,
|
||||||
} from "@yume-chan/no-data-view";
|
} from "@yume-chan/no-data-view";
|
||||||
import {
|
import {
|
||||||
|
@ -193,7 +193,7 @@ export class AdbPacketDispatcher implements Closeable {
|
||||||
"Invalid OKAY packet. Payload size should be 4",
|
"Invalid OKAY packet. Payload size should be 4",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
ackBytes = getUint32BigEndian(packet.payload, 0);
|
ackBytes = getUint32LittleEndian(packet.payload, 0);
|
||||||
} else {
|
} else {
|
||||||
if (packet.payload.byteLength !== 0) {
|
if (packet.payload.byteLength !== 0) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// cspell:ignore tport
|
// cspell:ignore tport
|
||||||
|
|
||||||
import { PromiseResolver } from "@yume-chan/async";
|
import { PromiseResolver } from "@yume-chan/async";
|
||||||
|
import { getUint64LittleEndian } from "@yume-chan/no-data-view";
|
||||||
import type {
|
import type {
|
||||||
AbortSignal,
|
AbortSignal,
|
||||||
ReadableWritablePair,
|
ReadableWritablePair,
|
||||||
|
@ -28,7 +29,6 @@ import { AdbBanner } from "../banner.js";
|
||||||
import type { AdbFeature } from "../features.js";
|
import type { AdbFeature } from "../features.js";
|
||||||
import { NOOP, hexToNumber, numberToHex, unreachable } from "../utils/index.js";
|
import { NOOP, hexToNumber, numberToHex, unreachable } from "../utils/index.js";
|
||||||
|
|
||||||
import { getUint64LittleEndian } from "@yume-chan/no-data-view";
|
|
||||||
import { AdbServerTransport } from "./transport.js";
|
import { AdbServerTransport } from "./transport.js";
|
||||||
|
|
||||||
export interface AdbServerConnectionOptions {
|
export interface AdbServerConnectionOptions {
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
import {
|
||||||
|
getUint16BigEndian,
|
||||||
|
getUint32BigEndian,
|
||||||
|
} from "@yume-chan/no-data-view";
|
||||||
import type { ReadableStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream } from "@yume-chan/stream-extra";
|
||||||
import {
|
import {
|
||||||
BufferedReadableStream,
|
BufferedReadableStream,
|
||||||
|
@ -23,10 +27,6 @@ import { ScrcpyVideoCodecId } from "../codec.js";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder, ScrcpyOptions } from "../types.js";
|
import type { ScrcpyDisplay, ScrcpyEncoder, ScrcpyOptions } from "../types.js";
|
||||||
import { toScrcpyOptionValue } from "../types.js";
|
import { toScrcpyOptionValue } from "../types.js";
|
||||||
|
|
||||||
import {
|
|
||||||
getUint16BigEndian,
|
|
||||||
getUint32BigEndian,
|
|
||||||
} from "@yume-chan/no-data-view";
|
|
||||||
import { CodecOptions } from "./codec-options.js";
|
import { CodecOptions } from "./codec-options.js";
|
||||||
import type { ScrcpyOptionsInit1_16 } from "./init.js";
|
import type { ScrcpyOptionsInit1_16 } from "./init.js";
|
||||||
import { ScrcpyLogLevel1_16, ScrcpyVideoOrientation1_16 } from "./init.js";
|
import { ScrcpyLogLevel1_16, ScrcpyVideoOrientation1_16 } from "./init.js";
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { getUint32BigEndian } from "@yume-chan/no-data-view";
|
||||||
import type { ReadableStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream } from "@yume-chan/stream-extra";
|
||||||
import {
|
import {
|
||||||
BufferedReadableStream,
|
BufferedReadableStream,
|
||||||
|
@ -11,7 +12,6 @@ import type {
|
||||||
ScrcpyInjectTouchControlMessage,
|
ScrcpyInjectTouchControlMessage,
|
||||||
} from "../control/index.js";
|
} from "../control/index.js";
|
||||||
|
|
||||||
import { getUint32BigEndian } from "@yume-chan/no-data-view";
|
|
||||||
import {
|
import {
|
||||||
CodecOptions,
|
CodecOptions,
|
||||||
ScrcpyFloatToUint16FieldDefinition,
|
ScrcpyFloatToUint16FieldDefinition,
|
||||||
|
|
|
@ -4,6 +4,7 @@ import {
|
||||||
getUint16,
|
getUint16,
|
||||||
getUint32,
|
getUint32,
|
||||||
} from "@yume-chan/no-data-view";
|
} from "@yume-chan/no-data-view";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
AsyncExactReadable,
|
AsyncExactReadable,
|
||||||
ExactReadable,
|
ExactReadable,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue