@yume-chan/android-bin 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.
Files changed (46) hide show
  1. package/CHANGELOG.json +15 -0
  2. package/CHANGELOG.md +9 -1
  3. package/esm/bu.d.ts +14 -14
  4. package/esm/bu.js +13 -13
  5. package/esm/bug-report.d.ts +37 -37
  6. package/esm/bug-report.d.ts.map +1 -1
  7. package/esm/bug-report.js +136 -135
  8. package/esm/bug-report.js.map +1 -1
  9. package/esm/cmd.d.ts +15 -0
  10. package/esm/cmd.d.ts.map +1 -0
  11. package/esm/cmd.js +54 -0
  12. package/esm/cmd.js.map +1 -0
  13. package/esm/demo-mode.d.ts +43 -42
  14. package/esm/demo-mode.d.ts.map +1 -1
  15. package/esm/demo-mode.js +179 -178
  16. package/esm/demo-mode.js.map +1 -1
  17. package/esm/index.d.ts +6 -4
  18. package/esm/index.d.ts.map +1 -1
  19. package/esm/index.js +7 -5
  20. package/esm/index.js.map +1 -1
  21. package/esm/logcat.d.ts +91 -89
  22. package/esm/logcat.d.ts.map +1 -1
  23. package/esm/logcat.js +288 -200
  24. package/esm/logcat.js.map +1 -1
  25. package/esm/overlay-display.d.ts +21 -0
  26. package/esm/overlay-display.d.ts.map +1 -0
  27. package/esm/overlay-display.js +78 -0
  28. package/esm/overlay-display.js.map +1 -0
  29. package/esm/pm.d.ts +139 -0
  30. package/esm/pm.d.ts.map +1 -0
  31. package/esm/pm.js +125 -0
  32. package/esm/pm.js.map +1 -0
  33. package/esm/settings.d.ts +12 -12
  34. package/esm/settings.d.ts.map +1 -1
  35. package/esm/settings.js +29 -24
  36. package/esm/settings.js.map +1 -1
  37. package/package.json +10 -9
  38. package/src/bug-report.ts +1 -1
  39. package/src/cmd.ts +67 -0
  40. package/src/demo-mode.ts +4 -3
  41. package/src/index.ts +6 -4
  42. package/src/logcat.ts +231 -19
  43. package/src/overlay-display.ts +115 -0
  44. package/src/pm.ts +281 -0
  45. package/src/settings.ts +45 -16
  46. package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.json CHANGED
