@yume-chan/android-bin 0.0.0-20240714132542
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.md +129 -0
- package/LICENSE +21 -0
- package/README.md +49 -0
- package/esm/am.d.ts +17 -0
- package/esm/am.d.ts.map +1 -0
- package/esm/am.js +42 -0
- package/esm/am.js.map +1 -0
- package/esm/bu.d.ts +28 -0
- package/esm/bu.d.ts.map +1 -0
- package/esm/bu.js +53 -0
- package/esm/bu.js.map +1 -0
- package/esm/bug-report.d.ts +99 -0
- package/esm/bug-report.d.ts.map +1 -0
- package/esm/bug-report.js +271 -0
- package/esm/bug-report.js.map +1 -0
- package/esm/cmd.d.ts +25 -0
- package/esm/cmd.d.ts.map +1 -0
- package/esm/cmd.js +81 -0
- package/esm/cmd.js.map +1 -0
- package/esm/demo-mode.d.ts +44 -0
- package/esm/demo-mode.d.ts.map +1 -0
- package/esm/demo-mode.js +179 -0
- package/esm/demo-mode.js.map +1 -0
- package/esm/dumpsys.d.ts +51 -0
- package/esm/dumpsys.d.ts.map +1 -0
- package/esm/dumpsys.js +114 -0
- package/esm/dumpsys.js.map +1 -0
- package/esm/index.d.ts +13 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +14 -0
- package/esm/index.js.map +1 -0
- package/esm/intent.d.ts +11 -0
- package/esm/intent.d.ts.map +1 -0
- package/esm/intent.js +59 -0
- package/esm/intent.js.map +1 -0
- package/esm/logcat.d.ts +93 -0
- package/esm/logcat.d.ts.map +1 -0
- package/esm/logcat.js +300 -0
- package/esm/logcat.js.map +1 -0
- package/esm/overlay-display.d.ts +38 -0
- package/esm/overlay-display.d.ts.map +1 -0
- package/esm/overlay-display.js +51 -0
- package/esm/overlay-display.js.map +1 -0
- package/esm/pm.d.ts +211 -0
- package/esm/pm.d.ts.map +1 -0
- package/esm/pm.js +382 -0
- package/esm/pm.js.map +1 -0
- package/esm/settings.d.ts +27 -0
- package/esm/settings.d.ts.map +1 -0
- package/esm/settings.js +66 -0
- package/esm/settings.js.map +1 -0
- package/esm/string-format.d.ts +43 -0
- package/esm/string-format.d.ts.map +1 -0
- package/esm/string-format.js +152 -0
- package/esm/string-format.js.map +1 -0
- package/esm/utils.d.ts +4 -0
- package/esm/utils.d.ts.map +1 -0
- package/esm/utils.js +23 -0
- package/esm/utils.js.map +1 -0
- package/package.json +49 -0
- package/src/am.ts +71 -0
- package/src/bu.ts +80 -0
- package/src/bug-report.ts +348 -0
- package/src/cmd.ts +113 -0
- package/src/demo-mode.ts +232 -0
- package/src/dumpsys.ts +153 -0
- package/src/index.ts +14 -0
- package/src/intent.ts +73 -0
- package/src/logcat.ts +509 -0
- package/src/overlay-display.ts +112 -0
- package/src/pm.ts +674 -0
- package/src/settings.ts +128 -0
- package/src/string-format.ts +197 -0
- package/src/utils.ts +29 -0
- package/tsconfig.build.json +14 -0
- package/tsconfig.build.tsbuildinfo +1 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
// cspell: ignore bugreport
|
|
2
|
+
// cspell: ignore bugreportz
|
|
3
|
+
import { AdbCommandBase, AdbSubprocessShellProtocol } from "@yume-chan/adb";
|
|
4
|
+
import { AbortController, PushReadableStream, SplitStringStream, TextDecoderStream, WrapReadableStream, WritableStream, } from "@yume-chan/stream-extra";
|
|
5
|
+
export class BugReport extends AdbCommandBase {
|
|
6
|
+
static VERSION_REGEX = /(\d+)\.(\d+)/;
|
|
7
|
+
static BEGIN_REGEX = /BEGIN:(.*)/;
|
|
8
|
+
static PROGRESS_REGEX = /PROGRESS:(.*)\/(.*)/;
|
|
9
|
+
static OK_REGEX = /OK:(.*)/;
|
|
10
|
+
static FAIL_REGEX = /FAIL:(.*)/;
|
|
11
|
+
/**
|
|
12
|
+
* Queries the device's bugreport capabilities.
|
|
13
|
+
*/
|
|
14
|
+
static async queryCapabilities(adb) {
|
|
15
|
+
// bugreportz requires shell protocol
|
|
16
|
+
if (!AdbSubprocessShellProtocol.isSupported(adb)) {
|
|
17
|
+
return new BugReport(adb, {
|
|
18
|
+
supportsBugReport: true,
|
|
19
|
+
bugReportZVersion: undefined,
|
|
20
|
+
supportsBugReportZ: false,
|
|
21
|
+
supportsBugReportZProgress: false,
|
|
22
|
+
supportsBugReportZStream: false,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const { stderr, exitCode } = await adb.subprocess.spawnAndWait([
|
|
26
|
+
"bugreportz",
|
|
27
|
+
"-v",
|
|
28
|
+
]);
|
|
29
|
+
if (exitCode !== 0 || stderr === "") {
|
|
30
|
+
return new BugReport(adb, {
|
|
31
|
+
supportsBugReport: true,
|
|
32
|
+
bugReportZVersion: undefined,
|
|
33
|
+
supportsBugReportZ: false,
|
|
34
|
+
supportsBugReportZProgress: false,
|
|
35
|
+
supportsBugReportZStream: false,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
const match = stderr.match(BugReport.VERSION_REGEX);
|
|
39
|
+
if (!match) {
|
|
40
|
+
return new BugReport(adb, {
|
|
41
|
+
supportsBugReport: true,
|
|
42
|
+
bugReportZVersion: undefined,
|
|
43
|
+
supportsBugReportZ: false,
|
|
44
|
+
supportsBugReportZProgress: false,
|
|
45
|
+
supportsBugReportZStream: false,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const [major, minor] = match[0]
|
|
49
|
+
.split(".")
|
|
50
|
+
.map((x) => parseInt(x, 10));
|
|
51
|
+
return new BugReport(adb, {
|
|
52
|
+
// Before BugReportZ version 1.2 (Android 12), BugReport was deprecated but still works.
|
|
53
|
+
supportsBugReport: major === 1 && minor <= 1,
|
|
54
|
+
bugReportZVersion: match[0],
|
|
55
|
+
supportsBugReportZ: true,
|
|
56
|
+
supportsBugReportZProgress: major > 1 || minor >= 1,
|
|
57
|
+
supportsBugReportZStream: major > 1 || minor >= 2,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
#supportsBugReport;
|
|
61
|
+
/**
|
|
62
|
+
* Gets whether the device supports flat (text file, non-zipped) bugreport.
|
|
63
|
+
*
|
|
64
|
+
* Should be `true` for Android version <= 11.
|
|
65
|
+
*/
|
|
66
|
+
get supportsBugReport() {
|
|
67
|
+
return this.#supportsBugReport;
|
|
68
|
+
}
|
|
69
|
+
#bugReportZVersion;
|
|
70
|
+
/**
|
|
71
|
+
* Gets the version of BugReportZ.
|
|
72
|
+
*
|
|
73
|
+
* Will be `undefined` if BugReportZ is not supported.
|
|
74
|
+
*/
|
|
75
|
+
get bugReportZVersion() {
|
|
76
|
+
return this.#bugReportZVersion;
|
|
77
|
+
}
|
|
78
|
+
#supportsBugReportZ;
|
|
79
|
+
/**
|
|
80
|
+
* Gets whether the device supports zipped bugreport.
|
|
81
|
+
*
|
|
82
|
+
* Should be `true` for Android version >= 7.
|
|
83
|
+
*/
|
|
84
|
+
get supportsBugReportZ() {
|
|
85
|
+
return this.#supportsBugReportZ;
|
|
86
|
+
}
|
|
87
|
+
#supportsBugReportZProgress;
|
|
88
|
+
/**
|
|
89
|
+
* Gets whether the device supports progress report for zipped bugreport.
|
|
90
|
+
*
|
|
91
|
+
* Should be `true` for Android version >= 8.
|
|
92
|
+
*/
|
|
93
|
+
get supportsBugReportZProgress() {
|
|
94
|
+
return this.#supportsBugReportZProgress;
|
|
95
|
+
}
|
|
96
|
+
#supportsBugReportZStream;
|
|
97
|
+
/**
|
|
98
|
+
* Gets whether the device supports streaming zipped bugreport.
|
|
99
|
+
*
|
|
100
|
+
* Should be `true` for Android version >= 12.
|
|
101
|
+
*/
|
|
102
|
+
get supportsBugReportZStream() {
|
|
103
|
+
return this.#supportsBugReportZStream;
|
|
104
|
+
}
|
|
105
|
+
constructor(adb, capabilities) {
|
|
106
|
+
super(adb);
|
|
107
|
+
this.#supportsBugReport = capabilities.supportsBugReport;
|
|
108
|
+
this.#bugReportZVersion = capabilities.bugReportZVersion;
|
|
109
|
+
this.#supportsBugReportZ = capabilities.supportsBugReportZ;
|
|
110
|
+
this.#supportsBugReportZProgress =
|
|
111
|
+
capabilities.supportsBugReportZProgress;
|
|
112
|
+
this.#supportsBugReportZStream = capabilities.supportsBugReportZStream;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Creates a legacy, non-zipped bugreport file, or throws an error if `supportsBugReport` is `false`.
|
|
116
|
+
*
|
|
117
|
+
* @returns A flat (text file, non-zipped) bugreport.
|
|
118
|
+
*/
|
|
119
|
+
bugReport() {
|
|
120
|
+
if (!this.#supportsBugReport) {
|
|
121
|
+
throw new Error("Flat (text file, non-zipped) bugreport is not supported.");
|
|
122
|
+
}
|
|
123
|
+
return new WrapReadableStream(async () => {
|
|
124
|
+
// https://cs.android.com/android/platform/superproject/+/master:frameworks/native/cmds/bugreport/bugreport.cpp;drc=9b73bf07d73dbab5b792632e1e233edbad77f5fd;bpv=0;bpt=0
|
|
125
|
+
const process = await this.adb.subprocess.spawn(["bugreport"]);
|
|
126
|
+
return process.stdout;
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Creates a zipped bugreport file, or throws an error if `supportsBugReportZ` is `false`.
|
|
131
|
+
*
|
|
132
|
+
* Compare to `bugReportZStream`, this method will write the output to a file on device.
|
|
133
|
+
* You can pull it later using sync protocol.
|
|
134
|
+
*
|
|
135
|
+
* @returns The path to the generated bugreport file on device filesystem.
|
|
136
|
+
*/
|
|
137
|
+
async bugReportZ(options) {
|
|
138
|
+
if (options?.signal?.aborted) {
|
|
139
|
+
throw options?.signal.reason ?? new Error("Aborted");
|
|
140
|
+
}
|
|
141
|
+
if (!this.#supportsBugReportZ) {
|
|
142
|
+
throw new Error("bugreportz is not supported");
|
|
143
|
+
}
|
|
144
|
+
const args = ["bugreportz"];
|
|
145
|
+
if (options?.onProgress) {
|
|
146
|
+
if (!this.#supportsBugReportZProgress) {
|
|
147
|
+
throw new Error("bugreportz progress is not supported");
|
|
148
|
+
}
|
|
149
|
+
args.push("-p");
|
|
150
|
+
}
|
|
151
|
+
const process = await this.adb.subprocess.spawn(args, {
|
|
152
|
+
protocols: [AdbSubprocessShellProtocol],
|
|
153
|
+
});
|
|
154
|
+
options?.signal?.addEventListener("abort", () => {
|
|
155
|
+
void process.kill();
|
|
156
|
+
});
|
|
157
|
+
let filename;
|
|
158
|
+
let error;
|
|
159
|
+
await process.stdout
|
|
160
|
+
.pipeThrough(new TextDecoderStream())
|
|
161
|
+
.pipeThrough(new SplitStringStream("\n"))
|
|
162
|
+
.pipeTo(new WritableStream({
|
|
163
|
+
write(line) {
|
|
164
|
+
// `BEGIN:` and `PROGRESS:` only appear when `-p` is specified.
|
|
165
|
+
let match = line.match(BugReport.PROGRESS_REGEX);
|
|
166
|
+
if (match) {
|
|
167
|
+
options?.onProgress?.(match[1], match[2]);
|
|
168
|
+
}
|
|
169
|
+
match = line.match(BugReport.BEGIN_REGEX);
|
|
170
|
+
if (match) {
|
|
171
|
+
filename = match[1];
|
|
172
|
+
}
|
|
173
|
+
match = line.match(BugReport.OK_REGEX);
|
|
174
|
+
if (match) {
|
|
175
|
+
filename = match[1];
|
|
176
|
+
}
|
|
177
|
+
match = line.match(BugReport.FAIL_REGEX);
|
|
178
|
+
if (match) {
|
|
179
|
+
// Don't report error now
|
|
180
|
+
// We want to gather all output.
|
|
181
|
+
error = match[1];
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
}));
|
|
185
|
+
if (error) {
|
|
186
|
+
throw new Error(error);
|
|
187
|
+
}
|
|
188
|
+
if (!filename) {
|
|
189
|
+
throw new Error("bugreportz did not return file name");
|
|
190
|
+
}
|
|
191
|
+
// Design choice: we don't automatically pull the file to avoid more dependency on `@yume-chan/adb`
|
|
192
|
+
return filename;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Creates a zipped bugreport file, or throws an error if `supportsBugReportZStream` is `false`.
|
|
196
|
+
*
|
|
197
|
+
* @returns The content of the generated bugreport file.
|
|
198
|
+
*/
|
|
199
|
+
bugReportZStream() {
|
|
200
|
+
return new PushReadableStream(async (controller) => {
|
|
201
|
+
const process = await this.adb.subprocess.spawn(["bugreportz", "-s"], { protocols: [AdbSubprocessShellProtocol] });
|
|
202
|
+
process.stdout
|
|
203
|
+
.pipeTo(new WritableStream({
|
|
204
|
+
async write(chunk) {
|
|
205
|
+
await controller.enqueue(chunk);
|
|
206
|
+
},
|
|
207
|
+
}))
|
|
208
|
+
.catch((e) => {
|
|
209
|
+
controller.error(e);
|
|
210
|
+
});
|
|
211
|
+
process.stderr
|
|
212
|
+
.pipeThrough(new TextDecoderStream())
|
|
213
|
+
.pipeTo(new WritableStream({
|
|
214
|
+
write(chunk) {
|
|
215
|
+
controller.error(new Error(chunk));
|
|
216
|
+
},
|
|
217
|
+
}))
|
|
218
|
+
.catch((e) => {
|
|
219
|
+
controller.error(e);
|
|
220
|
+
});
|
|
221
|
+
await process.exit;
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Automatically choose the best bugreport method.
|
|
226
|
+
*
|
|
227
|
+
* * If `supportsBugReportZStream` is `true`, this method will return a stream of zipped bugreport.
|
|
228
|
+
* * If `supportsBugReportZ` is `true`, this method will return a stream of zipped bugreport, and will delete the file on device after the stream is closed.
|
|
229
|
+
* * If `supportsBugReport` is `true`, this method will return a stream of flat bugreport.
|
|
230
|
+
*
|
|
231
|
+
* @param onProgress
|
|
232
|
+
* If `supportsBugReportZStream` is `false` and `supportsBugReportZProgress` is `true`,
|
|
233
|
+
* this callback will be called when progress is updated.
|
|
234
|
+
*/
|
|
235
|
+
automatic(onProgress) {
|
|
236
|
+
if (this.#supportsBugReportZStream) {
|
|
237
|
+
return { type: "bugreportz", stream: this.bugReportZStream() };
|
|
238
|
+
}
|
|
239
|
+
if (this.#supportsBugReportZ) {
|
|
240
|
+
let path;
|
|
241
|
+
let sync;
|
|
242
|
+
const controller = new AbortController();
|
|
243
|
+
const cleanup = async () => {
|
|
244
|
+
controller.abort();
|
|
245
|
+
await sync?.dispose();
|
|
246
|
+
if (path) {
|
|
247
|
+
await this.adb.rm(path);
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
return {
|
|
251
|
+
type: "bugreportz",
|
|
252
|
+
stream: new WrapReadableStream({
|
|
253
|
+
start: async () => {
|
|
254
|
+
path = await this.bugReportZ({
|
|
255
|
+
signal: controller.signal,
|
|
256
|
+
onProgress: this.#supportsBugReportZProgress
|
|
257
|
+
? onProgress
|
|
258
|
+
: undefined,
|
|
259
|
+
});
|
|
260
|
+
sync = await this.adb.sync();
|
|
261
|
+
return sync.read(path);
|
|
262
|
+
},
|
|
263
|
+
cancel: cleanup,
|
|
264
|
+
close: cleanup,
|
|
265
|
+
}),
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
return { type: "bugreport", stream: this.bugReport() };
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
//# sourceMappingURL=bug-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bug-report.js","sourceRoot":"","sources":["../src/bug-report.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,4BAA4B;AAG5B,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAE5E,OAAO,EACH,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,GACjB,MAAM,yBAAyB,CAAC;AAoBjC,MAAM,OAAO,SAAU,SAAQ,cAAc;IACzC,MAAM,CAAC,aAAa,GAAW,cAAc,CAAC;IAE9C,MAAM,CAAC,WAAW,GAAW,YAAY,CAAC;IAE1C,MAAM,CAAC,cAAc,GAAW,qBAAqB,CAAC;IAEtD,MAAM,CAAC,QAAQ,GAAW,SAAS,CAAC;IAEpC,MAAM,CAAC,UAAU,GAAW,WAAW,CAAC;IAExC;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAQ;QACnC,qCAAqC;QACrC,IAAI,CAAC,0BAA0B,CAAC,WAAW,CAAC,GA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,CAAC;YAC3B,IAAI,IAAwB,CAAC;YAC7B,IAAI,IAAyB,CAAC;YAC9B,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;YACzC,MAAM,OAAO,GAAG,KAAK,IAAI,EAAE;gBACvB,UAAU,CAAC,KAAK,EAAE,CAAC;gBACnB,MAAM,IAAI,EAAE,OAAO,EAAE,CAAC;gBACtB,IAAI,IAAI,EAAE,CAAC;oBACP,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;gBAC5B,CAAC;YACL,CAAC,CAAC;YAEF,OAAO;gBACH,IAAI,EAAE,YAAY;gBAClB,MAAM,EAAE,IAAI,kBAAkB,CAAC;oBAC3B,KAAK,EAAE,KAAK,IAAI,EAAE;wBACd,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC;4BACzB,MAAM,EAAE,UAAU,CAAC,MAAM;4BACzB,UAAU,EAAE,IAAI,CAAC,2BAA2B;gCACxC,CAAC,CAAC,UAAU;gCACZ,CAAC,CAAC,SAAS;yBAClB,CAAC,CAAC;wBACH,IAAI,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;wBAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAC3B,CAAC;oBACD,MAAM,EAAE,OAAO;oBACf,KAAK,EAAE,OAAO;iBACjB,CAAC;aACL,CAAC;QACN,CAAC;QAED,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;IAC3D,CAAC"}
|
package/esm/cmd.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Adb, AdbSubprocessProtocol, AdbSubprocessWaitResult } from "@yume-chan/adb";
|
|
2
|
+
import { AdbCommandBase } from "@yume-chan/adb";
|
|
3
|
+
export declare class Cmd extends AdbCommandBase {
|
|
4
|
+
#private;
|
|
5
|
+
get supportsShellV2(): boolean;
|
|
6
|
+
get supportsCmd(): boolean;
|
|
7
|
+
get supportsAbb(): boolean;
|
|
8
|
+
get supportsAbbExec(): boolean;
|
|
9
|
+
constructor(adb: Adb);
|
|
10
|
+
/**
|
|
11
|
+
* Spawn a new `cmd` command. It will use ADB's `abb` command if available.
|
|
12
|
+
*
|
|
13
|
+
* @param shellProtocol
|
|
14
|
+
* Whether to use shell protocol. If `true`, `stdout` and `stderr` will be separated.
|
|
15
|
+
*
|
|
16
|
+
* `cmd` doesn't use PTY, so even when shell protocol is used,
|
|
17
|
+
* resizing terminal size and closing `stdin` are not supported.
|
|
18
|
+
* @param command The command to run.
|
|
19
|
+
* @param args The arguments to pass to the command.
|
|
20
|
+
* @returns An `AdbSubprocessProtocol` that provides output streams.
|
|
21
|
+
*/
|
|
22
|
+
spawn(shellProtocol: boolean, command: string, ...args: string[]): Promise<AdbSubprocessProtocol>;
|
|
23
|
+
spawnAndWait(command: string, ...args: string[]): Promise<AdbSubprocessWaitResult>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=cmd.d.ts.map
|
package/esm/cmd.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cmd.d.ts","sourceRoot":"","sources":["../src/cmd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,GAAG,EACH,qBAAqB,EAErB,uBAAuB,EAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,cAAc,EAIjB,MAAM,gBAAgB,CAAC;AAGxB,qBAAa,GAAI,SAAQ,cAAc;;IAEnC,IAAI,eAAe,IAAI,OAAO,CAE7B;IAGD,IAAI,WAAW,IAAI,OAAO,CAEzB;IAGD,IAAI,WAAW,IAAI,OAAO,CAEzB;IAGD,IAAI,eAAe,IAAI,OAAO,CAE7B;gBAEW,GAAG,EAAE,GAAG;IAQpB;;;;;;;;;;;OAWG;IACG,KAAK,CACP,aAAa,EAAE,OAAO,EACtB,OAAO,EAAE,MAAM,EACf,GAAG,IAAI,EAAE,MAAM,EAAE,GAClB,OAAO,CAAC,qBAAqB,CAAC;IA+B3B,YAAY,CACd,OAAO,EAAE,MAAM,EACf,GAAG,IAAI,EAAE,MAAM,EAAE,GAClB,OAAO,CAAC,uBAAuB,CAAC;CAmBtC"}
|
package/esm/cmd.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { AdbCommandBase, AdbFeature, AdbSubprocessNoneProtocol, AdbSubprocessShellProtocol, } from "@yume-chan/adb";
|
|
2
|
+
import { ConcatStringStream, TextDecoderStream } from "@yume-chan/stream-extra";
|
|
3
|
+
export class Cmd extends AdbCommandBase {
|
|
4
|
+
#supportsShellV2;
|
|
5
|
+
get supportsShellV2() {
|
|
6
|
+
return this.#supportsShellV2;
|
|
7
|
+
}
|
|
8
|
+
#supportsCmd;
|
|
9
|
+
get supportsCmd() {
|
|
10
|
+
return this.#supportsCmd;
|
|
11
|
+
}
|
|
12
|
+
#supportsAbb;
|
|
13
|
+
get supportsAbb() {
|
|
14
|
+
return this.#supportsAbb;
|
|
15
|
+
}
|
|
16
|
+
#supportsAbbExec;
|
|
17
|
+
get supportsAbbExec() {
|
|
18
|
+
return this.#supportsAbbExec;
|
|
19
|
+
}
|
|
20
|
+
constructor(adb) {
|
|
21
|
+
super(adb);
|
|
22
|
+
this.#supportsShellV2 = adb.canUseFeature(AdbFeature.ShellV2);
|
|
23
|
+
this.#supportsCmd = adb.canUseFeature(AdbFeature.Cmd);
|
|
24
|
+
this.#supportsAbb = adb.canUseFeature(AdbFeature.Abb);
|
|
25
|
+
this.#supportsAbbExec = adb.canUseFeature(AdbFeature.AbbExec);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Spawn a new `cmd` command. It will use ADB's `abb` command if available.
|
|
29
|
+
*
|
|
30
|
+
* @param shellProtocol
|
|
31
|
+
* Whether to use shell protocol. If `true`, `stdout` and `stderr` will be separated.
|
|
32
|
+
*
|
|
33
|
+
* `cmd` doesn't use PTY, so even when shell protocol is used,
|
|
34
|
+
* resizing terminal size and closing `stdin` are not supported.
|
|
35
|
+
* @param command The command to run.
|
|
36
|
+
* @param args The arguments to pass to the command.
|
|
37
|
+
* @returns An `AdbSubprocessProtocol` that provides output streams.
|
|
38
|
+
*/
|
|
39
|
+
async spawn(shellProtocol, command, ...args) {
|
|
40
|
+
let supportsAbb;
|
|
41
|
+
let supportsCmd = this.#supportsCmd;
|
|
42
|
+
let service;
|
|
43
|
+
let Protocol;
|
|
44
|
+
if (shellProtocol) {
|
|
45
|
+
supportsAbb = this.#supportsAbb;
|
|
46
|
+
supportsCmd &&= this.supportsShellV2;
|
|
47
|
+
service = "abb";
|
|
48
|
+
Protocol = AdbSubprocessShellProtocol;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
supportsAbb = this.#supportsAbbExec;
|
|
52
|
+
service = "abb_exec";
|
|
53
|
+
Protocol = AdbSubprocessNoneProtocol;
|
|
54
|
+
}
|
|
55
|
+
if (supportsAbb) {
|
|
56
|
+
return new Protocol(await this.adb.createSocket(`${service}:${command}\0${args.join("\0")}\0`));
|
|
57
|
+
}
|
|
58
|
+
if (supportsCmd) {
|
|
59
|
+
return Protocol.raw(this.adb, `cmd ${command} ${args.join(" ")}`);
|
|
60
|
+
}
|
|
61
|
+
throw new Error("Not supported");
|
|
62
|
+
}
|
|
63
|
+
async spawnAndWait(command, ...args) {
|
|
64
|
+
const process = await this.spawn(true, command, ...args);
|
|
65
|
+
const [stdout, stderr, exitCode] = await Promise.all([
|
|
66
|
+
process.stdout
|
|
67
|
+
.pipeThrough(new TextDecoderStream())
|
|
68
|
+
.pipeThrough(new ConcatStringStream()),
|
|
69
|
+
process.stderr
|
|
70
|
+
.pipeThrough(new TextDecoderStream())
|
|
71
|
+
.pipeThrough(new ConcatStringStream()),
|
|
72
|
+
process.exit,
|
|
73
|
+
]);
|
|
74
|
+
return {
|
|
75
|
+
stdout,
|
|
76
|
+
stderr,
|
|
77
|
+
exitCode,
|
|
78
|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;YAC1C,OAAO,CAAC,MAAM;iBACT,WAAW,CAAC,IAAI,iBAAiB,EAAE,CAAC;iBACpC,WAAW,CAAC,IAAI,kBAAkB,EAAE,CAAC;YAC1C,OAAO,CAAC,IAAI;SACf,CAAC,CAAC;QAEH,OAAO;YACH,MAAM;YACN,MAAM;YACN,QAAQ;SACX,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Adb } from "@yume-chan/adb";
|
|
2
|
+
import { AdbCommandBase } from "@yume-chan/adb";
|
|
3
|
+
export declare enum DemoModeSignalStrength {
|
|
4
|
+
Hidden = "null",
|
|
5
|
+
Level0 = "0",
|
|
6
|
+
Level1 = "1",
|
|
7
|
+
Level2 = "2",
|
|
8
|
+
Level3 = "3",
|
|
9
|
+
Level4 = "4"
|
|
10
|
+
}
|
|
11
|
+
export declare const DemoModeMobileDataTypes: readonly ["1x", "3g", "4g", "4g+", "5g", "5ge", "5g+", "e", "g", "h", "h+", "lte", "lte+", "dis", "not", "null"];
|
|
12
|
+
export type DemoModeMobileDataType = (typeof DemoModeMobileDataTypes)[number];
|
|
13
|
+
export declare const DemoModeStatusBarModes: readonly ["opaque", "translucent", "semi-transparent", "transparent", "warning"];
|
|
14
|
+
export type DemoModeStatusBarMode = (typeof DemoModeStatusBarModes)[number];
|
|
15
|
+
export declare class DemoMode extends AdbCommandBase {
|
|
16
|
+
#private;
|
|
17
|
+
constructor(adb: Adb);
|
|
18
|
+
static readonly ALLOWED_SETTING_KEY = "sysui_demo_allowed";
|
|
19
|
+
static readonly ENABLED_SETTING_KEY = "sysui_tuner_demo_on";
|
|
20
|
+
getAllowed(): Promise<boolean>;
|
|
21
|
+
setAllowed(value: boolean): Promise<void>;
|
|
22
|
+
getEnabled(): Promise<boolean>;
|
|
23
|
+
setEnabled(value: boolean): Promise<void>;
|
|
24
|
+
broadcast(command: string, extra?: Record<string, string>): Promise<void>;
|
|
25
|
+
setBatteryLevel(level: number): Promise<void>;
|
|
26
|
+
setBatteryCharging(value: boolean): Promise<void>;
|
|
27
|
+
setPowerSaveMode(value: boolean): Promise<void>;
|
|
28
|
+
setAirplaneMode(show: boolean): Promise<void>;
|
|
29
|
+
setWifiSignalStrength(value: DemoModeSignalStrength): Promise<void>;
|
|
30
|
+
setMobileDataType(value: DemoModeMobileDataType): Promise<void>;
|
|
31
|
+
setMobileSignalStrength(value: DemoModeSignalStrength): Promise<void>;
|
|
32
|
+
setNoSimCardIcon(show: boolean): Promise<void>;
|
|
33
|
+
setStatusBarMode(mode: DemoModeStatusBarMode): Promise<void>;
|
|
34
|
+
setVibrateModeEnabled(value: boolean): Promise<void>;
|
|
35
|
+
setBluetoothConnected(value: boolean): Promise<void>;
|
|
36
|
+
setLocatingIcon(show: boolean): Promise<void>;
|
|
37
|
+
setAlarmIcon(show: boolean): Promise<void>;
|
|
38
|
+
setSyncingIcon(show: boolean): Promise<void>;
|
|
39
|
+
setMuteIcon(show: boolean): Promise<void>;
|
|
40
|
+
setSpeakerPhoneIcon(show: boolean): Promise<void>;
|
|
41
|
+
setNotificationsVisibility(show: boolean): Promise<void>;
|
|
42
|
+
setTime(hour: number, minute: number): Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=demo-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo-mode.d.ts","sourceRoot":"","sources":["../src/demo-mode.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAIhD,oBAAY,sBAAsB;IAC9B,MAAM,SAAS;IACf,MAAM,MAAM;IACZ,MAAM,MAAM;IACZ,MAAM,MAAM;IACZ,MAAM,MAAM;IACZ,MAAM,MAAM;CACf;AAGD,eAAO,MAAM,uBAAuB,kHAiB1B,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,uBAAuB,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BAAgB,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5D,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAKpD,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAOpD,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1C,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5C,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzC,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAMjD,0BAA0B,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAKxD,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAQ7D"}
|
package/esm/demo-mode.js
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// cspell: ignore carriernetworkchange
|
|
2
|
+
// cspell: ignore powersave
|
|
3
|
+
// cspell: ignore nosim
|
|
4
|
+
// cspell: ignore systemui
|
|
5
|
+
// cspell: ignore sysui
|
|
6
|
+
import { AdbCommandBase } from "@yume-chan/adb";
|
|
7
|
+
import { Settings } from "./settings.js";
|
|
8
|
+
export var DemoModeSignalStrength;
|
|
9
|
+
(function (DemoModeSignalStrength) {
|
|
10
|
+
DemoModeSignalStrength["Hidden"] = "null";
|
|
11
|
+
DemoModeSignalStrength["Level0"] = "0";
|
|
12
|
+
DemoModeSignalStrength["Level1"] = "1";
|
|
13
|
+
DemoModeSignalStrength["Level2"] = "2";
|
|
14
|
+
DemoModeSignalStrength["Level3"] = "3";
|
|
15
|
+
DemoModeSignalStrength["Level4"] = "4";
|
|
16
|
+
})(DemoModeSignalStrength || (DemoModeSignalStrength = {}));
|
|
17
|
+
// https://cs.android.com/android/platform/superproject/+/master:frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/NetworkControllerImpl.java;l=1362;drc=3b775bf7ad89902f94e03d191b0d8fbdebf2bdbf
|
|
18
|
+
export const DemoModeMobileDataTypes = [
|
|
19
|
+
"1x",
|
|
20
|
+
"3g",
|
|
21
|
+
"4g",
|
|
22
|
+
"4g+",
|
|
23
|
+
"5g",
|
|
24
|
+
"5ge",
|
|
25
|
+
"5g+",
|
|
26
|
+
"e",
|
|
27
|
+
"g",
|
|
28
|
+
"h",
|
|
29
|
+
"h+",
|
|
30
|
+
"lte",
|
|
31
|
+
"lte+",
|
|
32
|
+
"dis",
|
|
33
|
+
"not",
|
|
34
|
+
"null",
|
|
35
|
+
];
|
|
36
|
+
// https://cs.android.com/android/platform/superproject/+/master:frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java;l=3136
|
|
37
|
+
export const DemoModeStatusBarModes = [
|
|
38
|
+
"opaque",
|
|
39
|
+
"translucent",
|
|
40
|
+
"semi-transparent",
|
|
41
|
+
"transparent",
|
|
42
|
+
"warning",
|
|
43
|
+
];
|
|
44
|
+
export class DemoMode extends AdbCommandBase {
|
|
45
|
+
#settings;
|
|
46
|
+
constructor(adb) {
|
|
47
|
+
super(adb);
|
|
48
|
+
this.#settings = new Settings(adb);
|
|
49
|
+
}
|
|
50
|
+
static ALLOWED_SETTING_KEY = "sysui_demo_allowed";
|
|
51
|
+
// Demo Mode actually doesn't have a setting indicates its enablement
|
|
52
|
+
// However Developer Mode menu uses this key
|
|
53
|
+
// So we can only try our best to guess if it's enabled
|
|
54
|
+
static ENABLED_SETTING_KEY = "sysui_tuner_demo_on";
|
|
55
|
+
async getAllowed() {
|
|
56
|
+
const output = await this.#settings.get("global", DemoMode.ALLOWED_SETTING_KEY);
|
|
57
|
+
return output === "1";
|
|
58
|
+
}
|
|
59
|
+
async setAllowed(value) {
|
|
60
|
+
if (value) {
|
|
61
|
+
await this.#settings.put("global", DemoMode.ALLOWED_SETTING_KEY, "1");
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
await this.setEnabled(false);
|
|
65
|
+
await this.#settings.delete("global", DemoMode.ALLOWED_SETTING_KEY);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
async getEnabled() {
|
|
69
|
+
const result = await this.#settings.get("global", DemoMode.ENABLED_SETTING_KEY);
|
|
70
|
+
return result === "1";
|
|
71
|
+
}
|
|
72
|
+
async setEnabled(value) {
|
|
73
|
+
if (value) {
|
|
74
|
+
await this.#settings.put("global", DemoMode.ENABLED_SETTING_KEY, "1");
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
await this.#settings.delete("global", DemoMode.ENABLED_SETTING_KEY);
|
|
78
|
+
await this.broadcast("exit");
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async broadcast(command, extra) {
|
|
82
|
+
await this.adb.subprocess.spawnAndWaitLegacy([
|
|
83
|
+
"am",
|
|
84
|
+
"broadcast",
|
|
85
|
+
"-a",
|
|
86
|
+
"com.android.systemui.demo",
|
|
87
|
+
"-e",
|
|
88
|
+
"command",
|
|
89
|
+
command,
|
|
90
|
+
...(extra
|
|
91
|
+
? Object.entries(extra).flatMap(([key, value]) => [
|
|
92
|
+
"-e",
|
|
93
|
+
key,
|
|
94
|
+
value,
|
|
95
|
+
])
|
|
96
|
+
: []),
|
|
97
|
+
]);
|
|
98
|
+
}
|
|
99
|
+
async setBatteryLevel(level) {
|
|
100
|
+
await this.broadcast("battery", { level: level.toString() });
|
|
101
|
+
}
|
|
102
|
+
async setBatteryCharging(value) {
|
|
103
|
+
await this.broadcast("battery", { plugged: value.toString() });
|
|
104
|
+
}
|
|
105
|
+
async setPowerSaveMode(value) {
|
|
106
|
+
await this.broadcast("battery", { powersave: value.toString() });
|
|
107
|
+
}
|
|
108
|
+
async setAirplaneMode(show) {
|
|
109
|
+
await this.broadcast("network", { airplane: show ? "show" : "hide" });
|
|
110
|
+
}
|
|
111
|
+
async setWifiSignalStrength(value) {
|
|
112
|
+
await this.broadcast("network", { wifi: "show", level: value });
|
|
113
|
+
}
|
|
114
|
+
async setMobileDataType(value) {
|
|
115
|
+
for (let i = 0; i < 2; i += 1) {
|
|
116
|
+
await this.broadcast("network", {
|
|
117
|
+
mobile: "show",
|
|
118
|
+
sims: "1",
|
|
119
|
+
nosim: "hide",
|
|
120
|
+
slot: "0",
|
|
121
|
+
datatype: value,
|
|
122
|
+
fully: "true",
|
|
123
|
+
roam: "false",
|
|
124
|
+
level: "4",
|
|
125
|
+
inflate: "false",
|
|
126
|
+
activity: "in",
|
|
127
|
+
carriernetworkchange: "hide",
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
async setMobileSignalStrength(value) {
|
|
132
|
+
await this.broadcast("network", { mobile: "show", level: value });
|
|
133
|
+
}
|
|
134
|
+
async setNoSimCardIcon(show) {
|
|
135
|
+
await this.broadcast("network", { nosim: show ? "show" : "hide" });
|
|
136
|
+
}
|
|
137
|
+
async setStatusBarMode(mode) {
|
|
138
|
+
await this.broadcast("bars", { mode });
|
|
139
|
+
}
|
|
140
|
+
async setVibrateModeEnabled(value) {
|
|
141
|
+
// https://cs.android.com/android/platform/superproject/+/master:frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java;l=103
|
|
142
|
+
await this.broadcast("status", { volume: value ? "vibrate" : "hide" });
|
|
143
|
+
}
|
|
144
|
+
async setBluetoothConnected(value) {
|
|
145
|
+
// https://cs.android.com/android/platform/superproject/+/master:frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java;l=114
|
|
146
|
+
await this.broadcast("status", {
|
|
147
|
+
bluetooth: value ? "connected" : "hide",
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
async setLocatingIcon(show) {
|
|
151
|
+
await this.broadcast("status", { location: show ? "show" : "hide" });
|
|
152
|
+
}
|
|
153
|
+
async setAlarmIcon(show) {
|
|
154
|
+
await this.broadcast("status", { alarm: show ? "show" : "hide" });
|
|
155
|
+
}
|
|
156
|
+
async setSyncingIcon(show) {
|
|
157
|
+
await this.broadcast("status", { sync: show ? "show" : "hide" });
|
|
158
|
+
}
|
|
159
|
+
async setMuteIcon(show) {
|
|
160
|
+
await this.broadcast("status", { mute: show ? "show" : "hide" });
|
|
161
|
+
}
|
|
162
|
+
async setSpeakerPhoneIcon(show) {
|
|
163
|
+
await this.broadcast("status", {
|
|
164
|
+
speakerphone: show ? "show" : "hide",
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
async setNotificationsVisibility(show) {
|
|
168
|
+
// https://cs.android.com/android/platform/superproject/+/master:frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java;l=3131
|
|
169
|
+
await this.broadcast("notifications", { visible: show.toString() });
|
|
170
|
+
}
|
|
171
|
+
async setTime(hour, minute) {
|
|
172
|
+
await this.broadcast("clock", {
|
|
173
|
+
// cspell: disable-next-line
|
|
174
|
+
hhmm: hour.toString().padStart(2, "0") +
|
|
175
|
+
minute.toString().padStart(2, "0"),
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=demo-mode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo-mode.js","sourceRoot":"","sources":["../src/demo-mode.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,2BAA2B;AAC3B,uBAAuB;AACvB,0BAA0B;AAC1B,uBAAuB;AAGvB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,CAAN,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAC9B,yCAAe,CA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