appium-adb 9.14.12 → 10.0.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.
Files changed (86) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/build/lib/adb.d.ts +12 -0
  3. package/build/lib/adb.d.ts.map +1 -1
  4. package/build/lib/adb.js.map +1 -1
  5. package/build/lib/helpers.d.ts +82 -71
  6. package/build/lib/helpers.d.ts.map +1 -1
  7. package/build/lib/helpers.js +54 -41
  8. package/build/lib/helpers.js.map +1 -1
  9. package/build/lib/logcat.d.ts +25 -0
  10. package/build/lib/logcat.d.ts.map +1 -1
  11. package/build/lib/logcat.js +20 -0
  12. package/build/lib/logcat.js.map +1 -1
  13. package/build/lib/mixins.d.ts +2 -2
  14. package/build/lib/mixins.d.ts.map +1 -1
  15. package/build/lib/options.d.ts +2 -1
  16. package/build/lib/options.d.ts.map +1 -1
  17. package/build/lib/stubs.d.ts +1 -0
  18. package/build/lib/stubs.d.ts.map +1 -1
  19. package/build/lib/stubs.js +0 -1
  20. package/build/lib/tools/aab-utils.d.ts +12 -10
  21. package/build/lib/tools/aab-utils.d.ts.map +1 -1
  22. package/build/lib/tools/aab-utils.js +15 -10
  23. package/build/lib/tools/aab-utils.js.map +1 -1
  24. package/build/lib/tools/adb-commands.d.ts +256 -198
  25. package/build/lib/tools/adb-commands.d.ts.map +1 -1
  26. package/build/lib/tools/adb-commands.js +229 -118
  27. package/build/lib/tools/adb-commands.js.map +1 -1
  28. package/build/lib/tools/adb-emu-commands.d.ts +90 -29
  29. package/build/lib/tools/adb-emu-commands.d.ts.map +1 -1
  30. package/build/lib/tools/adb-emu-commands.js +44 -26
  31. package/build/lib/tools/adb-emu-commands.js.map +1 -1
  32. package/build/lib/tools/android-manifest.d.ts +16 -10
  33. package/build/lib/tools/android-manifest.d.ts.map +1 -1
  34. package/build/lib/tools/android-manifest.js +31 -23
  35. package/build/lib/tools/android-manifest.js.map +1 -1
  36. package/build/lib/tools/apk-signing.d.ts +21 -9
  37. package/build/lib/tools/apk-signing.d.ts.map +1 -1
  38. package/build/lib/tools/apk-signing.js +41 -24
  39. package/build/lib/tools/apk-signing.js.map +1 -1
  40. package/build/lib/tools/apk-utils.d.ts +92 -72
  41. package/build/lib/tools/apk-utils.d.ts.map +1 -1
  42. package/build/lib/tools/apk-utils.js +98 -54
  43. package/build/lib/tools/apk-utils.js.map +1 -1
  44. package/build/lib/tools/apks-utils.d.ts +34 -22
  45. package/build/lib/tools/apks-utils.d.ts.map +1 -1
  46. package/build/lib/tools/apks-utils.js +35 -18
  47. package/build/lib/tools/apks-utils.js.map +1 -1
  48. package/build/lib/tools/keyboard-commands.d.ts +4 -2
  49. package/build/lib/tools/keyboard-commands.d.ts.map +1 -1
  50. package/build/lib/tools/keyboard-commands.js +2 -0
  51. package/build/lib/tools/keyboard-commands.js.map +1 -1
  52. package/build/lib/tools/lockmgmt.d.ts +21 -13
  53. package/build/lib/tools/lockmgmt.d.ts.map +1 -1
  54. package/build/lib/tools/lockmgmt.js +21 -8
  55. package/build/lib/tools/lockmgmt.js.map +1 -1
  56. package/build/lib/tools/settings-client-commands.d.ts +32 -18
  57. package/build/lib/tools/settings-client-commands.d.ts.map +1 -1
  58. package/build/lib/tools/settings-client-commands.js +23 -8
  59. package/build/lib/tools/settings-client-commands.js.map +1 -1
  60. package/build/lib/tools/system-calls.d.ts +149 -84
  61. package/build/lib/tools/system-calls.d.ts.map +1 -1
  62. package/build/lib/tools/system-calls.js +162 -96
  63. package/build/lib/tools/system-calls.js.map +1 -1
  64. package/build/lib/tools/utf7.d.ts +7 -0
  65. package/build/lib/tools/utf7.d.ts.map +1 -1
  66. package/build/lib/tools/utf7.js +6 -3
  67. package/build/lib/tools/utf7.js.map +1 -1
  68. package/lib/adb.ts +12 -0
  69. package/lib/helpers.js +55 -42
  70. package/lib/logcat.js +21 -0
  71. package/lib/mixins.ts +2 -0
  72. package/lib/options.ts +2 -1
  73. package/lib/stubs.ts +1 -0
  74. package/lib/tools/aab-utils.js +16 -10
  75. package/lib/tools/adb-commands.js +238 -120
  76. package/lib/tools/adb-emu-commands.js +45 -26
  77. package/lib/tools/android-manifest.js +33 -23
  78. package/lib/tools/apk-signing.js +44 -24
  79. package/lib/tools/apk-utils.js +99 -54
  80. package/lib/tools/apks-utils.js +38 -19
  81. package/lib/tools/keyboard-commands.js +2 -0
  82. package/lib/tools/lockmgmt.js +21 -8
  83. package/lib/tools/settings-client-commands.js +23 -8
  84. package/lib/tools/system-calls.js +165 -99
  85. package/lib/tools/utf7.js +2 -1
  86. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [10.0.0](https://github.com/appium/appium-adb/compare/v9.14.12...v10.0.0) (2023-10-16)
2
+
3
+
4
+ ### ⚠ BREAKING CHANGES
5
+
6
+ * Some type declarations have been changed in order to make the compiler happy
7
+
8
+ ### Features
9
+
10
+ * Improve type declarations ([#698](https://github.com/appium/appium-adb/issues/698)) ([7d2588a](https://github.com/appium/appium-adb/commit/7d2588a1842be73dd77c08c493e7aef5aa4ee92d))
11
+
1
12
  ## [9.14.12](https://github.com/appium/appium-adb/compare/v9.14.11...v9.14.12) (2023-10-08)
2
13
 
3
14
 
@@ -1,6 +1,8 @@
1
1
  import { getAndroidBinaryPath } from './tools';
2
2
  import { getSdkRootFromEnv } from './helpers';
3
3
  import type { ADBOptions, ADBExecutable } from './options';
4
+ import type { LogcatOpts } from './logcat';
5
+ import type { LRUCache } from 'lru-cache';
4
6
  declare const DEFAULT_ADB_PORT = 5037;
5
7
  export declare const DEFAULT_OPTS: {
6
8
  readonly sdkRoot: string | undefined;
@@ -20,6 +22,16 @@ export declare const DEFAULT_OPTS: {
20
22
  export declare class ADB {
21
23
  adbHost?: string;
22
24
  adbPort?: number;
25
+ _apiLevel: number | undefined;
26
+ _logcatStartupParams: LogcatOpts | undefined;
27
+ _doesPsSupportAOption: boolean | undefined;
28
+ _isPgrepAvailable: boolean | undefined;
29
+ _canPgrepUseFullCmdLineSearch: boolean | undefined;
30
+ _isPidofAvailable: boolean | undefined;
31
+ _memoizedFeatures: (() => Promise<string>) | undefined;
32
+ _areExtendedLsOptionsSupported: boolean | undefined;
33
+ remoteAppsCache: LRUCache<string, string> | undefined;
34
+ _isLockManagementSupported: boolean | undefined;
23
35
  executable: ADBExecutable;
24
36
  constructor(opts?: Partial<ADBOptions>);
25
37
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"adb.d.ts","sourceRoot":"","sources":["../../lib/adb.ts"],"names":[],"mappings":"AAEA,OAAgB,EAAC,oBAAoB,EAAC,MAAM,SAAS,CAAC;AACtD,OAAO,EAA2C,iBAAiB,EAAC,MAAM,WAAW,CAAC;AAEtF,OAAO,KAAK,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,WAAW,CAAC;AAEzD,QAAA,MAAM,gBAAgB,OAAO,CAAC;AAC9B,eAAO,MAAM,YAAY;;;;;;;;;;;;;;CAWf,CAAC;AAEX,qBAAa,GAAG;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,UAAU,EAAE,aAAa,CAAC;gBACd,IAAI,GAAE,OAAO,CAAC,UAAU,CAAM;IAmB1C;;;;;OAKG;IACH,KAAK,CAAC,IAAI,GAAE,OAAO,CAAC,UAAU,CAAM,GAAG,GAAG;WAiB7B,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC;CAYjD;AAKD,OAAO,EAAC,gBAAgB,EAAE,oBAAoB,EAAE,iBAAiB,EAAC,CAAC"}
1
+ {"version":3,"file":"adb.d.ts","sourceRoot":"","sources":["../../lib/adb.ts"],"names":[],"mappings":"AAEA,OAAgB,EAAC,oBAAoB,EAAC,MAAM,SAAS,CAAC;AACtD,OAAO,EAA2C,iBAAiB,EAAC,MAAM,WAAW,CAAC;AAEtF,OAAO,KAAK,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,WAAW,CAAC;AACzD,O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AAM,IAAA,wBAAc,EAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAChD,MAAM,GAAG,CAAC,wBAAwB,EAAE,CAAC;QACrC,IAAI;YACF,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;SACrC;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,GAAG,GAAG,CAAqC,CAAC;YAClD,gBAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;SACrC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AArED,kBAqEC;AAED,2CAA2C;AAC3C,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,eAAO,CAAC,CAAC"}
@@ -12,33 +12,33 @@ export type PlatformInfo = {
12
12
  };
13
13
  export type InstallOptions = {
14
14
  /**
15
- * [false] - Set to true in order to allow test
16
- * packages installation.
15
+ * - Set to true in order to allow test
16
+ * packages installation.
17
17
  */
18
- allowTestPackages: boolean;
18
+ allowTestPackages?: boolean | undefined;
19
19
  /**
20
- * [false] - Set to true to install the app on sdcard
21
- * instead of the device memory.
20
+ * - Set to true to install the app on sdcard
21
+ * instead of the device memory.
22
22
  */
23
- useSdcard: boolean;
23
+ useSdcard?: boolean | undefined;
24
24
  /**
25
- * [false] - Set to true in order to grant all the
26
- * permissions requested in the application's manifest
27
- * automatically after the installation is completed
28
- * under Android 6+.
25
+ * - Set to true in order to grant all the
26
+ * permissions requested in the application's manifest
27
+ * automatically after the installation is completed
28
+ * under Android 6+.
29
29
  */
30
- grantPermissions: boolean;
30
+ grantPermissions?: boolean | undefined;
31
31
  /**
32
- * [true] - Set it to false if you don't want
33
- * the application to be upgraded/reinstalled
34
- * if it is already present on the device.
32
+ * - Set it to false if you don't want
33
+ * the application to be upgraded/reinstalled
34
+ * if it is already present on the device.
35
35
  */
36
- replace: boolean;
36
+ replace?: boolean | undefined;
37
37
  /**
38
- * [false] - Install apks partially. It is used for 'install-multiple'.
39
- * https://android.stackexchange.com/questions/111064/what-is-a-partial-application-install-via-adb
38
+ * - Install apks partially. It is used for 'install-multiple'.
39
+ * https://android.stackexchange.com/questions/111064/what-is-a-partial-application-install-via-adb
40
40
  */
41
- partialInstall: boolean;
41
+ partialInstall?: boolean | undefined;
42
42
  };
43
43
  export type ManifestInfo = {
44
44
  /**
@@ -48,7 +48,7 @@ export type ManifestInfo = {
48
48
  /**
49
49
  * - The name of the main package activity
50
50
  */
51
- activity: string;
51
+ activity?: string | undefined;
52
52
  /**
53
53
  * - The version code number (might be `NaN`)
54
54
  */
@@ -60,20 +60,30 @@ export type ManifestInfo = {
60
60
  };
61
61
  /**
62
62
  * @typedef {Object} PlatformInfo
63
- * @property {?string} platform - The platform name, for example `android-24`
63
+ * @property {string?} platform - The platform name, for example `android-24`
64
64
  * or `null` if it cannot be found
65
- * @property {?string} platformPath - Full path to the platform SDK folder
65
+ * @property {string?} platformPath - Full path to the platform SDK folder
66
66
  * or `null` if it cannot be found
67
67
  */
68
68
  /**
69
69
  * Retrieve the path to the recent installed Android platform.
70
70
  *
71
- * @return {PlatformInfo} The resulting path to the newest installed platform.
71
+ * @param {string} sdkRoot
72
+ * @return {Promise<PlatformInfo>} The resulting path to the newest installed platform.
72
73
  */
73
- export function getAndroidPlatformAndPath(sdkRoot: any): PlatformInfo;
74
- export function unzipFile(zipPath: any, dstRoot?: string): Promise<void>;
75
- export function getIMEListFromOutput(stdout: any): any[];
76
- export const getJavaForOs: (() => Promise<string>) & _.MemoizedFunction;
74
+ export function getAndroidPlatformAndPath(sdkRoot: string): Promise<PlatformInfo>;
75
+ /**
76
+ * @param {string} zipPath
77
+ * @param {string} dstRoot
78
+ */
79
+ export function unzipFile(zipPath: string, dstRoot?: string): Promise<void>;
80
+ /**
81
+ * @param {string} stdout
82
+ * @returns {string[]}
83
+ */
84
+ export function getIMEListFromOutput(stdout: string): string[];
85
+ /** @type {() => Promise<string>} */
86
+ export const getJavaForOs: () => Promise<string>;
77
87
  /**
78
88
  * Checks mShowingLockscreen or mDreamingLockscreen in dumpsys output to determine
79
89
  * if lock screen is showing
@@ -98,17 +108,19 @@ export function isScreenOnFully(dumpsys: any): boolean;
98
108
  * Builds command line representation for the given
99
109
  * application startup options
100
110
  *
101
- * @param {StartAppOptions} startAppOptions - Application options mapping
111
+ * @param {Record<string, any>} startAppOptions - Application options mapping
102
112
  * @param {number} apiLevel - The actual OS API level
103
- * @returns {Array<String>} The actual command line array
113
+ * @returns {string[]} The actual command line array
104
114
  */
105
- export function buildStartCmd(startAppOptions: StartAppOptions, apiLevel: number): Array<string>;
106
- export const getJavaHome: (() => Promise<string>) & _.MemoizedFunction;
107
- export const getSdkToolsVersion: (() => Promise<{
115
+ export function buildStartCmd(startAppOptions: Record<string, any>, apiLevel: number): string[];
116
+ /** @type {() => Promise<string>} */
117
+ export const getJavaHome: () => Promise<string>;
118
+ /** @type {() => Promise<{major: number, minor: number, build: number}?>} */
119
+ export const getSdkToolsVersion: () => Promise<{
108
120
  major: number;
109
121
  minor: number;
110
122
  build: number;
111
- } | undefined>) & _.MemoizedFunction;
123
+ } | null>;
112
124
  /**
113
125
  * Get the absolute path to apksigner tool
114
126
  *
@@ -116,69 +128,68 @@ export const getSdkToolsVersion: (() => Promise<{
116
128
  * @returns {Promise<string>} An absolute path to apksigner tool.
117
129
  * @throws {Error} If the tool is not present on the local file system.
118
130
  */
119
- export function getApksignerForOs(sysHelpers: Object): Promise<string>;
131
+ export function getApksignerForOs(sysHelpers: any): Promise<string>;
120
132
  /**
121
133
  * Retrieves full paths to all 'build-tools' subfolders under the particular
122
134
  * SDK root folder
123
135
  *
124
- * @param {string} sdkRoot - The full path to the Android SDK root folder
125
- * @returns {Array<string>} The full paths to the resulting folders sorted by
126
- * modification date (the newest comes first) or an empty list if no macthes were found
136
+ * @type {(sdkRoot: string) => Promise<string[]>}
127
137
  */
128
- export const getBuildToolsDirs: ((sdkRoot: any) => Promise<string[]>) & _.MemoizedFunction;
138
+ export const getBuildToolsDirs: (sdkRoot: string) => Promise<string[]>;
129
139
  /**
130
140
  * Get the absolute path to apkanalyzer tool.
131
141
  * https://developer.android.com/studio/command-line/apkanalyzer.html
132
142
  *
133
143
  * @param {Object} sysHelpers - An instance containing systemCallMethods helper methods
134
- * @returns {string} An absolute path to apkanalyzer tool.
144
+ * @returns {Promise<string>} An absolute path to apkanalyzer tool.
135
145
  * @throws {Error} If the tool is not present on the local file system.
136
146
  */
137
- export function getApkanalyzerForOs(sysHelpers: Object): string;
138
- export function getOpenSslForOs(): Promise<string>;
147
+ export function getApkanalyzerForOs(sysHelpers: any): Promise<string>;
148
+ /** @type {() => Promise<string>} */
149
+ export const getOpenSslForOs: () => Promise<string>;
139
150
  /**
140
151
  * Retrieves the list of permission names encoded in `dumpsys package` command output.
141
152
  *
142
153
  * @param {string} dumpsysOutput - The actual command output.
143
- * @param {Array<string>} groupNames - The list of group names to list permissions for.
144
- * @param {?boolean} grantedState - The expected state of `granted` attribute to filter with.
145
- * No filtering is done if the parameter is not set.
146
- * @returns {Array<string>} The list of matched permission names or an empty list if no matches were found.
154
+ * @param {string[]} groupNames - The list of group names to list permissions for.
155
+ * @param {boolean?} [grantedState=null] - The expected state of `granted` attribute to filter with.
156
+ * No filtering is done if the parameter is not set.
157
+ * @returns {string[]} The list of matched permission names or an empty list if no matches were found.
147
158
  */
148
- export function extractMatchingPermissions(dumpsysOutput: string, groupNames: Array<string>, grantedState?: boolean | null): Array<string>;
159
+ export function extractMatchingPermissions(dumpsysOutput: string, groupNames: string[], grantedState?: boolean | null | undefined): string[];
149
160
  export const APKS_EXTENSION: ".apks";
150
161
  export const APK_INSTALL_TIMEOUT: 60000;
151
162
  export const APKS_INSTALL_TIMEOUT: number;
152
163
  /**
153
164
  * @typedef {Object} InstallOptions
154
- * @property {boolean} allowTestPackages [false] - Set to true in order to allow test
165
+ * @property {boolean} [allowTestPackages=false] - Set to true in order to allow test
155
166
  * packages installation.
156
- * @property {boolean} useSdcard [false] - Set to true to install the app on sdcard
167
+ * @property {boolean} [useSdcard=false] - Set to true to install the app on sdcard
157
168
  * instead of the device memory.
158
- * @property {boolean} grantPermissions [false] - Set to true in order to grant all the
169
+ * @property {boolean} [grantPermissions=false] - Set to true in order to grant all the
159
170
  * permissions requested in the application's manifest
160
171
  * automatically after the installation is completed
161
172
  * under Android 6+.
162
- * @property {boolean} replace [true] - Set it to false if you don't want
173
+ * @property {boolean} [replace=true] - Set it to false if you don't want
163
174
  * the application to be upgraded/reinstalled
164
175
  * if it is already present on the device.
165
- * @property {boolean} partialInstall [false] - Install apks partially. It is used for 'install-multiple'.
176
+ * @property {boolean} [partialInstall=false] - Install apks partially. It is used for 'install-multiple'.
166
177
  * https://android.stackexchange.com/questions/111064/what-is-a-partial-application-install-via-adb
167
178
  */
168
179
  /**
169
180
  * Transforms given options into the list of `adb install.install-multiple` command arguments
170
181
  *
171
182
  * @param {number} apiLevel - The current API level
172
- * @param {?InstallOptions} options - The options mapping to transform
173
- * @returns {Array<String>} The array of arguments
183
+ * @param {InstallOptions} [options={}] - The options mapping to transform
184
+ * @returns {string[]} The array of arguments
174
185
  */
175
- export function buildInstallArgs(apiLevel: number, options?: InstallOptions | null): Array<string>;
186
+ export function buildInstallArgs(apiLevel: number, options?: InstallOptions | undefined): string[];
176
187
  export const APK_EXTENSION: ".apk";
177
188
  export const DEFAULT_ADB_EXEC_TIMEOUT: 20000;
178
189
  /**
179
190
  * @typedef {Object} ManifestInfo
180
191
  * @property {string} pkg - The application identifier
181
- * @property {string} activity - The name of the main package activity
192
+ * @property {string} [activity] - The name of the main package activity
182
193
  * @property {?number} versionCode - The version code number (might be `NaN`)
183
194
  * @property {?string} versionName - The version name (might be `null`)
184
195
  */
@@ -186,11 +197,11 @@ export const DEFAULT_ADB_EXEC_TIMEOUT: 20000;
186
197
  * Perform parsing of the manifest object in order
187
198
  * to extract some vital values from it
188
199
  *
189
- * @param {object} manifest The manifest content formatted as JSON
200
+ * @param {Record<string, any>} manifest The manifest content formatted as JSON
190
201
  * See https://www.npmjs.com/package/adbkit-apkreader for detailed format description
191
202
  * @returns {ManifestInfo}
192
203
  */
193
- export function parseManifest(manifest: object): ManifestInfo;
204
+ export function parseManifest(manifest: Record<string, any>): ManifestInfo;
194
205
  /**
195
206
  * Parses apk strings from aapt tool output
196
207
  *
@@ -201,7 +212,7 @@ export function parseManifest(manifest: object): ManifestInfo;
201
212
  * values are represented as arrays. If no config found for the
202
213
  * given marker then an empty mapping is returned.
203
214
  */
204
- export function parseAaptStrings(rawOutput: string, configMarker: string): Object;
215
+ export function parseAaptStrings(rawOutput: string, configMarker: string): any;
205
216
  /**
206
217
  * Parses apk strings from aapt2 tool output
207
218
  *
@@ -212,18 +223,18 @@ export function parseAaptStrings(rawOutput: string, configMarker: string): Objec
212
223
  * values are represented as arrays. If no config found for the
213
224
  * given marker then an empty mapping is returned.
214
225
  */
215
- export function parseAapt2Strings(rawOutput: string, configMarker: string): Object;
226
+ export function parseAapt2Strings(rawOutput: string, configMarker: string): any;
216
227
  /**
217
228
  * Formats the config marker, which is then passed to parse.. methods
218
229
  * to make it compatible with resource formats generated by aapt(2) tool
219
230
  *
220
231
  * @param {Function} configsGetter The function whose result is a list
221
232
  * of apk configs
222
- * @param {string} desiredMarker The desired config marker value
233
+ * @param {string?} desiredMarker The desired config marker value
223
234
  * @param {string} defaultMarker The default config marker value
224
- * @return {string} The formatted config marker
235
+ * @return {Promise<string>} The formatted config marker
225
236
  */
226
- export function formatConfigMarker(configsGetter: Function, desiredMarker: string, defaultMarker: string): string;
237
+ export function formatConfigMarker(configsGetter: Function, desiredMarker: string | null, defaultMarker: string): Promise<string>;
227
238
  /**
228
239
  * Parses the output in JSON format retrieved from
229
240
  * the corresponding Appium Settings broadcast calls
@@ -235,18 +246,18 @@ export function formatConfigMarker(configsGetter: Function, desiredMarker: strin
235
246
  * @throws {Error} If the output cannot be parsed
236
247
  * as a valid JSON
237
248
  */
238
- export function parseJsonData(output: string, entityName: string): Object;
249
+ export function parseJsonData(output: string, entityName: string): any;
239
250
  /**
240
251
  * Unsigns the given apk by removing the
241
252
  * META-INF folder recursively from the archive.
242
253
  * !!! The function overwrites the given apk after successful unsigning !!!
243
254
  *
244
255
  * @param {string} apkPath The path to the apk
245
- * @returns {boolean} `true` if the apk has been successfully
256
+ * @returns {Promise<boolean>} `true` if the apk has been successfully
246
257
  * unsigned and overwritten
247
258
  * @throws {Error} if there was an error during the unsign operation
248
259
  */
249
- export function unsignApk(apkPath: string): boolean;
260
+ export function unsignApk(apkPath: string): Promise<boolean>;
250
261
  /**
251
262
  * Transforms the given language and country abbreviations
252
263
  * to AVD arguments array
@@ -275,16 +286,16 @@ export function getSdkRootFromEnv(): string | undefined;
275
286
  /**
276
287
  * Retrieves the full path to the Android preferences root
277
288
  *
278
- * @returns {?string} The full path to the folder or `null` if the folder cannot be found
289
+ * @returns {Promise<string?>} The full path to the folder or `null` if the folder cannot be found
279
290
  */
280
- export function getAndroidPrefsRoot(): string | null;
291
+ export function getAndroidPrefsRoot(): Promise<string | null>;
281
292
  /**
282
293
  * Check if a path exists on the filesystem and is a directory
283
294
  *
284
- * @param {?string} location The full path to the directory
285
- * @returns {boolean}
295
+ * @param {string} location The full path to the directory
296
+ * @returns {Promise<boolean>}
286
297
  */
287
- export function dirExists(location: string | null): boolean;
298
+ export function dirExists(location: string): Promise<boolean>;
288
299
  /**
289
300
  * Escapes special characters in command line arguments.
290
301
  * This is needed to avoid possible issues with how system `spawn`
@@ -314,10 +325,10 @@ export function parseLaunchableActivityNames(dumpsys: string): string[];
314
325
  * Check if the given string is a valid component name
315
326
  *
316
327
  * @param {string} classString The string to verify
317
- * @return {?Array<Match>} The result of Regexp.exec operation
328
+ * @return {RegExpExecArray?} The result of Regexp.exec operation
318
329
  * or _null_ if no matches are found
319
330
  */
320
- export function matchComponentName(classString: string): Array<Match> | null;
331
+ export function matchComponentName(classString: string): RegExpExecArray | null;
321
332
  /**
322
333
  * Calculates the absolsute path to the given resource
323
334
  *
@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