@yume-chan/adb 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +57 -0
- package/CHANGELOG.md +26 -1
- package/README.md +222 -103
- package/esm/adb.d.ts +28 -45
- package/esm/adb.d.ts.map +1 -1
- package/esm/adb.js +34 -213
- package/esm/adb.js.map +1 -1
- package/esm/banner.d.ts +17 -0
- package/esm/banner.d.ts.map +1 -0
- package/esm/banner.js +67 -0
- package/esm/banner.js.map +1 -0
- package/esm/commands/base.d.ts.map +1 -1
- package/esm/commands/base.js.map +1 -1
- package/esm/commands/framebuffer.d.ts +9 -0
- package/esm/commands/framebuffer.d.ts.map +1 -1
- package/esm/commands/framebuffer.js +27 -3
- package/esm/commands/framebuffer.js.map +1 -1
- package/esm/commands/power.d.ts +1 -1
- package/esm/commands/power.d.ts.map +1 -1
- package/esm/commands/power.js +2 -2
- package/esm/commands/power.js.map +1 -1
- package/esm/commands/reverse.d.ts +17 -18
- package/esm/commands/reverse.d.ts.map +1 -1
- package/esm/commands/reverse.js +53 -48
- package/esm/commands/reverse.js.map +1 -1
- package/esm/commands/subprocess/command.d.ts +1 -1
- package/esm/commands/subprocess/command.d.ts.map +1 -1
- package/esm/commands/subprocess/command.js +15 -13
- package/esm/commands/subprocess/command.js.map +1 -1
- package/esm/commands/subprocess/protocols/none.d.ts +3 -8
- package/esm/commands/subprocess/protocols/none.d.ts.map +1 -1
- package/esm/commands/subprocess/protocols/none.js +16 -16
- package/esm/commands/subprocess/protocols/none.js.map +1 -1
- package/esm/commands/subprocess/protocols/shell.d.ts +3 -9
- package/esm/commands/subprocess/protocols/shell.d.ts.map +1 -1
- package/esm/commands/subprocess/protocols/shell.js +63 -57
- package/esm/commands/subprocess/protocols/shell.js.map +1 -1
- package/esm/commands/subprocess/protocols/types.d.ts +1 -2
- package/esm/commands/subprocess/protocols/types.d.ts.map +1 -1
- package/esm/commands/sync/list.js +2 -2
- package/esm/commands/sync/push.d.ts +14 -3
- package/esm/commands/sync/push.d.ts.map +1 -1
- package/esm/commands/sync/push.js +9 -9
- package/esm/commands/sync/push.js.map +1 -1
- package/esm/commands/sync/request.js +2 -2
- package/esm/commands/sync/request.js.map +1 -1
- package/esm/commands/sync/response.d.ts +5 -3
- package/esm/commands/sync/response.d.ts.map +1 -1
- package/esm/commands/sync/response.js +7 -5
- package/esm/commands/sync/response.js.map +1 -1
- package/esm/commands/sync/socket.d.ts +8 -14
- package/esm/commands/sync/socket.d.ts.map +1 -1
- package/esm/commands/sync/socket.js +35 -32
- package/esm/commands/sync/socket.js.map +1 -1
- package/esm/commands/sync/stat.js +4 -4
- package/esm/commands/sync/stat.js.map +1 -1
- package/esm/commands/sync/sync.d.ts +26 -18
- package/esm/commands/sync/sync.d.ts.map +1 -1
- package/esm/commands/sync/sync.js +36 -25
- package/esm/commands/sync/sync.js.map +1 -1
- package/esm/commands/tcpip.d.ts +2 -2
- package/esm/commands/tcpip.d.ts.map +1 -1
- package/esm/commands/tcpip.js +4 -2
- package/esm/commands/tcpip.js.map +1 -1
- package/esm/{auth.d.ts → daemon/auth.d.ts} +12 -11
- package/esm/daemon/auth.d.ts.map +1 -0
- package/esm/{auth.js → daemon/auth.js} +31 -22
- package/esm/daemon/auth.js.map +1 -0
- package/esm/{crypto.d.ts → daemon/crypto.d.ts} +5 -5
- package/esm/daemon/crypto.d.ts.map +1 -0
- package/esm/{crypto.js → daemon/crypto.js} +24 -28
- package/esm/daemon/crypto.js.map +1 -0
- package/esm/{backend.d.ts → daemon/device.d.ts} +2 -2
- package/esm/daemon/device.d.ts.map +1 -0
- package/esm/daemon/device.js +2 -0
- package/esm/daemon/device.js.map +1 -0
- package/esm/{socket → daemon}/dispatcher.d.ts +12 -30
- package/esm/daemon/dispatcher.d.ts.map +1 -0
- package/esm/{socket → daemon}/dispatcher.js +80 -78
- package/esm/daemon/dispatcher.js.map +1 -0
- package/esm/daemon/index.d.ts +8 -0
- package/esm/daemon/index.d.ts.map +1 -0
- package/esm/daemon/index.js +8 -0
- package/esm/daemon/index.js.map +1 -0
- package/esm/{packet.d.ts → daemon/packet.d.ts} +4 -4
- package/esm/daemon/packet.d.ts.map +1 -0
- package/esm/{packet.js → daemon/packet.js} +2 -2
- package/esm/{packet.js.map → daemon/packet.js.map} +1 -1
- package/esm/{socket → daemon}/socket.d.ts +15 -19
- package/esm/daemon/socket.d.ts.map +1 -0
- package/esm/{socket → daemon}/socket.js +49 -42
- package/esm/daemon/socket.js.map +1 -0
- package/esm/daemon/transport.d.ts +53 -0
- package/esm/daemon/transport.d.ts.map +1 -0
- package/esm/daemon/transport.js +186 -0
- package/esm/daemon/transport.js.map +1 -0
- package/esm/features.js +1 -1
- package/esm/features.js.map +1 -1
- package/esm/index.d.ts +3 -5
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +3 -5
- package/esm/index.js.map +1 -1
- package/esm/server/client.d.ts +78 -0
- package/esm/server/client.d.ts.map +1 -0
- package/esm/server/client.js +328 -0
- package/esm/server/client.js.map +1 -0
- package/esm/server/index.d.ts +3 -0
- package/esm/server/index.d.ts.map +1 -0
- package/esm/server/index.js +3 -0
- package/esm/server/index.js.map +1 -0
- package/esm/server/transport.d.ts +19 -0
- package/esm/server/transport.d.ts.map +1 -0
- package/esm/server/transport.js +44 -0
- package/esm/server/transport.js.map +1 -0
- package/esm/utils/auto-reset-event.d.ts +1 -2
- package/esm/utils/auto-reset-event.d.ts.map +1 -1
- package/esm/utils/auto-reset-event.js +12 -12
- package/esm/utils/auto-reset-event.js.map +1 -1
- package/esm/utils/base64.js +5 -5
- package/esm/utils/base64.js.map +1 -1
- package/esm/utils/conditional-variable.d.ts +1 -2
- package/esm/utils/conditional-variable.d.ts.map +1 -1
- package/esm/utils/conditional-variable.js +10 -10
- package/esm/utils/conditional-variable.js.map +1 -1
- package/esm/utils/hex.d.ts +3 -0
- package/esm/utils/hex.d.ts.map +1 -0
- package/esm/utils/hex.js +55 -0
- package/esm/utils/hex.js.map +1 -0
- package/esm/utils/index.d.ts +2 -0
- package/esm/utils/index.d.ts.map +1 -1
- package/esm/utils/index.js +2 -0
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/no-op.d.ts +7 -0
- package/esm/utils/no-op.d.ts.map +1 -0
- package/esm/utils/no-op.js +12 -0
- package/esm/utils/no-op.js.map +1 -0
- package/package.json +12 -12
- package/src/adb.ts +75 -274
- package/src/banner.ts +82 -0
- package/src/commands/base.ts +1 -1
- package/src/commands/framebuffer.ts +31 -3
- package/src/commands/power.ts +10 -10
- package/src/commands/reverse.ts +77 -82
- package/src/commands/subprocess/command.ts +24 -25
- package/src/commands/subprocess/protocols/none.ts +29 -30
- package/src/commands/subprocess/protocols/shell.ts +87 -89
- package/src/commands/subprocess/protocols/types.ts +1 -2
- package/src/commands/sync/list.ts +7 -7
- package/src/commands/sync/pull.ts +4 -4
- package/src/commands/sync/push.ts +28 -16
- package/src/commands/sync/request.ts +4 -4
- package/src/commands/sync/response.ts +13 -11
- package/src/commands/sync/socket.ts +48 -46
- package/src/commands/sync/stat.ts +5 -5
- package/src/commands/sync/sync.ts +55 -43
- package/src/commands/tcpip.ts +6 -4
- package/src/{auth.ts → daemon/auth.ts} +62 -43
- package/src/{crypto.ts → daemon/crypto.ts} +33 -41
- package/src/{backend.ts → daemon/device.ts} +1 -1
- package/src/{socket → daemon}/dispatcher.ts +103 -109
- package/src/daemon/index.ts +7 -0
- package/src/{packet.ts → daemon/packet.ts} +6 -6
- package/src/{socket → daemon}/socket.ts +77 -67
- package/src/daemon/transport.ts +281 -0
- package/src/index.ts +3 -5
- package/src/server/client.ts +473 -0
- package/src/server/index.ts +2 -0
- package/src/server/transport.ts +77 -0
- package/src/utils/auto-reset-event.ts +16 -16
- package/src/utils/base64.ts +5 -5
- package/src/utils/conditional-variable.ts +14 -14
- package/src/utils/hex.ts +58 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/no-op.ts +12 -0
- package/tsconfig.build.json +12 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/esm/auth.d.ts.map +0 -1
- package/esm/auth.js.map +0 -1
- package/esm/backend.d.ts.map +0 -1
- package/esm/backend.js +0 -2
- package/esm/backend.js.map +0 -1
- package/esm/commands/install.d.ts +0 -10
- package/esm/commands/install.d.ts.map +0 -1
- package/esm/commands/install.js +0 -29
- package/esm/commands/install.js.map +0 -1
- package/esm/crypto.d.ts.map +0 -1
- package/esm/crypto.js.map +0 -1
- package/esm/packet.d.ts.map +0 -1
- package/esm/socket/dispatcher.d.ts.map +0 -1
- package/esm/socket/dispatcher.js.map +0 -1
- package/esm/socket/index.d.ts +0 -3
- package/esm/socket/index.d.ts.map +0 -1
- package/esm/socket/index.js +0 -3
- package/esm/socket/index.js.map +0 -1
- package/esm/socket/socket.d.ts.map +0 -1
- package/esm/socket/socket.js.map +0 -1
- package/src/socket/index.ts +0 -2
|
@@ -1,38 +1,33 @@
|
|
|
1
1
|
import type { Disposable } from "@yume-chan/event";
|
|
2
2
|
import type { Consumable, ReadableStream, ReadableWritablePair, WritableStream } from "@yume-chan/stream-extra";
|
|
3
|
-
import type {
|
|
4
|
-
|
|
3
|
+
import type { Closeable } from "../adb.js";
|
|
4
|
+
import type { AdbPacketDispatcher } from "./dispatcher.js";
|
|
5
|
+
export interface AdbDaemonSocketInfo {
|
|
5
6
|
localId: number;
|
|
6
7
|
remoteId: number;
|
|
7
8
|
localCreated: boolean;
|
|
8
|
-
|
|
9
|
+
service: string;
|
|
9
10
|
}
|
|
10
|
-
export interface
|
|
11
|
+
export interface AdbDaemonSocketConstructionOptions extends AdbDaemonSocketInfo {
|
|
11
12
|
dispatcher: AdbPacketDispatcher;
|
|
12
13
|
highWaterMark?: number | undefined;
|
|
13
14
|
}
|
|
14
|
-
export declare class
|
|
15
|
-
private
|
|
15
|
+
export declare class AdbDaemonSocketController implements AdbDaemonSocketInfo, ReadableWritablePair<Uint8Array, Consumable<Uint8Array>>, Closeable, Disposable {
|
|
16
|
+
#private;
|
|
16
17
|
readonly localId: number;
|
|
17
18
|
readonly remoteId: number;
|
|
18
19
|
readonly localCreated: boolean;
|
|
19
|
-
readonly
|
|
20
|
-
private _duplex;
|
|
21
|
-
private _readable;
|
|
22
|
-
private _readableController;
|
|
20
|
+
readonly service: string;
|
|
23
21
|
get readable(): ReadableStream<Uint8Array>;
|
|
24
|
-
private _writePromise;
|
|
25
22
|
readonly writable: WritableStream<Consumable<Uint8Array>>;
|
|
26
|
-
private _closed;
|
|
27
23
|
/**
|
|
28
24
|
* Whether the socket is half-closed (i.e. the local side initiated the close).
|
|
29
25
|
*
|
|
30
26
|
* It's only used by dispatcher to avoid sending another `CLSE` packet to remote.
|
|
31
27
|
*/
|
|
32
28
|
get closed(): boolean;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
constructor(options: AdbSocketConstructionOptions);
|
|
29
|
+
get socket(): AdbDaemonSocket;
|
|
30
|
+
constructor(options: AdbDaemonSocketConstructionOptions);
|
|
36
31
|
enqueue(data: Uint8Array): Promise<void>;
|
|
37
32
|
ack(): void;
|
|
38
33
|
close(): Promise<void>;
|
|
@@ -46,15 +41,16 @@ export declare class AdbSocketController implements AdbSocketInfo, ReadableWrita
|
|
|
46
41
|
* `socket.writable.abort()`, `socket.writable.getWriter().abort()`,
|
|
47
42
|
* `socket.writable.close()` or `socket.writable.getWriter().close()`.
|
|
48
43
|
*/
|
|
49
|
-
export declare class
|
|
50
|
-
private
|
|
44
|
+
export declare class AdbDaemonSocket implements AdbDaemonSocketInfo, ReadableWritablePair<Uint8Array, Consumable<Uint8Array>> {
|
|
45
|
+
#private;
|
|
51
46
|
get localId(): number;
|
|
52
47
|
get remoteId(): number;
|
|
53
48
|
get localCreated(): boolean;
|
|
54
|
-
get
|
|
49
|
+
get service(): string;
|
|
55
50
|
get readable(): ReadableStream<Uint8Array>;
|
|
56
51
|
get writable(): WritableStream<Consumable<Uint8Array>>;
|
|
57
|
-
|
|
52
|
+
get closed(): boolean;
|
|
53
|
+
constructor(controller: AdbDaemonSocketController);
|
|
58
54
|
close(): Promise<void>;
|
|
59
55
|
}
|
|
60
56
|
//# sourceMappingURL=socket.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../../src/daemon/socket.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EACR,UAAU,EAEV,cAAc,EACd,oBAAoB,EACpB,cAAc,EACjB,MAAM,yBAAyB,CAAC;AASjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAG3D,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IAEjB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kCACb,SAAQ,mBAAmB;IAC3B,UAAU,EAAE,mBAAmB,CAAC;IAEhC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,qBAAa,yBACT,YACI,mBAAmB,EACnB,oBAAoB,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,EACxD,SAAS,EACT,UAAU;;IAId,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAG,OAAO,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAM1B,IAAI,QAAQ,+BAEX;IAGD,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IAG1D;;;;OAIG;IACH,IAAI,MAAM,YAET;IAGD,IAAI,MAAM,oBAET;gBAEW,OAAO,EAAE,kCAAkC;IAqEjD,OAAO,CAAC,IAAI,EAAE,UAAU;IAU9B,GAAG;IAIG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,OAAO;CAGV;AAED;;;;;;;GAOG;AACH,qBAAa,eACT,YACI,mBAAmB,EACnB,oBAAoB,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;;IAI5D,IAAI,OAAO,IAAI,MAAM,CAEpB;IACD,IAAI,QAAQ,IAAI,MAAM,CAErB;IACD,IAAI,YAAY,IAAI,OAAO,CAE1B;IACD,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,QAAQ,IAAI,cAAc,CAAC,UAAU,CAAC,CAEzC;IACD,IAAI,QAAQ,IAAI,cAAc,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAErD;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;gBAEW,UAAU,EAAE,yBAAyB;IAIjD,KAAK;CAGR"}
|
|
@@ -1,84 +1,88 @@
|
|
|
1
1
|
import { PromiseResolver } from "@yume-chan/async";
|
|
2
2
|
import { ConsumableWritableStream, DistributionStream, DuplexStreamFactory, PushReadableStream, pipeFrom, } from "@yume-chan/stream-extra";
|
|
3
|
-
import { AdbCommand } from "
|
|
4
|
-
export class
|
|
5
|
-
dispatcher;
|
|
3
|
+
import { AdbCommand } from "./packet.js";
|
|
4
|
+
export class AdbDaemonSocketController {
|
|
5
|
+
#dispatcher;
|
|
6
6
|
localId;
|
|
7
7
|
remoteId;
|
|
8
8
|
localCreated;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
service;
|
|
10
|
+
#duplex;
|
|
11
|
+
#readable;
|
|
12
|
+
#readableController;
|
|
13
13
|
get readable() {
|
|
14
|
-
return this
|
|
14
|
+
return this.#readable;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
#writePromise;
|
|
17
17
|
writable;
|
|
18
|
-
|
|
18
|
+
#closed = false;
|
|
19
19
|
/**
|
|
20
20
|
* Whether the socket is half-closed (i.e. the local side initiated the close).
|
|
21
21
|
*
|
|
22
22
|
* It's only used by dispatcher to avoid sending another `CLSE` packet to remote.
|
|
23
23
|
*/
|
|
24
24
|
get closed() {
|
|
25
|
-
return this
|
|
25
|
+
return this.#closed;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
#socket;
|
|
28
28
|
get socket() {
|
|
29
|
-
return this
|
|
29
|
+
return this.#socket;
|
|
30
30
|
}
|
|
31
31
|
constructor(options) {
|
|
32
|
-
|
|
32
|
+
this.#dispatcher = options.dispatcher;
|
|
33
|
+
this.localId = options.localId;
|
|
34
|
+
this.remoteId = options.remoteId;
|
|
35
|
+
this.localCreated = options.localCreated;
|
|
36
|
+
this.service = options.service;
|
|
33
37
|
// Check this image to help you understand the stream graph
|
|
34
38
|
// cspell: disable-next-line
|
|
35
39
|
// https://www.plantuml.com/plantuml/png/TL0zoeGm4ErpYc3l5JxyS0yWM6mX5j4C6p4cxcJ25ejttuGX88ZftizxUKmJI275pGhXl0PP_UkfK_CAz5Z2hcWsW9Ny2fdU4C1f5aSchFVxA8vJjlTPRhqZzDQMRB7AklwJ0xXtX0ZSKH1h24ghoKAdGY23FhxC4nS2pDvxzIvxb-8THU0XlEQJ-ZB7SnXTAvc_LhOckhMdLBnbtndpb-SB7a8q2SRD_W00
|
|
36
|
-
this
|
|
40
|
+
this.#duplex = new DuplexStreamFactory({
|
|
37
41
|
close: async () => {
|
|
38
|
-
this
|
|
39
|
-
await this
|
|
42
|
+
this.#closed = true;
|
|
43
|
+
await this.#dispatcher.sendPacket(AdbCommand.Close, this.localId, this.remoteId);
|
|
40
44
|
// Don't `dispose` here, we need to wait for `CLSE` response packet.
|
|
41
45
|
return false;
|
|
42
46
|
},
|
|
43
47
|
dispose: () => {
|
|
44
48
|
// Error out the pending writes
|
|
45
|
-
this
|
|
49
|
+
this.#writePromise?.reject(new Error("Socket closed"));
|
|
46
50
|
},
|
|
47
51
|
});
|
|
48
|
-
this
|
|
49
|
-
this
|
|
52
|
+
this.#readable = this.#duplex.wrapReadable(new PushReadableStream((controller) => {
|
|
53
|
+
this.#readableController = controller;
|
|
50
54
|
}, {
|
|
51
55
|
highWaterMark: options.highWaterMark ?? 16 * 1024,
|
|
52
56
|
size(chunk) {
|
|
53
57
|
return chunk.byteLength;
|
|
54
58
|
},
|
|
55
59
|
}));
|
|
56
|
-
this.writable = pipeFrom(this.
|
|
60
|
+
this.writable = pipeFrom(this.#duplex.createWritable(new ConsumableWritableStream({
|
|
57
61
|
write: async (chunk) => {
|
|
58
62
|
// Wait for an ack packet
|
|
59
|
-
this
|
|
60
|
-
await this
|
|
61
|
-
await this.
|
|
63
|
+
this.#writePromise = new PromiseResolver();
|
|
64
|
+
await this.#dispatcher.sendPacket(AdbCommand.Write, this.localId, this.remoteId, chunk);
|
|
65
|
+
await this.#writePromise.promise;
|
|
62
66
|
},
|
|
63
|
-
})), new DistributionStream(this
|
|
64
|
-
this
|
|
67
|
+
})), new DistributionStream(this.#dispatcher.options.maxPayloadSize));
|
|
68
|
+
this.#socket = new AdbDaemonSocket(this);
|
|
65
69
|
}
|
|
66
70
|
async enqueue(data) {
|
|
67
71
|
// Consumer may abort the `ReadableStream` to close the socket,
|
|
68
72
|
// it's OK to throw away further packets in this case.
|
|
69
|
-
if (this.
|
|
73
|
+
if (this.#readableController.abortSignal.aborted) {
|
|
70
74
|
return;
|
|
71
75
|
}
|
|
72
|
-
await this.
|
|
76
|
+
await this.#readableController.enqueue(data);
|
|
73
77
|
}
|
|
74
78
|
ack() {
|
|
75
|
-
this
|
|
79
|
+
this.#writePromise?.resolve();
|
|
76
80
|
}
|
|
77
81
|
async close() {
|
|
78
|
-
await this.
|
|
82
|
+
await this.#duplex.close();
|
|
79
83
|
}
|
|
80
84
|
dispose() {
|
|
81
|
-
return this.
|
|
85
|
+
return this.#duplex.dispose();
|
|
82
86
|
}
|
|
83
87
|
}
|
|
84
88
|
/**
|
|
@@ -89,31 +93,34 @@ export class AdbSocketController {
|
|
|
89
93
|
* `socket.writable.abort()`, `socket.writable.getWriter().abort()`,
|
|
90
94
|
* `socket.writable.close()` or `socket.writable.getWriter().close()`.
|
|
91
95
|
*/
|
|
92
|
-
export class
|
|
93
|
-
|
|
96
|
+
export class AdbDaemonSocket {
|
|
97
|
+
#controller;
|
|
94
98
|
get localId() {
|
|
95
|
-
return this.
|
|
99
|
+
return this.#controller.localId;
|
|
96
100
|
}
|
|
97
101
|
get remoteId() {
|
|
98
|
-
return this.
|
|
102
|
+
return this.#controller.remoteId;
|
|
99
103
|
}
|
|
100
104
|
get localCreated() {
|
|
101
|
-
return this.
|
|
105
|
+
return this.#controller.localCreated;
|
|
102
106
|
}
|
|
103
|
-
get
|
|
104
|
-
return this.
|
|
107
|
+
get service() {
|
|
108
|
+
return this.#controller.service;
|
|
105
109
|
}
|
|
106
110
|
get readable() {
|
|
107
|
-
return this.
|
|
111
|
+
return this.#controller.readable;
|
|
108
112
|
}
|
|
109
113
|
get writable() {
|
|
110
|
-
return this.
|
|
114
|
+
return this.#controller.writable;
|
|
115
|
+
}
|
|
116
|
+
get closed() {
|
|
117
|
+
return this.#controller.closed;
|
|
111
118
|
}
|
|
112
119
|
constructor(controller) {
|
|
113
|
-
this
|
|
120
|
+
this.#controller = controller;
|
|
114
121
|
}
|
|
115
122
|
close() {
|
|
116
|
-
return this.
|
|
123
|
+
return this.#controller.close();
|
|
117
124
|
}
|
|
118
125
|
}
|
|
119
126
|
//# sourceMappingURL=socket.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"socket.js","sourceRoot":"","sources":["../../src/daemon/socket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AASnD,OAAO,EACH,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,QAAQ,GACX,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAAE,UAAU,EAAE,MAAM,a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D,CAAC;IAED,GAAG;QACC,IAAI,CAAC,aAAa,EAAE,OAAO,EAAE,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,KAAK;QACP,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IAClC,CAAC;CACJ;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,eAAe;IAKxB,WAAW,CAA4B;IAEvC,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;IACpC,CAAC;IACD,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;IACrC,CAAC;IACD,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC;IACzC,CAAC;IACD,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;IACpC,CAAC;IAED,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;IACrC,CAAC;IACD,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;IACrC,CAAC;IAED,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;IACnC,CAAC;IAED,YAAY,UAAqC;QAC7C,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAClC,CAAC;IAED,KAAK;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IACpC,CAAC;CACJ"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Consumable, ReadableWritablePair } from "@yume-chan/stream-extra";
|
|
2
|
+
import type { ValueOrPromise } from "@yume-chan/struct";
|
|
3
|
+
import type { AdbIncomingSocketHandler, AdbSocket, AdbTransport } from "../adb.js";
|
|
4
|
+
import { AdbBanner } from "../banner.js";
|
|
5
|
+
import type { AdbAuthenticator, AdbCredentialStore } from "./auth.js";
|
|
6
|
+
import type { AdbPacketData, AdbPacketInit } from "./packet.js";
|
|
7
|
+
export declare const ADB_DAEMON_VERSION_OMIT_CHECKSUM = 16777217;
|
|
8
|
+
interface AdbDaemonAuthenticationOptions {
|
|
9
|
+
serial: string;
|
|
10
|
+
connection: ReadableWritablePair<AdbPacketData, Consumable<AdbPacketInit>>;
|
|
11
|
+
credentialStore: AdbCredentialStore;
|
|
12
|
+
authenticators?: AdbAuthenticator[];
|
|
13
|
+
/**
|
|
14
|
+
* Whether to preserve the connection open after the `AdbDaemonTransport` is closed.
|
|
15
|
+
*/
|
|
16
|
+
preserveConnection?: boolean | undefined;
|
|
17
|
+
}
|
|
18
|
+
interface AdbDaemonSocketConnectorConstructionOptions {
|
|
19
|
+
serial: string;
|
|
20
|
+
connection: ReadableWritablePair<AdbPacketData, Consumable<AdbPacketInit>>;
|
|
21
|
+
version: number;
|
|
22
|
+
maxPayloadSize: number;
|
|
23
|
+
banner: string;
|
|
24
|
+
/**
|
|
25
|
+
* Whether to preserve the connection open after the `AdbDaemonTransport` is closed.
|
|
26
|
+
*/
|
|
27
|
+
preserveConnection?: boolean | undefined;
|
|
28
|
+
}
|
|
29
|
+
export declare class AdbDaemonTransport implements AdbTransport {
|
|
30
|
+
#private;
|
|
31
|
+
/**
|
|
32
|
+
* Authenticates the connection and creates an `AdbDaemonTransport` instance
|
|
33
|
+
* that can be used by `Adb` class.
|
|
34
|
+
*
|
|
35
|
+
* If an authentication process failed, it's possible to call `authenticate` again
|
|
36
|
+
* on the same connection. Because every time the device receives a `CNXN` packet,
|
|
37
|
+
* it resets all internal state, and starts a new authentication process.
|
|
38
|
+
*/
|
|
39
|
+
static authenticate({ serial, connection, credentialStore, authenticators, preserveConnection, }: AdbDaemonAuthenticationOptions): Promise<AdbDaemonTransport>;
|
|
40
|
+
get serial(): string;
|
|
41
|
+
get protocolVersion(): number;
|
|
42
|
+
get maxPayloadSize(): number;
|
|
43
|
+
get banner(): AdbBanner;
|
|
44
|
+
get disconnected(): Promise<void>;
|
|
45
|
+
constructor({ serial, connection, version, maxPayloadSize, banner, preserveConnection, }: AdbDaemonSocketConnectorConstructionOptions);
|
|
46
|
+
connect(service: string): ValueOrPromise<AdbSocket>;
|
|
47
|
+
addReverseTunnel(handler: AdbIncomingSocketHandler, address?: string): string;
|
|
48
|
+
removeReverseTunnel(address: string): void;
|
|
49
|
+
clearReverseTunnels(): void;
|
|
50
|
+
close(): ValueOrPromise<void>;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/daemon/transport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAMhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,KAAK,EACR,wBAAwB,EACxB,SAAS,EACT,YAAY,EACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAMtE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGhE,eAAO,MAAM,gCAAgC,WAAa,CAAC;AAE3D,UAAU,8BAA8B;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,oBAAoB,CAAC,aAAa,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC;IAC3E,eAAe,EAAE,kBAAkB,CAAC;IACpC,cAAc,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC5C;AAED,UAAU,2CAA2C;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,oBAAoB,CAAC,aAAa,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC;IAC3E,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC5C;AAED,qBAAa,kBAAmB,YAAW,YAAY;;IACnD;;;;;;;OAOG;WACU,YAAY,CAAC,EACtB,MAAM,EACN,UAAU,EACV,eAAe,EACf,cAA2C,EAC3C,kBAAkB,GACrB,EAAE,8BAA8B,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAmI/D,IAAI,MAAM,WAET;IAGD,IAAI,eAAe,WAElB;IAGD,IAAI,cAAc,WAEjB;IAGD,IAAI,MAAM,cAET;IAED,IAAI,YAAY,kBAEf;gBAEW,EACR,MAAM,EACN,UAAU,EACV,OAAO,EACP,cAAc,EACd,MAAM,EACN,kBAAkB,GACrB,EAAE,2CAA2C;IAyB9C,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC;IAInD,gBAAgB,CACZ,OAAO,EAAE,wBAAwB,EACjC,OAAO,CAAC,EAAE,MAAM,GACjB,MAAM;IAST,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI1C,mBAAmB,IAAI,IAAI;IAI3B,KAAK,IAAI,cAAc,CAAC,IAAI,CAAC;CAGhC"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { PromiseResolver } from "@yume-chan/async";
|
|
2
|
+
import { AbortController, ConsumableWritableStream, WritableStream, } from "@yume-chan/stream-extra";
|
|
3
|
+
import { decodeUtf8, encodeUtf8 } from "@yume-chan/struct";
|
|
4
|
+
import { AdbBanner } from "../banner.js";
|
|
5
|
+
import { AdbFeature } from "../features.js";
|
|
6
|
+
import { ADB_DEFAULT_AUTHENTICATORS, AdbAuthenticationProcessor, } from "./auth.js";
|
|
7
|
+
import { AdbPacketDispatcher } from "./dispatcher.js";
|
|
8
|
+
import { AdbCommand, calculateChecksum } from "./packet.js";
|
|
9
|
+
export const ADB_DAEMON_VERSION_OMIT_CHECKSUM = 0x01000001;
|
|
10
|
+
export class AdbDaemonTransport {
|
|
11
|
+
/**
|
|
12
|
+
* Authenticates the connection and creates an `AdbDaemonTransport` instance
|
|
13
|
+
* that can be used by `Adb` class.
|
|
14
|
+
*
|
|
15
|
+
* If an authentication process failed, it's possible to call `authenticate` again
|
|
16
|
+
* on the same connection. Because every time the device receives a `CNXN` packet,
|
|
17
|
+
* it resets all internal state, and starts a new authentication process.
|
|
18
|
+
*/
|
|
19
|
+
static async authenticate({ serial, connection, credentialStore, authenticators = ADB_DEFAULT_AUTHENTICATORS, preserveConnection, }) {
|
|
20
|
+
// Initially, set to highest-supported version and payload size.
|
|
21
|
+
let version = 0x01000001;
|
|
22
|
+
// Android 4: 4K, Android 7: 256K, Android 9: 1M
|
|
23
|
+
let maxPayloadSize = 1024 * 1024;
|
|
24
|
+
const resolver = new PromiseResolver();
|
|
25
|
+
const authProcessor = new AdbAuthenticationProcessor(authenticators, credentialStore);
|
|
26
|
+
// Here is similar to `AdbPacketDispatcher`,
|
|
27
|
+
// But the received packet types and send packet processing are different.
|
|
28
|
+
const abortController = new AbortController();
|
|
29
|
+
const pipe = connection.readable
|
|
30
|
+
.pipeTo(new WritableStream({
|
|
31
|
+
async write(packet) {
|
|
32
|
+
switch (packet.command) {
|
|
33
|
+
case AdbCommand.Connect:
|
|
34
|
+
version = Math.min(version, packet.arg0);
|
|
35
|
+
maxPayloadSize = Math.min(maxPayloadSize, packet.arg1);
|
|
36
|
+
resolver.resolve(decodeUtf8(packet.payload));
|
|
37
|
+
break;
|
|
38
|
+
case AdbCommand.Auth: {
|
|
39
|
+
const response = await authProcessor.process(packet);
|
|
40
|
+
await sendPacket(response);
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
default:
|
|
44
|
+
// Maybe the previous ADB client exited without reading all packets,
|
|
45
|
+
// so they are still waiting in OS internal buffer.
|
|
46
|
+
// Just ignore them.
|
|
47
|
+
// Because a `Connect` packet will reset the device,
|
|
48
|
+
// Eventually there will be `Connect` and `Auth` response packets.
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
}), {
|
|
53
|
+
// Don't cancel the source ReadableStream on AbortSignal abort.
|
|
54
|
+
preventCancel: true,
|
|
55
|
+
signal: abortController.signal,
|
|
56
|
+
})
|
|
57
|
+
.then(() => {
|
|
58
|
+
if (resolver.state === "running") {
|
|
59
|
+
resolver.reject(new Error("Connection closed unexpectedly"));
|
|
60
|
+
}
|
|
61
|
+
}, (e) => {
|
|
62
|
+
resolver.reject(e);
|
|
63
|
+
});
|
|
64
|
+
const writer = connection.writable.getWriter();
|
|
65
|
+
async function sendPacket(init) {
|
|
66
|
+
// Always send checksum in auth steps
|
|
67
|
+
// Because we don't know if the device needs it or not.
|
|
68
|
+
init.checksum = calculateChecksum(init.payload);
|
|
69
|
+
init.magic = init.command ^ 0xffffffff;
|
|
70
|
+
await ConsumableWritableStream.write(writer, init);
|
|
71
|
+
}
|
|
72
|
+
let banner;
|
|
73
|
+
try {
|
|
74
|
+
// https://android.googlesource.com/platform/packages/modules/adb/+/79010dc6d5ca7490c493df800d4421730f5466ca/transport.cpp#1252
|
|
75
|
+
// There are some other feature constants, but some of them are only used by ADB server, not devices (daemons).
|
|
76
|
+
const features = [
|
|
77
|
+
AdbFeature.ShellV2,
|
|
78
|
+
AdbFeature.Cmd,
|
|
79
|
+
AdbFeature.StatV2,
|
|
80
|
+
AdbFeature.ListV2,
|
|
81
|
+
AdbFeature.FixedPushMkdir,
|
|
82
|
+
"apex",
|
|
83
|
+
AdbFeature.Abb,
|
|
84
|
+
// only tells the client the symlink timestamp issue in `adb push --sync` has been fixed.
|
|
85
|
+
// No special handling required.
|
|
86
|
+
"fixed_push_symlink_timestamp",
|
|
87
|
+
AdbFeature.AbbExec,
|
|
88
|
+
"remount_shell",
|
|
89
|
+
"track_app",
|
|
90
|
+
AdbFeature.SendReceiveV2,
|
|
91
|
+
"sendrecv_v2_brotli",
|
|
92
|
+
"sendrecv_v2_lz4",
|
|
93
|
+
"sendrecv_v2_zstd",
|
|
94
|
+
"sendrecv_v2_dry_run_send",
|
|
95
|
+
].join(",");
|
|
96
|
+
await sendPacket({
|
|
97
|
+
command: AdbCommand.Connect,
|
|
98
|
+
arg0: version,
|
|
99
|
+
arg1: maxPayloadSize,
|
|
100
|
+
// The terminating `;` is required in formal definition
|
|
101
|
+
// But ADB daemon (all versions) can still work without it
|
|
102
|
+
payload: encodeUtf8(`host::features=${features}`),
|
|
103
|
+
});
|
|
104
|
+
banner = await resolver.promise;
|
|
105
|
+
}
|
|
106
|
+
finally {
|
|
107
|
+
// When failed, release locks on `connection` so the caller can try again.
|
|
108
|
+
// When success, also release locks so `AdbPacketDispatcher` can use them.
|
|
109
|
+
abortController.abort();
|
|
110
|
+
writer.releaseLock();
|
|
111
|
+
// Wait until pipe stops (`ReadableStream` lock released)
|
|
112
|
+
await pipe;
|
|
113
|
+
}
|
|
114
|
+
return new AdbDaemonTransport({
|
|
115
|
+
serial,
|
|
116
|
+
connection,
|
|
117
|
+
version,
|
|
118
|
+
maxPayloadSize,
|
|
119
|
+
banner,
|
|
120
|
+
preserveConnection,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
#dispatcher;
|
|
124
|
+
#serial;
|
|
125
|
+
get serial() {
|
|
126
|
+
return this.#serial;
|
|
127
|
+
}
|
|
128
|
+
#protocolVersion;
|
|
129
|
+
get protocolVersion() {
|
|
130
|
+
return this.#protocolVersion;
|
|
131
|
+
}
|
|
132
|
+
#maxPayloadSize;
|
|
133
|
+
get maxPayloadSize() {
|
|
134
|
+
return this.#maxPayloadSize;
|
|
135
|
+
}
|
|
136
|
+
#banner;
|
|
137
|
+
get banner() {
|
|
138
|
+
return this.#banner;
|
|
139
|
+
}
|
|
140
|
+
get disconnected() {
|
|
141
|
+
return this.#dispatcher.disconnected;
|
|
142
|
+
}
|
|
143
|
+
constructor({ serial, connection, version, maxPayloadSize, banner, preserveConnection, }) {
|
|
144
|
+
this.#serial = serial;
|
|
145
|
+
this.#banner = AdbBanner.parse(banner);
|
|
146
|
+
let calculateChecksum;
|
|
147
|
+
let appendNullToServiceString;
|
|
148
|
+
if (version >= ADB_DAEMON_VERSION_OMIT_CHECKSUM) {
|
|
149
|
+
calculateChecksum = false;
|
|
150
|
+
appendNullToServiceString = false;
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
calculateChecksum = true;
|
|
154
|
+
appendNullToServiceString = true;
|
|
155
|
+
}
|
|
156
|
+
this.#dispatcher = new AdbPacketDispatcher(connection, {
|
|
157
|
+
calculateChecksum,
|
|
158
|
+
appendNullToServiceString,
|
|
159
|
+
maxPayloadSize,
|
|
160
|
+
preserveConnection,
|
|
161
|
+
});
|
|
162
|
+
this.#protocolVersion = version;
|
|
163
|
+
this.#maxPayloadSize = maxPayloadSize;
|
|
164
|
+
}
|
|
165
|
+
connect(service) {
|
|
166
|
+
return this.#dispatcher.createSocket(service);
|
|
167
|
+
}
|
|
168
|
+
addReverseTunnel(handler, address) {
|
|
169
|
+
if (!address) {
|
|
170
|
+
const id = Math.random().toString().substring(2);
|
|
171
|
+
address = `localabstract:reverse_${id}`;
|
|
172
|
+
}
|
|
173
|
+
this.#dispatcher.addReverseTunnel(address, handler);
|
|
174
|
+
return address;
|
|
175
|
+
}
|
|
176
|
+
removeReverseTunnel(address) {
|
|
177
|
+
this.#dispatcher.removeReverseTunnel(address);
|
|
178
|
+
}
|
|
179
|
+
clearReverseTunnels() {
|
|
180
|
+
this.#dispatcher.clearReverseTunnels();
|
|
181
|
+
}
|
|
182
|
+
close() {
|
|
183
|
+
return this.#dispatcher.close();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=transport.js.map
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AG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YACjD,OAAO,GAAG,yBAAyB,EAAE,EAAE,CAAC;SAC3C;QACD,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,mBAAmB,CAAC,OAAe;QAC/B,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;IAED,mBAAmB;QACf,IAAI,CAAC,WAAW,CAAC,mBAAmB,EAAE,CAAC;IAC3C,CAAC;IAED,KAAK;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IACpC,CAAC;CACJ"}
|
package/esm/features.js
CHANGED
|
@@ -10,5 +10,5 @@ export var AdbFeature;
|
|
|
10
10
|
AdbFeature["Abb"] = "abb";
|
|
11
11
|
AdbFeature["AbbExec"] = "abb_exec";
|
|
12
12
|
AdbFeature["SendReceiveV2"] = "sendrecv_v2";
|
|
13
|
-
})(AdbFeature
|
|
13
|
+
})(AdbFeature || (AdbFeature = {}));
|
|
14
14
|
//# sourceMappingURL=features.js.map
|
package/esm/features.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features.js","sourceRoot":"","sources":["../src/features.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+HAA+H;AAC/H,MAAM,CAAN,IAAY,UASX;AATD,WAAY,UAAU;IAClB,kCAAoB,CAAA;IACpB,yBAAW,CAAA;IACX,gCAAkB,CAAA;IAClB,8BAAgB,CAAA;IAChB,iDAAmC,CAAA;IACnC,yBAAW,CAAA;IACX,kCAAoB,CAAA;IACpB,2CAA6B,CAAA;AACjC,CAAC,EATW,UAAU,
|
|
1
|
+
{"version":3,"file":"features.js","sourceRoot":"","sources":["../src/features.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+HAA+H;AAC/H,MAAM,CAAN,IAAY,UASX;AATD,WAAY,UAAU;IAClB,kCAAoB,CAAA;IACpB,yBAAW,CAAA;IACX,gCAAkB,CAAA;IAClB,8BAAgB,CAAA;IAChB,iDAAmC,CAAA;IACnC,yBAAW,CAAA;IACX,kCAAoB,CAAA;IACpB,2CAA6B,CAAA;AACjC,CAAC,EATW,UAAU,KAAV,UAAU,QASrB"}
|
package/esm/index.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
export * from "./adb.js";
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./backend.js";
|
|
2
|
+
export * from "./banner.js";
|
|
4
3
|
export * from "./commands/index.js";
|
|
5
|
-
export * from "./
|
|
4
|
+
export * from "./daemon/index.js";
|
|
6
5
|
export * from "./features.js";
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./socket/index.js";
|
|
6
|
+
export * from "./server/index.js";
|
|
9
7
|
export * from "./utils/index.js";
|
|
10
8
|
//# sourceMappingURL=index.d.ts.map
|
package/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
|
package/esm/index.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
export * from "./adb.js";
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./backend.js";
|
|
2
|
+
export * from "./banner.js";
|
|
4
3
|
export * from "./commands/index.js";
|
|
5
|
-
export * from "./
|
|
4
|
+
export * from "./daemon/index.js";
|
|
6
5
|
export * from "./features.js";
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./socket/index.js";
|
|
6
|
+
export * from "./server/index.js";
|
|
9
7
|
export * from "./utils/index.js";
|
|
10
8
|
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { AbortSignal, ReadableWritablePair, WritableStreamDefaultWriter } from "@yume-chan/stream-extra";
|
|
2
|
+
import type { AsyncExactReadable, ExactReadable, ValueOrPromise } from "@yume-chan/struct";
|
|
3
|
+
import type { AdbIncomingSocketHandler, AdbSocket } from "../adb.js";
|
|
4
|
+
import type { AdbFeature } from "../features.js";
|
|
5
|
+
import { AdbServerTransport } from "./transport.js";
|
|
6
|
+
export interface AdbServerConnectionOptions {
|
|
7
|
+
unref?: boolean | undefined;
|
|
8
|
+
signal?: AbortSignal | undefined;
|
|
9
|
+
}
|
|
10
|
+
export interface AdbServerConnection {
|
|
11
|
+
connect(options?: AdbServerConnectionOptions): ValueOrPromise<ReadableWritablePair<Uint8Array, Uint8Array>>;
|
|
12
|
+
addReverseTunnel(handler: AdbIncomingSocketHandler, address?: string): ValueOrPromise<string>;
|
|
13
|
+
removeReverseTunnel(address: string): ValueOrPromise<void>;
|
|
14
|
+
clearReverseTunnels(): ValueOrPromise<void>;
|
|
15
|
+
}
|
|
16
|
+
export interface AdbServerSocket extends AdbSocket {
|
|
17
|
+
transportId: bigint;
|
|
18
|
+
}
|
|
19
|
+
export type AdbServerDeviceSelector = {
|
|
20
|
+
serial: string;
|
|
21
|
+
} | {
|
|
22
|
+
transportId: bigint;
|
|
23
|
+
} | {
|
|
24
|
+
usb: true;
|
|
25
|
+
} | {
|
|
26
|
+
tcp: true;
|
|
27
|
+
} | undefined;
|
|
28
|
+
export interface AdbServerDevice {
|
|
29
|
+
serial: string;
|
|
30
|
+
product?: string | undefined;
|
|
31
|
+
model?: string | undefined;
|
|
32
|
+
device?: string | undefined;
|
|
33
|
+
transportId: bigint;
|
|
34
|
+
}
|
|
35
|
+
export declare class AdbServerClient {
|
|
36
|
+
static readonly VERSION = 41;
|
|
37
|
+
readonly connection: AdbServerConnection;
|
|
38
|
+
constructor(connection: AdbServerConnection);
|
|
39
|
+
static readString(stream: ExactReadable): string;
|
|
40
|
+
static readString(stream: AsyncExactReadable): PromiseLike<string>;
|
|
41
|
+
static writeString(writer: WritableStreamDefaultWriter<Uint8Array>, value: string): Promise<void>;
|
|
42
|
+
static readOkay(stream: ExactReadable | AsyncExactReadable): Promise<void>;
|
|
43
|
+
connect(request: string, options?: AdbServerConnectionOptions): Promise<ReadableWritablePair<Uint8Array, Uint8Array>>;
|
|
44
|
+
getVersion(): Promise<number>;
|
|
45
|
+
validateVersion(): Promise<void>;
|
|
46
|
+
killServer(): Promise<void>;
|
|
47
|
+
getServerFeatures(): Promise<AdbFeature[]>;
|
|
48
|
+
getDevices(): Promise<AdbServerDevice[]>;
|
|
49
|
+
formatDeviceService(device: AdbServerDeviceSelector, command: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* Gets the features supported by the device.
|
|
52
|
+
* The transport ID of the selected device is also returned,
|
|
53
|
+
* so the caller can execute other commands against the same device.
|
|
54
|
+
* @param device The device selector
|
|
55
|
+
* @returns The transport ID of the selected device, and the features supported by the device.
|
|
56
|
+
*/
|
|
57
|
+
getDeviceFeatures(device: AdbServerDeviceSelector): Promise<{
|
|
58
|
+
transportId: bigint;
|
|
59
|
+
features: AdbFeature[];
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Creates a connection that will forward the service to device.
|
|
63
|
+
* @param device The device selector
|
|
64
|
+
* @param service The service to forward
|
|
65
|
+
* @returns An `AdbServerSocket` that can be used to communicate with the service
|
|
66
|
+
*/
|
|
67
|
+
connectDevice(device: AdbServerDeviceSelector, service: string): Promise<AdbServerSocket>;
|
|
68
|
+
/**
|
|
69
|
+
* Wait for a device to be connected or disconnected.
|
|
70
|
+
* @param device The device selector
|
|
71
|
+
* @param state The state to wait for
|
|
72
|
+
* @param options The options
|
|
73
|
+
* @returns A promise that resolves when the condition is met.
|
|
74
|
+
*/
|
|
75
|
+
waitFor(device: AdbServerDeviceSelector, state: "device" | "disconnect", options?: AdbServerConnectionOptions): Promise<void>;
|
|
76
|
+
createTransport(device: AdbServerDeviceSelector): Promise<AdbServerTransport>;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/server/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,WAAW,EAEX,oBAAoB,EACpB,2BAA2B,EAC9B,MAAM,yBAAyB,CAAC;AAOjC,OAAO,KAAK,EACR,kBAAkB,EAClB,aAAa,EACb,cAAc,EACjB,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAErE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,WAAW,0BAA0B;IACvC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,MAAM,CAAC,EAAE,WAAW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