@yume-chan/adb 0.0.10 → 0.0.13
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 +50 -0
- package/CHANGELOG.md +29 -1
- package/LICENSE +1 -1
- package/README.md +71 -51
- package/esm/adb.d.ts +48 -0
- package/esm/adb.d.ts.map +1 -0
- package/esm/adb.js +149 -136
- package/esm/adb.js.map +1 -1
- package/{dts → esm}/auth.d.ts +11 -11
- package/esm/auth.d.ts.map +1 -0
- package/esm/auth.js +72 -110
- package/esm/auth.js.map +1 -1
- package/esm/backend.d.ts +9 -0
- package/esm/backend.d.ts.map +1 -0
- package/{dts → esm}/commands/base.d.ts +1 -1
- package/esm/commands/base.d.ts.map +1 -0
- package/esm/commands/base.js +1 -0
- package/esm/commands/base.js.map +1 -1
- package/{dts → esm}/commands/framebuffer.d.ts +3 -3
- package/esm/commands/framebuffer.d.ts.map +1 -0
- package/esm/commands/framebuffer.js +15 -18
- package/esm/commands/framebuffer.js.map +1 -1
- package/esm/commands/index.d.ts +9 -0
- package/esm/commands/index.d.ts.map +1 -0
- package/esm/commands/index.js +8 -8
- package/esm/commands/index.js.map +1 -1
- package/esm/commands/install.d.ts +4 -0
- package/esm/commands/install.d.ts.map +1 -0
- package/esm/commands/install.js +19 -13
- package/esm/commands/install.js.map +1 -1
- package/esm/commands/power.d.ts +23 -0
- package/esm/commands/power.d.ts.map +1 -0
- package/esm/commands/power.js +45 -0
- package/esm/commands/power.js.map +1 -0
- package/{dts → esm}/commands/reverse.d.ts +3 -3
- package/esm/commands/reverse.d.ts.map +1 -0
- package/esm/commands/reverse.js +49 -60
- package/esm/commands/reverse.js.map +1 -1
- package/esm/commands/subprocess/index.d.ts +56 -0
- package/esm/commands/subprocess/index.d.ts.map +1 -0
- package/esm/commands/subprocess/index.js +88 -0
- package/esm/commands/subprocess/index.js.map +1 -0
- package/esm/commands/subprocess/legacy.d.ts +35 -0
- package/esm/commands/subprocess/legacy.d.ts.map +1 -0
- package/esm/commands/subprocess/legacy.js +53 -0
- package/esm/commands/subprocess/legacy.js.map +1 -0
- package/esm/commands/subprocess/protocol.d.ts +39 -0
- package/esm/commands/subprocess/protocol.d.ts.map +1 -0
- package/esm/commands/subprocess/protocol.js +157 -0
- package/esm/commands/subprocess/protocol.js.map +1 -0
- package/esm/commands/subprocess/protocols/index.d.ts +4 -0
- package/esm/commands/subprocess/protocols/index.d.ts.map +1 -0
- package/esm/commands/subprocess/protocols/index.js +4 -0
- package/esm/commands/subprocess/protocols/index.js.map +1 -0
- package/esm/commands/subprocess/protocols/none.d.ts +35 -0
- package/esm/commands/subprocess/protocols/none.d.ts.map +1 -0
- package/esm/commands/subprocess/protocols/none.js +53 -0
- package/esm/commands/subprocess/protocols/none.js.map +1 -0
- package/esm/commands/subprocess/protocols/shell.d.ts +39 -0
- package/esm/commands/subprocess/protocols/shell.d.ts.map +1 -0
- package/esm/commands/subprocess/protocols/shell.js +155 -0
- package/esm/commands/subprocess/protocols/shell.js.map +1 -0
- package/esm/commands/subprocess/protocols/types.d.ts +50 -0
- package/esm/commands/subprocess/protocols/types.d.ts.map +1 -0
- package/esm/commands/{shell → subprocess/protocols}/types.js +0 -0
- package/esm/commands/subprocess/protocols/types.js.map +1 -0
- package/esm/commands/subprocess/types.d.ts +50 -0
- package/esm/commands/subprocess/types.d.ts.map +1 -0
- package/esm/commands/subprocess/types.js +2 -0
- package/esm/commands/{shell → subprocess}/types.js.map +1 -1
- package/{dts/commands/shell → esm/commands/subprocess}/utils.d.ts +0 -0
- package/esm/commands/subprocess/utils.d.ts.map +1 -0
- package/esm/commands/{shell → subprocess}/utils.js +0 -0
- package/esm/commands/subprocess/utils.js.map +1 -0
- package/esm/commands/sync/index.d.ts +8 -0
- package/esm/commands/sync/index.d.ts.map +1 -0
- package/esm/commands/sync/index.js +7 -7
- package/esm/commands/sync/index.js.map +1 -1
- package/esm/commands/sync/list.d.ts +41 -0
- package/esm/commands/sync/list.d.ts.map +1 -0
- package/esm/commands/sync/list.js +52 -20
- package/esm/commands/sync/list.js.map +1 -1
- package/esm/commands/sync/pull.d.ts +11 -0
- package/esm/commands/sync/pull.d.ts.map +1 -0
- package/esm/commands/sync/pull.js +17 -11
- package/esm/commands/sync/pull.js.map +1 -1
- package/esm/commands/sync/push.d.ts +8 -0
- package/esm/commands/sync/push.d.ts.map +1 -0
- package/esm/commands/sync/push.js +19 -37
- package/esm/commands/sync/push.js.map +1 -1
- package/{dts → esm}/commands/sync/request.d.ts +4 -3
- package/esm/commands/sync/request.d.ts.map +1 -0
- package/esm/commands/sync/request.js +25 -27
- package/esm/commands/sync/request.js.map +1 -1
- package/{dts → esm}/commands/sync/response.d.ts +4 -3
- package/esm/commands/sync/response.d.ts.map +1 -0
- package/esm/commands/sync/response.js +17 -20
- package/esm/commands/sync/response.js.map +1 -1
- package/{dts → esm}/commands/sync/stat.d.ts +16 -4
- package/esm/commands/sync/stat.d.ts.map +1 -0
- package/esm/commands/sync/stat.js +38 -30
- package/esm/commands/sync/stat.js.map +1 -1
- package/esm/commands/sync/sync.d.ts +61 -0
- package/esm/commands/sync/sync.d.ts.map +1 -0
- package/esm/commands/sync/sync.js +122 -89
- package/esm/commands/sync/sync.js.map +1 -1
- package/{dts → esm}/commands/tcpip.d.ts +1 -1
- package/{dts → esm}/commands/tcpip.d.ts.map +1 -1
- package/esm/commands/tcpip.js +14 -19
- package/esm/commands/tcpip.js.map +1 -1
- package/esm/crypto.d.ts +37 -0
- package/esm/crypto.d.ts.map +1 -0
- package/esm/crypto.js +77 -62
- package/esm/crypto.js.map +1 -1
- package/esm/features.d.ts +8 -0
- package/esm/features.d.ts.map +1 -0
- package/esm/features.js +7 -3
- package/esm/features.js.map +1 -1
- package/esm/index.d.ts +11 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +10 -10
- package/esm/index.js.map +1 -1
- package/esm/packet.d.ts +47 -0
- package/esm/packet.d.ts.map +1 -0
- package/esm/packet.js +27 -52
- package/esm/packet.js.map +1 -1
- package/esm/socket/controller.d.ts +37 -0
- package/esm/socket/controller.d.ts.map +1 -0
- package/esm/socket/controller.js +52 -66
- package/esm/socket/controller.js.map +1 -1
- package/esm/socket/dispatcher.d.ts +44 -0
- package/esm/socket/dispatcher.d.ts.map +1 -0
- package/esm/socket/dispatcher.js +146 -165
- package/esm/socket/dispatcher.js.map +1 -1
- package/esm/socket/index.d.ts +3 -0
- package/esm/socket/index.d.ts.map +1 -0
- package/esm/socket/index.js +2 -6
- package/esm/socket/index.js.map +1 -1
- package/esm/socket/socket.d.ts +46 -0
- package/esm/socket/socket.d.ts.map +1 -0
- package/esm/socket/socket.js +77 -13
- package/esm/socket/socket.js.map +1 -1
- package/esm/stream/buffered.d.ts +35 -0
- package/esm/stream/buffered.d.ts.map +1 -0
- package/esm/stream/buffered.js +123 -0
- package/esm/stream/buffered.js.map +1 -0
- package/esm/stream/detect.bak.d.ts +240 -0
- package/esm/stream/detect.bak.d.ts.map +1 -0
- package/esm/stream/detect.bak.js +60 -0
- package/esm/stream/detect.bak.js.map +1 -0
- package/esm/stream/detect.d.ts +2 -0
- package/esm/stream/detect.d.ts.map +1 -0
- package/esm/stream/detect.js +5 -0
- package/esm/stream/detect.js.map +1 -0
- package/esm/stream/detect.native.d.ts +240 -0
- package/esm/stream/detect.native.d.ts.map +1 -0
- package/esm/stream/detect.native.js +60 -0
- package/esm/stream/detect.native.js.map +1 -0
- package/esm/stream/detect.polyfill.d.ts +18 -0
- package/esm/stream/detect.polyfill.d.ts.map +1 -0
- package/esm/stream/detect.polyfill.js +9 -0
- package/esm/stream/detect.polyfill.js.map +1 -0
- package/esm/stream/index.d.ts +4 -0
- package/esm/stream/index.d.ts.map +1 -0
- package/esm/stream/index.js +3 -2
- package/esm/stream/index.js.map +1 -1
- package/esm/stream/transform.d.ts +98 -0
- package/esm/stream/transform.d.ts.map +1 -0
- package/esm/stream/transform.js +402 -0
- package/esm/stream/transform.js.map +1 -0
- package/{dts → esm}/utils/auto-reset-event.d.ts +1 -1
- package/esm/utils/auto-reset-event.d.ts.map +1 -0
- package/esm/utils/auto-reset-event.js +2 -1
- package/esm/utils/auto-reset-event.js.map +1 -1
- package/esm/utils/base64.d.ts +5 -0
- package/esm/utils/base64.d.ts.map +1 -0
- package/esm/utils/base64.js +116 -80
- package/esm/utils/base64.js.map +1 -1
- package/esm/utils/encoding.d.ts +3 -0
- package/esm/utils/encoding.d.ts.map +1 -0
- package/esm/utils/encoding.js +1 -1
- package/esm/utils/encoding.js.map +1 -1
- package/esm/utils/index.d.ts +4 -0
- package/esm/utils/index.d.ts.map +1 -0
- package/esm/utils/index.js +3 -5
- package/esm/utils/index.js.map +1 -1
- package/package.json +50 -44
- package/src/adb.ts +177 -150
- package/src/auth.ts +37 -30
- package/src/backend.ts +3 -12
- package/src/commands/base.ts +1 -1
- package/src/commands/framebuffer.ts +4 -4
- package/src/commands/index.ts +8 -8
- package/src/commands/install.ts +24 -15
- package/src/commands/power.ts +54 -0
- package/src/commands/reverse.ts +10 -8
- package/src/commands/subprocess/index.ts +139 -0
- package/src/commands/subprocess/protocols/index.ts +3 -0
- package/src/commands/subprocess/protocols/none.ts +68 -0
- package/src/commands/subprocess/protocols/shell.ts +190 -0
- package/src/commands/subprocess/protocols/types.ts +59 -0
- package/src/commands/{shell → subprocess}/utils.ts +0 -0
- package/src/commands/sync/index.ts +7 -7
- package/src/commands/sync/list.ts +56 -9
- package/src/commands/sync/pull.ts +27 -18
- package/src/commands/sync/push.ts +25 -30
- package/src/commands/sync/request.ts +8 -7
- package/src/commands/sync/response.ts +12 -6
- package/src/commands/sync/stat.ts +43 -14
- package/src/commands/sync/sync.ts +102 -34
- package/src/commands/tcpip.ts +3 -3
- package/src/crypto.ts +95 -84
- package/src/features.ts +6 -2
- package/src/index.ts +11 -10
- package/src/packet.ts +49 -53
- package/src/socket/dispatcher.ts +110 -109
- package/src/socket/index.ts +2 -6
- package/src/socket/socket.ts +125 -17
- package/src/stream/buffered.ts +147 -0
- package/src/stream/detect.native.ts +362 -0
- package/src/stream/detect.polyfill.ts +28 -0
- package/src/stream/detect.ts +5 -0
- package/src/stream/index.ts +3 -2
- package/src/stream/transform.ts +483 -0
- package/src/utils/auto-reset-event.ts +1 -1
- package/src/utils/base64.ts +161 -129
- package/src/utils/index.ts +3 -5
- package/tsconfig.build.json +3 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.test.json +10 -0
- package/dts/adb.d.ts +0 -46
- package/dts/adb.d.ts.map +0 -1
- package/dts/auth.d.ts.map +0 -1
- package/dts/backend.d.ts +0 -13
- package/dts/backend.d.ts.map +0 -1
- package/dts/commands/base.d.ts.map +0 -1
- package/dts/commands/demo-mode.d.ts +0 -41
- package/dts/commands/demo-mode.d.ts.map +0 -1
- package/dts/commands/framebuffer.d.ts.map +0 -1
- package/dts/commands/index.d.ts +0 -9
- package/dts/commands/index.d.ts.map +0 -1
- package/dts/commands/install.d.ts +0 -3
- package/dts/commands/install.d.ts.map +0 -1
- package/dts/commands/reverse.d.ts.map +0 -1
- package/dts/commands/shell/index.d.ts +0 -46
- package/dts/commands/shell/index.d.ts.map +0 -1
- package/dts/commands/shell/legacy.d.ts +0 -38
- package/dts/commands/shell/legacy.d.ts.map +0 -1
- package/dts/commands/shell/protocol.d.ts +0 -45
- package/dts/commands/shell/protocol.d.ts.map +0 -1
- package/dts/commands/shell/types.d.ts +0 -47
- package/dts/commands/shell/types.d.ts.map +0 -1
- package/dts/commands/shell/utils.d.ts.map +0 -1
- package/dts/commands/sync/index.d.ts +0 -8
- package/dts/commands/sync/index.d.ts.map +0 -1
- package/dts/commands/sync/list.d.ts +0 -17
- package/dts/commands/sync/list.d.ts.map +0 -1
- package/dts/commands/sync/pull.d.ts +0 -11
- package/dts/commands/sync/pull.d.ts.map +0 -1
- package/dts/commands/sync/push.d.ts +0 -8
- package/dts/commands/sync/push.d.ts.map +0 -1
- package/dts/commands/sync/request.d.ts.map +0 -1
- package/dts/commands/sync/response.d.ts.map +0 -1
- package/dts/commands/sync/stat.d.ts.map +0 -1
- package/dts/commands/sync/sync.d.ts +0 -68
- package/dts/commands/sync/sync.d.ts.map +0 -1
- package/dts/crypto.d.ts +0 -24
- package/dts/crypto.d.ts.map +0 -1
- package/dts/features.d.ts +0 -6
- package/dts/features.d.ts.map +0 -1
- package/dts/index.d.ts +0 -11
- package/dts/index.d.ts.map +0 -1
- package/dts/packet.d.ts +0 -27
- package/dts/packet.d.ts.map +0 -1
- package/dts/socket/close-event-emitter.d.ts +0 -8
- package/dts/socket/close-event-emitter.d.ts.map +0 -1
- package/dts/socket/controller.d.ts +0 -43
- package/dts/socket/controller.d.ts.map +0 -1
- package/dts/socket/data-event-emitter.d.ts +0 -10
- package/dts/socket/data-event-emitter.d.ts.map +0 -1
- package/dts/socket/dispatcher.d.ts +0 -53
- package/dts/socket/dispatcher.d.ts.map +0 -1
- package/dts/socket/index.d.ts +0 -7
- package/dts/socket/index.d.ts.map +0 -1
- package/dts/socket/logger.d.ts +0 -9
- package/dts/socket/logger.d.ts.map +0 -1
- package/dts/socket/socket.d.ts +0 -22
- package/dts/socket/socket.d.ts.map +0 -1
- package/dts/stream/buffered-stream.d.ts +0 -28
- package/dts/stream/buffered-stream.d.ts.map +0 -1
- package/dts/stream/index.d.ts +0 -3
- package/dts/stream/index.d.ts.map +0 -1
- package/dts/stream/stream.d.ts +0 -15
- package/dts/stream/stream.d.ts.map +0 -1
- package/dts/utils/auto-reset-event.d.ts.map +0 -1
- package/dts/utils/base64.d.ts +0 -7
- package/dts/utils/base64.d.ts.map +0 -1
- package/dts/utils/chunk.d.ts +0 -3
- package/dts/utils/chunk.d.ts.map +0 -1
- package/dts/utils/encoding.d.ts +0 -3
- package/dts/utils/encoding.d.ts.map +0 -1
- package/dts/utils/event-queue.d.ts +0 -35
- package/dts/utils/event-queue.d.ts.map +0 -1
- package/dts/utils/index.d.ts +0 -6
- package/dts/utils/index.d.ts.map +0 -1
- package/esm/commands/demo-mode.js +0 -170
- package/esm/commands/demo-mode.js.map +0 -1
- package/esm/commands/shell/index.js +0 -62
- package/esm/commands/shell/index.js.map +0 -1
- package/esm/commands/shell/legacy.js +0 -49
- package/esm/commands/shell/legacy.js.map +0 -1
- package/esm/commands/shell/protocol.js +0 -106
- package/esm/commands/shell/protocol.js.map +0 -1
- package/esm/commands/shell/utils.js.map +0 -1
- package/esm/socket/close-event-emitter.js +0 -28
- package/esm/socket/close-event-emitter.js.map +0 -1
- package/esm/socket/data-event-emitter.js +0 -25
- package/esm/socket/data-event-emitter.js.map +0 -1
- package/esm/socket/logger.js +0 -2
- package/esm/socket/logger.js.map +0 -1
- package/esm/stream/buffered-stream.js +0 -67
- package/esm/stream/buffered-stream.js.map +0 -1
- package/esm/stream/stream.js +0 -41
- package/esm/stream/stream.js.map +0 -1
- package/esm/utils/chunk.js +0 -70
- package/esm/utils/chunk.js.map +0 -1
- package/esm/utils/event-queue.js +0 -104
- package/esm/utils/event-queue.js.map +0 -1
- package/src/commands/demo-mode.ts +0 -160
- package/src/commands/shell/index.ts +0 -87
- package/src/commands/shell/legacy.ts +0 -59
- package/src/commands/shell/protocol.ts +0 -121
- package/src/commands/shell/types.ts +0 -55
- package/src/socket/close-event-emitter.ts +0 -28
- package/src/socket/controller.ts +0 -105
- package/src/socket/data-event-emitter.ts +0 -27
- package/src/socket/logger.ts +0 -12
- package/src/stream/buffered-stream.ts +0 -92
- package/src/stream/stream.ts +0 -50
- package/src/utils/chunk.ts +0 -70
- package/src/utils/encoding.ts +0 -13
- package/src/utils/event-queue.ts +0 -145
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { PromiseResolver } from "@yume-chan/async";
|
|
2
|
+
import Struct, { placeholder } from "@yume-chan/struct";
|
|
3
|
+
import { AdbFeatures } from "../../../features.js";
|
|
4
|
+
import { pipeFrom, PushReadableStream, StructDeserializeStream, StructSerializeStream, TransformStream, WritableStream } from "../../../stream/index.js";
|
|
5
|
+
import { encodeUtf8 } from "../../../utils/index.js";
|
|
6
|
+
export var AdbShellProtocolId;
|
|
7
|
+
(function (AdbShellProtocolId) {
|
|
8
|
+
AdbShellProtocolId[AdbShellProtocolId["Stdin"] = 0] = "Stdin";
|
|
9
|
+
AdbShellProtocolId[AdbShellProtocolId["Stdout"] = 1] = "Stdout";
|
|
10
|
+
AdbShellProtocolId[AdbShellProtocolId["Stderr"] = 2] = "Stderr";
|
|
11
|
+
AdbShellProtocolId[AdbShellProtocolId["Exit"] = 3] = "Exit";
|
|
12
|
+
AdbShellProtocolId[AdbShellProtocolId["CloseStdin"] = 4] = "CloseStdin";
|
|
13
|
+
AdbShellProtocolId[AdbShellProtocolId["WindowSizeChange"] = 5] = "WindowSizeChange";
|
|
14
|
+
})(AdbShellProtocolId = AdbShellProtocolId || (AdbShellProtocolId = {}));
|
|
15
|
+
// This packet format is used in both direction.
|
|
16
|
+
const AdbShellProtocolPacket = new Struct({ littleEndian: true })
|
|
17
|
+
.uint8('id', placeholder())
|
|
18
|
+
.uint32('length')
|
|
19
|
+
.uint8Array('data', { lengthField: 'length' });
|
|
20
|
+
class StdinSerializeStream extends TransformStream {
|
|
21
|
+
constructor() {
|
|
22
|
+
super({
|
|
23
|
+
transform(chunk, controller) {
|
|
24
|
+
controller.enqueue({
|
|
25
|
+
id: AdbShellProtocolId.Stdin,
|
|
26
|
+
data: chunk,
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
flush() {
|
|
30
|
+
// TODO: AdbShellSubprocessProtocol: support closing stdin
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
class StdoutDeserializeStream extends TransformStream {
|
|
36
|
+
constructor(type) {
|
|
37
|
+
super({
|
|
38
|
+
transform(chunk, controller) {
|
|
39
|
+
if (chunk.id === type) {
|
|
40
|
+
controller.enqueue(chunk.data);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
class MultiplexStream {
|
|
47
|
+
_readable;
|
|
48
|
+
_readableController;
|
|
49
|
+
get readable() { return this._readable; }
|
|
50
|
+
_activeCount = 0;
|
|
51
|
+
constructor() {
|
|
52
|
+
this._readable = new PushReadableStream(controller => {
|
|
53
|
+
this._readableController = controller;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
createWriteable() {
|
|
57
|
+
return new WritableStream({
|
|
58
|
+
start: () => {
|
|
59
|
+
this._activeCount += 1;
|
|
60
|
+
},
|
|
61
|
+
write: async (chunk) => {
|
|
62
|
+
await this._readableController.enqueue(chunk);
|
|
63
|
+
},
|
|
64
|
+
abort: async (e) => {
|
|
65
|
+
this._activeCount -= 1;
|
|
66
|
+
if (this._activeCount === 0) {
|
|
67
|
+
this._readableController.close();
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
close: async () => {
|
|
71
|
+
this._activeCount -= 1;
|
|
72
|
+
if (this._activeCount === 0) {
|
|
73
|
+
this._readableController.close();
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Shell v2 a.k.a Shell Protocol
|
|
81
|
+
*
|
|
82
|
+
* Features:
|
|
83
|
+
* * `stderr`: Yes
|
|
84
|
+
* * `exit` exit code: Yes
|
|
85
|
+
* * `resize`: Yes
|
|
86
|
+
*/
|
|
87
|
+
export class AdbSubprocessShellProtocol {
|
|
88
|
+
static isSupported(adb) {
|
|
89
|
+
return adb.features.includes(AdbFeatures.ShellV2);
|
|
90
|
+
}
|
|
91
|
+
static async pty(adb, command) {
|
|
92
|
+
// TODO: AdbShellSubprocessProtocol: Support setting `XTERM` environment variable
|
|
93
|
+
return new AdbSubprocessShellProtocol(await adb.createSocket(`shell,v2,pty:${command}`));
|
|
94
|
+
}
|
|
95
|
+
static async raw(adb, command) {
|
|
96
|
+
return new AdbSubprocessShellProtocol(await adb.createSocket(`shell,v2,raw:${command}`));
|
|
97
|
+
}
|
|
98
|
+
_socket;
|
|
99
|
+
_socketWriter;
|
|
100
|
+
_stdin;
|
|
101
|
+
get stdin() { return this._stdin; }
|
|
102
|
+
_stdout;
|
|
103
|
+
get stdout() { return this._stdout; }
|
|
104
|
+
_stderr;
|
|
105
|
+
get stderr() { return this._stderr; }
|
|
106
|
+
_exit = new PromiseResolver();
|
|
107
|
+
get exit() { return this._exit.promise; }
|
|
108
|
+
constructor(socket) {
|
|
109
|
+
this._socket = socket;
|
|
110
|
+
// Check this image to help you understand the stream graph
|
|
111
|
+
// cspell: disable-next-line
|
|
112
|
+
// https://www.plantuml.com/plantuml/png/bL91QiCm4Bpx5SAdv90lb1JISmiw5XzaQKf5PIkiLZIqzEyLSg8ks13gYtOykpFhiOw93N6UGjVDqK7rZsxKqNw0U_NTgVAy4empOy2mm4_olC0VEVEE47GUpnGjKdgXoD76q4GIEpyFhOwP_m28hW0NNzxNUig1_JdW0bA7muFIJDco1daJ_1SAX9bgvoPJPyIkSekhNYctvIGXrCH6tIsPL5fs-s6J5yc9BpWXhKtNdF2LgVYPGM_6GlMwfhWUsIt4lbScANrwlgVVUifPSVi__t44qStnwPvZwobdSmHHlL57p2vFuHS0
|
|
113
|
+
// TODO: AdbShellSubprocessProtocol: Optimize stream graph
|
|
114
|
+
const [stdout, stderr] = socket.readable
|
|
115
|
+
.pipeThrough(new StructDeserializeStream(AdbShellProtocolPacket))
|
|
116
|
+
.pipeThrough(new TransformStream({
|
|
117
|
+
transform: (chunk, controller) => {
|
|
118
|
+
if (chunk.id === AdbShellProtocolId.Exit) {
|
|
119
|
+
this._exit.resolve(new Uint8Array(chunk.data)[0]);
|
|
120
|
+
// We can let `StdoutDeserializeStream` to process `AdbShellProtocolId.Exit`,
|
|
121
|
+
// but since we need this `TransformStream` to capture the exit code anyway,
|
|
122
|
+
// terminating child streams here is killing two birds with one stone.
|
|
123
|
+
controller.terminate();
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
controller.enqueue(chunk);
|
|
127
|
+
}
|
|
128
|
+
}))
|
|
129
|
+
.tee();
|
|
130
|
+
this._stdout = stdout
|
|
131
|
+
.pipeThrough(new StdoutDeserializeStream(AdbShellProtocolId.Stdout));
|
|
132
|
+
this._stderr = stderr
|
|
133
|
+
.pipeThrough(new StdoutDeserializeStream(AdbShellProtocolId.Stderr));
|
|
134
|
+
const multiplexer = new MultiplexStream();
|
|
135
|
+
multiplexer.readable
|
|
136
|
+
.pipeThrough(new StructSerializeStream(AdbShellProtocolPacket))
|
|
137
|
+
.pipeTo(socket.writable);
|
|
138
|
+
this._stdin = pipeFrom(multiplexer.createWriteable(), new StdinSerializeStream());
|
|
139
|
+
this._socketWriter = multiplexer.createWriteable().getWriter();
|
|
140
|
+
}
|
|
141
|
+
async resize(rows, cols) {
|
|
142
|
+
await this._socketWriter.write({
|
|
143
|
+
id: AdbShellProtocolId.WindowSizeChange,
|
|
144
|
+
data: encodeUtf8(
|
|
145
|
+
// The "correct" format is `${rows}x${cols},${x_pixels}x${y_pixels}`
|
|
146
|
+
// However, according to https://linux.die.net/man/4/tty_ioctl
|
|
147
|
+
// `x_pixels` and `y_pixels` are not used, so always passing `0` is fine.
|
|
148
|
+
`${rows}x${cols},0x0\0`),
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
kill() {
|
|
152
|
+
return this._socket.close();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=shell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../../../src/commands/subprocess/protocols/shell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,MAAM,EAAE,EAAE,WAAW,EAAwB,MAAM,mBAAmB,CAAC;AAE9E,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAkB,uBAAuB,EAAE,qBAAqB,EAAE,e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3
|
+
import type { AdbSocket } from "../../../socket/index.js";
|
|
4
|
+
import type { ReadableStream, WritableStream } from "../../../stream/index.js";
|
|
5
|
+
export interface AdbSubprocessProtocol {
|
|
6
|
+
/**
|
|
7
|
+
* A WritableStream that writes to the `stdin` pipe.
|
|
8
|
+
*/
|
|
9
|
+
readonly stdin: WritableStream<Uint8Array>;
|
|
10
|
+
/**
|
|
11
|
+
* The `stdout` pipe of the process.
|
|
12
|
+
*/
|
|
13
|
+
readonly stdout: ReadableStream<Uint8Array>;
|
|
14
|
+
/**
|
|
15
|
+
* The `stderr` pipe of the process.
|
|
16
|
+
*
|
|
17
|
+
* Note: Some `AdbSubprocessProtocol` doesn't separate `stdout` and `stderr`,
|
|
18
|
+
* All output will be sent to `stdout`.
|
|
19
|
+
*/
|
|
20
|
+
readonly stderr: ReadableStream<Uint8Array>;
|
|
21
|
+
/**
|
|
22
|
+
* A `Promise` that resolves to the exit code of the process.
|
|
23
|
+
*
|
|
24
|
+
* Note: Some `AdbSubprocessProtocol` doesn't support exit code,
|
|
25
|
+
* They will always resolve it with `0`.
|
|
26
|
+
*/
|
|
27
|
+
readonly exit: Promise<number>;
|
|
28
|
+
/**
|
|
29
|
+
* Resizes the current shell.
|
|
30
|
+
*
|
|
31
|
+
* Some `AdbSubprocessProtocol`s may not support resizing
|
|
32
|
+
* and will ignore calls to this method.
|
|
33
|
+
*/
|
|
34
|
+
resize(rows: number, cols: number): ValueOrPromise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Kills the current process.
|
|
37
|
+
*/
|
|
38
|
+
kill(): ValueOrPromise<void>;
|
|
39
|
+
}
|
|
40
|
+
export interface AdbSubprocessProtocolConstructor {
|
|
41
|
+
/** Returns `true` if the `adb` instance supports this shell */
|
|
42
|
+
isSupported(adb: Adb): ValueOrPromise<boolean>;
|
|
43
|
+
/** Spawns an executable in PTY (interactive) mode. */
|
|
44
|
+
pty(adb: Adb, command: string): ValueOrPromise<AdbSubprocessProtocol>;
|
|
45
|
+
/** Spawns an executable and pipe the output. */
|
|
46
|
+
raw(adb: Adb, command: string): ValueOrPromise<AdbSubprocessProtocol>;
|
|
47
|
+
/** Creates a new `AdbShell` by attaching to an exist `AdbSocket` */
|
|
48
|
+
new (socket: AdbSocket): AdbSubprocessProtocol;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/commands/subprocess/protocols/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/E,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAE3C;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAE5C;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAE5C;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAE/B;;;;;OAKG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IAEzD;;OAEG;IACH,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,gCAAgC;IAC7C,+DAA+D;IAC/D,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IAE/C,sDAAsD;IACtD,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAC;IAEtE,gDAAgD;IAChD,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAC;IAEtE,oEAAoE;IACpE,KAAI,MAAM,EAAE,SAAS,GAAG,qBAAqB,CAAC;CACjD"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/commands/subprocess/protocols/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ValueOrPromise } from "@yume-chan/struct";
|
|
2
|
+
import type { Adb } from "../../adb.js";
|
|
3
|
+
import type { AdbSocket } from "../../socket/index.js";
|
|
4
|
+
import type { ReadableStream, WritableStream } from "../../stream/index.js";
|
|
5
|
+
export interface AdbSubprocessProtocol {
|
|
6
|
+
/**
|
|
7
|
+
* A WritableStream that writes to the `stdin` pipe.
|
|
8
|
+
*/
|
|
9
|
+
readonly stdin: WritableStream<Uint8Array>;
|
|
10
|
+
/**
|
|
11
|
+
* The `stdout` pipe of the process.
|
|
12
|
+
*/
|
|
13
|
+
readonly stdout: ReadableStream<Uint8Array>;
|
|
14
|
+
/**
|
|
15
|
+
* The `stderr` pipe of the process.
|
|
16
|
+
*
|
|
17
|
+
* Note: Some `AdbSubprocessProtocol` doesn't separate `stdout` and `stderr`,
|
|
18
|
+
* All output will be sent to `stdout`.
|
|
19
|
+
*/
|
|
20
|
+
readonly stderr: ReadableStream<Uint8Array>;
|
|
21
|
+
/**
|
|
22
|
+
* A `Promise` that resolves to the exit code of the process.
|
|
23
|
+
*
|
|
24
|
+
* Note: Some `AdbSubprocessProtocol` doesn't support exit code,
|
|
25
|
+
* They will always resolve it with `0`.
|
|
26
|
+
*/
|
|
27
|
+
readonly exit: Promise<number>;
|
|
28
|
+
/**
|
|
29
|
+
* Resizes the current shell.
|
|
30
|
+
*
|
|
31
|
+
* Some `AdbSubprocessProtocol`s may not support resizing
|
|
32
|
+
* and will ignore calls to this method.
|
|
33
|
+
*/
|
|
34
|
+
resize(rows: number, cols: number): ValueOrPromise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Kills the current process.
|
|
37
|
+
*/
|
|
38
|
+
kill(): ValueOrPromise<void>;
|
|
39
|
+
}
|
|
40
|
+
export interface AdbSubprocessProtocolConstructor {
|
|
41
|
+
/** Returns `true` if the `adb` instance supports this shell */
|
|
42
|
+
isSupported(adb: Adb): ValueOrPromise<boolean>;
|
|
43
|
+
/** Spawns an executable in PTY (interactive) mode. */
|
|
44
|
+
pty(adb: Adb, command: string): ValueOrPromise<AdbSubprocessProtocol>;
|
|
45
|
+
/** Spawns an executable and pipe the output. */
|
|
46
|
+
raw(adb: Adb, command: string): ValueOrPromise<AdbSubprocessProtocol>;
|
|
47
|
+
/** Creates a new `AdbShell` by attaching to an exist `AdbSocket` */
|
|
48
|
+
new (socket: AdbSocket): AdbSubprocessProtocol;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/commands/subprocess/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5E,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAE3C;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAE5C;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAE5C;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAE/B;;;;;OAKG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IAEzD;;OAEG;IACH,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,gCAAgC;IAC7C,+DAA+D;IAC/D,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IAE/C,sDAAsD;IACtD,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAC;IAEtE,gDAAgD;IAChD,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAC;IAEtE,oEAAoE;IACpE,KAAI,MAAM,EAAE,SAAS,GAAG,qBAAqB,CAAC;CACjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/commands/
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/commands/subprocess/types.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/commands/subprocess/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,UAmBlC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/commands/subprocess/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,CAAS;IAC/B,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,MAAM,IAAI,GAAG,CAAC;IAEd,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,OAAO,IAAI,EAAE;QACT,MAAM,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACnC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YACd,MAAM,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAC5B,MAAM;SACT;QACD,MAAM,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACnC,oBAAoB;QACpB,MAAM,IAAI,MAAM,CAAC,GAAG,CAAA,MAAM,CAAC;QAC3B,IAAI,GAAG,KAAK,GAAG,CAAC,CAAC;KACpB;IAED,MAAM,IAAI,GAAG,CAAC;IACd,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './list';
|
|
2
|
-
export * from './pull';
|
|
3
|
-
export * from './request';
|
|
4
|
-
export * from './response';
|
|
5
|
-
export * from './push';
|
|
6
|
-
export * from './stat';
|
|
7
|
-
export * from './sync';
|
|
1
|
+
export * from './list.js';
|
|
2
|
+
export * from './pull.js';
|
|
3
|
+
export * from './request.js';
|
|
4
|
+
export * from './response.js';
|
|
5
|
+
export * from './push.js';
|
|
6
|
+
export * from './stat.js';
|
|
7
|
+
export * from './sync.js';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/sync/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/sync/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import Struct from '@yume-chan/struct';
|
|
2
|
+
import type { AdbBufferedStream, WritableStreamDefaultWriter } from '../../stream/index.js';
|
|
3
|
+
import { AdbSyncResponseId } from './response.js';
|
|
4
|
+
import { type AdbSyncStat } from './stat.js';
|
|
5
|
+
export interface AdbSyncEntry extends AdbSyncStat {
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const AdbSyncEntryResponse: Struct<{
|
|
9
|
+
mode: number;
|
|
10
|
+
size: number;
|
|
11
|
+
mtime: number;
|
|
12
|
+
nameLength: number;
|
|
13
|
+
name: string;
|
|
14
|
+
}, "nameLength", {
|
|
15
|
+
readonly type: import("./stat.js").LinuxFileType;
|
|
16
|
+
readonly permission: number;
|
|
17
|
+
id: AdbSyncResponseId.Entry;
|
|
18
|
+
}, undefined>;
|
|
19
|
+
export declare type AdbSyncEntryResponse = typeof AdbSyncEntryResponse['TDeserializeResult'];
|
|
20
|
+
export declare const AdbSyncEntry2Response: Struct<{
|
|
21
|
+
error: import("./stat.js").AdbSyncStatErrorCode;
|
|
22
|
+
dev: bigint;
|
|
23
|
+
ino: bigint;
|
|
24
|
+
mode: number;
|
|
25
|
+
nlink: number;
|
|
26
|
+
uid: number;
|
|
27
|
+
gid: number;
|
|
28
|
+
size: bigint;
|
|
29
|
+
atime: bigint;
|
|
30
|
+
mtime: bigint;
|
|
31
|
+
ctime: bigint;
|
|
32
|
+
nameLength: number;
|
|
33
|
+
name: string;
|
|
34
|
+
}, "nameLength", {
|
|
35
|
+
readonly type: import("./stat.js").LinuxFileType;
|
|
36
|
+
readonly permission: number;
|
|
37
|
+
id: AdbSyncResponseId.Entry2;
|
|
38
|
+
}, undefined>;
|
|
39
|
+
export declare type AdbSyncEntry2Response = typeof AdbSyncEntry2Response['TDeserializeResult'];
|
|
40
|
+
export declare function adbSyncOpenDir(stream: AdbBufferedStream, writer: WritableStreamDefaultWriter<Uint8Array>, path: string, v2: boolean): AsyncGenerator<AdbSyncEntry, void, void>;
|
|
41
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/list.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAE5F,OAAO,EAA4C,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EAA6C,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAExF,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC7C,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;aAKuB,CAAC;AAEzD,oBAAY,oBAAoB,GAAG,OAAO,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;AAErF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;aAKuB,CAAC;AAE1D,oBAAY,qBAAqB,GAAG,OAAO,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;AAYvF,wBAAuB,cAAc,CACjC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,2BAA2B,CAAC,UAAU,CAAC,EAC/C,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,OAAO,GACZ,cAAc,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,CA0C1C"}
|
|
@@ -1,32 +1,64 @@
|
|
|
1
|
-
import { __asyncGenerator, __await } from "tslib";
|
|
2
1
|
import Struct from '@yume-chan/struct';
|
|
3
|
-
import { AdbSyncRequestId, adbSyncWriteRequest } from './request';
|
|
4
|
-
import { AdbSyncDoneResponse, adbSyncReadResponse, AdbSyncResponseId } from './response';
|
|
5
|
-
import { AdbSyncLstatResponse } from './stat';
|
|
2
|
+
import { AdbSyncRequestId, adbSyncWriteRequest } from './request.js';
|
|
3
|
+
import { AdbSyncDoneResponse, adbSyncReadResponse, AdbSyncResponseId } from './response.js';
|
|
4
|
+
import { AdbSyncLstatResponse, AdbSyncStatResponse } from './stat.js';
|
|
6
5
|
export const AdbSyncEntryResponse = new Struct({ littleEndian: true })
|
|
7
6
|
.fields(AdbSyncLstatResponse)
|
|
8
7
|
.uint32('nameLength')
|
|
9
8
|
.string('name', { lengthField: 'nameLength' })
|
|
10
9
|
.extra({ id: AdbSyncResponseId.Entry });
|
|
11
|
-
const
|
|
10
|
+
export const AdbSyncEntry2Response = new Struct({ littleEndian: true })
|
|
11
|
+
.fields(AdbSyncStatResponse)
|
|
12
|
+
.uint32('nameLength')
|
|
13
|
+
.string('name', { lengthField: 'nameLength' })
|
|
14
|
+
.extra({ id: AdbSyncResponseId.Entry2 });
|
|
15
|
+
const LIST_V1_RESPONSE_TYPES = {
|
|
12
16
|
[AdbSyncResponseId.Entry]: AdbSyncEntryResponse,
|
|
13
17
|
[AdbSyncResponseId.Done]: new AdbSyncDoneResponse(AdbSyncEntryResponse.size),
|
|
14
18
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
const LIST_V2_RESPONSE_TYPES = {
|
|
20
|
+
[AdbSyncResponseId.Entry2]: AdbSyncEntry2Response,
|
|
21
|
+
[AdbSyncResponseId.Done]: new AdbSyncDoneResponse(AdbSyncEntry2Response.size),
|
|
22
|
+
};
|
|
23
|
+
export async function* adbSyncOpenDir(stream, writer, path, v2) {
|
|
24
|
+
let requestId;
|
|
25
|
+
let responseType;
|
|
26
|
+
if (v2) {
|
|
27
|
+
requestId = AdbSyncRequestId.List2;
|
|
28
|
+
responseType = LIST_V2_RESPONSE_TYPES;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
requestId = AdbSyncRequestId.List;
|
|
32
|
+
responseType = LIST_V1_RESPONSE_TYPES;
|
|
33
|
+
}
|
|
34
|
+
await adbSyncWriteRequest(writer, requestId, path);
|
|
35
|
+
while (true) {
|
|
36
|
+
const response = await adbSyncReadResponse(stream, responseType);
|
|
37
|
+
switch (response.id) {
|
|
38
|
+
case AdbSyncResponseId.Entry:
|
|
39
|
+
yield {
|
|
40
|
+
mode: response.mode,
|
|
41
|
+
size: BigInt(response.size),
|
|
42
|
+
mtime: BigInt(response.mtime),
|
|
43
|
+
get type() { return response.type; },
|
|
44
|
+
get permission() { return response.permission; },
|
|
45
|
+
name: response.name,
|
|
46
|
+
};
|
|
47
|
+
break;
|
|
48
|
+
case AdbSyncResponseId.Entry2:
|
|
49
|
+
// `LST2` can return error codes for failed `lstat` calls.
|
|
50
|
+
// `LIST` just ignores them.
|
|
51
|
+
// But they only contain `name` so still pretty useless.
|
|
52
|
+
if (response.error !== 0) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
yield response;
|
|
56
|
+
break;
|
|
57
|
+
case AdbSyncResponseId.Done:
|
|
58
|
+
return;
|
|
59
|
+
default:
|
|
60
|
+
throw new Error('Unexpected response id');
|
|
29
61
|
}
|
|
30
|
-
}
|
|
62
|
+
}
|
|
31
63
|
}
|
|
32
64
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/sync/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/sync/list.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAoB,MAAM,WAAW,CAAC;AAMxF,MAAM,CAAC,MAAM,oBAAoB,GAC7B,IAAI,MAAM,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;KAC7B,MAAM,CAAC,oBAAoB,CAAC;KAC5B,MAAM,CAAC,YAAY,CAAC;KACpB,MAAM,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;KAC7C,KAAK,CAAC,EAAE,EAAE,EAAE,iBAAiB,CAAC,KAAc,EAAE,CAAC,CAAC;AAIzD,MAAM,CAAC,MAAM,qBAAqB,GAC9B,IAAI,MAAM,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;KAC7B,MAAM,CAAC,mBAAmB,CAAC;KAC3B,MAAM,CAAC,YAAY,CAAC;KACpB,MAAM,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;KAC7C,KAAK,CAAC,EAAE,EAAE,EAAE,iBAAiB,CAAC,MAAe,EAAE,CAAC,CAAC;AAI1D,MAAM,sBAAsB,GAAG;IAC3B,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,oBAAoB;IAC/C,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,IAAI,mBAAmB,CAAC,oBAAoB,CAAC,IAAI,CAAC;CAC/E,CAAC;AAEF,MAAM,s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AAK,KAAK,CAAC,EAAE;oBACtB,SAAS;iBACZ;gBACD,MAAM,QAAQ,CAAC;gBACf,MAAM;YACV,KAAK,iBAAiB,CAAC,IAAI;gBACvB,OAAO;YACX;gBACI,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;SACjD;KACJ;AACL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Struct from '@yume-chan/struct';
|
|
2
|
+
import { AdbBufferedStream, ReadableStream, WritableStreamDefaultWriter } from '../../stream/index.js';
|
|
3
|
+
import { AdbSyncResponseId } from './response.js';
|
|
4
|
+
export declare const AdbSyncDataResponse: Struct<{
|
|
5
|
+
dataLength: number;
|
|
6
|
+
data: Uint8Array;
|
|
7
|
+
}, "dataLength", {
|
|
8
|
+
id: AdbSyncResponseId.Data;
|
|
9
|
+
}, undefined>;
|
|
10
|
+
export declare function adbSyncPull(stream: AdbBufferedStream, writer: WritableStreamDefaultWriter<Uint8Array>, path: string): ReadableStream<Uint8Array>;
|
|
11
|
+
//# sourceMappingURL=pull.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/pull.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEvG,OAAO,EAA4C,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE5F,eAAO,MAAM,mBAAmB;;;;;aAIuB,CAAC;AAOxD,wBAAgB,WAAW,CACvB,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,2BAA2B,CAAC,UAAU,CAAC,EAC/C,IAAI,EAAE,MAAM,GACb,cAAc,CAAC,UAAU,CAAC,CAsB5B"}
|
|
@@ -1,30 +1,36 @@
|
|
|
1
|
-
import { __asyncGenerator, __await } from "tslib";
|
|
2
1
|
import Struct from '@yume-chan/struct';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { ReadableStream } from '../../stream/index.js';
|
|
3
|
+
import { AdbSyncRequestId, adbSyncWriteRequest } from './request.js';
|
|
4
|
+
import { AdbSyncDoneResponse, adbSyncReadResponse, AdbSyncResponseId } from './response.js';
|
|
5
5
|
export const AdbSyncDataResponse = new Struct({ littleEndian: true })
|
|
6
6
|
.uint32('dataLength')
|
|
7
|
-
.
|
|
7
|
+
.uint8Array('data', { lengthField: 'dataLength' })
|
|
8
8
|
.extra({ id: AdbSyncResponseId.Data });
|
|
9
9
|
const ResponseTypes = {
|
|
10
10
|
[AdbSyncResponseId.Data]: AdbSyncDataResponse,
|
|
11
11
|
[AdbSyncResponseId.Done]: new AdbSyncDoneResponse(AdbSyncDataResponse.size),
|
|
12
12
|
};
|
|
13
|
-
export function adbSyncPull(stream, path) {
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
export function adbSyncPull(stream, writer, path) {
|
|
14
|
+
return new ReadableStream({
|
|
15
|
+
async start() {
|
|
16
|
+
await adbSyncWriteRequest(writer, AdbSyncRequestId.Receive, path);
|
|
17
|
+
},
|
|
18
|
+
async pull(controller) {
|
|
19
|
+
const response = await adbSyncReadResponse(stream, ResponseTypes);
|
|
18
20
|
switch (response.id) {
|
|
19
21
|
case AdbSyncResponseId.Data:
|
|
20
|
-
|
|
22
|
+
controller.enqueue(response.data);
|
|
21
23
|
break;
|
|
22
24
|
case AdbSyncResponseId.Done:
|
|
23
|
-
|
|
25
|
+
controller.close();
|
|
26
|
+
break;
|
|
24
27
|
default:
|
|
25
28
|
throw new Error('Unexpected response id');
|
|
26
29
|
}
|
|
27
30
|
}
|
|
31
|
+
}, {
|
|
32
|
+
highWaterMark: 16 * 1024,
|
|
33
|
+
size(chunk) { return chunk.byteLength; }
|
|
28
34
|
});
|
|
29
35
|
}
|
|
30
36
|
//# sourceMappingURL=pull.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pull.js","sourceRoot":"","sources":["../../../src/commands/sync/pull.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pull.js","sourceRoot":"","sources":["../../../src/commands/sync/pull.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAqB,cAAc,EAA+B,MAAM,uBAAuB,CAAC;AACvG,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE5F,MAAM,CAAC,MAAM,mBAAmB,GAC5B,IAAI,MAAM,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;KAC7B,MAAM,CAAC,YAAY,CAAC;KACpB,UAAU,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;KACjD,KAAK,CAAC,EAAE,EAAE,EAAE,iBAAiB,CAAC,IAAa,EAAE,CAAC,CAAC;AAExD,MAAM,aAAa,GAAG;IAClB,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,mBAAmB;IAC7C,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,IAAI,CAAC;CAC9E,CAAC;AAEF,MAAM,UAAU,WAAW,CACvB,MAAyB,EACzB,MAA+C,EAC/C,IAAY;IAEZ,OAAO,IAAI,cAAc,CAAa;QAClC,KAAK,CAAC,KAAK;YACP,MAAM,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACtE,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,UAAU;YACjB,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;YAClE,QAAQ,QAAQ,CAAC,EAAE,EAAE;gBACjB,KAAK,iBAAiB,CAAC,IAAI;oBACvB,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAK,CAAC,CAAC;oBACnC,MAAM;gBACV,KAAK,iBAAiB,CAAC,IAAI;oBACvB,UAAU,CAAC,KAAK,EAAE,CAAC;oBACnB,MAAM;gBACV;oBACI,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;aACjD;QACL,CAAC;KACJ,EAAE;QACC,aAAa,EAAE,EAAE,GAAG,IAAI;QACxB,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;KAC3C,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Struct from '@yume-chan/struct';
|
|
2
|
+
import { AdbBufferedStream, WritableStream, WritableStreamDefaultWriter } from '../../stream/index.js';
|
|
3
|
+
export declare const AdbSyncOkResponse: Struct<{
|
|
4
|
+
unused: number;
|
|
5
|
+
}, never, {}, undefined>;
|
|
6
|
+
export declare const ADB_SYNC_MAX_PACKET_SIZE: number;
|
|
7
|
+
export declare function adbSyncPush(stream: AdbBufferedStream, writer: WritableStreamDefaultWriter<Uint8Array>, filename: string, mode?: number, mtime?: number, packetSize?: number): WritableStream<Uint8Array>;
|
|
8
|
+
//# sourceMappingURL=push.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/push.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAyB,cAAc,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAK9H,eAAO,MAAM,iBAAiB;;wBAEL,CAAC;AAM1B,eAAO,MAAM,wBAAwB,QAAY,CAAC;AAElD,wBAAgB,WAAW,CACvB,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,2BAA2B,CAAC,UAAU,CAAC,EAC/C,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,MAA2C,EACjD,KAAK,GAAE,MAAgC,EACvC,UAAU,GAAE,MAAiC,GAC9C,cAAc,CAAC,UAAU,CAAC,CAiB5B"}
|