@cldmv/droidsock 2.0.3 → 2.2.0
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/README.md +43 -26
- package/dist/api/auth.mjs +2 -17
- package/dist/api/config.mjs +2 -17
- package/dist/api/connection.mjs +2 -17
- package/dist/api/device.mjs +2 -17
- package/dist/api/devices.mjs +2 -17
- package/dist/api/discover.mjs +2 -17
- package/dist/api/files.mjs +2 -17
- package/dist/api/forward.mjs +2 -17
- package/dist/api/install.mjs +2 -17
- package/dist/api/log.mjs +2 -17
- package/dist/api/pairing.mjs +2 -17
- package/dist/api/reboot.mjs +2 -17
- package/dist/api/reverse.mjs +2 -17
- package/dist/api/shell.mjs +2 -17
- package/dist/api/stream.mjs +2 -17
- package/dist/api/utils.mjs +5 -17
- package/dist/droidsock.mjs +2 -17
- package/dist/index.cjs +50 -0
- package/dist/index.mjs +2 -0
- package/dist/main.mjs +2 -0
- package/package.json +59 -43
- package/types/src/api/auth.d.mts +34 -0
- package/types/src/api/auth.d.mts.map +1 -0
- package/types/src/api/config.d.mts +50 -0
- package/types/src/api/config.d.mts.map +1 -0
- package/types/src/api/connection.d.mts +16 -0
- package/types/src/api/connection.d.mts.map +1 -0
- package/types/src/api/device.d.mts +41 -0
- package/types/src/api/device.d.mts.map +1 -0
- package/types/src/api/devices.d.mts +41 -0
- package/types/src/api/devices.d.mts.map +1 -0
- package/types/src/api/discover.d.mts +65 -0
- package/types/src/api/discover.d.mts.map +1 -0
- package/types/src/api/files.d.mts +228 -0
- package/types/src/api/files.d.mts.map +1 -0
- package/types/src/api/forward.d.mts +27 -0
- package/types/src/api/forward.d.mts.map +1 -0
- package/types/src/api/install.d.mts +54 -0
- package/types/src/api/install.d.mts.map +1 -0
- package/types/src/api/log.d.mts +37 -0
- package/types/src/api/log.d.mts.map +1 -0
- package/types/src/api/pairing.d.mts +30 -0
- package/types/src/api/pairing.d.mts.map +1 -0
- package/types/src/api/reboot.d.mts +33 -0
- package/types/src/api/reboot.d.mts.map +1 -0
- package/types/src/api/reverse.d.mts +26 -0
- package/types/src/api/reverse.d.mts.map +1 -0
- package/types/src/api/shell.d.mts +63 -0
- package/types/src/api/shell.d.mts.map +1 -0
- package/types/src/api/stream.d.mts +7 -0
- package/types/src/api/stream.d.mts.map +1 -0
- package/types/src/api/utils.d.mts +161 -0
- package/types/src/api/utils.d.mts.map +1 -0
- package/types/src/droidsock.d.mts +14 -0
- package/types/src/droidsock.d.mts.map +1 -0
- package/types/src/index.d.mts +2 -0
- package/types/src/index.d.mts.map +1 -0
- package/types/src/main.d.mts +3 -0
- package/types/src/main.d.mts.map +1 -0
- package/index.cjs +0 -46
- package/index.mjs +0 -44
- package/types/dist/api/auth.d.mts +0 -14
- package/types/dist/api/auth.d.mts.map +0 -1
- package/types/dist/api/config.d.mts +0 -52
- package/types/dist/api/config.d.mts.map +0 -1
- package/types/dist/api/connection.d.mts +0 -2
- package/types/dist/api/connection.d.mts.map +0 -1
- package/types/dist/api/device.d.mts +0 -4
- package/types/dist/api/device.d.mts.map +0 -1
- package/types/dist/api/devices.d.mts +0 -5
- package/types/dist/api/devices.d.mts.map +0 -1
- package/types/dist/api/discover.d.mts +0 -6
- package/types/dist/api/discover.d.mts.map +0 -1
- package/types/dist/api/files.d.mts +0 -85
- package/types/dist/api/files.d.mts.map +0 -1
- package/types/dist/api/forward.d.mts +0 -5
- package/types/dist/api/forward.d.mts.map +0 -1
- package/types/dist/api/install.d.mts +0 -3
- package/types/dist/api/install.d.mts.map +0 -1
- package/types/dist/api/log.d.mts +0 -21
- package/types/dist/api/log.d.mts.map +0 -1
- package/types/dist/api/pairing.d.mts +0 -2
- package/types/dist/api/pairing.d.mts.map +0 -1
- package/types/dist/api/reboot.d.mts +0 -2
- package/types/dist/api/reboot.d.mts.map +0 -1
- package/types/dist/api/reverse.d.mts +0 -6
- package/types/dist/api/reverse.d.mts.map +0 -1
- package/types/dist/api/shell.d.mts +0 -29
- package/types/dist/api/shell.d.mts.map +0 -1
- package/types/dist/api/stream.d.mts +0 -11
- package/types/dist/api/stream.d.mts.map +0 -1
- package/types/dist/api/utils.d.mts +0 -32
- package/types/dist/api/utils.d.mts.map +0 -1
- package/types/dist/droidsock.d.mts +0 -3
- package/types/dist/droidsock.d.mts.map +0 -1
- package/types/index.d.mts +0 -11
- package/types/index.d.mts.map +0 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Executes a shell command and returns the output
|
|
3
|
+
* @param {Object} socket - ADB socket
|
|
4
|
+
* @param {Object} streamManager - Stream manager instance
|
|
5
|
+
* @param {string} command - Shell command to execute
|
|
6
|
+
* @param {Object} [options={}] - Execution options
|
|
7
|
+
* @param {number} [options.timeout=30000] - Command timeout in ms
|
|
8
|
+
* @param {string} [options.encoding='utf8'] - Output encoding
|
|
9
|
+
* @returns {Promise<string>} Command output
|
|
10
|
+
*/
|
|
11
|
+
export function execute(socket: Object, streamManager: Object, command: string, options?: {
|
|
12
|
+
timeout?: number | undefined;
|
|
13
|
+
encoding?: string | undefined;
|
|
14
|
+
}): Promise<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Starts a streaming shell command
|
|
17
|
+
* @param {Object} socket - ADB socket
|
|
18
|
+
* @param {Object} streamManager - Stream manager instance
|
|
19
|
+
* @param {string} command - Shell command
|
|
20
|
+
* @param {Object} [options={}] - Options
|
|
21
|
+
* @param {Function} [options.onData] - Data callback
|
|
22
|
+
* @param {Function} [options.onError] - Error callback
|
|
23
|
+
* @param {Function} [options.onEnd] - End callback
|
|
24
|
+
* @returns {Object} Control object with stop() method
|
|
25
|
+
*/
|
|
26
|
+
export function startStreaming(socket: Object, streamManager: Object, command: string, options?: {
|
|
27
|
+
onData?: Function | undefined;
|
|
28
|
+
onError?: Function | undefined;
|
|
29
|
+
onEnd?: Function | undefined;
|
|
30
|
+
}): Object;
|
|
31
|
+
/**
|
|
32
|
+
* Starts an interactive shell command
|
|
33
|
+
* @param {Object} socket - ADB socket
|
|
34
|
+
* @param {Object} streamManager - Stream manager instance
|
|
35
|
+
* @param {string} command - Command to execute
|
|
36
|
+
* @param {Object} [options={}] - Options
|
|
37
|
+
* @param {Function} [options.onData] - Data callback
|
|
38
|
+
* @param {Function} [options.onError] - Error callback
|
|
39
|
+
* @param {Function} [options.onEnd] - End callback
|
|
40
|
+
* @returns {Object} Control object with sendInput() and stop() methods
|
|
41
|
+
*/
|
|
42
|
+
export function startInteractive(socket: Object, streamManager: Object, command: string, options?: {
|
|
43
|
+
onData?: Function | undefined;
|
|
44
|
+
onError?: Function | undefined;
|
|
45
|
+
onEnd?: Function | undefined;
|
|
46
|
+
}): Object;
|
|
47
|
+
export namespace commands {
|
|
48
|
+
function ls(socket: Object, streamManager: Object, path?: string): Promise<string>;
|
|
49
|
+
function pwd(socket: Object, streamManager: Object): Promise<string>;
|
|
50
|
+
function getprop(socket: Object, streamManager: Object, prop?: string): Promise<string>;
|
|
51
|
+
function getModel(socket: Object, streamManager: Object): Promise<string>;
|
|
52
|
+
function getAndroidVersion(socket: Object, streamManager: Object): Promise<string>;
|
|
53
|
+
function getBattery(socket: Object, streamManager: Object): Promise<string>;
|
|
54
|
+
function screenshot(socket: Object, streamManager: Object, filename?: string): Promise<string>;
|
|
55
|
+
function logcat(socket: Object, streamManager: Object, options?: Object): Object;
|
|
56
|
+
function top(socket: Object, streamManager: Object, options?: Object): Object;
|
|
57
|
+
function keypress(socket: Object, streamManager: Object, key: string | number): Promise<string>;
|
|
58
|
+
function launchApp(socket: Object, streamManager: Object, packageName: string, activity?: string): Promise<string>;
|
|
59
|
+
function killApp(socket: Object, streamManager: Object, packageName: string): Promise<string>;
|
|
60
|
+
function installApk(socket: Object, streamManager: Object, apkPath: string, flags?: Array<string>): Promise<string>;
|
|
61
|
+
function uninstallApp(socket: Object, streamManager: Object, packageName: string): Promise<string>;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=shell.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.d.mts","sourceRoot":"","sources":["../../../src/api/shell.mjs"],"names":[],"mappings":"AAsBA;;;;;;;;;GASG;AACH,gCARW,MAAM,iBACN,MAAM,WACN,MAAM,YAEd;IAAyB,OAAO;IACP,QAAQ;CACjC,GAAU,OAAO,CAAC,MAAM,CAAC,CAqI3B;AAED;;;;;;;;;;GAUG;AACH,uCATW,MAAM,iBACN,MAAM,WACN,MAAM,YAEd;IAA2B,MAAM;IACN,OAAO;IACP,KAAK;CAChC,GAAU,MAAM,CAqClB;AAED;;;;;;;;;;GAUG;AACH,yCATW,MAAM,iBACN,MAAM,WACN,MAAM,YAEd;IAA2B,MAAM;IACN,OAAO;IACP,KAAK;CAChC,GAAU,MAAM,CA2ClB;;IAaI,oBALO,MAAM,iBACN,MAAM,SACN,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAI3B;IAQI,qBAJM,MAAM,iBACN,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAI3B;IASQ,yBALE,MAAM,iBACN,MAAM,SACN,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAK3B;IAQS,0BAJC,MAAM,iBACN,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAI3B;IAQkB,mCAJR,MAAM,iBACN,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAI3B;IAQW,4BAJD,MAAM,iBACN,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAI3B;IASW,4BALD,MAAM,iBACN,MAAM,aACN,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAI3B;IASO,wBALG,MAAM,iBACN,MAAM,YACN,MAAM,GACJ,MAAM,CAIlB;IASI,qBALM,MAAM,iBACN,MAAM,YACN,MAAM,GACJ,MAAM,CAIlB;IASS,0BALC,MAAM,iBACN,MAAM,OACN,MAAM,GAAC,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAI3B;IAUU,2BANA,MAAM,iBACN,MAAM,eACN,MAAM,aACN,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAQ3B;IASQ,yBALE,MAAM,iBACN,MAAM,eACN,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAI3B;IAWW,4BAPD,MAAM,iBACN,MAAM,WACN,MAAM,UACN,KAAK,CAAC,MAAM,CAAC,GACX,OAAO,CAAC,MAAM,CAAC,CAO3B;IASa,8BALH,MAAM,iBACN,MAAM,eACN,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAI3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.d.mts","sourceRoot":"","sources":["../../../src/api/stream.mjs"],"names":[],"mappings":"AAgDA;;;;GAIG;AACH,+BAHW,MAAM,GACJ,MAAM,CA6HlB"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses Android property output into key-value pairs
|
|
3
|
+
* @param {string} propOutput - Output from getprop command
|
|
4
|
+
* @returns {Object} Parsed properties object
|
|
5
|
+
*/
|
|
6
|
+
export function parseProperties(propOutput: string): Object;
|
|
7
|
+
/**
|
|
8
|
+
* Parses ls -la output into structured data
|
|
9
|
+
* @param {string} lsOutput - Output from ls -la command
|
|
10
|
+
* @returns {Array} Array of file/directory objects
|
|
11
|
+
*/
|
|
12
|
+
export function parseListing(lsOutput: string): any[];
|
|
13
|
+
/**
|
|
14
|
+
* Parses battery status output
|
|
15
|
+
* @param {string} batteryOutput - Output from dumpsys battery
|
|
16
|
+
* @returns {Object} Parsed battery information
|
|
17
|
+
*/
|
|
18
|
+
export function parseBattery(batteryOutput: string): Object;
|
|
19
|
+
/**
|
|
20
|
+
* Formats bytes into human-readable format
|
|
21
|
+
* @param {number} bytes - Number of bytes
|
|
22
|
+
* @param {number} [decimals=2] - Number of decimal places
|
|
23
|
+
* @returns {string} Formatted string (e.g., "1.23 MB")
|
|
24
|
+
*/
|
|
25
|
+
export function formatBytes(bytes: number, decimals?: number): string;
|
|
26
|
+
/**
|
|
27
|
+
* Waits for a specified amount of time
|
|
28
|
+
* @param {number} ms - Milliseconds to wait
|
|
29
|
+
* @returns {Promise<void>}
|
|
30
|
+
*/
|
|
31
|
+
export function delay(ms: number): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Retries an async function with exponential backoff
|
|
34
|
+
* @param {Function} fn - Async function to retry
|
|
35
|
+
* @param {Object} [options={}] - Retry options
|
|
36
|
+
* @param {number} [options.maxRetries=3] - Maximum number of retries. Negative values are clamped to 0 (fn still runs once) with a console.warn.
|
|
37
|
+
* @param {number} [options.baseDelay=1000] - Base delay in ms
|
|
38
|
+
* @param {number} [options.maxDelay=10000] - Maximum delay in ms
|
|
39
|
+
* @param {Function} [options.shouldRetry] - Function to determine if error should be retried
|
|
40
|
+
* @returns {Promise<any>} Result of the function
|
|
41
|
+
*/
|
|
42
|
+
export function retry(fn: Function, options?: {
|
|
43
|
+
maxRetries?: number | undefined;
|
|
44
|
+
baseDelay?: number | undefined;
|
|
45
|
+
maxDelay?: number | undefined;
|
|
46
|
+
shouldRetry?: Function | undefined;
|
|
47
|
+
}): Promise<any>;
|
|
48
|
+
/**
|
|
49
|
+
* Validates if a string is a valid IP address
|
|
50
|
+
* @param {string} ip - IP address to validate
|
|
51
|
+
* @returns {boolean} True if valid IP address
|
|
52
|
+
*/
|
|
53
|
+
export function isValidIP(ip: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Validates if a port number is valid
|
|
56
|
+
* @param {number} port - Port number to validate
|
|
57
|
+
* @returns {boolean} True if valid port
|
|
58
|
+
*/
|
|
59
|
+
export function isValidPort(port: number): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Parses a host:port string. An IPv6 host MUST be bracketed when a port is
|
|
62
|
+
* attached ("[2001:db8::1]:5555") - the standard URL/curl convention - since
|
|
63
|
+
* an IPv6 literal's own colons make a bare "host:port" split ambiguous (which
|
|
64
|
+
* trailing segment is the port?). A bare, unbracketed IPv6 literal with no
|
|
65
|
+
* port is still accepted and gets `defaultPort`.
|
|
66
|
+
* @param {string} hostPort - Host, or host:port string (e.g., "192.168.1.100:5555", "[2001:db8::1]:5555", "2001:db8::1")
|
|
67
|
+
* @param {number} [defaultPort=5555] - Default port if not specified
|
|
68
|
+
* @returns {Object} Object with host and port properties
|
|
69
|
+
*/
|
|
70
|
+
export function parseHostPort(hostPort: string, defaultPort?: number): Object;
|
|
71
|
+
/**
|
|
72
|
+
* Sanitizes a "host:port" device id into a slothlet-safe api-path segment.
|
|
73
|
+
* `.` and `:` are ordinary characters in an IP:port string but are the
|
|
74
|
+
* tree's own path-separator-adjacent punctuation, so both are replaced -
|
|
75
|
+
* with DIFFERENT substitutions so the two remain distinguishable. Mapping
|
|
76
|
+
* both to a single "_" (the original scheme) is lossy: an IPv4 dotted quad
|
|
77
|
+
* and an IPv6 literal's colons become indistinguishable runs of underscores.
|
|
78
|
+
* A single "_" marks a former ".", a double "__" marks a former ":" - still
|
|
79
|
+
* fully identifier-safe (letters/digits/underscore only), so
|
|
80
|
+
* `api.devices.<key>` dot-access still works.
|
|
81
|
+
* @param {string} deviceId - `${host}:${port}`
|
|
82
|
+
* @returns {string} A path-safe key, e.g. "10_6_0_108__5555" (from "10.6.0.108:5555"), "fe80____1__5555" (from "fe80::1:5555")
|
|
83
|
+
*/
|
|
84
|
+
export function sanitizeKey(deviceId: string): string;
|
|
85
|
+
/**
|
|
86
|
+
* Escapes shell special characters in a string
|
|
87
|
+
* @param {string} str - String to escape
|
|
88
|
+
* @returns {string} Escaped string
|
|
89
|
+
*/
|
|
90
|
+
export function escapeShell(str: string): string;
|
|
91
|
+
/**
|
|
92
|
+
* Wraps a string in single quotes for safe interpolation into a POSIX shell
|
|
93
|
+
* command, using the standard close-quote/escaped-quote/reopen-quote technique
|
|
94
|
+
* (`'` -> `'\''`) for any embedded single quotes. Unlike double-quote-based
|
|
95
|
+
* escaping (see escapeShell), a single-quoted string has no metacharacters at
|
|
96
|
+
* all - `$`, backticks, and `"` all pass through inert - so the only character
|
|
97
|
+
* that needs handling is the quote delimiter itself.
|
|
98
|
+
* @param {*} str - Value to quote; coerced via String() if not already a string
|
|
99
|
+
* @returns {string} Single-quoted, shell-safe string
|
|
100
|
+
*/
|
|
101
|
+
export function quoteShellArg(str: any): string;
|
|
102
|
+
/**
|
|
103
|
+
* Validates a `pm install`/`cmd package install` flags array before it's
|
|
104
|
+
* joined and interpolated into a shell command. A non-array throws a
|
|
105
|
+
* confusing TypeError from .join()/.map() with no context; a flag containing
|
|
106
|
+
* whitespace (e.g. a caller passing "--user 0" as one element instead of
|
|
107
|
+
* ["--user", "0"]) would either silently split into multiple argv tokens once
|
|
108
|
+
* joined and re-parsed by the device shell (unquoted interpolation), or - once
|
|
109
|
+
* quoted via quoteShellArg - collapse into a single argv token that `pm
|
|
110
|
+
* install` won't parse as intended. Either way it changes what's actually
|
|
111
|
+
* passed to the device from what the caller specified, so it's rejected
|
|
112
|
+
* outright rather than silently mishandled.
|
|
113
|
+
* @param {*} flags - Value to validate.
|
|
114
|
+
* @returns {Array<string>} The validated flags, unchanged.
|
|
115
|
+
*/
|
|
116
|
+
export function assertValidFlags(flags: any): Array<string>;
|
|
117
|
+
/**
|
|
118
|
+
* Converts an IPv6 address string to its 128-bit BigInt form. Accepts every
|
|
119
|
+
* form `net.isIPv6()` accepts - including an embedded dotted-IPv4 tail
|
|
120
|
+
* ("::ffff:192.0.2.1", RFC 4291 2.2.3) - except a zone/scope id
|
|
121
|
+
* ("fe80::1%eth0"): `net.isIPv6()` accepts one, but a zone has no bit
|
|
122
|
+
* representation in a 128-bit value, and silently dropping it would make the
|
|
123
|
+
* address unusable (a link-local address is meaningless without its zone)
|
|
124
|
+
* rather than just less precise, so it's rejected outright instead of
|
|
125
|
+
* stripped.
|
|
126
|
+
* @param {string} address - IPv6 literal, e.g. "2001:db8::1".
|
|
127
|
+
* @returns {bigint} The address as a 0..2**128-1 BigInt.
|
|
128
|
+
* @throws {Error} If `address` is not a zone-free IPv6 literal.
|
|
129
|
+
*/
|
|
130
|
+
export function ipv6ToBigInt(address: string): bigint;
|
|
131
|
+
/**
|
|
132
|
+
* Formats a 128-bit BigInt as a canonical IPv6 string per RFC 5952 section 4:
|
|
133
|
+
* lowercase hex, no leading zeros per group, and the single longest run of
|
|
134
|
+
* two-or-more all-zero groups collapsed to "::" (the first such run wins a
|
|
135
|
+
* tie, and a lone zero group is never collapsed). Byte-identical to a
|
|
136
|
+
* browser/WHATWG IPv6 serialization for the same address. Note this is a
|
|
137
|
+
* numeric, not textual, inverse of ipv6ToBigInt() for an IPv4-mapped address:
|
|
138
|
+
* `bigIntToIpv6(ipv6ToBigInt("::ffff:192.0.2.1"))` re-emits "::ffff:c000:201"
|
|
139
|
+
* rather than the original dotted-quad tail form - the same behavior a
|
|
140
|
+
* browser's URL parser produces.
|
|
141
|
+
* @param {bigint} value - Address value, 0..2**128-1.
|
|
142
|
+
* @returns {string} Canonical IPv6 string, e.g. "2001:db8::1".
|
|
143
|
+
* @throws {Error} If `value` is not a BigInt in range.
|
|
144
|
+
*/
|
|
145
|
+
export function bigIntToIpv6(value: bigint): string;
|
|
146
|
+
/**
|
|
147
|
+
* Creates a timeout promise that rejects after specified time
|
|
148
|
+
* @param {number} ms - Timeout in milliseconds
|
|
149
|
+
* @param {string} [message='Operation timed out'] - Timeout error message
|
|
150
|
+
* @returns {Promise<never>} Promise that rejects on timeout
|
|
151
|
+
*/
|
|
152
|
+
export function timeout(ms: number, message?: string): Promise<never>;
|
|
153
|
+
/**
|
|
154
|
+
* Wraps a promise with a timeout
|
|
155
|
+
* @param {Promise} promise - Promise to wrap
|
|
156
|
+
* @param {number} ms - Timeout in milliseconds
|
|
157
|
+
* @param {string} [message='Operation timed out'] - Timeout error message
|
|
158
|
+
* @returns {Promise<any>} Promise that resolves/rejects with timeout
|
|
159
|
+
*/
|
|
160
|
+
export function withTimeout(promise: Promise<any>, ms: number, message?: string): Promise<any>;
|
|
161
|
+
//# sourceMappingURL=utils.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.mts","sourceRoot":"","sources":["../../../src/api/utils.mjs"],"names":[],"mappings":"AAqBA;;;;GAIG;AACH,4CAHW,MAAM,GACJ,MAAM,CAelB;AAED;;;;GAIG;AACH,uCAHW,MAAM,SAiChB;AAED;;;;GAIG;AACH,4CAHW,MAAM,GACJ,MAAM,CAuBlB;AAED;;;;;GAKG;AACH,mCAJW,MAAM,aACN,MAAM,GACJ,MAAM,CAYlB;AAED;;;;GAIG;AACH,0BAHW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAIzB;AAED;;;;;;;;;GASG;AACH,8CANG;IAAyB,UAAU;IACV,SAAS;IACT,QAAQ;IACN,WAAW;CACtC,GAAU,OAAO,CAAC,GAAG,CAAC,CA6BxB;AAED;;;;GAIG;AACH,8BAHW,MAAM,GACJ,OAAO,CAUnB;AAED;;;;GAIG;AACH,kCAHW,MAAM,GACJ,OAAO,CAInB;AAED;;;;;;;;;GASG;AACH,wCAJW,MAAM,gBACN,MAAM,GACJ,MAAM,CAyDlB;AAED;;;;;;;;;;;;GAYG;AACH,sCAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;GAIG;AACH,iCAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;;;;;;GASG;AACH,mCAHW,GAAC,GACC,MAAM,CAIlB;AAED;;;;;;;;;;;;;GAaG;AACH,wCAHW,GAAC,GACC,KAAK,CAAC,MAAM,CAAC,CAgBzB;AAKD;;;;;;;;;;;;GAYG;AACH,sCAJW,MAAM,GACJ,MAAM,CAiDlB;AAED;;;;;;;;;;;;;GAaG;AACH,oCAJW,MAAM,GACJ,MAAM,CAuClB;AAED;;;;;GAKG;AACH,4BAJW,MAAM,YACN,MAAM,GACJ,OAAO,CAAC,KAAK,CAAC,CAM1B;AAED;;;;;;GAMG;AACH,uDAJW,MAAM,YACN,MAAM,GACJ,OAAO,CAAC,GAAG,CAAC,CAIxB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a new DroidSock API instance with slothlet modular loading
|
|
3
|
+
* @param {Object} options - Configuration options
|
|
4
|
+
* @param {string} [options.mode='eager'] - Loading mode: 'lazy' or 'eager'
|
|
5
|
+
* @param {Object} [options.context={}] - Context object for API modules
|
|
6
|
+
* @param {Object} [options.config={}] - Initial configuration options
|
|
7
|
+
* @returns {Promise<Object>} The DroidSock API instance
|
|
8
|
+
*/
|
|
9
|
+
export default function createDroidSock(options?: {
|
|
10
|
+
mode?: string | undefined;
|
|
11
|
+
context?: Object | undefined;
|
|
12
|
+
config?: Object | undefined;
|
|
13
|
+
}): Promise<Object>;
|
|
14
|
+
//# sourceMappingURL=droidsock.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"droidsock.d.mts","sourceRoot":"","sources":["../../src/droidsock.mjs"],"names":[],"mappings":"AA2BA;;;;;;;GAOG;AACH,kDALG;IAAyB,IAAI;IACJ,OAAO;IACP,MAAM;CAC/B,GAAU,OAAO,CAAC,MAAM,CAAC,CAgC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/index.mjs"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.mts","sourceRoot":"","sources":["../../src/main.mjs"],"names":[],"mappings":""}
|
package/index.cjs
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @Project: @cldmv/droidsock
|
|
4
|
-
* @Filename: /index.cjs
|
|
5
|
-
* @Date: 2025-11-21T15:41:06-08:00 (1763768466)
|
|
6
|
-
* @Author: Nate Corcoran <CLDMV>
|
|
7
|
-
* @Email: <Shinrai@users.noreply.github.com>
|
|
8
|
-
* -----
|
|
9
|
-
* @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
|
|
10
|
-
* @Last modified time: 2026-10-02T15:29:45-07:00 (1790980185)
|
|
11
|
-
* -----
|
|
12
|
-
* @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* CommonJS entry point for DroidSock
|
|
18
|
-
*
|
|
19
|
-
* This file provides CommonJS (require) support for the DroidSock library.
|
|
20
|
-
* It imports and re-exports the main DroidSock functions from the ESM module.
|
|
21
|
-
*
|
|
22
|
-
* @module droidsock
|
|
23
|
-
*/
|
|
24
|
-
"use strict";
|
|
25
|
-
|
|
26
|
-
// index.cjs is a thin wrapper: it loads index.mjs through Node's synchronous require(esm).
|
|
27
|
-
// Node.js versions without require(esm) would fail with a bare ERR_REQUIRE_ESM, so fail
|
|
28
|
-
// early with a message that says what to do instead.
|
|
29
|
-
if (!process.features?.require_module) {
|
|
30
|
-
const error = new Error(
|
|
31
|
-
`@cldmv/droidsock: require() needs Node.js ^20.19.0 or >=22.12.0 (this is ${process.version}). On older Node.js, load the package with import() instead.`
|
|
32
|
-
);
|
|
33
|
-
error.code = "ERR_REQUIRE_ESM";
|
|
34
|
-
throw error;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const { default: droidsock } = require("./index.mjs");
|
|
38
|
-
|
|
39
|
-
// Export main function - the quick path, also callable with options
|
|
40
|
-
module.exports = droidsock; // Default export
|
|
41
|
-
module.exports.createDroidSock = droidsock;
|
|
42
|
-
|
|
43
|
-
// Common DroidSock aliases
|
|
44
|
-
module.exports.DroidSock = droidsock;
|
|
45
|
-
module.exports.ADB = droidsock;
|
|
46
|
-
module.exports.AndroidDebugBridge = droidsock;
|
package/index.mjs
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @Project: @cldmv/droidsock
|
|
4
|
-
* @Filename: /index.mjs
|
|
5
|
-
* @Date: 2025-11-21T15:41:06-08:00 (1763768466)
|
|
6
|
-
* @Author: Nate Corcoran <CLDMV>
|
|
7
|
-
* @Email: <Shinrai@users.noreply.github.com>
|
|
8
|
-
* -----
|
|
9
|
-
* @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
|
|
10
|
-
* @Last modified time: 2026-10-02T15:29:45-07:00 (1790980185)
|
|
11
|
-
* -----
|
|
12
|
-
* @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
// Development environment check (must happen before droidsock imports)
|
|
17
|
-
(async () => {
|
|
18
|
-
try {
|
|
19
|
-
await import("./devcheck.mjs");
|
|
20
|
-
} catch {
|
|
21
|
-
// ignore
|
|
22
|
-
}
|
|
23
|
-
})();
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Creates a DroidSock instance for ADB communication. This is the default export - the
|
|
27
|
-
* quick path - and also available under the explicit name `createDroidSock` for callers
|
|
28
|
-
* who prefer it.
|
|
29
|
-
* @param {object} [options={}] - Configuration options
|
|
30
|
-
* @returns {Promise<object>} DroidSock instance
|
|
31
|
-
*/
|
|
32
|
-
async function droidsock(options = {}) {
|
|
33
|
-
// Dynamic import after environment check
|
|
34
|
-
const mod = await import("@cldmv/droidsock/main");
|
|
35
|
-
return await mod.default(options);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export default droidsock;
|
|
39
|
-
export { droidsock as createDroidSock };
|
|
40
|
-
|
|
41
|
-
// Named export aliases
|
|
42
|
-
export { droidsock as DroidSock };
|
|
43
|
-
export { droidsock as ADB };
|
|
44
|
-
export { droidsock as AndroidDebugBridge };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export function formatAdbPublicKey(publicKey: any): string;
|
|
2
|
-
export function generateKeys(keySize?: number, saveDir?: null): {
|
|
3
|
-
privateKey: any;
|
|
4
|
-
publicKey: any;
|
|
5
|
-
adbPublicKey: string;
|
|
6
|
-
};
|
|
7
|
-
export function getKeys(keyDir: any): {
|
|
8
|
-
privateKey: any;
|
|
9
|
-
publicKey: any;
|
|
10
|
-
adbPublicKey: any;
|
|
11
|
-
};
|
|
12
|
-
export function sign(token: any, privateKey: any): any;
|
|
13
|
-
export function validateAuth(token: any, privateKey: any): boolean;
|
|
14
|
-
//# sourceMappingURL=auth.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.mts","sourceRoot":"","sources":["../../../dist/api/auth.mjs"],"names":[],"mappings":"AAgBqmH,2DAAkyC;AAApnI;;;;EAA2kB;AAAxsC;;;;EAA6nB;AAA2kB,uDAAw6C;AAA6lB,mEAAkQ"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export function all(): any;
|
|
2
|
-
export function get(key: any, defaultValue?: undefined): any;
|
|
3
|
-
export function getApi(): {
|
|
4
|
-
init: typeof init;
|
|
5
|
-
get: typeof get;
|
|
6
|
-
set: typeof set;
|
|
7
|
-
merge: typeof merge;
|
|
8
|
-
reset: typeof reset;
|
|
9
|
-
all: typeof all;
|
|
10
|
-
};
|
|
11
|
-
export function getDefaults(): {
|
|
12
|
-
host: string;
|
|
13
|
-
port: number;
|
|
14
|
-
timeout: number;
|
|
15
|
-
retryAttempts: number;
|
|
16
|
-
retryDelay: number;
|
|
17
|
-
keyDir: null;
|
|
18
|
-
autoGenerateKeys: boolean;
|
|
19
|
-
keySize: number;
|
|
20
|
-
debug: boolean;
|
|
21
|
-
verbose: boolean;
|
|
22
|
-
silent: boolean;
|
|
23
|
-
debugArrowSent: string;
|
|
24
|
-
debugArrowReceived: string;
|
|
25
|
-
streamTimeout: number;
|
|
26
|
-
maxStreams: number;
|
|
27
|
-
shellTimeout: number;
|
|
28
|
-
shellEncoding: string;
|
|
29
|
-
fileTimeout: number;
|
|
30
|
-
chunkSize: number;
|
|
31
|
-
emitEvents: boolean;
|
|
32
|
-
eventPrefix: string;
|
|
33
|
-
bufferSize: number;
|
|
34
|
-
keepAlive: boolean;
|
|
35
|
-
keepAliveInterval: number;
|
|
36
|
-
};
|
|
37
|
-
export function init(options?: {}): {
|
|
38
|
-
init: typeof init;
|
|
39
|
-
get: typeof get;
|
|
40
|
-
set: typeof set;
|
|
41
|
-
merge: typeof merge;
|
|
42
|
-
reset: typeof reset;
|
|
43
|
-
all: typeof all;
|
|
44
|
-
};
|
|
45
|
-
export function merge(options: any): void;
|
|
46
|
-
export function reset(): void;
|
|
47
|
-
export function set(key: any, value: any): void;
|
|
48
|
-
export function validateConfig(config: any): {
|
|
49
|
-
valid: boolean;
|
|
50
|
-
errors: string[];
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=config.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.mts","sourceRoot":"","sources":["../../../dist/api/config.mjs"],"names":[],"mappings":"AAgBw+C,2BAA6E;AAA5gC,6DAA8O;AAA8xB;;;;;;;EAAuD;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;EAAiD;AAAhuC;;;;;;;EAA4G;AAAie,0CAA0a;AAAA,8BAAoD;AAAjtB,gDAAmP;AAAmpB;;;EAAswB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.mts","sourceRoot":"","sources":["../../../dist/api/connection.mjs"],"names":[],"mappings":"AAgBkT,mDAAwhG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"device.d.mts","sourceRoot":"","sources":["../../../dist/api/device.mjs"],"names":[],"mappings":"AAgBu4K,8EAA8c;AAAA,8DAA4L;AAAA,mEAAgM"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"devices.d.mts","sourceRoot":"","sources":["../../../dist/api/devices.mjs"],"names":[],"mappings":"AAgB0lB,mDAA0S;AAA1hB,wCAAgP;AAA1T,8BAA0E;AAA0hB,wDAAuR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discover.d.mts","sourceRoot":"","sources":["../../../dist/api/discover.mjs"],"names":[],"mappings":"AAgB2qP,iDAAs5E;AAAh6P;;;KAAggC"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
export function chmod(socket: any, streamManager: any, remotePath: any, mode: any, recursive?: boolean): Promise<any>;
|
|
2
|
-
export function copy(socket: any, streamManager: any, sourcePath: any, destPath: any, recursive?: boolean): Promise<any>;
|
|
3
|
-
export function diskUsage(socket: any, streamManager: any, path2?: string): Promise<any>;
|
|
4
|
-
export function find(socket: any, streamManager: any, path2: any, pattern: any, options?: {}): Promise<any>;
|
|
5
|
-
export function list(socket: any, streamManager: any, remotePath: any): Promise<{
|
|
6
|
-
name: any;
|
|
7
|
-
permissions: any;
|
|
8
|
-
links: number;
|
|
9
|
-
owner: any;
|
|
10
|
-
group: any;
|
|
11
|
-
size: number;
|
|
12
|
-
dateTime: any;
|
|
13
|
-
isDirectory: any;
|
|
14
|
-
isFile: any;
|
|
15
|
-
isSymlink: any;
|
|
16
|
-
}[] | {
|
|
17
|
-
name: any;
|
|
18
|
-
size: any;
|
|
19
|
-
mtime: any;
|
|
20
|
-
mode: any;
|
|
21
|
-
isDirectory: boolean;
|
|
22
|
-
isFile: boolean;
|
|
23
|
-
isSymlink: boolean;
|
|
24
|
-
}[]>;
|
|
25
|
-
export function listShell(socket: any, streamManager: any, remotePath: any): Promise<{
|
|
26
|
-
name: any;
|
|
27
|
-
permissions: any;
|
|
28
|
-
links: number;
|
|
29
|
-
owner: any;
|
|
30
|
-
group: any;
|
|
31
|
-
size: number;
|
|
32
|
-
dateTime: any;
|
|
33
|
-
isDirectory: any;
|
|
34
|
-
isFile: any;
|
|
35
|
-
isSymlink: any;
|
|
36
|
-
}[]>;
|
|
37
|
-
export function listSync(___socket: any, streamManager: any, remotePath: any): Promise<{
|
|
38
|
-
name: any;
|
|
39
|
-
size: any;
|
|
40
|
-
mtime: any;
|
|
41
|
-
mode: any;
|
|
42
|
-
isDirectory: boolean;
|
|
43
|
-
isFile: boolean;
|
|
44
|
-
isSymlink: boolean;
|
|
45
|
-
}[]>;
|
|
46
|
-
export function listV2(___socket: any, streamManager: any, remotePath: any): Promise<{
|
|
47
|
-
name: any;
|
|
48
|
-
mode: any;
|
|
49
|
-
size: any;
|
|
50
|
-
atime: any;
|
|
51
|
-
mtime: any;
|
|
52
|
-
ctime: any;
|
|
53
|
-
uid: any;
|
|
54
|
-
gid: any;
|
|
55
|
-
nlink: any;
|
|
56
|
-
dev: any;
|
|
57
|
-
ino: any;
|
|
58
|
-
isDirectory: boolean;
|
|
59
|
-
isFile: boolean;
|
|
60
|
-
isSymlink: boolean;
|
|
61
|
-
}[]>;
|
|
62
|
-
export function mkdir(socket: any, streamManager: any, remotePath: any, mode?: number): Promise<any>;
|
|
63
|
-
export function move(socket: any, streamManager: any, sourcePath: any, destPath: any): Promise<any>;
|
|
64
|
-
export function pull(___socket: any, streamManager: any, remotePath: any, localPath: any, options?: {}): Promise<void>;
|
|
65
|
-
export function pullV2(___socket: any, streamManager: any, remotePath: any, localPath: any, options?: {}): Promise<void>;
|
|
66
|
-
export function push(___socket: any, streamManager: any, localPath: any, remotePath: any, options?: {}): Promise<void>;
|
|
67
|
-
export function pushV2(___socket: any, streamManager: any, localPath: any, remotePath: any, options?: {}): Promise<void>;
|
|
68
|
-
export function remove(socket: any, streamManager: any, remotePath: any, recursive?: boolean): Promise<any>;
|
|
69
|
-
export function stat(socket: any, streamManager: any, remotePath: any): Promise<any>;
|
|
70
|
-
export function statV2(___socket: any, streamManager: any, remotePath: any): Promise<{
|
|
71
|
-
mode: any;
|
|
72
|
-
size: any;
|
|
73
|
-
atime: any;
|
|
74
|
-
mtime: any;
|
|
75
|
-
ctime: any;
|
|
76
|
-
uid: any;
|
|
77
|
-
gid: any;
|
|
78
|
-
nlink: any;
|
|
79
|
-
dev: any;
|
|
80
|
-
ino: any;
|
|
81
|
-
isDirectory: boolean;
|
|
82
|
-
isFile: boolean;
|
|
83
|
-
isSymlink: boolean;
|
|
84
|
-
}>;
|
|
85
|
-
//# sourceMappingURL=files.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.mts","sourceRoot":"","sources":["../../../dist/api/files.mjs"],"names":[],"mappings":"AAgByugB,sHAA2Q;AAAvgB,yHAA4P;AAA2Q,yFAAqK;AAAA,4GAA8mB;AAAhoG;;;;;;;;;;;;;;;;;;;KAAgO;AAAxZ;;;;;;;;;;;KAAwL;AAAlqC;;;;;;;;KAAgK;AAAA;;;;;;;;;;;;;;;KAA00B;AAAu3C,qGAAmQ;AAA6N,oGAAuM;AAApxM,uHAAkyB;AAAA,yHAAgxD;AAAj3K,uHAAg+B;AAAA,yHAA+1D;AAAg3L,4GAA6N;AAA/7C,qFAA+I;AAAA;;;;;;;;;;;;;;GAAg1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"forward.d.mts","sourceRoot":"","sources":["../../../dist/api/forward.mjs"],"names":[],"mappings":"AAgB0B;;;GAA8pC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.mts","sourceRoot":"","sources":["../../../dist/api/install.mjs"],"names":[],"mappings":"AAgBkL,qGAA2b;AAAA,0GAAm1C"}
|
package/types/dist/api/log.d.mts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export function child(context: any): {
|
|
2
|
-
debug: (...args: any[]) => void;
|
|
3
|
-
verbose: (...args: any[]) => void;
|
|
4
|
-
info: (...args: any[]) => void;
|
|
5
|
-
warn: (...args: any[]) => void;
|
|
6
|
-
error: (...args: any[]) => void;
|
|
7
|
-
};
|
|
8
|
-
export function debug(...args: any[]): void;
|
|
9
|
-
export function error(...args: any[]): void;
|
|
10
|
-
export function getApi(): {
|
|
11
|
-
debug: typeof debug;
|
|
12
|
-
verbose: typeof verbose;
|
|
13
|
-
info: typeof info;
|
|
14
|
-
warn: typeof warn;
|
|
15
|
-
error: typeof error;
|
|
16
|
-
child: typeof child;
|
|
17
|
-
};
|
|
18
|
-
export function info(...args: any[]): void;
|
|
19
|
-
export function verbose(...args: any[]): void;
|
|
20
|
-
export function warn(...args: any[]): void;
|
|
21
|
-
//# sourceMappingURL=log.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.mts","sourceRoot":"","sources":["../../../dist/api/log.mjs"],"names":[],"mappings":"AAgBkxB;;;;;;EAAmoB;AAAlwC,4CAA+I;AAAmY,4CAA6G;AAAmoB;;;;;;;EAA8D;AAAjgC,2CAAyG;AAAzR,8CAAgL;AAAyG,2CAA0G"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pairing.d.mts","sourceRoot":"","sources":["../../../dist/api/pairing.mjs"],"names":[],"mappings":"AAgBwyK,yFAA67E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reboot.d.mts","sourceRoot":"","sources":["../../../dist/api/reboot.mjs"],"names":[],"mappings":"AAgBA,0FAA4K"}
|