@yume-chan/adb 0.0.18 → 0.0.19
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 +21 -0
- package/CHANGELOG.md +11 -1
- package/esm/adb.d.ts +63 -60
- package/esm/adb.d.ts.map +1 -1
- package/esm/adb.js +257 -249
- package/esm/adb.js.map +1 -1
- package/esm/auth.d.ts +51 -51
- package/esm/auth.d.ts.map +1 -1
- package/esm/auth.js +95 -96
- package/esm/auth.js.map +1 -1
- package/esm/backend.d.ts +8 -8
- package/esm/backend.d.ts.map +1 -1
- package/esm/backend.js +1 -1
- package/esm/commands/base.d.ts +6 -6
- package/esm/commands/base.d.ts.map +1 -1
- package/esm/commands/base.js +8 -8
- package/esm/commands/framebuffer.d.ts +53 -53
- package/esm/commands/framebuffer.d.ts.map +1 -1
- package/esm/commands/framebuffer.js +46 -46
- package/esm/commands/framebuffer.js.map +1 -1
- package/esm/commands/index.d.ts +7 -8
- package/esm/commands/index.d.ts.map +1 -1
- package/esm/commands/index.js +7 -8
- package/esm/commands/index.js.map +1 -1
- package/esm/commands/install.d.ts +9 -3
- package/esm/commands/install.d.ts.map +1 -1
- package/esm/commands/install.js +26 -26
- package/esm/commands/install.js.map +1 -1
- package/esm/commands/power.d.ts +22 -22
- package/esm/commands/power.js +48 -48
- package/esm/commands/reverse.d.ts +41 -28
- package/esm/commands/reverse.d.ts.map +1 -1
- package/esm/commands/reverse.js +125 -100
- package/esm/commands/reverse.js.map +1 -1
- package/esm/commands/subprocess/command.d.ts +57 -51
- package/esm/commands/subprocess/command.d.ts.map +1 -1
- package/esm/commands/subprocess/command.js +86 -80
- package/esm/commands/subprocess/command.js.map +1 -1
- package/esm/commands/subprocess/index.d.ts +3 -3
- package/esm/commands/subprocess/index.js +3 -3
- package/esm/commands/subprocess/protocols/index.d.ts +3 -3
- package/esm/commands/subprocess/protocols/index.js +3 -3
- package/esm/commands/subprocess/protocols/none.d.ts +35 -35
- package/esm/commands/subprocess/protocols/none.d.ts.map +1 -1
- package/esm/commands/subprocess/protocols/none.js +65 -55
- package/esm/commands/subprocess/protocols/none.js.map +1 -1
- package/esm/commands/subprocess/protocols/shell.d.ts +39 -38
- package/esm/commands/subprocess/protocols/shell.d.ts.map +1 -1
- package/esm/commands/subprocess/protocols/shell.js +166 -162
- package/esm/commands/subprocess/protocols/shell.js.map +1 -1
- package/esm/commands/subprocess/protocols/types.d.ts +49 -49
- package/esm/commands/subprocess/protocols/types.d.ts.map +1 -1
- package/esm/commands/subprocess/protocols/types.js +1 -1
- package/esm/commands/subprocess/utils.d.ts +1 -1
- package/esm/commands/subprocess/utils.js +18 -18
- package/esm/commands/sync/index.d.ts +8 -7
- package/esm/commands/sync/index.d.ts.map +1 -1
- package/esm/commands/sync/index.js +8 -7
- package/esm/commands/sync/index.js.map +1 -1
- package/esm/commands/sync/list.d.ts +42 -40
- package/esm/commands/sync/list.d.ts.map +1 -1
- package/esm/commands/sync/list.js +67 -47
- package/esm/commands/sync/list.js.map +1 -1
- package/esm/commands/sync/pull.d.ts +13 -11
- package/esm/commands/sync/pull.d.ts.map +1 -1
- package/esm/commands/sync/pull.js +35 -37
- package/esm/commands/sync/pull.js.map +1 -1
- package/esm/commands/sync/push.d.ts +46 -7
- package/esm/commands/sync/push.d.ts.map +1 -1
- package/esm/commands/sync/push.js +89 -22
- package/esm/commands/sync/push.js.map +1 -1
- package/esm/commands/sync/request.d.ts +26 -23
- package/esm/commands/sync/request.d.ts.map +1 -1
- package/esm/commands/sync/request.js +40 -42
- package/esm/commands/sync/request.js.map +1 -1
- package/esm/commands/sync/response.d.ts +19 -19
- package/esm/commands/sync/response.d.ts.map +1 -1
- package/esm/commands/sync/response.js +54 -54
- package/esm/commands/sync/response.js.map +1 -1
- package/esm/commands/sync/socket.d.ts +27 -0
- package/esm/commands/sync/socket.d.ts.map +1 -0
- package/esm/commands/sync/socket.js +66 -0
- package/esm/commands/sync/socket.js.map +1 -0
- package/esm/commands/sync/stat.d.ts +72 -72
- package/esm/commands/sync/stat.d.ts.map +1 -1
- package/esm/commands/sync/stat.js +116 -104
- package/esm/commands/sync/stat.js.map +1 -1
- package/esm/commands/sync/sync.d.ts +72 -60
- package/esm/commands/sync/sync.d.ts.map +1 -1
- package/esm/commands/sync/sync.js +127 -149
- package/esm/commands/sync/sync.js.map +1 -1
- package/esm/commands/tcpip.d.ts +5 -5
- package/esm/commands/tcpip.js +18 -18
- package/esm/crypto.d.ts +36 -36
- package/esm/crypto.js +248 -248
- package/esm/features.d.ts +10 -7
- package/esm/features.d.ts.map +1 -1
- package/esm/features.js +13 -10
- package/esm/features.js.map +1 -1
- package/esm/index.d.ts +9 -9
- package/esm/index.js +9 -9
- package/esm/packet.d.ts +45 -46
- package/esm/packet.d.ts.map +1 -1
- package/esm/packet.js +43 -48
- package/esm/packet.js.map +1 -1
- package/esm/socket/dispatcher.d.ts +59 -59
- package/esm/socket/dispatcher.d.ts.map +1 -1
- package/esm/socket/dispatcher.js +223 -234
- package/esm/socket/dispatcher.js.map +1 -1
- package/esm/socket/index.d.ts +2 -2
- package/esm/socket/index.js +2 -2
- package/esm/socket/socket.d.ts +59 -59
- package/esm/socket/socket.d.ts.map +1 -1
- package/esm/socket/socket.js +118 -118
- package/esm/socket/socket.js.map +1 -1
- package/esm/utils/auto-reset-event.d.ts +9 -9
- package/esm/utils/auto-reset-event.d.ts.map +1 -1
- package/esm/utils/auto-reset-event.js +33 -33
- package/esm/utils/auto-reset-event.js.map +1 -1
- package/esm/utils/base64.d.ts +27 -27
- package/esm/utils/base64.js +246 -246
- package/esm/utils/conditional-variable.d.ts +9 -0
- package/esm/utils/conditional-variable.d.ts.map +1 -0
- package/esm/utils/conditional-variable.js +34 -0
- package/esm/utils/conditional-variable.js.map +1 -0
- package/esm/utils/index.d.ts +4 -3
- package/esm/utils/index.d.ts.map +1 -1
- package/esm/utils/index.js +4 -3
- package/esm/utils/index.js.map +1 -1
- package/package.json +11 -10
- package/src/adb.ts +47 -37
- package/src/auth.ts +7 -6
- package/src/backend.ts +4 -4
- package/src/commands/base.ts +1 -1
- package/src/commands/framebuffer.ts +4 -4
- package/src/commands/index.ts +7 -8
- package/src/commands/reverse.ts +35 -10
- package/src/commands/subprocess/command.ts +12 -4
- package/src/commands/subprocess/index.ts +3 -3
- package/src/commands/subprocess/protocols/index.ts +3 -3
- package/src/commands/subprocess/protocols/none.ts +25 -11
- package/src/commands/subprocess/protocols/shell.ts +50 -28
- package/src/commands/subprocess/protocols/types.ts +8 -7
- package/src/commands/subprocess/utils.ts +1 -1
- package/src/commands/sync/index.ts +8 -7
- package/src/commands/sync/list.ts +42 -23
- package/src/commands/sync/pull.ts +40 -45
- package/src/commands/sync/push.ts +146 -39
- package/src/commands/sync/request.ts +20 -15
- package/src/commands/sync/response.ts +7 -6
- package/src/commands/sync/socket.ts +97 -0
- package/src/commands/sync/stat.ts +47 -42
- package/src/commands/sync/sync.ts +68 -108
- package/src/commands/tcpip.ts +5 -5
- package/src/features.ts +9 -6
- package/src/packet.ts +19 -34
- package/src/socket/dispatcher.ts +32 -47
- package/src/socket/index.ts +2 -2
- package/src/socket/socket.ts +26 -17
- package/src/utils/auto-reset-event.ts +14 -15
- package/src/utils/conditional-variable.ts +45 -0
- package/src/utils/index.ts +4 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/src/commands/install.ts +0 -40
package/esm/commands/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from './tcpip.js';
|
|
1
|
+
export * from "./base.js";
|
|
2
|
+
export * from "./framebuffer.js";
|
|
3
|
+
export * from "./power.js";
|
|
4
|
+
export * from "./reverse.js";
|
|
5
|
+
export * from "./subprocess/index.js";
|
|
6
|
+
export * from "./sync/index.js";
|
|
7
|
+
export * from "./tcpip.js";
|
|
9
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import type { ReadableStream } from "@yume-chan/stream-extra";
|
|
2
|
+
import type { Adb } from "../adb.js";
|
|
3
|
+
/**
|
|
4
|
+
* Install an apk file to the device.
|
|
5
|
+
* @param adb An Adb instance
|
|
6
|
+
* @returns A writable stream that accepts an APK file
|
|
7
|
+
* @deprecated Use `PackageManager#installStream` from `@yume-chan/android-bin` package instead.
|
|
8
|
+
*/
|
|
9
|
+
export declare function install(adb: Adb, file: ReadableStream<Uint8Array>): Promise<void>;
|
|
4
10
|
//# sourceMappingURL=install.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAIrC;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,iBAoBvE"}
|
package/esm/commands/install.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { WrapWritableStream, } from "@yume-chan/stream-extra";
|
|
2
1
|
import { escapeArg } from "./subprocess/index.js";
|
|
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
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Install an apk file to the device.
|
|
4
|
+
* @param adb An Adb instance
|
|
5
|
+
* @returns A writable stream that accepts an APK file
|
|
6
|
+
* @deprecated Use `PackageManager#installStream` from `@yume-chan/android-bin` package instead.
|
|
7
|
+
*/
|
|
8
|
+
export async function install(adb, file) {
|
|
9
|
+
const fileName = Math.random().toString().substring(2);
|
|
10
|
+
const filePath = `/data/local/tmp/${fileName}.apk`;
|
|
11
|
+
const sync = await adb.sync();
|
|
12
|
+
try {
|
|
13
|
+
await sync.write(filePath, file, undefined, undefined);
|
|
14
|
+
}
|
|
15
|
+
finally {
|
|
16
|
+
await sync.dispose();
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
await adb.subprocess.spawnAndWaitLegacy([
|
|
20
|
+
"pm",
|
|
21
|
+
"install",
|
|
22
|
+
escapeArg(filePath),
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
await adb.rm(filePath);
|
|
27
|
+
}
|
|
28
28
|
}
|
|
29
29
|
//# sourceMappingURL=install.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,GAAQ,EAAE,IAAgC;IACpE,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAG,mBAAmB,QAAQ,MAAM,CAAC;IAEnD,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9B,IAAI;QACA,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;KAC1D;YAAS;QACN,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;KACxB;IAED,IAAI;QACA,MAAM,GAAG,CAAC,UAAU,CAAC,kBAAkB,CAAC;YACpC,IAAI;YACJ,SAAS;YACT,SAAS,CAAC,QAAQ,CAAC;SACtB,CAAC,CAAC;KACN;YAAS;QACN,MAAM,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;KAC1B;AACL,CAAC"}
|
package/esm/commands/power.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { AdbCommandBase } from "./base.js";
|
|
2
|
-
export declare class AdbPower extends AdbCommandBase {
|
|
3
|
-
reboot(name?: string): Promise<string>;
|
|
4
|
-
bootloader(): Promise<string>;
|
|
5
|
-
fastboot(): Promise<string>;
|
|
6
|
-
recovery(): Promise<string>;
|
|
7
|
-
sideload(): Promise<string>;
|
|
8
|
-
/**
|
|
9
|
-
* Reboot to Qualcomm Emergency Download (EDL) Mode.
|
|
10
|
-
*
|
|
11
|
-
* Only works on some Qualcomm devices.
|
|
12
|
-
*/
|
|
13
|
-
qualcommEdlMode(): Promise<string>;
|
|
14
|
-
powerOff(): Promise<string>;
|
|
15
|
-
powerButton(longPress?: boolean): Promise<string>;
|
|
16
|
-
/**
|
|
17
|
-
* Reboot to Samsung Odin download mode.
|
|
18
|
-
*
|
|
19
|
-
* Only works on Samsung devices.
|
|
20
|
-
*/
|
|
21
|
-
samsungOdin(): Promise<string>;
|
|
22
|
-
}
|
|
1
|
+
import { AdbCommandBase } from "./base.js";
|
|
2
|
+
export declare class AdbPower extends AdbCommandBase {
|
|
3
|
+
reboot(name?: string): Promise<string>;
|
|
4
|
+
bootloader(): Promise<string>;
|
|
5
|
+
fastboot(): Promise<string>;
|
|
6
|
+
recovery(): Promise<string>;
|
|
7
|
+
sideload(): Promise<string>;
|
|
8
|
+
/**
|
|
9
|
+
* Reboot to Qualcomm Emergency Download (EDL) Mode.
|
|
10
|
+
*
|
|
11
|
+
* Only works on some Qualcomm devices.
|
|
12
|
+
*/
|
|
13
|
+
qualcommEdlMode(): Promise<string>;
|
|
14
|
+
powerOff(): Promise<string>;
|
|
15
|
+
powerButton(longPress?: boolean): Promise<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Reboot to Samsung Odin download mode.
|
|
18
|
+
*
|
|
19
|
+
* Only works on Samsung devices.
|
|
20
|
+
*/
|
|
21
|
+
samsungOdin(): Promise<string>;
|
|
22
|
+
}
|
|
23
23
|
//# sourceMappingURL=power.d.ts.map
|
package/esm/commands/power.js
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
// cspell: ignore bootloader
|
|
2
|
-
// cspell: ignore fastboot
|
|
3
|
-
// cspell: ignore keyevent
|
|
4
|
-
// cspell: ignore longpress
|
|
5
|
-
import { AdbCommandBase } from "./base.js";
|
|
6
|
-
export class AdbPower extends AdbCommandBase {
|
|
7
|
-
reboot(name = "") {
|
|
8
|
-
return this.adb.createSocketAndWait(`reboot:${name}`);
|
|
9
|
-
}
|
|
10
|
-
bootloader() {
|
|
11
|
-
return this.reboot("bootloader");
|
|
12
|
-
}
|
|
13
|
-
fastboot() {
|
|
14
|
-
return this.reboot("fastboot");
|
|
15
|
-
}
|
|
16
|
-
recovery() {
|
|
17
|
-
return this.reboot("recovery");
|
|
18
|
-
}
|
|
19
|
-
sideload() {
|
|
20
|
-
return this.reboot("sideload");
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Reboot to Qualcomm Emergency Download (EDL) Mode.
|
|
24
|
-
*
|
|
25
|
-
* Only works on some Qualcomm devices.
|
|
26
|
-
*/
|
|
27
|
-
qualcommEdlMode() {
|
|
28
|
-
return this.reboot("edl");
|
|
29
|
-
}
|
|
30
|
-
powerOff() {
|
|
31
|
-
return this.adb.subprocess.spawnAndWaitLegacy(["reboot", "-p"]);
|
|
32
|
-
}
|
|
33
|
-
powerButton(longPress = false) {
|
|
34
|
-
return this.adb.subprocess.spawnAndWaitLegacy([
|
|
35
|
-
"input",
|
|
36
|
-
"keyevent",
|
|
37
|
-
longPress ? "--longpress POWER" : "POWER",
|
|
38
|
-
]);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Reboot to Samsung Odin download mode.
|
|
42
|
-
*
|
|
43
|
-
* Only works on Samsung devices.
|
|
44
|
-
*/
|
|
45
|
-
samsungOdin() {
|
|
46
|
-
return this.reboot("download");
|
|
47
|
-
}
|
|
48
|
-
}
|
|
1
|
+
// cspell: ignore bootloader
|
|
2
|
+
// cspell: ignore fastboot
|
|
3
|
+
// cspell: ignore keyevent
|
|
4
|
+
// cspell: ignore longpress
|
|
5
|
+
import { AdbCommandBase } from "./base.js";
|
|
6
|
+
export class AdbPower extends AdbCommandBase {
|
|
7
|
+
reboot(name = "") {
|
|
8
|
+
return this.adb.createSocketAndWait(`reboot:${name}`);
|
|
9
|
+
}
|
|
10
|
+
bootloader() {
|
|
11
|
+
return this.reboot("bootloader");
|
|
12
|
+
}
|
|
13
|
+
fastboot() {
|
|
14
|
+
return this.reboot("fastboot");
|
|
15
|
+
}
|
|
16
|
+
recovery() {
|
|
17
|
+
return this.reboot("recovery");
|
|
18
|
+
}
|
|
19
|
+
sideload() {
|
|
20
|
+
return this.reboot("sideload");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Reboot to Qualcomm Emergency Download (EDL) Mode.
|
|
24
|
+
*
|
|
25
|
+
* Only works on some Qualcomm devices.
|
|
26
|
+
*/
|
|
27
|
+
qualcommEdlMode() {
|
|
28
|
+
return this.reboot("edl");
|
|
29
|
+
}
|
|
30
|
+
powerOff() {
|
|
31
|
+
return this.adb.subprocess.spawnAndWaitLegacy(["reboot", "-p"]);
|
|
32
|
+
}
|
|
33
|
+
powerButton(longPress = false) {
|
|
34
|
+
return this.adb.subprocess.spawnAndWaitLegacy([
|
|
35
|
+
"input",
|
|
36
|
+
"keyevent",
|
|
37
|
+
longPress ? "--longpress POWER" : "POWER",
|
|
38
|
+
]);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Reboot to Samsung Odin download mode.
|
|
42
|
+
*
|
|
43
|
+
* Only works on Samsung devices.
|
|
44
|
+
*/
|
|
45
|
+
samsungOdin() {
|
|
46
|
+
return this.reboot("download");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
49
|
//# sourceMappingURL=power.js.map
|
|
@@ -1,29 +1,42 @@
|
|
|
1
|
-
import { AutoDisposable } from "@yume-chan/event";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export interface AdbForwardListener {
|
|
5
|
-
deviceSerial: string;
|
|
6
|
-
localName: string;
|
|
7
|
-
remoteName: string;
|
|
8
|
-
}
|
|
9
|
-
export declare class
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { AutoDisposable } from "@yume-chan/event";
|
|
2
|
+
import type { Adb } from "../adb.js";
|
|
3
|
+
import type { AdbIncomingSocketHandler, AdbSocket } from "../socket/index.js";
|
|
4
|
+
export interface AdbForwardListener {
|
|
5
|
+
deviceSerial: string;
|
|
6
|
+
localName: string;
|
|
7
|
+
remoteName: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class AdbReverseError extends Error {
|
|
10
|
+
constructor(message: string);
|
|
11
|
+
}
|
|
12
|
+
export declare class AdbReverseNotSupportedError extends Error {
|
|
13
|
+
constructor();
|
|
14
|
+
}
|
|
15
|
+
export declare class AdbReverseCommand extends AutoDisposable {
|
|
16
|
+
protected localAddressToHandler: Map<string, AdbIncomingSocketHandler>;
|
|
17
|
+
protected deviceAddressToLocalAddress: Map<string, string>;
|
|
18
|
+
protected adb: Adb;
|
|
19
|
+
protected listening: boolean;
|
|
20
|
+
constructor(adb: Adb);
|
|
21
|
+
protected handleIncomingSocket: (socket: AdbSocket) => Promise<boolean>;
|
|
22
|
+
private createBufferedStream;
|
|
23
|
+
private sendRequest;
|
|
24
|
+
list(): Promise<AdbForwardListener[]>;
|
|
25
|
+
/**
|
|
26
|
+
* @param deviceAddress
|
|
27
|
+
* The address to be listened on device by ADB daemon. Or `tcp:0` to choose an available TCP port.
|
|
28
|
+
* @param localAddress
|
|
29
|
+
* An identifier for the reverse tunnel.
|
|
30
|
+
*
|
|
31
|
+
* When a socket wants to connect to {@link deviceAddress}, native ADB client will forward that connection to {@link localAddress}.
|
|
32
|
+
* However in this library, the {@link handler} is invoked instead. So this parameter is only used to identify the reverse tunnel.
|
|
33
|
+
* @param handler A callback to handle incoming connections. It must return `true` if it accepts the connection.
|
|
34
|
+
* @returns `tcp:{ACTUAL_LISTENING_PORT}`, If `deviceAddress` is `tcp:0`; otherwise, `deviceAddress`.
|
|
35
|
+
* @throws {AdbReverseNotSupportedError} If ADB reverse tunnel is not supported on this device when connected wirelessly.
|
|
36
|
+
* @throws {AdbReverseError} If ADB daemon returns an error.
|
|
37
|
+
*/
|
|
38
|
+
add(deviceAddress: string, localAddress: string, handler: AdbIncomingSocketHandler): Promise<string>;
|
|
39
|
+
remove(deviceAddress: string): Promise<void>;
|
|
40
|
+
removeAll(): Promise<void>;
|
|
41
|
+
}
|
|
29
42
|
//# sourceMappingURL=reverse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reverse.d.ts","sourceRoot":"","sources":["../../src/commands/reverse.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOlD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"reverse.d.ts","sourceRoot":"","sources":["../../src/commands/reverse.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOlD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG9E,MAAM,WAAW,kBAAkB;IAC/B,YAAY,EAAE,MAAM,CAAC;IAErB,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,qBAAa,eAAgB,SAAQ,KAAK;gBACnB,OAAO,EAAE,MAAM;CAIrC;AAED,qBAAa,2BAA4B,SAAQ,KAAK;;CAOrD;AAeD,qBAAa,iBAAkB,SAAQ,cAAc;IACjD,SAAS,CAAC,qBAAqB,wCAG3B;IAEJ,SAAS,CAAC,2BAA2B,sBAA6B;IAElE,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC;IAEnB,SAAS,CAAC,SAAS,UAAS;gBAET,GAAG,EAAE,GAAG;IAS3B,SAAS,CAAC,oBAAoB,WAAkB,SAAS,sBAKvD;YAEY,oBAAoB;YAKpB,WAAW;IASZ,IAAI,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAgBlD;;;;;;;;;;;;OAYG;IACU,GAAG,CACZ,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,wBAAwB,GAClC,OAAO,CAAC,MAAM,CAAC;IAkCL,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAa5C,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ1C"}
|
package/esm/commands/reverse.js
CHANGED
|
@@ -1,101 +1,126 @@
|
|
|
1
|
-
// cspell: ignore killforward
|
|
2
|
-
import { AutoDisposable } from "@yume-chan/event";
|
|
3
|
-
import { BufferedReadableStream, BufferedReadableStreamEndedError, } from "@yume-chan/stream-extra";
|
|
4
|
-
import Struct from "@yume-chan/struct";
|
|
5
|
-
import { decodeUtf8 } from "../utils/index.js";
|
|
6
|
-
const AdbReverseStringResponse = new Struct()
|
|
7
|
-
.string("length", { length: 4 })
|
|
8
|
-
.string("content", { lengthField: "length", lengthFieldRadix: 16 });
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
1
|
+
// cspell: ignore killforward
|
|
2
|
+
import { AutoDisposable } from "@yume-chan/event";
|
|
3
|
+
import { BufferedReadableStream, BufferedReadableStreamEndedError, } from "@yume-chan/stream-extra";
|
|
4
|
+
import Struct from "@yume-chan/struct";
|
|
5
|
+
import { decodeUtf8 } from "../utils/index.js";
|
|
6
|
+
const AdbReverseStringResponse = new Struct()
|
|
7
|
+
.string("length", { length: 4 })
|
|
8
|
+
.string("content", { lengthField: "length", lengthFieldRadix: 16 });
|
|
9
|
+
export class AdbReverseError extends Error {
|
|
10
|
+
constructor(message) {
|
|
11
|
+
super(message);
|
|
12
|
+
Object.setPrototypeOf(this, AdbReverseError.prototype);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export class AdbReverseNotSupportedError extends Error {
|
|
16
|
+
constructor() {
|
|
17
|
+
super("ADB reverse tunnel is not supported on this device when connected wirelessly.");
|
|
18
|
+
Object.setPrototypeOf(this, AdbReverseNotSupportedError.prototype);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const AdbReverseErrorResponse = new Struct()
|
|
22
|
+
.fields(AdbReverseStringResponse)
|
|
23
|
+
.postDeserialize((value) => {
|
|
24
|
+
// https://issuetracker.google.com/issues/37066218
|
|
25
|
+
// ADB on Android <9 can't create reverse tunnels when connected wirelessly (ADB over WiFi),
|
|
26
|
+
// and returns this confusing "more than one device/emulator" error.
|
|
27
|
+
if (value.content === "more than one device/emulator") {
|
|
28
|
+
throw new AdbReverseNotSupportedError();
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
throw new AdbReverseError(value.content);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
export class AdbReverseCommand extends AutoDisposable {
|
|
35
|
+
localAddressToHandler = new Map();
|
|
36
|
+
deviceAddressToLocalAddress = new Map();
|
|
37
|
+
adb;
|
|
38
|
+
listening = false;
|
|
39
|
+
constructor(adb) {
|
|
40
|
+
super();
|
|
41
|
+
this.adb = adb;
|
|
42
|
+
this.addDisposable(this.adb.onIncomingSocket(this.handleIncomingSocket));
|
|
43
|
+
}
|
|
44
|
+
handleIncomingSocket = async (socket) => {
|
|
45
|
+
let address = socket.serviceString;
|
|
46
|
+
// ADB daemon appends `\0` to the service string
|
|
47
|
+
address = address.replace(/\0/g, "");
|
|
48
|
+
return !!(await this.localAddressToHandler.get(address)?.(socket));
|
|
49
|
+
};
|
|
50
|
+
async createBufferedStream(service) {
|
|
51
|
+
const socket = await this.adb.createSocket(service);
|
|
52
|
+
return new BufferedReadableStream(socket.readable);
|
|
53
|
+
}
|
|
54
|
+
async sendRequest(service) {
|
|
55
|
+
const stream = await this.createBufferedStream(service);
|
|
56
|
+
const success = decodeUtf8(await stream.read(4)) === "OKAY";
|
|
57
|
+
if (!success) {
|
|
58
|
+
await AdbReverseErrorResponse.deserialize(stream);
|
|
59
|
+
}
|
|
60
|
+
return stream;
|
|
61
|
+
}
|
|
62
|
+
async list() {
|
|
63
|
+
const stream = await this.createBufferedStream("reverse:list-forward");
|
|
64
|
+
const response = await AdbReverseStringResponse.deserialize(stream);
|
|
65
|
+
return response.content.split("\n").map((line) => {
|
|
66
|
+
const [deviceSerial, localName, remoteName] = line.split(" ");
|
|
67
|
+
return { deviceSerial, localName, remoteName };
|
|
68
|
+
});
|
|
69
|
+
// No need to close the stream, device will close it
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @param deviceAddress
|
|
73
|
+
* The address to be listened on device by ADB daemon. Or `tcp:0` to choose an available TCP port.
|
|
74
|
+
* @param localAddress
|
|
75
|
+
* An identifier for the reverse tunnel.
|
|
76
|
+
*
|
|
77
|
+
* When a socket wants to connect to {@link deviceAddress}, native ADB client will forward that connection to {@link localAddress}.
|
|
78
|
+
* However in this library, the {@link handler} is invoked instead. So this parameter is only used to identify the reverse tunnel.
|
|
79
|
+
* @param handler A callback to handle incoming connections. It must return `true` if it accepts the connection.
|
|
80
|
+
* @returns `tcp:{ACTUAL_LISTENING_PORT}`, If `deviceAddress` is `tcp:0`; otherwise, `deviceAddress`.
|
|
81
|
+
* @throws {AdbReverseNotSupportedError} If ADB reverse tunnel is not supported on this device when connected wirelessly.
|
|
82
|
+
* @throws {AdbReverseError} If ADB daemon returns an error.
|
|
83
|
+
*/
|
|
84
|
+
async add(deviceAddress, localAddress, handler) {
|
|
85
|
+
const stream = await this.sendRequest(`reverse:forward:${deviceAddress};${localAddress}`);
|
|
86
|
+
// `tcp:0` tells the device to pick an available port.
|
|
87
|
+
// On Android >=8, device will respond with the selected port for all `tcp:` requests.
|
|
88
|
+
if (deviceAddress.startsWith("tcp:")) {
|
|
89
|
+
let length;
|
|
90
|
+
try {
|
|
91
|
+
length = Number.parseInt(decodeUtf8(await stream.read(4)), 16);
|
|
92
|
+
}
|
|
93
|
+
catch (e) {
|
|
94
|
+
if (!(e instanceof BufferedReadableStreamEndedError)) {
|
|
95
|
+
throw e;
|
|
96
|
+
}
|
|
97
|
+
// Android <8 doesn't have this response.
|
|
98
|
+
// (the stream is closed now)
|
|
99
|
+
// Can be safely ignored.
|
|
100
|
+
}
|
|
101
|
+
if (length !== undefined) {
|
|
102
|
+
const port = decodeUtf8(await stream.read(length));
|
|
103
|
+
deviceAddress = `tcp:${Number.parseInt(port, 10)}`;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
this.localAddressToHandler.set(localAddress, handler);
|
|
107
|
+
this.deviceAddressToLocalAddress.set(deviceAddress, localAddress);
|
|
108
|
+
return deviceAddress;
|
|
109
|
+
// No need to close the stream, device will close it
|
|
110
|
+
}
|
|
111
|
+
async remove(deviceAddress) {
|
|
112
|
+
await this.sendRequest(`reverse:killforward:${deviceAddress}`);
|
|
113
|
+
if (this.deviceAddressToLocalAddress.has(deviceAddress)) {
|
|
114
|
+
this.localAddressToHandler.delete(this.deviceAddressToLocalAddress.get(deviceAddress));
|
|
115
|
+
this.deviceAddressToLocalAddress.delete(deviceAddress);
|
|
116
|
+
}
|
|
117
|
+
// No need to close the stream, device will close it
|
|
118
|
+
}
|
|
119
|
+
async removeAll() {
|
|
120
|
+
await this.sendRequest(`reverse:killforward-all`);
|
|
121
|
+
this.deviceAddressToLocalAddress.clear();
|
|
122
|
+
this.localAddressToHandler.clear();
|
|
123
|
+
// No need to close the stream, device will close it
|
|
124
|
+
}
|
|
125
|
+
}
|
|
101
126
|
//# sourceMappingURL=reverse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reverse.js","sourceRoot":"","sources":["../../src/commands/reverse.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACH,sBAAsB,EACtB,gCAAgC,GACnC,MAAM,yBAAyB,CAAC;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"reverse.js","sourceRoot":"","sources":["../../src/commands/reverse.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACH,sBAAsB,EACtB,gCAAgC,GACnC,MAAM,yBAAyB,CAAC;AACjC,OAAO,MAAM,MAAM,mBAAmB,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