@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
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yume-chan/adb",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.0.13",
|
|
6
|
+
"tag": "@yume-chan/adb_v0.0.13",
|
|
7
|
+
"date": "Thu, 28 Apr 2022 01:23:53 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"none": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "Add support for raw shell mode"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"comment": "Add support for LIS2 command in Sync protocol"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"comment": "Add workaround for the push_mkdir issue in Android 9"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"version": "0.0.12",
|
|
24
|
+
"tag": "@yume-chan/adb_v0.0.12",
|
|
25
|
+
"date": "Sun, 03 Apr 2022 11:18:47 GMT",
|
|
26
|
+
"comments": {}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"version": "0.0.11",
|
|
30
|
+
"tag": "@yume-chan/adb_v0.0.11",
|
|
31
|
+
"date": "Sun, 03 Apr 2022 10:54:15 GMT",
|
|
32
|
+
"comments": {
|
|
33
|
+
"none": [
|
|
34
|
+
{
|
|
35
|
+
"comment": "Add power related API"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"comment": "Update compatibility matrix"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"comment": "Update license year"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"patch": [
|
|
45
|
+
{
|
|
46
|
+
"comment": "Update to use Web Streams API"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"comment": "Improve compatibility with Node.js 12 ESM format"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
4
54
|
{
|
|
5
55
|
"version": "0.0.10",
|
|
6
56
|
"tag": "@yume-chan/adb_v0.0.10",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
# Change Log - @yume-chan/adb
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 28 Apr 2022 01:23:53 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.0.13
|
|
6
|
+
Thu, 28 Apr 2022 01:23:53 GMT
|
|
7
|
+
|
|
8
|
+
### Updates
|
|
9
|
+
|
|
10
|
+
- Add support for raw shell mode
|
|
11
|
+
- Add support for LIS2 command in Sync protocol
|
|
12
|
+
- Add workaround for the push_mkdir issue in Android 9
|
|
13
|
+
|
|
14
|
+
## 0.0.12
|
|
15
|
+
Sun, 03 Apr 2022 11:18:47 GMT
|
|
16
|
+
|
|
17
|
+
_Version update only_
|
|
18
|
+
|
|
19
|
+
## 0.0.11
|
|
20
|
+
Sun, 03 Apr 2022 10:54:15 GMT
|
|
21
|
+
|
|
22
|
+
### Patches
|
|
23
|
+
|
|
24
|
+
- Update to use Web Streams API
|
|
25
|
+
- Improve compatibility with Node.js 12 ESM format
|
|
26
|
+
|
|
27
|
+
### Updates
|
|
28
|
+
|
|
29
|
+
- Add power related API
|
|
30
|
+
- Update compatibility matrix
|
|
31
|
+
- Update license year
|
|
4
32
|
|
|
5
33
|
## 0.0.10
|
|
6
34
|
Sun, 09 Jan 2022 15:52:20 GMT
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -5,21 +5,23 @@ TypeScript implementation of Android Debug Bridge (ADB) protocol.
|
|
|
5
5
|
**WARNING:** The public API is UNSTABLE. If you have any questions, please open an issue.
|
|
6
6
|
|
|
7
7
|
- [Compatibility](#compatibility)
|
|
8
|
+
- [Basic usage](#basic-usage)
|
|
9
|
+
- [Use without bundlers](#use-without-bundlers)
|
|
8
10
|
- [Connection](#connection)
|
|
9
11
|
- [Backend](#backend)
|
|
10
12
|
- [`connect`](#connect)
|
|
11
|
-
- [`read`](#read)
|
|
12
|
-
- [`write`](#write)
|
|
13
13
|
- [Authentication](#authentication)
|
|
14
14
|
- [AdbCredentialStore](#adbcredentialstore)
|
|
15
15
|
- [`generateKey`](#generatekey)
|
|
16
16
|
- [`iterateKeys`](#iteratekeys)
|
|
17
17
|
- [Implementations](#implementations)
|
|
18
18
|
- [AdbAuthenticator](#adbauthenticator)
|
|
19
|
+
- [`authenticate`](#authenticate)
|
|
19
20
|
- [Stream multiplex](#stream-multiplex)
|
|
20
|
-
- [Backend](#backend-1)
|
|
21
21
|
- [Commands](#commands)
|
|
22
|
-
- [
|
|
22
|
+
- [subprocess](#subprocess)
|
|
23
|
+
- [raw mode](#raw-mode)
|
|
24
|
+
- [pty mode](#pty-mode)
|
|
23
25
|
- [usb](#usb)
|
|
24
26
|
- [tcpip](#tcpip)
|
|
25
27
|
- [sync](#sync)
|
|
@@ -36,50 +38,46 @@ TypeScript implementation of Android Debug Bridge (ADB) protocol.
|
|
|
36
38
|
|
|
37
39
|
## Compatibility
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
Here is a list of features, their used APIs, and their compatibilities. If an optional feature is not actually used, its requirements can be ignored.
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
Some features can be polyfilled to support older runtimes, but this library doesn't ship with any polyfills.
|
|
42
44
|
|
|
43
|
-
|
|
44
|
-
| --------------- | ------ | ---- | ------- | ----------------- | -------------- | ------- |
|
|
45
|
-
| **Basic usage** | 68 | 79 | 68 | No | 14<sup>1</sup> | 10.4 |
|
|
45
|
+
Each backend may have different requirements.
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
### Basic usage
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
| | Chrome | Edge | Firefox | Internet Explorer | Safari | Node.js |
|
|
50
|
+
| ------------------------------- | ------ | ---- | ------- | ----------------- | ------ | ------------------- |
|
|
51
|
+
| `@yume-chan/struct`<sup>1</sup> | 67 | 79 | 68 | No | 14 | 8.3<sup>2</sup>, 11 |
|
|
52
|
+
| *Overall* | 67 | 79 | No | No | 14.1 | 16.5 |
|
|
53
|
+
|
|
54
|
+
<sup>1</sup> `uint64` and `string` are used.
|
|
55
|
+
|
|
56
|
+
<sup>2</sup> `TextEncoder` and `TextDecoder` are only available in `util` module. Need to be assigned to `globalThis`.
|
|
57
|
+
|
|
58
|
+
### Use without bundlers
|
|
59
|
+
|
|
60
|
+
| | Chrome | Edge | Firefox | Internet Explorer | Safari | Node.js |
|
|
61
|
+
| --------------- | ------ | ---- | ------- | ----------------- | ------ | ------- |
|
|
62
|
+
| Top-level await | 89 | 89 | 89 | No | 15 | 14.8 |
|
|
51
63
|
|
|
52
64
|
## Connection
|
|
53
65
|
|
|
54
66
|
This library doesn't tie to a specific transportation method.
|
|
55
67
|
|
|
56
|
-
Instead, a `Backend` is responsible for transferring data in its own way (USB, WebSocket, etc).
|
|
68
|
+
Instead, a `Backend` is responsible for transferring data in its own way (USB, WebSocket, TCP, etc).
|
|
57
69
|
|
|
58
70
|
### Backend
|
|
59
71
|
|
|
60
72
|
#### `connect`
|
|
61
73
|
|
|
62
|
-
Establishes a connection with the device.
|
|
63
|
-
|
|
64
|
-
If a backend doesn't have extra steps to establish the connection, it can omit the `connect` method implementation.
|
|
65
|
-
|
|
66
|
-
#### `read`
|
|
67
|
-
|
|
68
74
|
```ts
|
|
69
|
-
|
|
75
|
+
connect(): ValueOrPromise<ReadableWritablePair<AdbPacketCore, AdbPacketInit>>
|
|
70
76
|
```
|
|
71
77
|
|
|
72
|
-
|
|
78
|
+
Connect to a device and create a pair of `AdbPacket` streams.
|
|
73
79
|
|
|
74
|
-
The
|
|
75
|
-
|
|
76
|
-
#### `write`
|
|
77
|
-
|
|
78
|
-
```ts
|
|
79
|
-
write(buffer: ArrayBuffer): void | Promise<void>
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Writes data to the underlying connection.
|
|
80
|
+
The backend, instead of the core library, is responsible for serializing and deserializing the packets. Because it's extreme slow for WebUSB backend (`@yume-chan/adb-backend-webusb`) to read packets with unknown size.
|
|
83
81
|
|
|
84
82
|
## Authentication
|
|
85
83
|
|
|
@@ -87,22 +85,19 @@ For how does ADB authentication work, see https://chensi.moe/blog/2020/09/30/web
|
|
|
87
85
|
|
|
88
86
|
In this library, authentication comes in two parts:
|
|
89
87
|
|
|
90
|
-
* `AdbCredentialStore`: because JavaScript has no unified method to generate, store and iterate crypto keys, an implementation of `AdbCredentialStore` is required for the two built-in authenticators.
|
|
91
|
-
* `AdbAuthenticator`: can be used to implement custom authentication modes.
|
|
92
|
-
|
|
93
|
-
Custom `AdbCredentialStore`s and `AdbAuthenticator`s can be specified in the `Adb#connect` method.
|
|
94
|
-
|
|
95
88
|
#### AdbCredentialStore
|
|
96
89
|
|
|
90
|
+
An interface to generate, store and iterate ADB private keys on each runtime. (Because Node.js and Browsers have different APIs to do this)
|
|
91
|
+
|
|
97
92
|
##### `generateKey`
|
|
98
93
|
|
|
99
94
|
```ts
|
|
100
|
-
generateKey():
|
|
95
|
+
generateKey(): ValueOrPromise<Uint8Array>
|
|
101
96
|
```
|
|
102
97
|
|
|
103
98
|
Generate and store a RSA private key with modulus length `2048` and public exponent `65537`.
|
|
104
99
|
|
|
105
|
-
The returned `
|
|
100
|
+
The returned `Uint8Array` is the private key in PKCS #8 format.
|
|
106
101
|
|
|
107
102
|
##### `iterateKeys`
|
|
108
103
|
|
|
@@ -116,7 +111,7 @@ Each call to `iterateKeys` must return a different iterator that iterate through
|
|
|
116
111
|
|
|
117
112
|
##### Implementations
|
|
118
113
|
|
|
119
|
-
The `@yume-chan/adb-
|
|
114
|
+
The `@yume-chan/adb-credential-web` package contains a `AdbWebCredentialStore` implementation using Web Crypto API for generating keys and Web Storage API for storing keys.
|
|
120
115
|
|
|
121
116
|
#### AdbAuthenticator
|
|
122
117
|
|
|
@@ -124,6 +119,20 @@ An `AdbAuthenticator` generates `AUTH` responses for each `AUTH` request from se
|
|
|
124
119
|
|
|
125
120
|
This package contains `AdbSignatureAuthenticator` and `AdbPublicKeyAuthenticator`, the two basic modes.
|
|
126
121
|
|
|
122
|
+
#### `authenticate`
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
static async authenticate(
|
|
126
|
+
connection: ReadableWritablePair<AdbPacketCore, AdbPacketCore>,
|
|
127
|
+
credentialStore: AdbCredentialStore,
|
|
128
|
+
authenticators = AdbDefaultAuthenticators,
|
|
129
|
+
): Promise<Adb>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Call this method to authenticate the connection and create an `Adb` instance.
|
|
133
|
+
|
|
134
|
+
If an authentication process failed, it's possible to call `authenticate` again on the same connection (`AdbPacket` stream pair). Every time the device receives a `CNXN` packet, it resets all internal state, and starts a new authentication process.
|
|
135
|
+
|
|
127
136
|
## Stream multiplex
|
|
128
137
|
|
|
129
138
|
ADB commands are all based on streams. Multiple streams can send and receive at the same time in one connection.
|
|
@@ -133,25 +142,36 @@ ADB commands are all based on streams. Multiple streams can send and receive at
|
|
|
133
142
|
3. Client and server read/write on the stream.
|
|
134
143
|
4. Client/server sends a `CLSE` to close the stream.
|
|
135
144
|
|
|
136
|
-
|
|
145
|
+
## Commands
|
|
137
146
|
|
|
138
|
-
###
|
|
147
|
+
### subprocess
|
|
139
148
|
|
|
140
|
-
|
|
149
|
+
ADB has two subprocess invocation modes and two data protocols (4 combinations).
|
|
150
|
+
|
|
151
|
+
#### raw mode
|
|
152
|
+
|
|
153
|
+
In raw mode, Shell protocol transfers `stdout` and `stderr` separately. It also supports returning exit code.
|
|
154
|
+
|
|
155
|
+
| | Legacy protocol | Shell Protocol |
|
|
156
|
+
| --------------------------- | --------------------------- | ---------------------------- |
|
|
157
|
+
| Feature flag | - | `shell_v2` |
|
|
158
|
+
| Implementation | `AdbNoneSubprocessProtocol` | `AdbShellSubprocessProtocol` |
|
|
159
|
+
| Splitting stdout and stderr | No | Yes |
|
|
160
|
+
| Returning exit code | No | Yes |
|
|
161
|
+
|
|
162
|
+
Use `spawn` method to create a subprocess in raw mode.
|
|
141
163
|
|
|
142
|
-
|
|
164
|
+
#### pty mode
|
|
143
165
|
|
|
144
|
-
|
|
166
|
+
In PTY mode, the subprocess has a pseudo-terminal, so it can send special control sequences like clear screen and set cursor position. The two protocols both send data in `stdout`, but Shell Protocol also supports resizing the terminal from client.
|
|
145
167
|
|
|
146
|
-
| | Legacy
|
|
147
|
-
| --------------------------- |
|
|
148
|
-
| Feature flag | -
|
|
149
|
-
| Implementation | `
|
|
150
|
-
|
|
|
151
|
-
| Returning exit code | No | Yes |
|
|
152
|
-
| Resizing window | No | Yes |
|
|
168
|
+
| | Legacy protocol | Shell Protocol |
|
|
169
|
+
| --------------------------- | --------------------------- | ---------------------------- |
|
|
170
|
+
| Feature flag | - | `shell_v2` |
|
|
171
|
+
| Implementation | `AdbNoneSubprocessProtocol` | `AdbShellSubprocessProtocol` |
|
|
172
|
+
| Resizing window | No | Yes |
|
|
153
173
|
|
|
154
|
-
|
|
174
|
+
Use `shell` method to create a subprocess in PTY mode.
|
|
155
175
|
|
|
156
176
|
### usb
|
|
157
177
|
|
package/esm/adb.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type AdbCredentialStore } from './auth.js';
|
|
2
|
+
import { AdbPower, AdbReverseCommand, AdbSubprocess, AdbSync, AdbTcpIpCommand, type AdbFrameBuffer } from './commands/index.js';
|
|
3
|
+
import { AdbFeatures } from './features.js';
|
|
4
|
+
import { type AdbPacketData, type AdbPacketInit } from './packet.js';
|
|
5
|
+
import { type AdbSocket } from './socket/index.js';
|
|
6
|
+
import { WritableStream, type ReadableWritablePair } from "./stream/index.js";
|
|
7
|
+
export declare enum AdbPropKey {
|
|
8
|
+
Product = "ro.product.name",
|
|
9
|
+
Model = "ro.product.model",
|
|
10
|
+
Device = "ro.product.device",
|
|
11
|
+
Features = "features"
|
|
12
|
+
}
|
|
13
|
+
export declare const VERSION_OMIT_CHECKSUM = 16777217;
|
|
14
|
+
export declare class Adb {
|
|
15
|
+
/**
|
|
16
|
+
* It's possible to call `authenticate` multiple times on a single connection,
|
|
17
|
+
* every time the device receives a `CNXN` packet, it resets its internal state,
|
|
18
|
+
* and starts a new authentication process.
|
|
19
|
+
*/
|
|
20
|
+
static authenticate(connection: ReadableWritablePair<AdbPacketData, AdbPacketInit>, credentialStore: AdbCredentialStore, authenticators?: import("./auth.js").AdbAuthenticator[]): Promise<Adb>;
|
|
21
|
+
private readonly packetDispatcher;
|
|
22
|
+
get disconnected(): Promise<void>;
|
|
23
|
+
private _protocolVersion;
|
|
24
|
+
get protocolVersion(): number | undefined;
|
|
25
|
+
private _product;
|
|
26
|
+
get product(): string | undefined;
|
|
27
|
+
private _model;
|
|
28
|
+
get model(): string | undefined;
|
|
29
|
+
private _device;
|
|
30
|
+
get device(): string | undefined;
|
|
31
|
+
private _features;
|
|
32
|
+
get features(): AdbFeatures[] | undefined;
|
|
33
|
+
readonly subprocess: AdbSubprocess;
|
|
34
|
+
readonly power: AdbPower;
|
|
35
|
+
readonly reverse: AdbReverseCommand;
|
|
36
|
+
readonly tcpip: AdbTcpIpCommand;
|
|
37
|
+
constructor(connection: ReadableWritablePair<AdbPacketData, AdbPacketInit>, version: number, maxPayloadSize: number, banner: string);
|
|
38
|
+
private parseBanner;
|
|
39
|
+
createSocket(service: string): Promise<AdbSocket>;
|
|
40
|
+
createSocketAndWait(service: string): Promise<string>;
|
|
41
|
+
getProp(key: string): Promise<string>;
|
|
42
|
+
rm(...filenames: string[]): Promise<string>;
|
|
43
|
+
install(): WritableStream<Uint8Array>;
|
|
44
|
+
sync(): Promise<AdbSync>;
|
|
45
|
+
framebuffer(): Promise<AdbFrameBuffer>;
|
|
46
|
+
dispose(): Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=adb.d.ts.map
|
package/esm/adb.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adb.d.ts","sourceRoot":"","sources":["../src/adb.ts"],"names":[],"mappings":"AAGA,OAAO,EAA0D,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC5G,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAmC,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACjK,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAiC,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAyD,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGrI,oBAAY,UAAU;IAClB,OAAO,oBAAoB;IAC3B,KAAK,qBAAqB;IAC1B,MAAM,sBAAsB;IAC5B,QAAQ,aAAa;CACxB;AAED,eAAO,MAAM,qBAAqB,WAAa,CAAC;AAEhD,qBAAa,GAAG;IACZ;;;;OAIG;WACiB,YAAY,CAC5B,UAAU,EAAE,oBAAoB,CAAC,aAAa,EAAE,aAAa,CAAC,EAC9D,eAAe,EAAE,kBAAkB,EACnC,cAAc,yCAA6B,GAC5C,OAAO,CAAC,GAAG,CAAC;IAsGf,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAsB;IAEvD,IAAW,YAAY,kBAAiD;IAExE,OAAO,CAAC,gBAAgB,CAAqB;IAC7C,IAAW,eAAe,uBAAoC;IAE9D,OAAO,CAAC,QAAQ,CAAqB;IACrC,IAAW,OAAO,uBAA4B;IAE9C,OAAO,CAAC,MAAM,CAAqB;IACnC,IAAW,KAAK,uBAA0B;IAE1C,OAAO,CAAC,OAAO,CAAqB;IACpC,IAAW,MAAM,uBAA2B;IAE5C,OAAO,CAAC,SAAS,CAA4B;IAC7C,IAAW,QAAQ,8BAA6B;IAEhD,SAAgB,UAAU,EAAE,aAAa,CAAC;IAC1C,SAAgB,KAAK,EAAE,QAAQ,CAAC;IAChC,SAAgB,OAAO,EAAE,iBAAiB,CAAC;IAC3C,SAAgB,KAAK,EAAE,eAAe,CAAC;gBAGnC,UAAU,EAAE,oBAAoB,CAAC,aAAa,EAAE,aAAa,CAAC,EAC9D,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM;IA+BlB,OAAO,CAAC,WAAW;IAmCN,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAIjD,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IASrD,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAOrC,EAAE,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAOjD,OAAO;IAID,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAKxB,WAAW,IAAI,OAAO,CAAC,cAAc,CAAC;IAItC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAGxC"}
|