@@ -1,6 +1,21 @@
1
1
  {
2
2
  "name": "@yume-chan/android-bin",
3
3
  "entries": [
4
+ {
5
+ "version": "0.0.19",
6
+ "tag": "@yume-chan/android-bin_v0.0.19",
7
+ "date": "Sun, 09 Apr 2023 05:55:33 GMT",
8
+ "comments": {
9
+ "none": [
10
+ {
11
+ "comment": "Add wrapper for `cmd`, with support for Android Binder Bridge (abb)"
12
+ },
13
+ {
14
+ "comment": "Add `OverlayDisplay` wrapper for managing overlay displays"
15
+ }
16
+ ]
17
+ }
18
+ },
4
19
  {
5
20
  "version": "0.0.18",
6
21
  "tag": "@yume-chan/android-bin_v0.0.18",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # Change Log - @yume-chan/android-bin
2
2
 
3
- This log was last generated on Wed, 25 Jan 2023 21:33:49 GMT and should not be manually modified.
3
+ This log was last generated on Sun, 09 Apr 2023 05:55:33 GMT and should not be manually modified.
4
+
5
+ ## 0.0.19
6
+ Sun, 09 Apr 2023 05:55:33 GMT
7
+
8
+ ### Updates
9
+
10
+ - Add wrapper for `cmd`, with support for Android Binder Bridge (abb)
11
+ - Add `OverlayDisplay` wrapper for managing overlay displays
4
12
 
5
13
  ## 0.0.18
6
14
  Wed, 25 Jan 2023 21:33:49 GMT
package/esm/bu.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- import { AdbCommandBase } from "@yume-chan/adb";
2
- export interface AdbBackupOptions {
3
- apps: string[] | "all" | "all-including-system";
4
- apks: boolean;
5
- obbs: boolean;
6
- shared: boolean;
7
- widgets: boolean;
8
- compress: boolean;
9
- user: number;
10
- }
11
- export declare class AdbBackup extends AdbCommandBase {
12
- backup(options: AdbBackupOptions): Promise<void>;
13
- restore(options: AdbBackupOptions): Promise<void>;
14
- }
1
+ import { AdbCommandBase } from "@yume-chan/adb";
2
+ export interface AdbBackupOptions {
3
+ apps: string[] | "all" | "all-including-system";
4
+ apks: boolean;
5
+ obbs: boolean;
6
+ shared: boolean;
7
+ widgets: boolean;
8
+ compress: boolean;
9
+ user: number;
10
+ }
11
+ export declare class AdbBackup extends AdbCommandBase {
12
+ backup(options: AdbBackupOptions): Promise<void>;
13
+ restore(options: AdbBackupOptions): Promise<void>;
14
+ }
15
15
  //# sourceMappingURL=bu.d.ts.map
package/esm/bu.js CHANGED
@@ -1,14 +1,14 @@
1
- // cspell: ignore apks
2
- // cspell: ignore obbs
3
- import { AdbCommandBase } from "@yume-chan/adb";
4
- export class AdbBackup extends AdbCommandBase {
5
- backup(options) {
6
- void options;
7
- throw new Error("Not implemented");
8
- }
9
- restore(options) {
10
- void options;
11
- throw new Error("Not implemented");
12
- }
13
- }
1
+ // cspell: ignore apks
2
+ // cspell: ignore obbs
3
+ import { AdbCommandBase } from "@yume-chan/adb";
4
+ export class AdbBackup extends AdbCommandBase {
5
+ backup(options) {
6
+ void options;
7
+ throw new Error("Not implemented");
8
+ }
9
+ restore(options) {
10
+ void options;
11
+ throw new Error("Not implemented");
12
+ }
13
+ }
14
14
  //# sourceMappingURL=bu.js.map
@@ -1,38 +1,38 @@
1
- import { AdbCommandBase } from "@yume-chan/adb";
2
- import { type ReadableStream } from "@yume-chan/stream-extra";
3
- export interface BugReportZVersion {
4
- major: number;
5
- minor: number;
6
- supportProgress: boolean;
7
- supportStream: boolean;
8
- }
9
- export declare class BugReportZ extends AdbCommandBase {
10
- static VERSION_REGEX: RegExp;
11
- static BEGIN_REGEX: RegExp;
12
- static PROGRESS_REGEX: RegExp;
13
- static OK_REGEX: RegExp;
14
- static FAIL_REGEX: RegExp;
15
- /**
16
- * Retrieve the version of bugreportz.
17
- *
18
- * @returns a `BugReportVersion` object, or `undefined` if `bugreportz` is not available.
19
- */
20
- version(): Promise<BugReportZVersion | undefined>;
21
- supportProgress(major: number, minor: number): boolean;
22
- /**
23
- * Create a zipped bugreport file.
24
- *
25
- * Compare to `stream`, this method will write the output to a file on device.
26
- * You can pull it later using sync protocol.
27
- *
28
- * @param onProgress Progress callback. Only specify this if `supportsProgress` is `true`.
29
- * @returns The path of the bugreport file.
30
- */
31
- generate(onProgress?: (progress: string, total: string) => void): Promise<string>;
32
- supportStream(major: number, minor: number): boolean;
33
- stream(): ReadableStream<Uint8Array>;
34
- }
35
- export declare class BugReport extends AdbCommandBase {
36
- generate(): ReadableStream<Uint8Array>;
37
- }
1
+ import { AdbCommandBase } from "@yume-chan/adb";
2
+ import type { ReadableStream } from "@yume-chan/stream-extra";
3
+ export interface BugReportZVersion {
4
+ major: number;
5
+ minor: number;
6
+ supportProgress: boolean;
7
+ supportStream: boolean;
8
+ }
9
+ export declare class BugReportZ extends AdbCommandBase {
10
+ static VERSION_REGEX: RegExp;
11
+ static BEGIN_REGEX: RegExp;
12
+ static PROGRESS_REGEX: RegExp;
13
+ static OK_REGEX: RegExp;
14
+ static FAIL_REGEX: RegExp;
15
+ /**
16
+ * Retrieve the version of bugreportz.
17
+ *
18
+ * @returns a `BugReportVersion` object, or `undefined` if `bugreportz` is not available.
19
+ */
20
+ version(): Promise<BugReportZVersion | undefined>;
21
+ supportProgress(major: number, minor: number): boolean;
22
+ /**
23
+ * Create a zipped bugreport file.
24
+ *
25
+ * Compare to `stream`, this method will write the output to a file on device.
26
+ * You can pull it later using sync protocol.
27
+ *
28
+ * @param onProgress Progress callback. Only specify this if `supportsProgress` is `true`.
29
+ * @returns The path of the bugreport file.
30
+ */
31
+ generate(onProgress?: (progress: string, total: string) => void): Promise<string>;
32
+ supportStream(major: number, minor: number): boolean;
33
+ stream(): ReadableStream<Uint8Array>;
34
+ }
35
+ export declare class BugReport extends AdbCommandBase {
36
+ generate(): ReadableStream<Uint8Array>;
37
+ }
38
38
  //# sourceMappingURL=bug-report.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bug-report.d.ts","sourceRoot":"","sources":["../src/bug-report.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAA8B,MA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1B;AAED,qBAAa,UAAW,SAAQ,cAAc;IAC1C,OAAc,aAAa,SAAkB;IAE7C,OAAc,WAAW,SAAgB;IAEzC,OAAc,cAAc,SAAyB;IAErD,OAAc,QAAQ,SAAa;IAEnC,OAAc,UAAU,SAAe;IAEvC;;;;OAIG;IACU,OAAO,IAAI,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;IA8BvD,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAI7D;;;;;;;;OAQG;IACU,QAAQ,CACjB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,GACvD,OAAO,CAAC,MAAM,CAAC;IAqDX,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAIpD,MAAM,IAAI,cAAc,CAAC,UAAU,CAAC;CAgC9C;AAGD,qBAAa,SAAU,SAAQ,cAAc;IAClC,QAAQ,IAAI,cAAc,CAAC,UAAU,CAAC;CAMhD"}
package/esm/bug-report.js CHANGED
@@ -1,136 +1,137 @@
1
- // cspell: ignore bugreport
2
- // cspell: ignore bugreportz
3
- import { AdbCommandBase, AdbSubprocessShellProtocol } from "@yume-chan/adb";
4
- import { DecodeUtf8Stream, PushReadableStream, SplitStringStream, WrapReadableStream, WritableStream, } from "@yume-chan/stream-extra";
5
- export class BugReportZ 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
- * Retrieve the version of bugreportz.
13
- *
14
- * @returns a `BugReportVersion` object, or `undefined` if `bugreportz` is not available.
15
- */
16
- async version() {
17
- // bugreportz requires shell protocol
18
- if (!AdbSubprocessShellProtocol.isSupported(this.adb)) {
19
- return undefined;
20
- }
21
- const { stderr, exitCode } = await this.adb.subprocess.spawnAndWait([
22
- "bugreportz",
23
- "-v",
24
- ]);
25
- if (exitCode !== 0 || stderr === "") {
26
- return undefined;
27
- }
28
- const match = stderr.match(BugReportZ.VERSION_REGEX);
29
- if (!match) {
30
- return undefined;
31
- }
32
- const major = parseInt(match[1], 10);
33
- const minor = parseInt(match[2], 10);
34
- return {
35
- major,
36
- minor,
37
- supportProgress: this.supportProgress(major, minor),
38
- supportStream: this.supportStream(major, minor),
39
- };
40
- }
41
- supportProgress(major, minor) {
42
- return major > 1 || minor >= 1;
43
- }
44
- /**
45
- * Create a zipped bugreport file.
46
- *
47
- * Compare to `stream`, this method will write the output to a file on device.
48
- * You can pull it later using sync protocol.
49
- *
50
- * @param onProgress Progress callback. Only specify this if `supportsProgress` is `true`.
51
- * @returns The path of the bugreport file.
52
- */
53
- async generate(onProgress) {
54
- const process = await this.adb.subprocess.spawn([
55
- "bugreportz",
56
- ...(onProgress ? ["-p"] : []),
57
- ]);
58
- let filename;
59
- let error;
60
- await process.stdout
61
- .pipeThrough(new DecodeUtf8Stream())
62
- .pipeThrough(new SplitStringStream("\n"))
63
- .pipeTo(new WritableStream({
64
- write(line) {
65
- // `BEGIN:` and `PROGRESS:` only appear when `-p` is specified.
66
- let match = line.match(BugReportZ.PROGRESS_REGEX);
67
- if (match) {
68
- onProgress?.(match[1], match[2]);
69
- }
70
- match = line.match(BugReportZ.BEGIN_REGEX);
71
- if (match) {
72
- filename = match[1];
73
- }
74
- match = line.match(BugReportZ.OK_REGEX);
75
- if (match) {
76
- filename = match[1];
77
- }
78
- match = line.match(BugReportZ.FAIL_REGEX);
79
- if (match) {
80
- // Don't report error now
81
- // We want to gather all output.
82
- error = match[1];
83
- }
84
- },
85
- }));
86
- if (error) {
87
- throw new Error(error);
88
- }
89
- if (!filename) {
90
- throw new Error("bugreportz did not return file name");
91
- }
92
- // Design choice: we don't automatically pull the file to avoid more dependency on `@yume-chan/adb`
93
- return filename;
94
- }
95
- supportStream(major, minor) {
96
- return major > 1 || minor >= 2;
97
- }
98
- stream() {
99
- return new PushReadableStream(async (controller) => {
100
- const process = await this.adb.subprocess.spawn([
101
- "bugreportz",
102
- "-s",
103
- ]);
104
- process.stdout
105
- .pipeTo(new WritableStream({
106
- async write(chunk) {
107
- await controller.enqueue(chunk);
108
- },
109
- }))
110
- .catch((e) => {
111
- void e;
112
- });
113
- process.stderr
114
- .pipeThrough(new DecodeUtf8Stream())
115
- .pipeTo(new WritableStream({
116
- write(chunk) {
117
- controller.error(new Error(chunk));
118
- },
119
- }))
120
- .catch((e) => {
121
- void e;
122
- });
123
- await process.exit;
124
- });
125
- }
126
- }
127
- // https://cs.android.com/android/platform/superproject/+/master:frameworks/native/cmds/bugreport/bugreport.cpp;drc=9b73bf07d73dbab5b792632e1e233edbad77f5fd;bpv=0;bpt=0
128
- export class BugReport extends AdbCommandBase {
129
- generate() {
130
- return new WrapReadableStream(async () => {
131
- const process = await this.adb.subprocess.spawn(["bugreport"]);
132
- return process.stdout;
133
- });
134
- }
135
- }
1
+ // cspell: ignore bugreport
2
+ // cspell: ignore bugreportz
3
+ import { AdbCommandBase, AdbSubprocessShellProtocol } from "@yume-chan/adb";
4
+ import { DecodeUtf8Stream, PushReadableStream, SplitStringStream, WrapReadableStream, WritableStream, } from "@yume-chan/stream-extra";
5
+ class BugReportZ 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
+ * Retrieve the version of bugreportz.
13
+ *
14
+ * @returns a `BugReportVersion` object, or `undefined` if `bugreportz` is not available.
15
+ */
16
+ async version() {
17
+ // bugreportz requires shell protocol
18
+ if (!AdbSubprocessShellProtocol.isSupported(this.adb)) {
19
+ return undefined;
20
+ }
21
+ const { stderr, exitCode } = await this.adb.subprocess.spawnAndWait([
22
+ "bugreportz",
23
+ "-v",
24
+ ]);
25
+ if (exitCode !== 0 || stderr === "") {
26
+ return undefined;
27
+ }
28
+ const match = stderr.match(BugReportZ.VERSION_REGEX);
29
+ if (!match) {
30
+ return undefined;
31
+ }
32
+ const major = parseInt(match[1], 10);
33
+ const minor = parseInt(match[2], 10);
34
+ return {
35
+ major,
36
+ minor,
37
+ supportProgress: this.supportProgress(major, minor),
38
+ supportStream: this.supportStream(major, minor),
39
+ };
40
+ }
41
+ supportProgress(major, minor) {
42
+ return major > 1 || minor >= 1;
43
+ }
44
+ /**
45
+ * Create a zipped bugreport file.
46
+ *
47
+ * Compare to `stream`, this method will write the output to a file on device.
48
+ * You can pull it later using sync protocol.
49
+ *
50
+ * @param onProgress Progress callback. Only specify this if `supportsProgress` is `true`.
51
+ * @returns The path of the bugreport file.
52
+ */
53
+ async generate(onProgress) {
54
+ const process = await this.adb.subprocess.spawn([
55
+ "bugreportz",
56
+ ...(onProgress ? ["-p"] : []),
57
+ ]);
58
+ let filename;
59
+ let error;
60
+ await process.stdout
61
+ .pipeThrough(new DecodeUtf8Stream())
62
+ .pipeThrough(new SplitStringStream("\n"))
63
+ .pipeTo(new WritableStream({
64
+ write(line) {
65
+ // `BEGIN:` and `PROGRESS:` only appear when `-p` is specified.
66
+ let match = line.match(BugReportZ.PROGRESS_REGEX);
67
+ if (match) {
68
+ onProgress?.(match[1], match[2]);
69
+ }
70
+ match = line.match(BugReportZ.BEGIN_REGEX);
71
+ if (match) {
72
+ filename = match[1];
73
+ }
74
+ match = line.match(BugReportZ.OK_REGEX);
75
+ if (match) {
76
+ filename = match[1];
77
+ }
78
+ match = line.match(BugReportZ.FAIL_REGEX);
79
+ if (match) {
80
+ // Don't report error now
81
+ // We want to gather all output.
82
+ error = match[1];
83
+ }
84
+ },
85
+ }));
86
+ if (error) {
87
+ throw new Error(error);
88
+ }
89
+ if (!filename) {
90
+ throw new Error("bugreportz did not return file name");
91
+ }
92
+ // Design choice: we don't automatically pull the file to avoid more dependency on `@yume-chan/adb`
93
+ return filename;
94
+ }
95
+ supportStream(major, minor) {
96
+ return major > 1 || minor >= 2;
97
+ }
98
+ stream() {
99
+ return new PushReadableStream(async (controller) => {
100
+ const process = await this.adb.subprocess.spawn([
101
+ "bugreportz",
102
+ "-s",
103
+ ]);
104
+ process.stdout
105
+ .pipeTo(new WritableStream({
106
+ async write(chunk) {
107
+ await controller.enqueue(chunk);
108
+ },
109
+ }))
110
+ .catch((e) => {
111
+ void e;
112
+ });
113
+ process.stderr
114
+ .pipeThrough(new DecodeUtf8Stream())
115
+ .pipeTo(new WritableStream({
116
+ write(chunk) {
117
+ controller.error(new Error(chunk));
118
+ },
119
+ }))
120
+ .catch((e) => {
121
+ void e;
122
+ });
123
+ await process.exit;
124
+ });
125
+ }
126
+ }
127
+ export { BugReportZ };
128
+ // https://cs.android.com/android/platform/superproject/+/master:frameworks/native/cmds/bugreport/bugreport.cpp;drc=9b73bf07d73dbab5b792632e1e233edbad77f5fd;bpv=0;bpt=0
129
+ export class BugReport extends AdbCommandBase {
130
+ generate() {
131
+ return new WrapReadableStream(async () => {
132
+ const process = await this.adb.subprocess.spawn(["bugreport"]);
133
+ return process.stdout;
134
+ });
135
+ }
136
+ }
136
137
  //# sourceMappingURL=bug-report.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bug-report.js","sourceRoot":"","sources":["../src/bug-report.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,4BAA4B;AAE5B,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EACH,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,GAEjB,MAAM,yBAAyB,CAAC;AAUjC,MAAM,OAAO,UAAW,SAAQ,cAAc;IACnC,MAAM,CAAC,aAAa,GAAG,cAAc,CAAC;IAEtC,MAAM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AE;gBACT,KAAK,CAAC,CAAC;YACX,CAAC,CAAC,CAAC;YACP,OAAO,CAAC,MAAM;iBACT,WAAW,CAAC,IAAI,gBAAgB,EAAE,CAAC;iBACnC,MAAM,CACH,IAAI,cAAc,CAAC;gBACf,KAAK,CAAC,KAAK;oBACP,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;gBACvC,CAAC;aACJ,CAAC,CACL;iBACA,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;gBACT,KAAK,CAAC,CAAC;YACX,CAAC,CAAC,CAAC;YACP,MAAM,OAAO,CAAC,IAAI,CAAC;QACvB,CAAC,CAAC,CAAC;IACP,CAAC;;SArJQ,UAAU;AAwJvB,wKAAwK;AACxK,MAAM,OAAO,SAAU,SAAQ,cAAc;IAClC,QAAQ;QACX,OAAO,IAAI,kBAAkB,CAAC,KAAK,IAAI,EAAE;YACrC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;YAC/D,OAAO,OAAO,CAAC,MAAM,CAAC;QAC1B,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
package/esm/cmd.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ import type { Adb } from "@yume-chan/adb";
2
+ import { AdbCommandBase } from "@yume-chan/adb";
3
+ export declare class Cmd extends AdbCommandBase {
4
+ private _supportsShellV2;
5
+ private _supportsCmd;
6
+ private _supportsAbb;
7
+ private _supportsAbbExec;
8
+ get supportsShellV2(): boolean;
9
+ get supportsCmd(): boolean;
10
+ get supportsAbb(): boolean;
11
+ get supportsAbbExec(): boolean;
12
+ constructor(adb: Adb);
13
+ spawn(shellProtocol: boolean, command: string, ...args: string[]): Promise<import("@yume-chan/adb").AdbSubprocessProtocol>;
14
+ }
15
+ //# sourceMappingURL=cmd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cmd.d.ts","sourceRoot":"","sources":["../src/cmd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAoC,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EACH,cAAc,EAIjB,MAAM,gBAAgB,CAAC;AAExB,qBAAa,GAAI,SAAQ,cAAc;IACnC,OAAO,CAAC,gBAAgB,CAAU;IAClC,OAAO,CAAC,YAAY,CAAU;IAC9B,OAAO,CAAC,YAAY,CAAU;IAC9B,OAAO,CAAC,gBAAgB,CAAU;IAElC,IAAW,eAAe,YAEzB;IACD,IAAW,WAAW,YAErB;IACD,IAAW,WAAW,YAErB;IACD,IAAW,eAAe,YAEzB;gBAEkB,GAAG,EAAE,GAAG;IAQd,KAAK,CACd,aAAa,EAAE,OAAO,EACtB,OAAO,EAAE,MAAM,EACf,GAAG,IAAI,EAAE,MAAM,EAAE;CA4BxB"}
package/esm/cmd.js ADDED
@@ -0,0 +1,54 @@
1
+ import { AdbCommandBase, AdbFeature, AdbSubprocessNoneProtocol, AdbSubprocessShellProtocol, } from "@yume-chan/adb";
2
+ export class Cmd extends AdbCommandBase {
3
+ _supportsShellV2;
4
+ _supportsCmd;
5
+ _supportsAbb;
6
+ _supportsAbbExec;
7
+ get supportsShellV2() {
8
+ return this._supportsShellV2;
9
+ }
10
+ get supportsCmd() {
11
+ return this._supportsCmd;
12
+ }
13
+ get supportsAbb() {
14
+ return this._supportsAbb;
15
+ }
16
+ get supportsAbbExec() {
17
+ return this._supportsAbbExec;
18
+ }
19
+ constructor(adb) {
20
+ super(adb);
21
+ this._supportsShellV2 = adb.supportsFeature(AdbFeature.ShellV2);
22
+ this._supportsCmd = adb.supportsFeature(AdbFeature.Cmd);
23
+ this._supportsAbb = adb.supportsFeature(AdbFeature.Abb);
24
+ this._supportsAbbExec = adb.supportsFeature(AdbFeature.AbbExec);
25
+ }
26
+ async spawn(shellProtocol, command, ...args) {
27
+ let supportAbb;
28
+ let supportCmd = this.supportsCmd;
29
+ let service;
30
+ let Protocol;
31
+ if (shellProtocol) {
32
+ supportAbb = this._supportsAbb;
33
+ supportCmd &&= this.supportsShellV2;
34
+ service = "abb";
35
+ Protocol = AdbSubprocessShellProtocol;
36
+ }
37
+ else {
38
+ supportAbb = this._supportsAbbExec;
39
+ service = "abb_exec";
40
+ Protocol = AdbSubprocessNoneProtocol;
41
+ }
42
+ if (supportAbb) {
43
+ const socket = await this.adb.createSocket(`${service}:${command}\0${args.join("\0")}\0`);
44
+ return new Protocol(socket);
45
+ }
46
+ else if (supportCmd) {
47
+ return Protocol.raw(this.adb, `cmd ${command} ${args.join(" ")}`);
48
+ }
49
+ else {
50
+ throw new Error("Not supported");
51
+ }
52
+ }
53
+ }
54
+ //# sourceMappingURL=cmd.js.map
package/esm/cmd.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cmd.js","sourceRoot":"","sources":["../src/cmd.ts"],"names":[],"mappings":"AACA,OAAO,EACH,cAAc,EACd,UAAU,EACV,yBAAyB,EACzB,0BAA0B,GAC7B,MAAM,gBAAgB,CAAC;AAExB,MAAM,OAAO,GAAI,SAAQ,cAAc;IAC3B,gBAAgB,CAAU;IAC1B,YAAY,CAAU;IACtB,YAAY,CAAU;IACtB,gBAAgB,CAAU;IAElC,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IACD,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IACD,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IACD,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED,YAAmB,GAAQ;QACvB,KAAK,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,gBAAgB,GAAG,GAAG,CAAC,eAAe,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAChE,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,eAAe,CAAC,UAAU,CAAC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ModeSignalStrength {
3
- Hidden = "null",
4
- Level0 = "0",
5
- Level1 = "1",
6
- Level2 = "2",
7
- Level3 = "3",
8
- Level4 = "4"
9
- }
10
- export declare const DemoModeMobileDataTypes: readonly ["1x", "3g", "4g", "4g+", "5g", "5ge", "5g+", "e", "g", "h", "h+", "lte", "lte+", "dis", "not", "null"];
11
- export type DemoModeMobileDataType = typeof DemoModeMobileDataTypes[number];
12
- export declare const DemoModeStatusBarModes: readonly ["opaque", "translucent", "semi-transparent", "transparent", "warning"];
13
- export type DemoModeStatusBarMode = typeof DemoModeStatusBarModes[number];
14
- export declare class DemoMode extends AdbCommandBase {
15
- private settings;
16
- constructor(adb: Adb);
17
- static readonly AllowedSettingKey = "sysui_demo_allowed";
18
- static readonly EnabledSettingKey = "sysui_tuner_demo_on";
19
- getAllowed(): Promise<boolean>;
20
- setAllowed(value: boolean): Promise<void>;
21
- getEnabled(): Promise<boolean>;
22
- setEnabled(value: boolean): Promise<void>;
23
- broadcast(command: string, extra?: Record<string, string>): Promise<void>;
24
- setBatteryLevel(level: number): Promise<void>;
25
- setBatteryCharging(value: boolean): Promise<void>;
26
- setPowerSaveMode(value: boolean): Promise<void>;
27
- setAirplaneMode(show: boolean): Promise<void>;
28
- setWifiSignalStrength(value: DemoModeSignalStrength): Promise<void>;
29
- setMobileDataType(value: DemoModeMobileDataType): Promise<void>;
30
- setMobileSignalStrength(value: DemoModeSignalStrength): Promise<void>;
31
- setNoSimCardIcon(show: boolean): Promise<void>;
32
- setStatusBarMode(mode: DemoModeStatusBarMode): Promise<void>;
33
- setVibrateModeEnabled(value: boolean): Promise<void>;
34
- setBluetoothConnected(value: boolean): Promise<void>;
35
- setLocatingIcon(show: boolean): Promise<void>;
36
- setAlarmIcon(show: boolean): Promise<void>;
37
- setSyncingIcon(show: boolean): Promise<void>;
38
- setMuteIcon(show: boolean): Promise<void>;
39
- setSpeakerPhoneIcon(show: boolean): Promise<void>;
40
- setNotificationsVisibility(show: boolean): Promise<void>;
41
- setTime(hour: number, minute: number): Promise<void>;
42
- }
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 settings;
17
+ constructor(adb: Adb);
18
+ static readonly AllowedSettingKey = "sysui_demo_allowed";
19
+ static readonly EnabledSettingKey = "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
+ }
43
44
  //# sourceMappingURL=demo-mode.d.ts.map