@yume-chan/adb 0.0.17 → 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 +27 -0
- package/CHANGELOG.md +16 -1
- package/LICENSE +1 -1
- package/esm/adb.d.ts +63 -60
- package/esm/adb.d.ts.map +1 -1
- package/esm/adb.js +257 -229
- 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.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 -47
- 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 +27 -21
- package/esm/commands/install.js.map +1 -1
- package/esm/commands/power.d.ts +22 -22
- package/esm/commands/power.d.ts.map +1 -1
- package/esm/commands/power.js +48 -44
- package/esm/commands/power.js.map +1 -1
- package/esm/commands/reverse.d.ts +41 -28
- package/esm/commands/reverse.d.ts.map +1 -1
- package/esm/commands/reverse.js +125 -98
- 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 -82
- 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 -154
- 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 -35
- 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 -36
- 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 -23
- 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 -94
- 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 -148
- 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.d.ts.map +1 -1
- package/esm/crypto.js +248 -238
- package/esm/crypto.js.map +1 -1
- 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.d.ts.map +1 -1
- package/esm/index.js +9 -9
- package/esm/index.js.map +1 -1
- package/esm/packet.d.ts +45 -46
- package/esm/packet.d.ts.map +1 -1
- package/esm/packet.js +43 -46
- 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 -231
- 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 -98
- 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.d.ts.map +1 -1
- package/esm/utils/base64.js +246 -245
- package/esm/utils/base64.js.map +1 -1
- 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 +17 -13
- package/src/adb.ts +160 -101
- package/src/auth.ts +31 -22
- package/src/backend.ts +6 -4
- package/src/commands/base.ts +2 -2
- package/src/commands/framebuffer.ts +37 -41
- package/src/commands/index.ts +7 -8
- package/src/commands/power.ts +15 -11
- package/src/commands/reverse.ts +74 -30
- package/src/commands/subprocess/command.ts +34 -23
- package/src/commands/subprocess/index.ts +3 -3
- package/src/commands/subprocess/protocols/index.ts +3 -3
- package/src/commands/subprocess/protocols/none.ts +26 -11
- package/src/commands/subprocess/protocols/shell.ts +110 -56
- package/src/commands/subprocess/protocols/types.ts +10 -6
- package/src/commands/subprocess/utils.ts +1 -1
- package/src/commands/sync/index.ts +8 -7
- package/src/commands/sync/list.ts +74 -28
- package/src/commands/sync/pull.ts +49 -37
- package/src/commands/sync/push.ts +153 -32
- package/src/commands/sync/request.ts +37 -34
- package/src/commands/sync/response.ts +34 -27
- package/src/commands/sync/socket.ts +97 -0
- package/src/commands/sync/stat.ts +98 -70
- package/src/commands/sync/sync.ts +78 -97
- package/src/commands/tcpip.ts +5 -5
- package/src/crypto.ts +60 -32
- package/src/features.ts +9 -6
- package/src/index.ts +9 -10
- package/src/packet.ts +41 -46
- package/src/socket/dispatcher.ts +130 -108
- package/src/socket/index.ts +2 -2
- package/src/socket/socket.ts +84 -34
- package/src/utils/auto-reset-event.ts +16 -17
- package/src/utils/base64.ts +51 -41
- package/src/utils/conditional-variable.ts +45 -0
- package/src/utils/index.ts +4 -3
- package/tsconfig.build.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/src/commands/install.ts +0 -32
|
@@ -1,95 +1,117 @@
|
|
|
1
|
-
import Struct, { placeholder } from
|
|
2
|
-
import { AdbSyncRequestId, adbSyncWriteRequest } from
|
|
3
|
-
import {
|
|
4
|
-
// https://github.com/python/cpython/blob/4e581d64b8aff3e2eda99b12f080c877bb78dfca/Lib/stat.py#L36
|
|
5
|
-
export var LinuxFileType;
|
|
6
|
-
(function (LinuxFileType) {
|
|
7
|
-
LinuxFileType[LinuxFileType["Directory"] = 4] = "Directory";
|
|
8
|
-
LinuxFileType[LinuxFileType["File"] = 8] = "File";
|
|
9
|
-
LinuxFileType[LinuxFileType["Link"] = 10] = "Link";
|
|
10
|
-
})(LinuxFileType = LinuxFileType || (LinuxFileType = {}));
|
|
11
|
-
export const AdbSyncLstatResponse = new Struct({ littleEndian: true })
|
|
12
|
-
.int32(
|
|
13
|
-
.int32(
|
|
14
|
-
.int32(
|
|
15
|
-
.extra({
|
|
16
|
-
id: AdbSyncResponseId.Lstat,
|
|
17
|
-
get type() {
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
32
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
33
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
34
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
35
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
36
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
37
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
38
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
39
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
40
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
41
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
42
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
43
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
44
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
45
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
46
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
47
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
48
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
49
|
-
AdbSyncStatErrorCode[AdbSyncStatErrorCode["
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
.
|
|
55
|
-
.
|
|
56
|
-
.
|
|
57
|
-
.uint32(
|
|
58
|
-
.uint32(
|
|
59
|
-
.
|
|
60
|
-
.
|
|
61
|
-
.uint64(
|
|
62
|
-
.uint64(
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
1
|
+
import Struct, { placeholder } from "@yume-chan/struct";
|
|
2
|
+
import { AdbSyncRequestId, adbSyncWriteRequest } from "./request.js";
|
|
3
|
+
import { AdbSyncResponseId, adbSyncReadResponse } from "./response.js";
|
|
4
|
+
// https://github.com/python/cpython/blob/4e581d64b8aff3e2eda99b12f080c877bb78dfca/Lib/stat.py#L36
|
|
5
|
+
export var LinuxFileType;
|
|
6
|
+
(function (LinuxFileType) {
|
|
7
|
+
LinuxFileType[LinuxFileType["Directory"] = 4] = "Directory";
|
|
8
|
+
LinuxFileType[LinuxFileType["File"] = 8] = "File";
|
|
9
|
+
LinuxFileType[LinuxFileType["Link"] = 10] = "Link";
|
|
10
|
+
})(LinuxFileType = LinuxFileType || (LinuxFileType = {}));
|
|
11
|
+
export const AdbSyncLstatResponse = new Struct({ littleEndian: true })
|
|
12
|
+
.int32("mode")
|
|
13
|
+
.int32("size")
|
|
14
|
+
.int32("mtime")
|
|
15
|
+
.extra({
|
|
16
|
+
id: AdbSyncResponseId.Lstat,
|
|
17
|
+
get type() {
|
|
18
|
+
return (this.mode >> 12);
|
|
19
|
+
},
|
|
20
|
+
get permission() {
|
|
21
|
+
return this.mode & 4095;
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
.postDeserialize((object) => {
|
|
25
|
+
if (object.mode === 0 && object.size === 0 && object.mtime === 0) {
|
|
26
|
+
throw new Error("lstat error");
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
export var AdbSyncStatErrorCode;
|
|
30
|
+
(function (AdbSyncStatErrorCode) {
|
|
31
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["SUCCESS"] = 0] = "SUCCESS";
|
|
32
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["EACCES"] = 13] = "EACCES";
|
|
33
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["EEXIST"] = 17] = "EEXIST";
|
|
34
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["EFAULT"] = 14] = "EFAULT";
|
|
35
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["EFBIG"] = 27] = "EFBIG";
|
|
36
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["EINTR"] = 4] = "EINTR";
|
|
37
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["EINVAL"] = 22] = "EINVAL";
|
|
38
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["EIO"] = 5] = "EIO";
|
|
39
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["EISDIR"] = 21] = "EISDIR";
|
|
40
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["ELOOP"] = 40] = "ELOOP";
|
|
41
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["EMFILE"] = 24] = "EMFILE";
|
|
42
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["ENAMETOOLONG"] = 36] = "ENAMETOOLONG";
|
|
43
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["ENFILE"] = 23] = "ENFILE";
|
|
44
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["ENOENT"] = 2] = "ENOENT";
|
|
45
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["ENOMEM"] = 12] = "ENOMEM";
|
|
46
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["ENOSPC"] = 28] = "ENOSPC";
|
|
47
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["ENOTDIR"] = 20] = "ENOTDIR";
|
|
48
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["EOVERFLOW"] = 75] = "EOVERFLOW";
|
|
49
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["EPERM"] = 1] = "EPERM";
|
|
50
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["EROFS"] = 30] = "EROFS";
|
|
51
|
+
AdbSyncStatErrorCode[AdbSyncStatErrorCode["ETXTBSY"] = 26] = "ETXTBSY";
|
|
52
|
+
})(AdbSyncStatErrorCode = AdbSyncStatErrorCode || (AdbSyncStatErrorCode = {}));
|
|
53
|
+
export const AdbSyncStatResponse = new Struct({ littleEndian: true })
|
|
54
|
+
.uint32("error", placeholder())
|
|
55
|
+
.uint64("dev")
|
|
56
|
+
.uint64("ino")
|
|
57
|
+
.uint32("mode")
|
|
58
|
+
.uint32("nlink")
|
|
59
|
+
.uint32("uid")
|
|
60
|
+
.uint32("gid")
|
|
61
|
+
.uint64("size")
|
|
62
|
+
.uint64("atime")
|
|
63
|
+
.uint64("mtime")
|
|
64
|
+
.uint64("ctime")
|
|
65
|
+
.extra({
|
|
66
|
+
id: AdbSyncResponseId.Stat,
|
|
67
|
+
get type() {
|
|
68
|
+
return (this.mode >> 12);
|
|
69
|
+
},
|
|
70
|
+
get permission() {
|
|
71
|
+
return this.mode & 4095;
|
|
72
|
+
},
|
|
73
|
+
})
|
|
74
|
+
.postDeserialize((object) => {
|
|
75
|
+
if (object.error) {
|
|
76
|
+
throw new Error(AdbSyncStatErrorCode[object.error]);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
export async function adbSyncLstat(socket, path, v2) {
|
|
80
|
+
const locked = await socket.lock();
|
|
81
|
+
try {
|
|
82
|
+
if (v2) {
|
|
83
|
+
await adbSyncWriteRequest(locked, AdbSyncRequestId.LstatV2, path);
|
|
84
|
+
return await adbSyncReadResponse(locked, AdbSyncResponseId.Lstat2, AdbSyncStatResponse);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
await adbSyncWriteRequest(locked, AdbSyncRequestId.Lstat, path);
|
|
88
|
+
const response = await adbSyncReadResponse(locked, AdbSyncResponseId.Lstat, AdbSyncLstatResponse);
|
|
89
|
+
return {
|
|
90
|
+
mode: response.mode,
|
|
91
|
+
// Convert to `BigInt` to make it compatible with `AdbSyncStatResponse`
|
|
92
|
+
size: BigInt(response.size),
|
|
93
|
+
mtime: BigInt(response.mtime),
|
|
94
|
+
get type() {
|
|
95
|
+
return response.type;
|
|
96
|
+
},
|
|
97
|
+
get permission() {
|
|
98
|
+
return response.permission;
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
finally {
|
|
104
|
+
locked.release();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
export async function adbSyncStat(socket, path) {
|
|
108
|
+
const locked = await socket.lock();
|
|
109
|
+
try {
|
|
110
|
+
await adbSyncWriteRequest(locked, AdbSyncRequestId.Stat, path);
|
|
111
|
+
return await adbSyncReadResponse(locked, AdbSyncResponseId.Stat, AdbSyncStatResponse);
|
|
112
|
+
}
|
|
113
|
+
finally {
|
|
114
|
+
locked.release();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
95
117
|
//# sourceMappingURL=stat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat.js","sourceRoot":"","sources":["../../../src/commands/sync/stat.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stat.js","sourceRoot":"","sources":["../../../src/commands/sync/stat.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGvE,kGAAkG;AAClG,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,2DAAgB,CAAA;IAChB,iDAAW,CAAA;IACX,kDAAW,CAAA;AACf,CAAC,EAJW,aAAa,GAAb,aAAa,KAAb,aAAa,QAIxB;AAeD,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,MAAM,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;KACjE,KAAK,CAAC,MAAM,CAAC;KACb,KAAK,CAAC,MAAM,CAAC;KACb,KAAK,CAAC,OAAO,CAAC;KACd,KAAK,CAAC;IACH,EAAE,EAAE,iBAAiB,CAAC,KAAc;IACpC,IAAI,IAAI;QACJ,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAkB,CAAC;IAC9C,CAAC;IACD,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,IAAI,GAAG,IAAmB,CAAC;IAC3C,CAAC;CACJ,CAAC;KACD,eAAe,CAAC,CAAC,MAAM,EAAE,EAAE;IACxB,IAAI,MAAM,CAAC,IAAI,KAAK,CA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AAM,CAAC,KAAK,UAAU,WAAW,CAC7B,MAAqB,EACrB,IAAY;IAEZ,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;IACnC,IAAI;QACA,MAAM,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC/D,OAAO,MAAM,mBAAmB,CAC5B,MAAM,EACN,iBAAiB,CAAC,IAAI,EACtB,mBAAmB,CACtB,CAAC;KACL;YAAS;QACN,MAAM,CAAC,OAAO,EAAE,CAAC;KACpB;AACL,CAAC"}
|
|
@@ -1,61 +1,73 @@
|
|
|
1
|
-
import { AutoDisposable } from
|
|
2
|
-
import {
|
|
3
|
-
import type { Adb } from
|
|
4
|
-
import type { AdbSocket } from
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
/**
|
|
8
|
-
* A simplified `dirname` function that only handles absolute unix paths.
|
|
9
|
-
* @param path an absolute unix path
|
|
10
|
-
* @returns the directory name of the input path
|
|
11
|
-
*/
|
|
12
|
-
export declare function dirname(path: string): string;
|
|
13
|
-
export
|
|
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
|
-
|
|
1
|
+
import { AutoDisposable } from "@yume-chan/event";
|
|
2
|
+
import type { Consumable, ReadableStream } from "@yume-chan/stream-extra";
|
|
3
|
+
import type { Adb } from "../../adb.js";
|
|
4
|
+
import type { AdbSocket } from "../../socket/index.js";
|
|
5
|
+
import type { AdbSyncEntry } from "./list.js";
|
|
6
|
+
import { AdbSyncSocket } from "./socket.js";
|
|
7
|
+
/**
|
|
8
|
+
* A simplified `dirname` function that only handles absolute unix paths.
|
|
9
|
+
* @param path an absolute unix path
|
|
10
|
+
* @returns the directory name of the input path
|
|
11
|
+
*/
|
|
12
|
+
export declare function dirname(path: string): string;
|
|
13
|
+
export interface AdbSyncWriteOptions {
|
|
14
|
+
filename: string;
|
|
15
|
+
file: ReadableStream<Consumable<Uint8Array>>;
|
|
16
|
+
mode?: number;
|
|
17
|
+
mtime?: number;
|
|
18
|
+
dryRun?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare class AdbSync extends AutoDisposable {
|
|
21
|
+
protected _adb: Adb;
|
|
22
|
+
protected _socket: AdbSyncSocket;
|
|
23
|
+
private _supportsStat;
|
|
24
|
+
private _supportsListV2;
|
|
25
|
+
private _fixedPushMkdir;
|
|
26
|
+
private _supportsSendReceiveV2;
|
|
27
|
+
private _needPushMkdirWorkaround;
|
|
28
|
+
get supportsStat(): boolean;
|
|
29
|
+
get supportsListV2(): boolean;
|
|
30
|
+
get fixedPushMkdir(): boolean;
|
|
31
|
+
get supportsSendReceiveV2(): boolean;
|
|
32
|
+
get needPushMkdirWorkaround(): boolean;
|
|
33
|
+
constructor(adb: Adb, socket: AdbSocket);
|
|
34
|
+
lstat(path: string): Promise<import("./stat.js").AdbSyncStat>;
|
|
35
|
+
stat(path: string): Promise<{
|
|
36
|
+
id: import("./response.js").AdbSyncResponseId.Stat;
|
|
37
|
+
readonly type: import("./stat.js").LinuxFileType;
|
|
38
|
+
readonly permission: number;
|
|
39
|
+
error: import("./stat.js").AdbSyncStatErrorCode;
|
|
40
|
+
dev: bigint;
|
|
41
|
+
ino: bigint;
|
|
42
|
+
mode: number;
|
|
43
|
+
nlink: number;
|
|
44
|
+
uid: number;
|
|
45
|
+
gid: number;
|
|
46
|
+
size: bigint;
|
|
47
|
+
atime: bigint;
|
|
48
|
+
mtime: bigint;
|
|
49
|
+
ctime: bigint;
|
|
50
|
+
}>;
|
|
51
|
+
isDirectory(path: string): Promise<boolean>;
|
|
52
|
+
opendir(path: string): AsyncGenerator<AdbSyncEntry, void, void>;
|
|
53
|
+
readdir(path: string): Promise<AdbSyncEntry[]>;
|
|
54
|
+
/**
|
|
55
|
+
* Read the content of a file on device.
|
|
56
|
+
*
|
|
57
|
+
* @param filename The full path of the file on device to read.
|
|
58
|
+
* @returns A `ReadableStream` that reads from the file.
|
|
59
|
+
*/
|
|
60
|
+
read(filename: string): ReadableStream<Uint8Array>;
|
|
61
|
+
/**
|
|
62
|
+
* Write (or overwrite) a file on device.
|
|
63
|
+
*
|
|
64
|
+
* @param filename The full path of the file on device to write.
|
|
65
|
+
* @param file The content to write.
|
|
66
|
+
* @param mode The unix permissions of the file.
|
|
67
|
+
* @param mtime The modified time of the file.
|
|
68
|
+
* @returns A `WritableStream` that writes to the file.
|
|
69
|
+
*/
|
|
70
|
+
write(options: AdbSyncWriteOptions): Promise<void>;
|
|
71
|
+
dispose(): Promise<void>;
|
|
72
|
+
}
|
|
61
73
|
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EA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