@yume-chan/adb 0.0.21 → 0.0.23
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 +39 -0
- package/CHANGELOG.md +20 -1
- package/README.md +46 -366
- package/esm/adb.d.ts +9 -5
- package/esm/adb.d.ts.map +1 -1
- package/esm/adb.js +9 -2
- package/esm/adb.js.map +1 -1
- package/esm/banner.d.ts.map +1 -1
- package/esm/banner.js +1 -0
- package/esm/banner.js.map +1 -1
- package/esm/commands/framebuffer.d.ts +1 -1
- package/esm/commands/framebuffer.d.ts.map +1 -1
- package/esm/commands/framebuffer.js.map +1 -1
- package/esm/commands/reverse.js +1 -1
- package/esm/commands/reverse.js.map +1 -1
- package/esm/commands/subprocess/command.js.map +1 -1
- package/esm/commands/subprocess/protocols/none.d.ts +2 -1
- package/esm/commands/subprocess/protocols/none.d.ts.map +1 -1
- package/esm/commands/subprocess/protocols/none.js +11 -14
- package/esm/commands/subprocess/protocols/none.js.map +1 -1
- package/esm/commands/subprocess/protocols/shell.d.ts.map +1 -1
- package/esm/commands/subprocess/protocols/shell.js +21 -71
- package/esm/commands/subprocess/protocols/shell.js.map +1 -1
- package/esm/commands/subprocess/utils.js +1 -1
- package/esm/commands/subprocess/utils.js.map +1 -1
- package/esm/commands/sync/list.d.ts +2 -1
- package/esm/commands/sync/list.d.ts.map +1 -1
- package/esm/commands/sync/list.js +2 -2
- package/esm/commands/sync/list.js.map +1 -1
- package/esm/commands/sync/pull.d.ts.map +1 -1
- package/esm/commands/sync/pull.js +4 -0
- package/esm/commands/sync/pull.js.map +1 -1
- package/esm/commands/sync/push.js.map +1 -1
- package/esm/commands/sync/request.js.map +1 -1
- package/esm/commands/sync/response.d.ts +1 -1
- package/esm/commands/sync/response.d.ts.map +1 -1
- package/esm/commands/sync/response.js +1 -1
- package/esm/commands/sync/response.js.map +1 -1
- package/esm/commands/sync/socket.d.ts +1 -0
- package/esm/commands/sync/socket.d.ts.map +1 -1
- package/esm/commands/sync/socket.js +4 -0
- package/esm/commands/sync/socket.js.map +1 -1
- package/esm/commands/sync/stat.js.map +1 -1
- package/esm/commands/sync/sync.d.ts.map +1 -1
- package/esm/commands/sync/sync.js +5 -6
- package/esm/commands/sync/sync.js.map +1 -1
- package/esm/commands/tcpip.d.ts +21 -0
- package/esm/commands/tcpip.d.ts.map +1 -1
- package/esm/commands/tcpip.js +18 -0
- package/esm/commands/tcpip.js.map +1 -1
- package/esm/daemon/auth.js.map +1 -1
- package/esm/daemon/crypto.js.map +1 -1
- package/esm/daemon/dispatcher.d.ts +9 -1
- package/esm/daemon/dispatcher.d.ts.map +1 -1
- package/esm/daemon/dispatcher.js +107 -51
- package/esm/daemon/dispatcher.js.map +1 -1
- package/esm/daemon/packet.d.ts +5 -5
- package/esm/daemon/packet.d.ts.map +1 -1
- package/esm/daemon/packet.js +1 -1
- package/esm/daemon/packet.js.map +1 -1
- package/esm/daemon/socket.d.ts +8 -13
- package/esm/daemon/socket.d.ts.map +1 -1
- package/esm/daemon/socket.js +80 -44
- package/esm/daemon/socket.js.map +1 -1
- package/esm/daemon/transport.d.ts +32 -4
- package/esm/daemon/transport.d.ts.map +1 -1
- package/esm/daemon/transport.js +61 -31
- package/esm/daemon/transport.js.map +1 -1
- package/esm/features.d.ts +2 -1
- package/esm/features.d.ts.map +1 -1
- package/esm/features.js +2 -1
- package/esm/features.js.map +1 -1
- package/esm/server/client.d.ts +14 -8
- package/esm/server/client.d.ts.map +1 -1
- package/esm/server/client.js +122 -70
- package/esm/server/client.js.map +1 -1
- package/esm/server/transport.d.ts +3 -0
- package/esm/server/transport.d.ts.map +1 -1
- package/esm/server/transport.js +26 -0
- package/esm/server/transport.js.map +1 -1
- package/esm/utils/auto-reset-event.js.map +1 -1
- package/esm/utils/base64.js.map +1 -1
- package/esm/utils/conditional-variable.js.map +1 -1
- package/esm/utils/hex.js.map +1 -1
- package/package.json +14 -14
- package/src/adb.ts +22 -7
- package/src/banner.ts +1 -0
- package/src/commands/framebuffer.ts +1 -1
- package/src/commands/reverse.ts +2 -2
- package/src/commands/subprocess/protocols/none.ts +15 -19
- package/src/commands/subprocess/protocols/shell.ts +28 -98
- package/src/commands/subprocess/utils.ts +1 -1
- package/src/commands/sync/list.ts +6 -2
- package/src/commands/sync/pull.ts +3 -0
- package/src/commands/sync/response.ts +2 -2
- package/src/commands/sync/socket.ts +5 -0
- package/src/commands/sync/sync.ts +5 -6
- package/src/commands/tcpip.ts +44 -0
- package/src/daemon/dispatcher.ts +156 -65
- package/src/daemon/packet.ts +1 -1
- package/src/daemon/socket.ts +104 -86
- package/src/daemon/transport.ts +104 -38
- package/src/features.ts +2 -1
- package/src/server/client.ts +141 -91
- package/src/server/transport.ts +28 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yume-chan/adb",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.0.23",
|
|
6
|
+
"tag": "@yume-chan/adb_v0.0.23",
|
|
7
|
+
"date": "Thu, 21 Mar 2024 03:15:10 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"none": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "Refactor `AdbSubprocessShellProtocol` (this shouldn't affect usage)"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"comment": "Add `AdbServerClient.trackDevices`, which runs a callback function whenever device list changes"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"comment": "Add support for delayed ack on Android 14"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"version": "0.0.22",
|
|
24
|
+
"tag": "@yume-chan/adb_v0.0.22",
|
|
25
|
+
"date": "Wed, 13 Dec 2023 05:57:27 GMT",
|
|
26
|
+
"comments": {
|
|
27
|
+
"none": [
|
|
28
|
+
{
|
|
29
|
+
"comment": "Add `getListenAddresses` method to `AdbTcpIpCommand` class for retrieving current ADB over WiFi state"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"comment": "Add `debugSlowRead` option to `AdbDaemonTransport` that throws an error when an ADB socket is stalled for 5 seconds"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"comment": "Fix `AdbSync#read` stuck when there is an error"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"comment": "Fix TypeScript build when using `AdbSubprocessNoneProtocol` without installing `web-streams-polyfill` package"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
4
43
|
{
|
|
5
44
|
"version": "0.0.21",
|
|
6
45
|
"tag": "@yume-chan/adb_v0.0.21",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
# Change Log - @yume-chan/adb
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 21 Mar 2024 03:15:10 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.0.23
|
|
6
|
+
Thu, 21 Mar 2024 03:15:10 GMT
|
|
7
|
+
|
|
8
|
+
### Updates
|
|
9
|
+
|
|
10
|
+
- Refactor `AdbSubprocessShellProtocol` (this shouldn't affect usage)
|
|
11
|
+
- Add `AdbServerClient.trackDevices`, which runs a callback function whenever device list changes
|
|
12
|
+
- Add support for delayed ack on Android 14
|
|
13
|
+
|
|
14
|
+
## 0.0.22
|
|
15
|
+
Wed, 13 Dec 2023 05:57:27 GMT
|
|
16
|
+
|
|
17
|
+
### Updates
|
|
18
|
+
|
|
19
|
+
- Add `getListenAddresses` method to `AdbTcpIpCommand` class for retrieving current ADB over WiFi state
|
|
20
|
+
- Add `debugSlowRead` option to `AdbDaemonTransport` that throws an error when an ADB socket is stalled for 5 seconds
|
|
21
|
+
- Fix `AdbSync#read` stuck when there is an error
|
|
22
|
+
- Fix TypeScript build when using `AdbSubprocessNoneProtocol` without installing `web-streams-polyfill` package
|
|
4
23
|
|
|
5
24
|
## 0.0.21
|
|
6
25
|
Fri, 25 Aug 2023 14:05:18 GMT
|
package/README.md
CHANGED
|
@@ -1,366 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Each transport and connection may have different requirements.
|
|
48
|
-
|
|
49
|
-
### Basic usage
|
|
50
|
-
|
|
51
|
-
| | Chrome | Edge | Firefox | Internet Explorer | Safari | Node.js |
|
|
52
|
-
| -------------------------------- | ------ | ---- | ------- | ----------------- | ------ | ------------------- |
|
|
53
|
-
| `@yume-chan/struct`<sup>1</sup> | 67 | 79 | 68 | No | 14 | 8.3<sup>2</sup>, 11 |
|
|
54
|
-
| Private class fields<sup>3</sup> | 74 | 79 | 90 | No | 14.1 | 12.0.0 |
|
|
55
|
-
| _Overall_ | 74 | 79 | 90 | No | 14.1 | 16.5 |
|
|
56
|
-
|
|
57
|
-
<sup>1</sup> `uint64` and `string` are used.
|
|
58
|
-
|
|
59
|
-
<sup>2</sup> `TextEncoder` and `TextDecoder` are only available in `util` module. Need to be assigned to `globalThis`.
|
|
60
|
-
|
|
61
|
-
<sup>3</sup> Can be down-level compiled using Babel.
|
|
62
|
-
|
|
63
|
-
### Use without bundlers
|
|
64
|
-
|
|
65
|
-
| | Chrome | Edge | Firefox | Internet Explorer | Safari | Node.js |
|
|
66
|
-
| --------------- | ------ | ---- | ------- | ----------------- | ------ | ------- |
|
|
67
|
-
| Top-level await | 89 | 89 | 89 | No | 15 | 14.8 |
|
|
68
|
-
|
|
69
|
-
## Transport
|
|
70
|
-
|
|
71
|
-
This library doesn't tie to a specific transportation method.
|
|
72
|
-
|
|
73
|
-
Instead, an implementation of the `AdbTransport` interface is responsible for creating ADB sockets when requested. Each implementation might have different methods to discover, connect and authenticate devices.
|
|
74
|
-
|
|
75
|
-
### `AdbDaemonTransport`
|
|
76
|
-
|
|
77
|
-
`AdbDaemonTransport` connects to an ADB daemon directly.
|
|
78
|
-
|
|
79
|
-
It requires a `ReadableWritablePair<AdbPacketData, Consumable<AdbPacketInit>>` to send and receive ADB packets to the daemon.
|
|
80
|
-
|
|
81
|
-
Usually an implementation of `AdbDaemonConnection` will provide that along with other useful information about the device. Possible implementations includes:
|
|
82
|
-
|
|
83
|
-
- WebUSB API
|
|
84
|
-
- `usb` package for Node.js
|
|
85
|
-
- Node.js' `net` module (for ADB over WiFi)
|
|
86
|
-
- Though a WebSockify wrapper (also for ADB over WiFi).
|
|
87
|
-
|
|
88
|
-
ADB daemon requires authentication unless built in debug mode. For how ADB authentication work, see https://chensi.moe/blog/2020/09/30/webadb-part2-connection/#auth.
|
|
89
|
-
|
|
90
|
-
Authentication requires two extra components:
|
|
91
|
-
|
|
92
|
-
#### `AdbCredentialStore`
|
|
93
|
-
|
|
94
|
-
An interface to generate, store and iterate ADB private keys on each runtime. (Because Node.js and Browsers have different APIs to do that)
|
|
95
|
-
|
|
96
|
-
The `@yume-chan/adb-credential-web` package contains a `AdbWebCredentialStore` implementation using Web Crypto API for generating keys and IndexedDB for storing keys.
|
|
97
|
-
|
|
98
|
-
##### `generateKey`
|
|
99
|
-
|
|
100
|
-
```ts
|
|
101
|
-
generateKey(): ValueOrPromise<Uint8Array>
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
Generate and store a RSA private key with modulus length `2048` and public exponent `65537`.
|
|
105
|
-
|
|
106
|
-
The returned `Uint8Array` is the private key in PKCS #8 format.
|
|
107
|
-
|
|
108
|
-
##### `iterateKeys`
|
|
109
|
-
|
|
110
|
-
```ts
|
|
111
|
-
iterateKeys(): Iterator<ArrayBuffer> | AsyncIterator<ArrayBuffer>
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Synchronously or asynchronously iterate through all stored RSA private keys.
|
|
115
|
-
|
|
116
|
-
Each call to `iterateKeys` must return a different iterator that iterate through all stored keys.
|
|
117
|
-
|
|
118
|
-
#### `AdbAuthenticator`
|
|
119
|
-
|
|
120
|
-
An `AdbAuthenticator` generates `AUTH` responses for each `AUTH` request from server.
|
|
121
|
-
|
|
122
|
-
This package contains `AdbSignatureAuthenticator` and `AdbPublicKeyAuthenticator` classes for the two basic modes, they all uses the `AdbCredentialStore` to get the private key.
|
|
123
|
-
|
|
124
|
-
#### `authenticate`
|
|
125
|
-
|
|
126
|
-
```ts
|
|
127
|
-
static async authenticate(options: {
|
|
128
|
-
connection: ReadableWritablePair<AdbPacketCore, AdbPacketCore>,
|
|
129
|
-
credentialStore: AdbCredentialStore,
|
|
130
|
-
authenticators?: AdbAuthenticator[],
|
|
131
|
-
}): Promise<AdbDaemonTransport>
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
Authenticates the connection and creates an `AdbDaemonTransport` instance that can be used by `Adb` class.
|
|
135
|
-
|
|
136
|
-
If an authentication process failed, it's possible to call `authenticate` again on the same connection. Because every time the device receives a `CNXN` packet, it resets all internal state, and starts a new authentication process.
|
|
137
|
-
|
|
138
|
-
#### `addReverseTunnel`
|
|
139
|
-
|
|
140
|
-
```ts
|
|
141
|
-
public addReverseTunnel(
|
|
142
|
-
handler: AdbIncomingSocketHandler,
|
|
143
|
-
address?: string
|
|
144
|
-
): string
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
Adds a reverse tunnel handler to the transport. It doesn't register the reverse tunnel to the device, for that use `AdbReverseCommand#add` instead. Because the process for ADB to create a tunnel is same as calling a command, `address` can be any string that the ADB daemon might call as a command.
|
|
148
|
-
|
|
149
|
-
### `AdbServerTransport`
|
|
150
|
-
|
|
151
|
-
`AdbServerTransport` connects to an ADB server. Because a USB device can only be used by one process at a time, the ADB server is the process that manages all connected devices. The server proxies and multiplexes connections from ADB clients so multiple adb commands can be executed on one device at the same time. `AdbServerTransport` instances can be retrieved from `AdbServerClient` class.
|
|
152
|
-
|
|
153
|
-
#### `AdbServerClient`
|
|
154
|
-
|
|
155
|
-
The `AdbServerClient` class implements the client-server protocol to interact with the ADB server. It can query the list of connected devices, detect device connections and disconnections, and invoke other server commands.
|
|
156
|
-
|
|
157
|
-
It needs an implementation of `AdbServerConnection` interface to actually connects to the ADB server using each runtime's API.
|
|
158
|
-
|
|
159
|
-
##### `getVersion`
|
|
160
|
-
|
|
161
|
-
```ts
|
|
162
|
-
public async getVersion(): Promise<string>;
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
Get the version number of the ADB server. This version is not related to the ADB server-daemon protocol version nor device Android version, it increases when a breaking change is introduced into the client-server protocol.
|
|
166
|
-
|
|
167
|
-
##### `kill`
|
|
168
|
-
|
|
169
|
-
```ts
|
|
170
|
-
public async kill(): Promise<void>;
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
Kill the ADB server, for example if you want to connect to the ADB daemon directly over USB.
|
|
174
|
-
|
|
175
|
-
##### `getServerFeatures`
|
|
176
|
-
|
|
177
|
-
```ts
|
|
178
|
-
public async getServerFeatures(): Promise<AdbFeature[]>;
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
Get the list of ADB features supported by the server.
|
|
182
|
-
|
|
183
|
-
Generally it's not that useful because most ADB commands only cares about what features the device supports.
|
|
184
|
-
|
|
185
|
-
##### `getDevices`
|
|
186
|
-
|
|
187
|
-
```ts
|
|
188
|
-
public async getDevices(): Promise<AdbServerTransport[]>;
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
Get the list of connected devices.
|
|
192
|
-
|
|
193
|
-
The returned `AdbServerTransport` instance can be supplied to `new Adb` to operate on that device.
|
|
194
|
-
|
|
195
|
-
##### `AdbServerDeviceSelector`
|
|
196
|
-
|
|
197
|
-
Some commands target a specific device. `AdbServerDeviceSelector` chooses a device from the list of connected devices.
|
|
198
|
-
|
|
199
|
-
It can be one of:
|
|
200
|
-
|
|
201
|
-
- `undefined`: any one device, will throw an error if there are multiple devices connected. Same as no argument are given to `adb` command.
|
|
202
|
-
- `{ serial: string }`: a device with the given serial number. Note that multiple devices can have the same serial number (if the manufacturer is lazy), usually it's enough to identify a device. Same as the `-s` argument for the `adb` command.
|
|
203
|
-
- `{ transportId: number }`: a device with the given transport ID. The transport ID is from the order devices connect. It can be obtained from `getDevices` method. Same as the `-t` argument for the `adb` command.
|
|
204
|
-
- `{ usb: true }`: any one USB device, will throw an error if there are multiple devices connected via USB. Same as the `-d` argument for the `adb` command.
|
|
205
|
-
- `{ emulator: true }`: any one TCP device (including emulators and devices connected via ADB over WiFi), will throw an error if there are multiple TCP devices. Same as the `-e` argument for the `adb` command. Same as the `-e` argument for the `adb` command.
|
|
206
|
-
|
|
207
|
-
The selector will be sent to ADB server and resolved there.
|
|
208
|
-
|
|
209
|
-
##### `getDeviceFeatures`
|
|
210
|
-
|
|
211
|
-
```ts
|
|
212
|
-
public async getDeviceFeatures(
|
|
213
|
-
device: AdbServerDeviceSelector
|
|
214
|
-
): Promise<AdbFeature[]>
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
Gets the list of ADB features supported by the device. `Adb` class requires this information to choose the correct commands to use.
|
|
218
|
-
|
|
219
|
-
##### `waitFor`
|
|
220
|
-
|
|
221
|
-
```ts
|
|
222
|
-
public async waitFor(
|
|
223
|
-
device: AdbServerDeviceSelector,
|
|
224
|
-
state: "device" | "disconnect",
|
|
225
|
-
signal?: AbortSignal
|
|
226
|
-
): Promise<void>
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
Wait for a specific device to be connected or disconnected. The `AdbServerTransport` instance uses this method to detect device disconnects.
|
|
230
|
-
|
|
231
|
-
## Commands
|
|
232
|
-
|
|
233
|
-
### subprocess
|
|
234
|
-
|
|
235
|
-
ADB has two subprocess invocation modes and two data protocols (4 combinations). The Shell protocol was added in Android 8 and can be identified by the `shell_v2` feature flag.
|
|
236
|
-
|
|
237
|
-
#### raw mode
|
|
238
|
-
|
|
239
|
-
In raw mode, Shell protocol transfers `stdout` and `stderr` separately, and supports returning exit code.
|
|
240
|
-
|
|
241
|
-
| | Legacy protocol | Shell Protocol |
|
|
242
|
-
| --------------------------- | --------------------------- | ---------------------------- |
|
|
243
|
-
| Feature flag | - | `shell_v2` |
|
|
244
|
-
| Implementation | `AdbNoneSubprocessProtocol` | `AdbShellSubprocessProtocol` |
|
|
245
|
-
| Splitting stdout and stderr | No | Yes |
|
|
246
|
-
| Returning exit code | No | Yes |
|
|
247
|
-
|
|
248
|
-
Use `spawn` method to create a subprocess in raw mode.
|
|
249
|
-
|
|
250
|
-
#### pty mode
|
|
251
|
-
|
|
252
|
-
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 and returning the exit code.
|
|
253
|
-
|
|
254
|
-
| | Legacy protocol | Shell Protocol |
|
|
255
|
-
| --------------------------- | --------------------------- | ---------------------------- |
|
|
256
|
-
| Feature flag | - | `shell_v2` |
|
|
257
|
-
| Implementation | `AdbNoneSubprocessProtocol` | `AdbShellSubprocessProtocol` |
|
|
258
|
-
| Resizing window | No | Yes |
|
|
259
|
-
| Splitting stdout and stderr | No | No |
|
|
260
|
-
| Returning exit code | No | Yes |
|
|
261
|
-
|
|
262
|
-
Use `shell` method to create a subprocess in PTY mode.
|
|
263
|
-
|
|
264
|
-
### usb
|
|
265
|
-
|
|
266
|
-
Disable ADB over WiFi.
|
|
267
|
-
|
|
268
|
-
### tcpip
|
|
269
|
-
|
|
270
|
-
Enable ADB over WiFi.
|
|
271
|
-
|
|
272
|
-
### sync
|
|
273
|
-
|
|
274
|
-
Sync protocol is a sub-protocol of the server-daemon protocol, it allows interacting with the device's filesystem.
|
|
275
|
-
|
|
276
|
-
```ts
|
|
277
|
-
public async sync(): Promise<AdbSync>;
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
Creates an `AdbSync` client. The client can send multiple command in sequence, and multiple clients can be created to send commands in parallel.
|
|
281
|
-
|
|
282
|
-
#### `lstat`
|
|
283
|
-
|
|
284
|
-
```ts
|
|
285
|
-
public async lstat(path: string): Promise<AdbSyncStat>;
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
Gets the information of a file or folder. If `path` points to a symbolic link, the returned information is about the link itself.
|
|
289
|
-
|
|
290
|
-
This uses the `STAT` or `LST2` (when supported) sync commands, notice that despite the name of `STAT`, it doesn't resolve symbolic links.
|
|
291
|
-
|
|
292
|
-
Same as the [`lstat`](https://linux.die.net/man/2/lstat) system call in Linux.
|
|
293
|
-
|
|
294
|
-
#### `stat`
|
|
295
|
-
|
|
296
|
-
```ts
|
|
297
|
-
public async stat(path: string): Promise<AdbSyncStat>;
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
Gets the information of a file or folder. If `path` points to a symbolic link, it will be resolved and the returned information is about the target.
|
|
301
|
-
|
|
302
|
-
Uses the `STA2` sync command, which requires the `stat_v2` feature flag. Will throw an error if device doesn't support that.
|
|
303
|
-
|
|
304
|
-
Same as the `stat` system call in Linux.
|
|
305
|
-
|
|
306
|
-
#### `isDirectory`
|
|
307
|
-
|
|
308
|
-
```ts
|
|
309
|
-
public async isDirectory(path: string): Promise<boolean>
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
Checks if `path` is a directory, or a symbolic link to a directory.
|
|
313
|
-
|
|
314
|
-
This uses `lstat` internally, thus works on all Android versions.
|
|
315
|
-
|
|
316
|
-
#### `opendir`
|
|
317
|
-
|
|
318
|
-
```ts
|
|
319
|
-
public opendir(path: string): AsyncGenerator<AdbSyncEntry, void, void>;
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
Returns an async generator that yields the content of a folder.
|
|
323
|
-
|
|
324
|
-
Example:
|
|
325
|
-
|
|
326
|
-
```ts
|
|
327
|
-
for await (const entry of this.opendir(path)) {
|
|
328
|
-
console.log(entry.name, entry.size);
|
|
329
|
-
}
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
#### `readdir`
|
|
333
|
-
|
|
334
|
-
```ts
|
|
335
|
-
public async readdir(path: string): Promise<AdbSyncEntry>
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
Collects the result of `opendir` into an array. Useful if you want to send other commands using the same `AdbSync` instance while iterating the folder.
|
|
339
|
-
|
|
340
|
-
#### `read`
|
|
341
|
-
|
|
342
|
-
```ts
|
|
343
|
-
public read(filename: string): ReadableStream<Uint8Array>
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
Reads the content of a file on device.
|
|
347
|
-
|
|
348
|
-
#### `write`
|
|
349
|
-
|
|
350
|
-
```ts
|
|
351
|
-
public async write(options: {
|
|
352
|
-
filename: string;
|
|
353
|
-
file: ReadableStream<Consumable<Uint8Array>>;
|
|
354
|
-
type?: LinuxFileType;
|
|
355
|
-
permission?: number;
|
|
356
|
-
mtime?: number;
|
|
357
|
-
dryRun?: boolean;
|
|
358
|
-
})
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
Writes a file on device. If the file name already exists, it will be overwritten.
|
|
362
|
-
|
|
363
|
-
## Useful links
|
|
364
|
-
|
|
365
|
-
- [ADB protocol overview](https://android.googlesource.com/platform/packages/modules/adb/+/2fd69306184634c6d90db3ed3be5349e71dcc471/OVERVIEW.TXT)
|
|
366
|
-
- [ADB commands](https://android.googlesource.com/platform/packages/modules/adb/+/2fd69306184634c6d90db3ed3be5349e71dcc471/SERVICES.TXT#145)
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img alt="Tango" src="https://raw.githubusercontent.com/yume-chan/ya-webadb/main/.github/logo.svg" width="200">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">@yume-chan/adb</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
TypeScript implementation of Android Debug Bridge (ADB) protocol.
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://github.com/yume-chan/ya-webadb/blob/main/LICENSE">
|
|
13
|
+
<img alt="MIT License" src="https://img.shields.io/github/license/yume-chan/ya-webadb">
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://github.com/yume-chan/ya-webadb/releases">
|
|
16
|
+
<img alt="GitHub release" src="https://img.shields.io/github/v/release/yume-chan/ya-webadb?logo=github">
|
|
17
|
+
</a>
|
|
18
|
+
<a href="https://www.npmjs.com/package/@yume-chan/adb">
|
|
19
|
+
<img alt="npm" src="https://img.shields.io/npm/dm/%40yume-chan/adb?logo=npm">
|
|
20
|
+
</a>
|
|
21
|
+
<a href="https://discord.gg/26k3ttC2PN">
|
|
22
|
+
<img alt="Discord" src="https://img.shields.io/discord/1120215514732564502?logo=discord&logoColor=%23ffffff&label=Discord">
|
|
23
|
+
</a>
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
This package is part of [Tango ADB](https://github.com/yume-chan/ya-webadb). Generally you need multiple packages to build a complete ADB client that can run on Web browsers and Node.js. Read the documentation for more information.
|
|
27
|
+
|
|
28
|
+
## Documentation
|
|
29
|
+
|
|
30
|
+
Check the latest documentation at https://tango-adb.github.io/docs/
|
|
31
|
+
|
|
32
|
+
## Sponsors
|
|
33
|
+
|
|
34
|
+
[Become a backer](https://opencollective.com/ya-webadb) and get your image on our README on Github with a link to your site.
|
|
35
|
+
|
|
36
|
+
<a href="https://opencollective.com/ya-webadb/backer/0/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/0/avatar.svg?requireActive=false"></a>
|
|
37
|
+
<a href="https://opencollective.com/ya-webadb/backer/1/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/1/avatar.svg?requireActive=false"></a>
|
|
38
|
+
<a href="https://opencollective.com/ya-webadb/backer/2/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/2/avatar.svg?requireActive=false"></a>
|
|
39
|
+
<a href="https://opencollective.com/ya-webadb/backer/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/3/avatar.svg?requireActive=false"></a>
|
|
40
|
+
<a href="https://opencollective.com/ya-webadb/backer/4/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/4/avatar.svg?requireActive=false"></a>
|
|
41
|
+
<a href="https://opencollective.com/ya-webadb/backer/5/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/5/avatar.svg?requireActive=false"></a>
|
|
42
|
+
<a href="https://opencollective.com/ya-webadb/backer/6/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/6/avatar.svg?requireActive=false"></a>
|
|
43
|
+
<a href="https://opencollective.com/ya-webadb/backer/7/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/7/avatar.svg?requireActive=false"></a>
|
|
44
|
+
<a href="https://opencollective.com/ya-webadb/backer/8/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/8/avatar.svg?requireActive=false"></a>
|
|
45
|
+
<a href="https://opencollective.com/ya-webadb/backer/9/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/9/avatar.svg?requireActive=false"></a>
|
|
46
|
+
<a href="https://opencollective.com/ya-webadb/backer/10/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/10/avatar.svg?requireActive=false"></a>
|
package/esm/adb.d.ts
CHANGED
|
@@ -4,18 +4,20 @@ import type { AdbBanner } from "./banner.js";
|
|
|
4
4
|
import type { AdbFrameBuffer } from "./commands/index.js";
|
|
5
5
|
import { AdbPower, AdbReverseCommand, AdbSubprocess, AdbSync, AdbTcpIpCommand } from "./commands/index.js";
|
|
6
6
|
import type { AdbFeature } from "./features.js";
|
|
7
|
-
export interface AdbSocket extends ReadableWritablePair<Uint8Array, Consumable<Uint8Array>>, Closeable {
|
|
8
|
-
readonly service: string;
|
|
9
|
-
}
|
|
10
|
-
export type AdbIncomingSocketHandler = (socket: AdbSocket) => ValueOrPromise<void>;
|
|
11
7
|
export interface Closeable {
|
|
12
8
|
close(): ValueOrPromise<void>;
|
|
13
9
|
}
|
|
10
|
+
export interface AdbSocket extends ReadableWritablePair<Uint8Array, Consumable<Uint8Array>>, Closeable {
|
|
11
|
+
get service(): string;
|
|
12
|
+
get closed(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export type AdbIncomingSocketHandler = (socket: AdbSocket) => ValueOrPromise<void>;
|
|
14
15
|
export interface AdbTransport extends Closeable {
|
|
15
16
|
readonly serial: string;
|
|
16
17
|
readonly maxPayloadSize: number;
|
|
17
18
|
readonly banner: AdbBanner;
|
|
18
19
|
readonly disconnected: Promise<void>;
|
|
20
|
+
readonly clientFeatures: readonly AdbFeature[];
|
|
19
21
|
connect(service: string): ValueOrPromise<AdbSocket>;
|
|
20
22
|
addReverseTunnel(handler: AdbIncomingSocketHandler, address?: string): ValueOrPromise<string>;
|
|
21
23
|
removeReverseTunnel(address: string): ValueOrPromise<void>;
|
|
@@ -27,12 +29,14 @@ export declare class Adb implements Closeable {
|
|
|
27
29
|
get maxPayloadSize(): number;
|
|
28
30
|
get banner(): AdbBanner;
|
|
29
31
|
get disconnected(): Promise<void>;
|
|
32
|
+
get clientFeatures(): readonly AdbFeature[];
|
|
33
|
+
get deviceFeatures(): AdbFeature[];
|
|
30
34
|
readonly subprocess: AdbSubprocess;
|
|
31
35
|
readonly power: AdbPower;
|
|
32
36
|
readonly reverse: AdbReverseCommand;
|
|
33
37
|
readonly tcpip: AdbTcpIpCommand;
|
|
34
38
|
constructor(transport: AdbTransport);
|
|
35
|
-
|
|
39
|
+
canUseFeature(feature: AdbFeature): boolean;
|
|
36
40
|
createSocket(service: string): Promise<AdbSocket>;
|
|
37
41
|
createSocketAndWait(service: string): Promise<string>;
|
|
38
42
|
getProp(key: string): Promise<string>;
|
package/esm/adb.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adb.d.ts","sourceRoot":"","sources":["../src/adb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACH,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,OAAO,EACP,eAAe,EAGlB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,WAAW,SACb,SAAQ,oBAAoB,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,EAC5D,SAAS;IACb,
|
|
1
|
+
{"version":3,"file":"adb.d.ts","sourceRoot":"","sources":["../src/adb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACH,QAAQ,EACR,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AM,cAET;IAED,IAAI,YAAY,kBAEf;IAED,IAAW,cAAc,0BAExB;IAED,IAAW,cAAc,iBAExB;IAED,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;gBAEpB,SAAS,EAAE,YAAY;IASnC,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO;IAOrC,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAIjD,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAOrD,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQrC,EAAE,CACJ,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,EAC5B,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GACnD,OAAO,CAAC,MAAM,CAAC;IAqBZ,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAKxB,WAAW,IAAI,OAAO,CAAC,cAAc,CAAC;IAItC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG/B"}
|
package/esm/adb.js
CHANGED
|
@@ -14,6 +14,12 @@ export class Adb {
|
|
|
14
14
|
get disconnected() {
|
|
15
15
|
return this.transport.disconnected;
|
|
16
16
|
}
|
|
17
|
+
get clientFeatures() {
|
|
18
|
+
return this.transport.clientFeatures;
|
|
19
|
+
}
|
|
20
|
+
get deviceFeatures() {
|
|
21
|
+
return this.banner.features;
|
|
22
|
+
}
|
|
17
23
|
subprocess;
|
|
18
24
|
power;
|
|
19
25
|
reverse;
|
|
@@ -25,8 +31,9 @@ export class Adb {
|
|
|
25
31
|
this.reverse = new AdbReverseCommand(this);
|
|
26
32
|
this.tcpip = new AdbTcpIpCommand(this);
|
|
27
33
|
}
|
|
28
|
-
|
|
29
|
-
return this.
|
|
34
|
+
canUseFeature(feature) {
|
|
35
|
+
return (this.clientFeatures.includes(feature) &&
|
|
36
|
+
this.deviceFeatures.includes(feature));
|
|
30
37
|
}
|
|
31
38
|
async createSocket(service) {
|
|
32
39
|
return this.transport.connect(service);
|
package/esm/adb.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adb.js","sourceRoot":"","sources":["../src/adb.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAK/E,OAAO,EACH,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,OAAO,EACP,eAAe,EACf,SAAS,EACT,WAAW,GACd,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"adb.js","sourceRoot":"","sources":["../src/adb.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAK/E,OAAO,EACH,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,OAAO,EACP,eAAe,EACf,SAAS,EACT,WAAW,GACd,MAAM,qBAAqB,CAAC;AA0C7B,MAAM,OAAO,GAAG;IACH,SAAS,CAAe;IAEjC,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;IACjC,CAAC;IAED,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC;IACzC,CAAC;IAED,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;IACjC,CAAC;IAED,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;IACvC,CAAC;IAED,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC;IACzC,CAAC;IA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ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,oBAAY,YAAY;IACpB,OAAO,oBAAoB;IAC3B,KAAK,qBAAqB;IAC1B,MAAM,sBAAsB;IAC5B,QAAQ,aAAa;CACxB;AAED,qBAAa,SAAS;;IAClB,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../src/banner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,oBAAY,YAAY;IACpB,OAAO,oBAAoB;IAC3B,KAAK,qBAAqB;IAC1B,MAAM,sBAAsB;IAC5B,QAAQ,aAAa;CACxB;AAED,qBAAa,SAAS;;IAClB,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM;IA0C3B,IAAI,OAAO,uBAEV;IAGD,IAAI,KAAK,uBAER;IAGD,IAAI,MAAM,uBAET;IAGD,IAAI,QAAQ,iBAEX;gBAGG,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,QAAQ,EAAE,UAAU,EAAE;CAO7B"}
|
package/esm/banner.js
CHANGED
package/esm/banner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../src/banner.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACpB,2CAA2B,CAAA;IAC3B,0CAA0B,CAAA;IAC1B,4CAA4B,CAAA;IAC5B,qCAAqB,CAAA;AACzB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAED,MAAM,OAAO,SAAS;IAClB,MAAM,CAAC,KAAK,CAAC,MAAc;QACvB,IAAI,OAA2B,CAAC;QAChC,IAAI,KAAyB,CAAC;Q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K,CAAC;wBAChB,MAAM;oBACV,KAAK,YAAY,CAAC,KAAK;wBACnB,KAAK,GAAG,KAAK,CAAC;wBACd,MAAM;oBACV,KAAK,YAAY,CAAC,MAAM;wBACpB,MAAM,GAAG,KAAK,CAAC;wBACf,MAAM;oBACV,KAAK,YAAY,CAAC,QAAQ;wBACtB,QAAQ,GAAG,KAAM,CAAC,KAAK,CAAC,GAAG,CAAiB,CAAC;wBAC7C,MAAM;gBACd,CAAC;YACL,CAAC;QACL,CAAC;QAED,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAED,QAAQ,CAAqB;IAC7B,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED,MAAM,CAAqB;IAC3B,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,OAAO,CAAqB;IAC5B,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,SAAS,GAAiB,EAAE,CAAC;IAC7B,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,YACI,OAA2B,EAC3B,KAAyB,EACzB,MAA0B,EAC1B,QAAsB;QAEtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC9B,CAAC;CACJ"}
|
|
@@ -50,7 +50,7 @@ export type AdbFrameBufferV2 = (typeof AdbFrameBufferV2)["TDeserializeResult"];
|
|
|
50
50
|
* But it doesn't mean that other combinations are not possible.
|
|
51
51
|
*/
|
|
52
52
|
export type AdbFrameBuffer = AdbFrameBufferV1 | AdbFrameBufferV2;
|
|
53
|
-
export declare class AdbFrameBufferError extends Error {
|
|
53
|
+
export declare abstract class AdbFrameBufferError extends Error {
|
|
54
54
|
constructor(message: string, options?: ErrorOptions);
|
|
55
55
|
}
|
|
56
56
|
export declare class AdbFrameBufferUnsupportedVersionError extends AdbFrameBufferError {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framebuffer.d.ts","sourceRoot":"","sources":["../../src/commands/framebuffer.ts"],"names":[],"mappings":"AACA,OAAO,MAA4B,MAAM,mBAAmB,CAAC;AAE7D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAIrC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;2CAamB,CAAC;AAEjD,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,oBAAoB,CAAC,CAAC;AAE/E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;2CAcmB,CAAC;AAEjD,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,oBAAoB,CAAC,CAAC;AAE/E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAEjE,
|
|
1
|
+
{"version":3,"file":"framebuffer.d.ts","sourceRoot":"","sources":["../../src/commands/framebuffer.ts"],"names":[],"mappings":"AACA,OAAO,MAA4B,MAAM,mBAAmB,CAAC;AAE7D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAIrC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;2CAamB,CAAC;AAEjD,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,oBAAoB,CAAC,CAAC;AAE/E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;2CAcmB,CAAC;AAEjD,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,oBAAoB,CAAC,CAAC;AAE/E;;;;;;;;;;;;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,MAAM,MAAM,GAAG,IAAI,sBAAsB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAE3D,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACD,CAAC,EAAE,OAAO,EAAE,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IACtD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,IAAI,CAAC,YAAY,gBAAgB,EAAE,CAAC;YAChC,MAAM,IAAI,4BAA4B,EAAE,CAAC;QAC7C,CAAC;QACD,MAAM,CAAC,CAAC;IACZ,CAAC;IAED,QAAQ,OAAO,EAAE,CAAC;QACd,KAAK,CAAC;YACF,qIAAqI;YACrI,OAAO,gBAAgB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAChD,KAAK,CAAC;YACF,OAAO,gBAAgB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAChD;YACI,MAAM,IAAI,qCAAqC,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC;AACL,CAAC"}
|
package/esm/commands/reverse.js
CHANGED
|
@@ -21,7 +21,7 @@ const AdbReverseErrorResponse = new Struct()
|
|
|
21
21
|
.concat(AdbReverseStringResponse)
|
|
22
22
|
.postDeserialize((value) => {
|
|
23
23
|
// https://issuetracker.google.com/issues/37066218
|
|
24
|
-
// ADB on Android <9 can't create reverse tunnels when connected wirelessly (ADB over
|
|
24
|
+
// ADB on Android <9 can't create reverse tunnels when connected wirelessly (ADB over Wi-Fi),
|
|
25
25
|
// and returns this confusing "more than one device/emulator" error.
|
|
26
26
|
if (value.content === "more than one device/emulator") {
|
|
27
27
|
throw new AdbReverseNotSupportedError();
|