appium-adb 14.1.2 → 14.1.3
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 +6 -0
- package/build/lib/tools/aab-utils.d.ts +5 -4
- package/build/lib/tools/aab-utils.d.ts.map +1 -1
- package/build/lib/tools/aab-utils.js +13 -11
- package/build/lib/tools/aab-utils.js.map +1 -1
- package/build/lib/tools/android-manifest.d.ts +26 -30
- package/build/lib/tools/android-manifest.d.ts.map +1 -1
- package/build/lib/tools/android-manifest.js +33 -47
- package/build/lib/tools/android-manifest.js.map +1 -1
- package/build/lib/tools/apks-utils.d.ts +25 -29
- package/build/lib/tools/apks-utils.d.ts.map +1 -1
- package/build/lib/tools/apks-utils.js +41 -52
- package/build/lib/tools/apks-utils.js.map +1 -1
- package/build/lib/tools/fs-commands.d.ts +25 -30
- package/build/lib/tools/fs-commands.d.ts.map +1 -1
- package/build/lib/tools/fs-commands.js +19 -26
- package/build/lib/tools/fs-commands.js.map +1 -1
- package/build/lib/tools/general-commands.d.ts +36 -58
- package/build/lib/tools/general-commands.d.ts.map +1 -1
- package/build/lib/tools/general-commands.js +41 -47
- package/build/lib/tools/general-commands.js.map +1 -1
- package/build/lib/tools/keyboard-commands.d.ts +27 -36
- package/build/lib/tools/keyboard-commands.d.ts.map +1 -1
- package/build/lib/tools/keyboard-commands.js +24 -34
- package/build/lib/tools/keyboard-commands.js.map +1 -1
- package/build/lib/tools/lockmgmt.d.ts +25 -36
- package/build/lib/tools/lockmgmt.d.ts.map +1 -1
- package/build/lib/tools/lockmgmt.js +34 -38
- package/build/lib/tools/lockmgmt.js.map +1 -1
- package/build/lib/tools/logcat-commands.d.ts +11 -30
- package/build/lib/tools/logcat-commands.d.ts.map +1 -1
- package/build/lib/tools/logcat-commands.js +16 -17
- package/build/lib/tools/logcat-commands.js.map +1 -1
- package/build/lib/tools/network-commands.d.ts +24 -31
- package/build/lib/tools/network-commands.d.ts.map +1 -1
- package/build/lib/tools/network-commands.js +14 -24
- package/build/lib/tools/network-commands.js.map +1 -1
- package/lib/tools/{aab-utils.js → aab-utils.ts} +24 -15
- package/lib/tools/{android-manifest.js → android-manifest.ts} +66 -59
- package/lib/tools/{apks-utils.js → apks-utils.ts} +76 -68
- package/lib/tools/{fs-commands.js → fs-commands.ts} +41 -35
- package/lib/tools/{general-commands.js → general-commands.ts} +71 -68
- package/lib/tools/{keyboard-commands.js → keyboard-commands.ts} +42 -49
- package/lib/tools/{lockmgmt.js → lockmgmt.ts} +71 -56
- package/lib/tools/{logcat-commands.js → logcat-commands.ts} +24 -22
- package/lib/tools/{network-commands.js → network-commands.ts} +42 -34
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [14.1.3](https://github.com/appium/appium-adb/compare/v14.1.2...v14.1.3) (2025-12-10)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* Migrate the rest of tools into typescript ([#849](https://github.com/appium/appium-adb/issues/849)) ([2d8ff00](https://github.com/appium/appium-adb/commit/2d8ff00d1117fa63d03e23f7e4f1cbda7289111a))
|
|
6
|
+
|
|
1
7
|
## [14.1.2](https://github.com/appium/appium-adb/compare/v14.1.1...v14.1.2) (2025-12-07)
|
|
2
8
|
|
|
3
9
|
### Miscellaneous Chores
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import type { ADB } from '../adb.js';
|
|
2
|
+
import type { ApkCreationOptions } from './types.js';
|
|
1
3
|
/**
|
|
2
4
|
* Builds a universal .apk from the given .aab package. See
|
|
3
5
|
* https://developer.android.com/studio/command-line/bundletool#generate_apks
|
|
4
6
|
* for more details.
|
|
5
7
|
*
|
|
6
|
-
* @
|
|
7
|
-
* @param
|
|
8
|
-
* @param {import('./types').ApkCreationOptions} [opts={}]
|
|
8
|
+
* @param aabPath Full path to the source .aab package
|
|
9
|
+
* @param opts Options for APK creation
|
|
9
10
|
* @returns The path to the resulting universal .apk. The .apk is stored in the internal cache
|
|
10
11
|
* by default.
|
|
11
12
|
* @throws {Error} If there was an error while creating the universal .apk
|
|
12
13
|
*/
|
|
13
|
-
export function extractUniversalApk(this:
|
|
14
|
+
export declare function extractUniversalApk(this: ADB, aabPath: string, opts?: ApkCreationOptions): Promise<string>;
|
|
14
15
|
//# sourceMappingURL=aab-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aab-utils.d.ts","sourceRoot":"","sources":["../../../lib/tools/aab-utils.
|
|
1
|
+
{"version":3,"file":"aab-utils.d.ts","sourceRoot":"","sources":["../../../lib/tools/aab-utils.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAC,kBAAkB,EAAe,MAAM,YAAY,CAAC;AA4BjE;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,GAAG,EACT,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,kBAAuB,GAC5B,OAAO,CAAC,MAAM,CAAC,CAuGjB"}
|
|
@@ -12,10 +12,9 @@ const helpers_js_1 = require("../helpers.js");
|
|
|
12
12
|
const async_lock_1 = __importDefault(require("async-lock"));
|
|
13
13
|
const bluebird_1 = __importDefault(require("bluebird"));
|
|
14
14
|
const crypto_1 = __importDefault(require("crypto"));
|
|
15
|
-
/** @type {LRUCache<string, string>} */
|
|
16
15
|
const AAB_CACHE = new lru_cache_1.LRUCache({
|
|
17
16
|
max: 10,
|
|
18
|
-
dispose: (extractedFilesRoot) => support_1.fs.rimraf(
|
|
17
|
+
dispose: (extractedFilesRoot) => support_1.fs.rimraf(extractedFilesRoot),
|
|
19
18
|
});
|
|
20
19
|
const AAB_CACHE_GUARD = new async_lock_1.default();
|
|
21
20
|
const UNIVERSAL_APK = 'universal.apk';
|
|
@@ -23,7 +22,7 @@ process.on('exit', () => {
|
|
|
23
22
|
if (!AAB_CACHE.size) {
|
|
24
23
|
return;
|
|
25
24
|
}
|
|
26
|
-
const paths =
|
|
25
|
+
const paths = [...AAB_CACHE.values()];
|
|
27
26
|
logger_js_1.log.debug(`Performing cleanup of ${paths.length} cached .aab ` + support_1.util.pluralize('package', paths.length));
|
|
28
27
|
for (const appPath of paths) {
|
|
29
28
|
try {
|
|
@@ -31,7 +30,7 @@ process.on('exit', () => {
|
|
|
31
30
|
support_1.fs.rimrafSync(appPath);
|
|
32
31
|
}
|
|
33
32
|
catch (e) {
|
|
34
|
-
logger_js_1.log.warn(
|
|
33
|
+
logger_js_1.log.warn(e.message);
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
});
|
|
@@ -40,9 +39,8 @@ process.on('exit', () => {
|
|
|
40
39
|
* https://developer.android.com/studio/command-line/bundletool#generate_apks
|
|
41
40
|
* for more details.
|
|
42
41
|
*
|
|
43
|
-
* @
|
|
44
|
-
* @param
|
|
45
|
-
* @param {import('./types').ApkCreationOptions} [opts={}]
|
|
42
|
+
* @param aabPath Full path to the source .aab package
|
|
43
|
+
* @param opts Options for APK creation
|
|
46
44
|
* @returns The path to the resulting universal .apk. The .apk is stored in the internal cache
|
|
47
45
|
* by default.
|
|
48
46
|
* @throws {Error} If there was an error while creating the universal .apk
|
|
@@ -75,17 +73,21 @@ async function extractUniversalApk(aabPath, opts = {}) {
|
|
|
75
73
|
}
|
|
76
74
|
logger_js_1.log.debug(`Calculated the cache key for '${aabPath}': ${cacheHash}`);
|
|
77
75
|
if (AAB_CACHE.has(cacheHash)) {
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
80
|
-
|
|
76
|
+
const cachedRoot = AAB_CACHE.get(cacheHash);
|
|
77
|
+
if (cachedRoot) {
|
|
78
|
+
const resultPath = path_1.default.resolve(cachedRoot, apkName);
|
|
79
|
+
if (await support_1.fs.exists(resultPath)) {
|
|
80
|
+
return resultPath;
|
|
81
|
+
}
|
|
81
82
|
}
|
|
82
83
|
AAB_CACHE.delete(cacheHash);
|
|
83
84
|
}
|
|
84
85
|
await this.initAapt2();
|
|
86
|
+
const binaries = this.binaries;
|
|
85
87
|
const args = [
|
|
86
88
|
'build-apks',
|
|
87
89
|
'--aapt2',
|
|
88
|
-
|
|
90
|
+
binaries.aapt2,
|
|
89
91
|
'--bundle',
|
|
90
92
|
aabPath,
|
|
91
93
|
'--output',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aab-utils.js","sourceRoot":"","sources":["../../../lib/tools/aab-utils.
|
|
1
|
+
{"version":3,"file":"aab-utils.js","sourceRoot":"","sources":["../../../lib/tools/aab-utils.ts"],"names":[],"mappings":";;;;;AAgDA,kDA2GC;AA3JD,4CAAiC;AACjC,gDAAwB;AACxB,6CAAkD;AAClD,yCAAmC;AACnC,8CAAwC;AACxC,4DAAmC;AACnC,wDAAyB;AACzB,oDAA4B;AAI5B,MAAM,SAAS,GAAG,IAAI,oBAAQ,CAAiB;IAC7C,GAAG,EAAE,EAAE;IACP,OAAO,EAAE,CAAC,kBAAkB,EAAE,EAAE,CAAC,YAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC;CAC/D,CAAC,CAAC;AACH,MAAM,eAAe,GAAG,IAAI,oBAAS,EAAE,CAAC;AACxC,MAAM,aAAa,GAAG,eAAe,CAAC;AAEtC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;IACtB,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACpB,OAAO;IACT,CAAC;IAED,MAAM,KAAK,GAAG,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;IACtC,eAAG,CAAC,KAAK,CACP,yBAAyB,KAAK,CAAC,MAAM,eAAe,GAAG,cAAI,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAC/F,CAAC;IACF,KAAK,MAAM,OAAO,IAAI,KAAK,EAAE,CAAC;QAC5B,IAAI,CAAC;YACH,yDAAyD;YACzD,YAAE,CAAC,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AY,EAAE,CAAC,CAAC;gBACtF,MAAM,IAAI,KAAK,CACb,GAAG,aAAa,wBAAwB,OAAO,YAAY;oBACzD,sDAAsD,CACzD,CAAC;YACJ,CAAC;YACD,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC/C,eAAG,CAAC,KAAK,CAAC,SAAS,aAAa,QAAQ,gBAAgB,qBAAqB,UAAU,GAAG,CAAC,CAAC;YAC5F,MAAM,YAAE,CAAC,EAAE,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;YAC1C,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAClC,OAAO,UAAU,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,YAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACzB,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC"}
|
|
@@ -1,72 +1,68 @@
|
|
|
1
|
+
import type { ADB } from '../adb.js';
|
|
2
|
+
import type { APKInfo, PlatformInfo } from './types.js';
|
|
1
3
|
/**
|
|
2
4
|
* Extract package and main activity name from application manifest.
|
|
3
5
|
*
|
|
4
|
-
* @
|
|
5
|
-
* @
|
|
6
|
-
* @return {Promise<import('./types').APKInfo>} The parsed application info.
|
|
6
|
+
* @param appPath - The full path to application .apk(s) package
|
|
7
|
+
* @return The parsed application info.
|
|
7
8
|
* @throws {error} If there was an error while getting the data from the given
|
|
8
9
|
* application package.
|
|
9
10
|
*/
|
|
10
|
-
export function packageAndLaunchActivityFromManifest(this:
|
|
11
|
+
export declare function packageAndLaunchActivityFromManifest(this: ADB, appPath: string): Promise<APKInfo>;
|
|
11
12
|
/**
|
|
12
13
|
* Extract target SDK version from application manifest.
|
|
13
14
|
*
|
|
14
|
-
* @
|
|
15
|
-
* @
|
|
16
|
-
* @return {Promise<number>} The version of the target SDK.
|
|
15
|
+
* @param appPath - The full path to .apk(s) package.
|
|
16
|
+
* @return The version of the target SDK.
|
|
17
17
|
* @throws {error} If there was an error while getting the data from the given
|
|
18
18
|
* application package.
|
|
19
19
|
*/
|
|
20
|
-
export function targetSdkVersionFromManifest(this:
|
|
20
|
+
export declare function targetSdkVersionFromManifest(this: ADB, appPath: string): Promise<number>;
|
|
21
21
|
/**
|
|
22
22
|
* Extract target SDK version from package information.
|
|
23
23
|
*
|
|
24
|
-
* @
|
|
25
|
-
* @param
|
|
26
|
-
* @param {string?} [cmdOutput=null] - Optional parameter containing the output of
|
|
24
|
+
* @param pkg - The class name of the package installed on the device under test.
|
|
25
|
+
* @param cmdOutput - Optional parameter containing the output of
|
|
27
26
|
* _dumpsys package_ command. It may speed up the method execution.
|
|
28
|
-
* @return
|
|
27
|
+
* @return The version of the target SDK.
|
|
29
28
|
*/
|
|
30
|
-
export function targetSdkVersionUsingPKG(this:
|
|
29
|
+
export declare function targetSdkVersionUsingPKG(this: ADB, pkg: string, cmdOutput?: string | null): Promise<number>;
|
|
31
30
|
/**
|
|
32
31
|
* Create binary representation of package manifest (usually AndroidManifest.xml).
|
|
33
32
|
* `${manifest}.apk` file will be created as the result of this method
|
|
34
33
|
* containing the compiled manifest.
|
|
35
34
|
*
|
|
36
|
-
* @
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
39
|
-
* @param {string} targetPackage - The name of the destination package
|
|
35
|
+
* @param manifest - Full path to the initial manifest template
|
|
36
|
+
* @param manifestPackage - The name of the manifest package
|
|
37
|
+
* @param targetPackage - The name of the destination package
|
|
40
38
|
*/
|
|
41
|
-
export function compileManifest(this:
|
|
39
|
+
export declare function compileManifest(this: ADB, manifest: string, manifestPackage: string, targetPackage: string): Promise<void>;
|
|
42
40
|
/**
|
|
43
41
|
* Replace/insert the specially precompiled manifest file into the
|
|
44
42
|
* particular package.
|
|
45
43
|
*
|
|
46
|
-
* @
|
|
47
|
-
* @param {string} manifest - Full path to the precompiled manifest
|
|
44
|
+
* @param manifest - Full path to the precompiled manifest
|
|
48
45
|
* created by `compileManifest` method call
|
|
49
46
|
* without .apk extension
|
|
50
|
-
* @param
|
|
47
|
+
* @param srcApk - Full path to the existing valid application package, where
|
|
51
48
|
* this manifest has to be insetred to. This package
|
|
52
49
|
* will NOT be modified.
|
|
53
|
-
* @param
|
|
50
|
+
* @param dstApk - Full path to the resulting package.
|
|
54
51
|
* The file will be overridden if it already exists.
|
|
55
52
|
*/
|
|
56
|
-
export function insertManifest(this:
|
|
53
|
+
export declare function insertManifest(this: ADB, manifest: string, srcApk: string, dstApk: string): Promise<void>;
|
|
57
54
|
/**
|
|
58
55
|
* Check whether package manifest contains Internet permissions.
|
|
59
56
|
*
|
|
60
|
-
* @
|
|
61
|
-
* @
|
|
62
|
-
* @return {Promise<boolean>} True if the manifest requires Internet access permission.
|
|
57
|
+
* @param appPath - The full path to .apk(s) package.
|
|
58
|
+
* @return True if the manifest requires Internet access permission.
|
|
63
59
|
*/
|
|
64
|
-
export function hasInternetPermissionFromManifest(this:
|
|
60
|
+
export declare function hasInternetPermissionFromManifest(this: ADB, appPath: string): Promise<boolean>;
|
|
65
61
|
/**
|
|
66
62
|
* Retrieve the path to the recent installed Android platform.
|
|
67
63
|
*
|
|
68
|
-
* @param
|
|
69
|
-
* @return
|
|
64
|
+
* @param sdkRoot
|
|
65
|
+
* @return The resulting path to the newest installed platform.
|
|
70
66
|
*/
|
|
71
|
-
export function getAndroidPlatformAndPath(sdkRoot: string): Promise<
|
|
67
|
+
export declare function getAndroidPlatformAndPath(sdkRoot: string): Promise<PlatformInfo>;
|
|
72
68
|
//# sourceMappingURL=android-manifest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android-manifest.d.ts","sourceRoot":"","sources":["../../../lib/tools/android-manifest.
|
|
1
|
+
{"version":3,"file":"android-manifest.d.ts","sourceRoot":"","sources":["../../../lib/tools/android-manifest.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAC,OAAO,EAAE,YAAY,EAAe,MAAM,YAAY,CAAC;AAEpE;;;;;;;GAOG;AACH,wBAAsB,oCAAoC,CACxD,IAAI,EAAE,GAAG,EACT,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,OAAO,CAAC,CAYlB;AAED;;;;;;;GAOG;AACH,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAe9F;AAED;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,GAAG,EACT,GAAG,EAAE,MAAM,EACX,SAAS,GAAE,MAAM,GAAG,IAAW,GAC9B,OAAO,CAAC,MAAM,CAAC,CAMjB;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,GAAG,EACT,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CAqEf;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,GAAG,EACT,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAuCf;AAED;;;;;GAKG;AACH,wBAAsB,iCAAiC,CACrD,IAAI,EAAE,GAAG,EACT,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,OAAO,CAAC,CAQlB;AAID;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAmCtF"}
|
|
@@ -19,9 +19,8 @@ const path_1 = __importDefault(require("path"));
|
|
|
19
19
|
/**
|
|
20
20
|
* Extract package and main activity name from application manifest.
|
|
21
21
|
*
|
|
22
|
-
* @
|
|
23
|
-
* @
|
|
24
|
-
* @return {Promise<import('./types').APKInfo>} The parsed application info.
|
|
22
|
+
* @param appPath - The full path to application .apk(s) package
|
|
23
|
+
* @return The parsed application info.
|
|
25
24
|
* @throws {error} If there was an error while getting the data from the given
|
|
26
25
|
* application package.
|
|
27
26
|
*/
|
|
@@ -37,9 +36,8 @@ async function packageAndLaunchActivityFromManifest(appPath) {
|
|
|
37
36
|
/**
|
|
38
37
|
* Extract target SDK version from application manifest.
|
|
39
38
|
*
|
|
40
|
-
* @
|
|
41
|
-
* @
|
|
42
|
-
* @return {Promise<number>} The version of the target SDK.
|
|
39
|
+
* @param appPath - The full path to .apk(s) package.
|
|
40
|
+
* @return The version of the target SDK.
|
|
43
41
|
* @throws {error} If there was an error while getting the data from the given
|
|
44
42
|
* application package.
|
|
45
43
|
*/
|
|
@@ -59,11 +57,10 @@ async function targetSdkVersionFromManifest(appPath) {
|
|
|
59
57
|
/**
|
|
60
58
|
* Extract target SDK version from package information.
|
|
61
59
|
*
|
|
62
|
-
* @
|
|
63
|
-
* @param
|
|
64
|
-
* @param {string?} [cmdOutput=null] - Optional parameter containing the output of
|
|
60
|
+
* @param pkg - The class name of the package installed on the device under test.
|
|
61
|
+
* @param cmdOutput - Optional parameter containing the output of
|
|
65
62
|
* _dumpsys package_ command. It may speed up the method execution.
|
|
66
|
-
* @return
|
|
63
|
+
* @return The version of the target SDK.
|
|
67
64
|
*/
|
|
68
65
|
async function targetSdkVersionUsingPKG(pkg, cmdOutput = null) {
|
|
69
66
|
const stdout = cmdOutput || (await this.shell(['dumpsys', 'package', pkg]));
|
|
@@ -77,14 +74,12 @@ async function targetSdkVersionUsingPKG(pkg, cmdOutput = null) {
|
|
|
77
74
|
* `${manifest}.apk` file will be created as the result of this method
|
|
78
75
|
* containing the compiled manifest.
|
|
79
76
|
*
|
|
80
|
-
* @
|
|
81
|
-
* @param
|
|
82
|
-
* @param
|
|
83
|
-
* @param {string} targetPackage - The name of the destination package
|
|
77
|
+
* @param manifest - Full path to the initial manifest template
|
|
78
|
+
* @param manifestPackage - The name of the manifest package
|
|
79
|
+
* @param targetPackage - The name of the destination package
|
|
84
80
|
*/
|
|
85
81
|
async function compileManifest(manifest, manifestPackage, targetPackage) {
|
|
86
|
-
const { platform, platformPath } = await getAndroidPlatformAndPath(
|
|
87
|
-
/** @type {string} */ (this.sdkRoot));
|
|
82
|
+
const { platform, platformPath } = await getAndroidPlatformAndPath(this.sdkRoot);
|
|
88
83
|
if (!platform || !platformPath) {
|
|
89
84
|
throw new Error('Cannot compile the manifest. The required platform does not exist (API level >= 17)');
|
|
90
85
|
}
|
|
@@ -96,6 +91,7 @@ async function compileManifest(manifest, manifestPackage, targetPackage) {
|
|
|
96
91
|
try {
|
|
97
92
|
await this.initAapt2();
|
|
98
93
|
// https://developer.android.com/studio/command-line/aapt2
|
|
94
|
+
const binaries = this.binaries;
|
|
99
95
|
const args = [
|
|
100
96
|
'link',
|
|
101
97
|
'-o',
|
|
@@ -110,16 +106,14 @@ async function compileManifest(manifest, manifestPackage, targetPackage) {
|
|
|
110
106
|
androidJarPath,
|
|
111
107
|
'-v',
|
|
112
108
|
];
|
|
113
|
-
logger_js_1.log.debug(`Compiling the manifest using '${support_1.util.quote([
|
|
114
|
-
|
|
115
|
-
...args,
|
|
116
|
-
])}'`);
|
|
117
|
-
await (0, teen_process_1.exec)(/** @type {import('./types').StringRecord} */ (this.binaries).aapt2, args);
|
|
109
|
+
logger_js_1.log.debug(`Compiling the manifest using '${support_1.util.quote([binaries.aapt2, ...args])}'`);
|
|
110
|
+
await (0, teen_process_1.exec)(binaries.aapt2, args);
|
|
118
111
|
}
|
|
119
112
|
catch (e) {
|
|
120
113
|
logger_js_1.log.debug('Cannot compile the manifest using aapt2. Defaulting to aapt. ' +
|
|
121
|
-
`Original error: ${e.
|
|
114
|
+
`Original error: ${e.message || e.stderr}`);
|
|
122
115
|
await this.initAapt();
|
|
116
|
+
const binaries = this.binaries;
|
|
123
117
|
const args = [
|
|
124
118
|
'package',
|
|
125
119
|
'-M',
|
|
@@ -134,15 +128,12 @@ async function compileManifest(manifest, manifestPackage, targetPackage) {
|
|
|
134
128
|
resultPath,
|
|
135
129
|
'-f',
|
|
136
130
|
];
|
|
137
|
-
logger_js_1.log.debug(`Compiling the manifest using '${support_1.util.quote([
|
|
138
|
-
/** @type {import('./types').StringRecord} */ (this.binaries).aapt,
|
|
139
|
-
...args,
|
|
140
|
-
])}'`);
|
|
131
|
+
logger_js_1.log.debug(`Compiling the manifest using '${support_1.util.quote([binaries.aapt, ...args])}'`);
|
|
141
132
|
try {
|
|
142
|
-
await (0, teen_process_1.exec)(
|
|
133
|
+
await (0, teen_process_1.exec)(binaries.aapt, args);
|
|
143
134
|
}
|
|
144
135
|
catch (e1) {
|
|
145
|
-
throw new Error(`Cannot compile the manifest. Original error: ${e1.
|
|
136
|
+
throw new Error(`Cannot compile the manifest. Original error: ${e1.message || e1.stderr}`);
|
|
146
137
|
}
|
|
147
138
|
}
|
|
148
139
|
logger_js_1.log.debug(`Compiled the manifest at '${resultPath}'`);
|
|
@@ -151,14 +142,13 @@ async function compileManifest(manifest, manifestPackage, targetPackage) {
|
|
|
151
142
|
* Replace/insert the specially precompiled manifest file into the
|
|
152
143
|
* particular package.
|
|
153
144
|
*
|
|
154
|
-
* @
|
|
155
|
-
* @param {string} manifest - Full path to the precompiled manifest
|
|
145
|
+
* @param manifest - Full path to the precompiled manifest
|
|
156
146
|
* created by `compileManifest` method call
|
|
157
147
|
* without .apk extension
|
|
158
|
-
* @param
|
|
148
|
+
* @param srcApk - Full path to the existing valid application package, where
|
|
159
149
|
* this manifest has to be insetred to. This package
|
|
160
150
|
* will NOT be modified.
|
|
161
|
-
* @param
|
|
151
|
+
* @param dstApk - Full path to the resulting package.
|
|
162
152
|
* The file will be overridden if it already exists.
|
|
163
153
|
*/
|
|
164
154
|
async function insertManifest(manifest, srcApk, dstApk) {
|
|
@@ -168,22 +158,20 @@ async function insertManifest(manifest, srcApk, dstApk) {
|
|
|
168
158
|
const manifestName = path_1.default.basename(manifest);
|
|
169
159
|
try {
|
|
170
160
|
await this.initAapt();
|
|
161
|
+
const binaries = this.binaries;
|
|
171
162
|
await support_1.fs.copyFile(srcApk, dstApk);
|
|
172
163
|
logger_js_1.log.debug('Moving manifest');
|
|
173
164
|
try {
|
|
174
|
-
await (0, teen_process_1.exec)(
|
|
175
|
-
'remove',
|
|
176
|
-
dstApk,
|
|
177
|
-
manifestName,
|
|
178
|
-
]);
|
|
165
|
+
await (0, teen_process_1.exec)(binaries.aapt, ['remove', dstApk, manifestName]);
|
|
179
166
|
}
|
|
180
167
|
catch { }
|
|
181
|
-
await (0, teen_process_1.exec)(
|
|
182
|
-
|
|
168
|
+
await (0, teen_process_1.exec)(binaries.aapt, ['add', dstApk, manifestName], {
|
|
169
|
+
cwd: path_1.default.dirname(manifest),
|
|
170
|
+
});
|
|
183
171
|
}
|
|
184
172
|
catch (e) {
|
|
185
173
|
logger_js_1.log.debug('Cannot insert manifest using aapt. Defaulting to zip. ' +
|
|
186
|
-
`Original error: ${e.
|
|
174
|
+
`Original error: ${e.message || e.stderr}`);
|
|
187
175
|
const tmpRoot = await support_1.tempDir.openDir();
|
|
188
176
|
try {
|
|
189
177
|
// Unfortunately NodeJS does not provide any reliable methods
|
|
@@ -207,9 +195,8 @@ async function insertManifest(manifest, srcApk, dstApk) {
|
|
|
207
195
|
/**
|
|
208
196
|
* Check whether package manifest contains Internet permissions.
|
|
209
197
|
*
|
|
210
|
-
* @
|
|
211
|
-
* @
|
|
212
|
-
* @return {Promise<boolean>} True if the manifest requires Internet access permission.
|
|
198
|
+
* @param appPath - The full path to .apk(s) package.
|
|
199
|
+
* @return True if the manifest requires Internet access permission.
|
|
213
200
|
*/
|
|
214
201
|
async function hasInternetPermissionFromManifest(appPath) {
|
|
215
202
|
logger_js_1.log.debug(`Checking if '${appPath}' requires internet access permission in the manifest`);
|
|
@@ -217,21 +204,20 @@ async function hasInternetPermissionFromManifest(appPath) {
|
|
|
217
204
|
appPath = await this.extractBaseApk(appPath);
|
|
218
205
|
}
|
|
219
206
|
const { usesPermissions } = await helpers_js_1.readPackageManifest.bind(this)(appPath);
|
|
220
|
-
return usesPermissions.some((
|
|
207
|
+
return usesPermissions.some((name) => name === 'android.permission.INTERNET');
|
|
221
208
|
}
|
|
222
209
|
// #region Private functions
|
|
223
210
|
/**
|
|
224
211
|
* Retrieve the path to the recent installed Android platform.
|
|
225
212
|
*
|
|
226
|
-
* @param
|
|
227
|
-
* @return
|
|
213
|
+
* @param sdkRoot
|
|
214
|
+
* @return The resulting path to the newest installed platform.
|
|
228
215
|
*/
|
|
229
216
|
async function getAndroidPlatformAndPath(sdkRoot) {
|
|
230
217
|
const propsPaths = await support_1.fs.glob('*/build.prop', {
|
|
231
218
|
cwd: path_1.default.resolve(sdkRoot, 'platforms'),
|
|
232
219
|
absolute: true,
|
|
233
220
|
});
|
|
234
|
-
/** @type {Record<string, import('./types').PlatformInfo>} */
|
|
235
221
|
const platformsMapping = {};
|
|
236
222
|
for (const propsPath of propsPaths) {
|
|
237
223
|
const propsContent = await support_1.fs.readFile(propsPath, 'utf-8');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android-manifest.js","sourceRoot":"","sources":["../../../lib/tools/android-manifest.
|
|
1
|
+
{"version":3,"file":"android-manifest.js","sourceRoot":"","sources":["../../../lib/tools/android-manifest.ts"],"names":[],"mappings":";;;;;AAiBA,oFAeC;AAUD,oEAeC;AAUD,4DAUC;AAWD,0CA0EC;AAeD,wCA4CC;AAQD,8EAWC;AAUD,8DAmCC;AA7RD,oDAAuB;AACvB,+CAAkC;AAClC,4CAAiC;AACjC,8CAA6E;AAC7E,6CAAuD;AACvD,gDAAwB;AAIxB;;;;;;;GAOG;AACI,KAAK,UAAU,oCAAoC,CAExD,OAAe;IAEf,IAAI,OAAO,CAAC,QAAQ,CAAC,2BAAc,CAAC,EAAE,CAAC;QACrC,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IA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,SAAS,CAAC,CAAC;QAC7C,MAAM,QAAQ,GAAG,cAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAC7C,MAAM,KAAK,GAAG,+BAA+B,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACjE,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,eAAG,CAAC,IAAI,CAAC,qCAAqC,SAAS,gBAAgB,QAAQ,GAAG,CAAC,CAAC;YACpF,SAAS;QACX,CAAC;QACD,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG;YACzC,QAAQ;YACR,YAAY;SACb,CAAC;IACJ,CAAC;IACD,IAAI,gBAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAChC,eAAG,CAAC,IAAI,CACN,mCAAmC,cAAI,CAAC,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK;YACxE,yCAAyC,CAC5C,CAAC;QACF,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,IAAI;SACnB,CAAC;IACJ,CAAC;IAED,MAAM,gBAAgB,GAAG,gBAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IACtE,MAAM,MAAM,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAClD,eAAG,CAAC,KAAK,CAAC,2CAA2C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC/E,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,aAAa"}
|
|
@@ -1,65 +1,61 @@
|
|
|
1
|
+
import type { ADB } from '../adb.js';
|
|
2
|
+
import type { InstallMultipleApksOptions, InstallApksOptions } from './types.js';
|
|
1
3
|
/**
|
|
2
4
|
* Executes bundletool utility with given arguments and returns the actual stdout
|
|
3
5
|
*
|
|
4
|
-
* @
|
|
5
|
-
* @param
|
|
6
|
-
* @
|
|
7
|
-
* @returns {Promise<string>} the actual command stdout
|
|
6
|
+
* @param args - the list of bundletool arguments
|
|
7
|
+
* @param errorMsg - The customized error message string
|
|
8
|
+
* @returns the actual command stdout
|
|
8
9
|
* @throws {Error} If bundletool jar does not exist in PATH or there was an error while
|
|
9
10
|
* executing it
|
|
10
11
|
*/
|
|
11
|
-
export function execBundletool(this:
|
|
12
|
+
export declare function execBundletool(this: ADB, args: string[], errorMsg: string): Promise<string>;
|
|
12
13
|
/**
|
|
13
14
|
*
|
|
14
|
-
* @
|
|
15
|
-
* @
|
|
16
|
-
* @returns {Promise<string>} The same `specLocation` value
|
|
15
|
+
* @param specLocation - The full path to the generated device spec location
|
|
16
|
+
* @returns The same `specLocation` value
|
|
17
17
|
* @throws {Error} If it is not possible to retrieve the spec for the current device
|
|
18
18
|
*/
|
|
19
|
-
export function getDeviceSpec(this:
|
|
19
|
+
export declare function getDeviceSpec(this: ADB, specLocation: string): Promise<string>;
|
|
20
20
|
/**
|
|
21
21
|
* Installs the given apks into the device under test
|
|
22
22
|
*
|
|
23
|
-
* @
|
|
24
|
-
* @param
|
|
25
|
-
* @param {import('./types').InstallMultipleApksOptions} [options={}] - Installation options
|
|
23
|
+
* @param apkPathsToInstall - The full paths to install apks
|
|
24
|
+
* @param options - Installation options
|
|
26
25
|
*/
|
|
27
|
-
export function installMultipleApks(this:
|
|
26
|
+
export declare function installMultipleApks(this: ADB, apkPathsToInstall: string[], options?: InstallMultipleApksOptions): Promise<string>;
|
|
28
27
|
/**
|
|
29
28
|
* Installs the given .apks package into the device under test
|
|
30
29
|
*
|
|
31
|
-
* @
|
|
32
|
-
* @param
|
|
33
|
-
* @param {import('./types').InstallApksOptions} [options={}] - Installation options
|
|
30
|
+
* @param apks - The full path to the .apks file
|
|
31
|
+
* @param options - Installation options
|
|
34
32
|
* @throws {Error} If the .apks bundle cannot be installed
|
|
35
33
|
*/
|
|
36
|
-
export function installApks(this:
|
|
34
|
+
export declare function installApks(this: ADB, apks: string, options?: InstallApksOptions): Promise<void>;
|
|
37
35
|
/**
|
|
38
36
|
* Extracts and returns the full path to the master .apk file inside the bundle.
|
|
39
37
|
*
|
|
40
|
-
* @
|
|
41
|
-
* @
|
|
42
|
-
* @returns {Promise<string>} The full path to the master bundle .apk
|
|
38
|
+
* @param apks - The full path to the .apks file
|
|
39
|
+
* @returns The full path to the master bundle .apk
|
|
43
40
|
* @throws {Error} If there was an error while extracting/finding the file
|
|
44
41
|
*/
|
|
45
|
-
export function extractBaseApk(this:
|
|
42
|
+
export declare function extractBaseApk(this: ADB, apks: string): Promise<string>;
|
|
46
43
|
/**
|
|
47
44
|
* Extracts and returns the full path to the .apk, which contains the corresponding
|
|
48
45
|
* resources for the given language in the .apks bundle.
|
|
49
46
|
*
|
|
50
|
-
* @
|
|
51
|
-
* @param
|
|
52
|
-
* @param {?string} [language=null] - The language abbreviation. The default language is
|
|
47
|
+
* @param apks - The full path to the .apks file
|
|
48
|
+
* @param language - The language abbreviation. The default language is
|
|
53
49
|
* going to be selected if it is not set.
|
|
54
|
-
* @returns
|
|
50
|
+
* @returns The full path to the corresponding language .apk or the master .apk
|
|
55
51
|
* if language split is not enabled for the bundle.
|
|
56
52
|
* @throws {Error} If there was an error while extracting/finding the file
|
|
57
53
|
*/
|
|
58
|
-
export function extractLanguageApk(this:
|
|
54
|
+
export declare function extractLanguageApk(this: ADB, apks: string, language?: string | null): Promise<string>;
|
|
59
55
|
/**
|
|
60
56
|
*
|
|
61
|
-
* @param
|
|
62
|
-
* @returns
|
|
57
|
+
* @param output
|
|
58
|
+
* @returns
|
|
63
59
|
*/
|
|
64
|
-
export function isTestPackageOnlyError(output: string): boolean;
|
|
60
|
+
export declare function isTestPackageOnlyError(output: string): boolean;
|
|
65
61
|
//# sourceMappingURL=apks-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apks-utils.d.ts","sourceRoot":"","sources":["../../../lib/tools/apks-utils.
|
|
1
|
+
{"version":3,"file":"apks-utils.d.ts","sourceRoot":"","sources":["../../../lib/tools/apks-utils.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAC,0BAA0B,EAAE,kBAAkB,EAAe,MAAM,YAAY,CAAC;AAgF7F;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,GAAG,EACT,IAAI,EAAE,MAAM,EAAE,EACd,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CA8BjB;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAapF;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,GAAG,EACT,iBAAiB,EAAE,MAAM,EAAE,EAC3B,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,GAAG,EACT,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CA+Bf;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7E;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,GAAG,EACT,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,MAAM,GAAG,IAAW,GAC7B,OAAO,CAAC,MAAM,CAAC,CA0BjB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE9D"}
|