appium-ios-simulator 8.0.13 → 8.1.1
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 +12 -0
- package/build/lib/defaults-utils.d.ts +24 -24
- package/build/lib/defaults-utils.d.ts.map +1 -1
- package/build/lib/defaults-utils.js +61 -65
- package/build/lib/defaults-utils.js.map +1 -1
- package/build/lib/extensions/applications.d.ts.map +1 -1
- package/build/lib/extensions/applications.js +6 -7
- package/build/lib/extensions/applications.js.map +1 -1
- package/build/lib/extensions/biometric.d.ts.map +1 -1
- package/build/lib/extensions/biometric.js +3 -6
- package/build/lib/extensions/biometric.js.map +1 -1
- package/build/lib/extensions/keychain.d.ts.map +1 -1
- package/build/lib/extensions/keychain.js +7 -6
- package/build/lib/extensions/keychain.js.map +1 -1
- package/build/lib/extensions/permissions.d.ts.map +1 -1
- package/build/lib/extensions/permissions.js +17 -19
- package/build/lib/extensions/permissions.js.map +1 -1
- package/build/lib/extensions/safari.d.ts.map +1 -1
- package/build/lib/extensions/safari.js +2 -4
- package/build/lib/extensions/safari.js.map +1 -1
- package/build/lib/extensions/settings.d.ts.map +1 -1
- package/build/lib/extensions/settings.js +52 -50
- package/build/lib/extensions/settings.js.map +1 -1
- package/build/lib/simulator-xcode-14.d.ts +37 -37
- package/build/lib/simulator-xcode-14.d.ts.map +1 -1
- package/build/lib/simulator-xcode-14.js +57 -59
- package/build/lib/simulator-xcode-14.js.map +1 -1
- package/build/lib/simulator-xcode-15.d.ts.map +1 -1
- package/build/lib/simulator-xcode-15.js +3 -5
- package/build/lib/simulator-xcode-15.js.map +1 -1
- package/build/lib/types.d.ts +8 -8
- package/build/lib/types.d.ts.map +1 -1
- package/build/lib/utils.d.ts +11 -3
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +50 -35
- package/build/lib/utils.js.map +1 -1
- package/lib/defaults-utils.ts +69 -68
- package/lib/extensions/applications.ts +6 -7
- package/lib/extensions/biometric.ts +3 -3
- package/lib/extensions/keychain.ts +11 -6
- package/lib/extensions/permissions.ts +18 -20
- package/lib/extensions/safari.ts +2 -4
- package/lib/extensions/settings.ts +71 -62
- package/lib/simulator-xcode-14.ts +70 -71
- package/lib/simulator-xcode-15.ts +3 -5
- package/lib/types.ts +9 -9
- package/lib/utils.ts +52 -37
- package/package.json +1 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [8.1.1](https://github.com/appium/appium-ios-simulator/compare/v8.1.0...v8.1.1) (2026-04-28)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* Copilot review comments ([#478](https://github.com/appium/appium-ios-simulator/issues/478)) ([3dbc29c](https://github.com/appium/appium-ios-simulator/commit/3dbc29c61e18533d05433f2239a78e6350e8415c))
|
|
6
|
+
|
|
7
|
+
## [8.1.0](https://github.com/appium/appium-ios-simulator/compare/v8.0.13...v8.1.0) (2026-04-27)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Strip bluebird and lodash usage ([#477](https://github.com/appium/appium-ios-simulator/issues/477)) ([3f19625](https://github.com/appium/appium-ios-simulator/commit/3f1962542e6bcad5098c8d056218c41e0fac9c9e))
|
|
12
|
+
|
|
1
13
|
## [8.0.13](https://github.com/appium/appium-ios-simulator/compare/v8.0.12...v8.0.13) (2026-04-10)
|
|
2
14
|
|
|
3
15
|
### Miscellaneous Chores
|
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
import { type Element } from '@xmldom/xmldom';
|
|
2
|
+
export declare class NSUserDefaults {
|
|
3
|
+
plist: string;
|
|
4
|
+
constructor(plist: string);
|
|
5
|
+
/**
|
|
6
|
+
* Reads the content of the given plist file using plutil command line tool
|
|
7
|
+
* and serializes it to a JSON representation
|
|
8
|
+
*
|
|
9
|
+
* @returns The serialized plist content
|
|
10
|
+
* @throws {Error} If there was an error during serialization
|
|
11
|
+
*/
|
|
12
|
+
asJson(): Promise<Record<string, any>>;
|
|
13
|
+
/**
|
|
14
|
+
* Updates the content of the given plist file.
|
|
15
|
+
* If the plist does not exist yet then it is going to be created.
|
|
16
|
+
*
|
|
17
|
+
* @param valuesMap Mapping of preference values to update.
|
|
18
|
+
* If any of item values are of dictionary type then only the first level dictionary gets
|
|
19
|
+
* updated. Everything below this level will be replaced. This is the known limitation
|
|
20
|
+
* of the `defaults` command line tool. A workaround for it would be to read the current
|
|
21
|
+
* preferences mapping first and merge it with this value.
|
|
22
|
+
* @throws {Error} If there was an error while updating the plist
|
|
23
|
+
*/
|
|
24
|
+
update(valuesMap: Record<string, any>): Promise<void>;
|
|
25
|
+
}
|
|
2
26
|
/**
|
|
3
27
|
* Serializes the given value to plist-compatible
|
|
4
28
|
* XML representation, which is ready for further usage
|
|
@@ -26,28 +50,4 @@ export declare function toXmlArg(value: any, serialize?: boolean): string | Elem
|
|
|
26
50
|
* is the `defaults write <plist>` command suffix
|
|
27
51
|
*/
|
|
28
52
|
export declare function generateDefaultsCommandArgs(valuesMap: Record<string, any>, replace?: boolean): string[][];
|
|
29
|
-
export declare class NSUserDefaults {
|
|
30
|
-
plist: string;
|
|
31
|
-
constructor(plist: string);
|
|
32
|
-
/**
|
|
33
|
-
* Reads the content of the given plist file using plutil command line tool
|
|
34
|
-
* and serializes it to a JSON representation
|
|
35
|
-
*
|
|
36
|
-
* @returns The serialized plist content
|
|
37
|
-
* @throws {Error} If there was an error during serialization
|
|
38
|
-
*/
|
|
39
|
-
asJson(): Promise<Record<string, any>>;
|
|
40
|
-
/**
|
|
41
|
-
* Updates the content of the given plist file.
|
|
42
|
-
* If the plist does not exist yet then it is going to be created.
|
|
43
|
-
*
|
|
44
|
-
* @param valuesMap Mapping of preference values to update.
|
|
45
|
-
* If any of item values are of dictionary type then only the first level dictionary gets
|
|
46
|
-
* updated. Everything below this level will be replaced. This is the known limitation
|
|
47
|
-
* of the `defaults` command line tool. A workaround for it would be to read the current
|
|
48
|
-
* preferences mapping first and merge it with this value.
|
|
49
|
-
* @throws {Error} If there was an error while updating the plist
|
|
50
|
-
*/
|
|
51
|
-
update(valuesMap: Record<string, any>): Promise<void>;
|
|
52
|
-
}
|
|
53
53
|
//# sourceMappingURL=defaults-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults-utils.d.ts","sourceRoot":"","sources":["../../lib/defaults-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"defaults-utils.d.ts","sourceRoot":"","sources":["../../lib/defaults-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAKrF,qBAAa,cAAc;IACzB,KAAK,EAAE,MAAM,CAAC;gBAEF,KAAK,EAAE,MAAM;IAIzB;;;;;;OAMG;IACG,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAW5C;;;;;;;;;;OAUG;IACG,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAmB5D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,GAAE,OAAc,GAAG,MAAM,GAAG,OAAO,CA0ChF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC9B,OAAO,GAAE,OAAe,GACvB,MAAM,EAAE,EAAE,CA4BZ"}
|
|
@@ -1,16 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.NSUserDefaults = void 0;
|
|
7
4
|
exports.toXmlArg = toXmlArg;
|
|
8
5
|
exports.generateDefaultsCommandArgs = generateDefaultsCommandArgs;
|
|
9
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
10
6
|
const xmldom_1 = require("@xmldom/xmldom");
|
|
11
7
|
const teen_process_1 = require("teen_process");
|
|
12
|
-
const bluebird_1 = __importDefault(require("bluebird"));
|
|
13
8
|
const logger_1 = require("./logger");
|
|
9
|
+
const utils_1 = require("./utils");
|
|
10
|
+
class NSUserDefaults {
|
|
11
|
+
plist;
|
|
12
|
+
constructor(plist) {
|
|
13
|
+
this.plist = plist;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Reads the content of the given plist file using plutil command line tool
|
|
17
|
+
* and serializes it to a JSON representation
|
|
18
|
+
*
|
|
19
|
+
* @returns The serialized plist content
|
|
20
|
+
* @throws {Error} If there was an error during serialization
|
|
21
|
+
*/
|
|
22
|
+
async asJson() {
|
|
23
|
+
try {
|
|
24
|
+
const { stdout } = await (0, teen_process_1.exec)('plutil', ['-convert', 'json', '-o', '-', this.plist]);
|
|
25
|
+
return JSON.parse(stdout);
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
throw new Error(`'${this.plist}' cannot be converted to JSON. Original error: ${e.stderr || e.message}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Updates the content of the given plist file.
|
|
33
|
+
* If the plist does not exist yet then it is going to be created.
|
|
34
|
+
*
|
|
35
|
+
* @param valuesMap Mapping of preference values to update.
|
|
36
|
+
* If any of item values are of dictionary type then only the first level dictionary gets
|
|
37
|
+
* updated. Everything below this level will be replaced. This is the known limitation
|
|
38
|
+
* of the `defaults` command line tool. A workaround for it would be to read the current
|
|
39
|
+
* preferences mapping first and merge it with this value.
|
|
40
|
+
* @throws {Error} If there was an error while updating the plist
|
|
41
|
+
*/
|
|
42
|
+
async update(valuesMap) {
|
|
43
|
+
if (!(0, utils_1.isPlainObject)(valuesMap)) {
|
|
44
|
+
throw new TypeError(`plist values must be a map. '${valuesMap}' is given instead`);
|
|
45
|
+
}
|
|
46
|
+
if (Object.keys(valuesMap).length === 0) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const commandArgs = generateDefaultsCommandArgs(valuesMap);
|
|
50
|
+
try {
|
|
51
|
+
await Promise.all(commandArgs.map((args) => (0, teen_process_1.exec)('defaults', ['write', this.plist, ...args])));
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
throw new Error(`Could not write defaults into '${this.plist}'. Original error: ${e.stderr || e.message}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.NSUserDefaults = NSUserDefaults;
|
|
14
59
|
/**
|
|
15
60
|
* Serializes the given value to plist-compatible
|
|
16
61
|
* XML representation, which is ready for further usage
|
|
@@ -25,10 +70,10 @@ const logger_1 = require("./logger");
|
|
|
25
70
|
*/
|
|
26
71
|
function toXmlArg(value, serialize = true) {
|
|
27
72
|
let xmlDoc = null;
|
|
28
|
-
if (
|
|
73
|
+
if ((0, utils_1.isPlainObject)(value)) {
|
|
29
74
|
xmlDoc = new xmldom_1.DOMParser().parseFromString('<dict></dict>', 'text/xml');
|
|
30
75
|
const documentElement = requireDocumentElement(xmlDoc);
|
|
31
|
-
for (const [subKey, subValue] of
|
|
76
|
+
for (const [subKey, subValue] of Object.entries(value)) {
|
|
32
77
|
const keyEl = xmlDoc.createElement('key');
|
|
33
78
|
const keyTextEl = xmlDoc.createTextNode(subKey);
|
|
34
79
|
keyEl.appendChild(keyTextEl);
|
|
@@ -37,7 +82,7 @@ function toXmlArg(value, serialize = true) {
|
|
|
37
82
|
documentElement.appendChild(subValueEl);
|
|
38
83
|
}
|
|
39
84
|
}
|
|
40
|
-
else if (
|
|
85
|
+
else if (Array.isArray(value)) {
|
|
41
86
|
xmlDoc = new xmldom_1.DOMParser().parseFromString('<array></array>', 'text/xml');
|
|
42
87
|
const documentElement = requireDocumentElement(xmlDoc);
|
|
43
88
|
for (const subValue of value) {
|
|
@@ -45,16 +90,16 @@ function toXmlArg(value, serialize = true) {
|
|
|
45
90
|
documentElement.appendChild(subValueEl);
|
|
46
91
|
}
|
|
47
92
|
}
|
|
48
|
-
else if (
|
|
93
|
+
else if (typeof value === 'boolean') {
|
|
49
94
|
xmlDoc = new xmldom_1.DOMParser().parseFromString(value ? '<true/>' : '<false/>', 'text/xml');
|
|
50
95
|
}
|
|
51
|
-
else if (
|
|
96
|
+
else if (Number.isInteger(value)) {
|
|
52
97
|
xmlDoc = new xmldom_1.DOMParser().parseFromString(`<integer>${value}</integer>`, 'text/xml');
|
|
53
98
|
}
|
|
54
|
-
else if (
|
|
99
|
+
else if (typeof value === 'number') {
|
|
55
100
|
xmlDoc = new xmldom_1.DOMParser().parseFromString(`<real>${value}</real>`, 'text/xml');
|
|
56
101
|
}
|
|
57
|
-
else if (
|
|
102
|
+
else if (typeof value === 'string') {
|
|
58
103
|
xmlDoc = new xmldom_1.DOMParser().parseFromString(`<string></string>`, 'text/xml');
|
|
59
104
|
const valueTextEl = xmlDoc.createTextNode(value);
|
|
60
105
|
requireDocumentElement(xmlDoc).appendChild(valueTextEl);
|
|
@@ -81,16 +126,16 @@ function toXmlArg(value, serialize = true) {
|
|
|
81
126
|
*/
|
|
82
127
|
function generateDefaultsCommandArgs(valuesMap, replace = false) {
|
|
83
128
|
const resultArgs = [];
|
|
84
|
-
for (const [key, value] of
|
|
129
|
+
for (const [key, value] of Object.entries(valuesMap)) {
|
|
85
130
|
try {
|
|
86
|
-
if (!replace &&
|
|
131
|
+
if (!replace && (0, utils_1.isPlainObject)(value)) {
|
|
87
132
|
const dictArgs = [key, '-dict-add'];
|
|
88
|
-
for (const [subKey, subValue] of
|
|
133
|
+
for (const [subKey, subValue] of Object.entries(value)) {
|
|
89
134
|
dictArgs.push(subKey, toXmlArg(subValue));
|
|
90
135
|
}
|
|
91
136
|
resultArgs.push(dictArgs);
|
|
92
137
|
}
|
|
93
|
-
else if (!replace &&
|
|
138
|
+
else if (!replace && Array.isArray(value)) {
|
|
94
139
|
const arrayArgs = [key, '-array-add'];
|
|
95
140
|
for (const subValue of value) {
|
|
96
141
|
arrayArgs.push(toXmlArg(subValue));
|
|
@@ -112,55 +157,6 @@ function generateDefaultsCommandArgs(valuesMap, replace = false) {
|
|
|
112
157
|
}
|
|
113
158
|
return resultArgs;
|
|
114
159
|
}
|
|
115
|
-
class NSUserDefaults {
|
|
116
|
-
plist;
|
|
117
|
-
constructor(plist) {
|
|
118
|
-
this.plist = plist;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Reads the content of the given plist file using plutil command line tool
|
|
122
|
-
* and serializes it to a JSON representation
|
|
123
|
-
*
|
|
124
|
-
* @returns The serialized plist content
|
|
125
|
-
* @throws {Error} If there was an error during serialization
|
|
126
|
-
*/
|
|
127
|
-
async asJson() {
|
|
128
|
-
try {
|
|
129
|
-
const { stdout } = await (0, teen_process_1.exec)('plutil', ['-convert', 'json', '-o', '-', this.plist]);
|
|
130
|
-
return JSON.parse(stdout);
|
|
131
|
-
}
|
|
132
|
-
catch (e) {
|
|
133
|
-
throw new Error(`'${this.plist}' cannot be converted to JSON. Original error: ${e.stderr || e.message}`);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Updates the content of the given plist file.
|
|
138
|
-
* If the plist does not exist yet then it is going to be created.
|
|
139
|
-
*
|
|
140
|
-
* @param valuesMap Mapping of preference values to update.
|
|
141
|
-
* If any of item values are of dictionary type then only the first level dictionary gets
|
|
142
|
-
* updated. Everything below this level will be replaced. This is the known limitation
|
|
143
|
-
* of the `defaults` command line tool. A workaround for it would be to read the current
|
|
144
|
-
* preferences mapping first and merge it with this value.
|
|
145
|
-
* @throws {Error} If there was an error while updating the plist
|
|
146
|
-
*/
|
|
147
|
-
async update(valuesMap) {
|
|
148
|
-
if (!lodash_1.default.isPlainObject(valuesMap)) {
|
|
149
|
-
throw new TypeError(`plist values must be a map. '${valuesMap}' is given instead`);
|
|
150
|
-
}
|
|
151
|
-
if (lodash_1.default.isEmpty(valuesMap)) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
const commandArgs = generateDefaultsCommandArgs(valuesMap);
|
|
155
|
-
try {
|
|
156
|
-
await bluebird_1.default.all(commandArgs.map((args) => (0, teen_process_1.exec)('defaults', ['write', this.plist, ...args])));
|
|
157
|
-
}
|
|
158
|
-
catch (e) {
|
|
159
|
-
throw new Error(`Could not write defaults into '${this.plist}'. Original error: ${e.stderr || e.message}`);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
exports.NSUserDefaults = NSUserDefaults;
|
|
164
160
|
function requireDocumentElement(xmlDoc) {
|
|
165
161
|
const { documentElement } = xmlDoc;
|
|
166
162
|
if (!documentElement) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults-utils.js","sourceRoot":"","sources":["../../lib/defaults-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"defaults-utils.js","sourceRoot":"","sources":["../../lib/defaults-utils.ts"],"names":[],"mappings":";;;AA0EA,4BA0CC;AAeD,kEA+BC;AAlKD,2CAAqF;AACrF,+CAAkC;AAClC,qCAA6B;AAC7B,mCAAsC;AAEtC,MAAa,cAAc;IACzB,KAAK,CAAS;IAEd,YAAY,KAAa;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM;QACV,IAAI,CAAC;YACH,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAA,mBAAI,EAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACnF,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC;QAAC,OAAO,CAAM,EAAE,CA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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applications.d.ts","sourceRoot":"","sources":["../../../lib/extensions/applications.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"applications.d.ts","sourceRoot":"","sources":["../../../lib/extensions/applications.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAE,iBAAiB,EAAE,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAEjF,KAAK,qBAAqB,GAAG,aAAa,GAAG,iBAAiB,CAAC;AAE/D;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,qBAAqB,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAExF;AAED;;;;;GAKG;AACH,wBAAsB,qCAAqC,CACzD,IAAI,EAAE,qBAAqB,EAC3B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC,CAoCnB;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,qBAAqB,EAC3B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAkBlB;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5F;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,qBAAqB,EAC3B,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAef;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/F;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,qBAAqB,EAC3B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAElB;AAED;;;;;;GAMG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkB3F"}
|
|
@@ -11,11 +11,10 @@ exports.launchApp = launchApp;
|
|
|
11
11
|
exports.terminateApp = terminateApp;
|
|
12
12
|
exports.isAppRunning = isAppRunning;
|
|
13
13
|
exports.scrubApp = scrubApp;
|
|
14
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
15
14
|
const node_path_1 = __importDefault(require("node:path"));
|
|
16
15
|
const support_1 = require("@appium/support");
|
|
17
|
-
const bluebird_1 = __importDefault(require("bluebird"));
|
|
18
16
|
const asyncbox_1 = require("asyncbox");
|
|
17
|
+
const utils_1 = require("../utils");
|
|
19
18
|
/**
|
|
20
19
|
* Install valid .app package on Simulator.
|
|
21
20
|
*
|
|
@@ -37,7 +36,7 @@ async function getUserInstalledBundleIdsByBundleName(bundleName) {
|
|
|
37
36
|
cwd: appsRoot,
|
|
38
37
|
absolute: true,
|
|
39
38
|
});
|
|
40
|
-
if (
|
|
39
|
+
if (infoPlists.length === 0) {
|
|
41
40
|
return [];
|
|
42
41
|
}
|
|
43
42
|
const bundleInfoPromises = [];
|
|
@@ -51,11 +50,11 @@ async function getUserInstalledBundleIdsByBundleName(bundleName) {
|
|
|
51
50
|
}
|
|
52
51
|
})());
|
|
53
52
|
}
|
|
54
|
-
const bundleInfos = (await
|
|
53
|
+
const bundleInfos = (await Promise.all(bundleInfoPromises)).filter(utils_1.isPlainObject);
|
|
55
54
|
const bundleIds = bundleInfos
|
|
56
55
|
.filter(({ CFBundleName }) => CFBundleName === bundleName)
|
|
57
56
|
.map(({ CFBundleIdentifier }) => CFBundleIdentifier);
|
|
58
|
-
if (
|
|
57
|
+
if (bundleIds.length === 0) {
|
|
59
58
|
return [];
|
|
60
59
|
}
|
|
61
60
|
this.log.debug(`The simulator has ${support_1.util.pluralize('bundle', bundleIds.length, true)} which ` +
|
|
@@ -150,13 +149,13 @@ async function scrubApp(bundleId) {
|
|
|
150
149
|
absolute: true,
|
|
151
150
|
});
|
|
152
151
|
this.log.info(`Found ${appFiles.length} ${bundleId} app ${support_1.util.pluralize('file', appFiles.length, false)} to scrub`);
|
|
153
|
-
if (
|
|
152
|
+
if (appFiles.length === 0) {
|
|
154
153
|
return;
|
|
155
154
|
}
|
|
156
155
|
try {
|
|
157
156
|
await this.terminateApp(bundleId);
|
|
158
157
|
}
|
|
159
158
|
catch { }
|
|
160
|
-
await
|
|
159
|
+
await Promise.all(appFiles.map((p) => support_1.fs.rimraf(p)));
|
|
161
160
|
}
|
|
162
161
|
//# sourceMappingURL=applications.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applications.js","sourceRoot":"","sources":["../../../lib/extensions/applications.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"applications.js","sourceRoot":"","sources":["../../../lib/extensions/applications.ts"],"names":[],"mappings":";;;;;AAaA,gCAEC;AAQD,sFAuCC;AAQD,wCAqBC;AAOD,8BAEC;AAQD,8BAmBC;AAOD,oCAEC;AAOD,oCAKC;AASD,4BAkBC;AA/KD,0DAA6B;AAC7B,6CAAgD;AAChD,uCAA0C;AAC1C,oCAAuC;AAKvC;;;;GAIG;AACI,KAAK,UAAU,UAAU,CAA8B,GAAW;IACvE,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,qCAAqC,CAEzD,UAAkB;IAElB,MAAM,QAAQ,GAAG,mBAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;IACpF,qEAAqE;IACrE,MAAM,UAAU,GAAG,MAAM,YAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE;QACrD,GAAG,EAAE,QAAQ;QACb,QAAQ,EAAE,IAAI;KAC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|
|
1
|
+
{"version":3,"file":"biometric.d.ts","sourceRoot":"","sources":["../../../lib/extensions/biometric.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAE,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAG/D,KAAK,0BAA0B,GAAG,aAAa,GAAG,iBAAiB,CAAC;AAQpE;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,CAc5F;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,0BAA0B,EAChC,SAAS,GAAE,OAAc,GACxB,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,0BAA0B,EAChC,WAAW,GAAE,OAAc,EAC3B,aAAa,GAAE,MAAkB,GAChC,OAAO,CAAC,IAAI,CAAC,CAQf;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO/D"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.isBiometricEnrolled = isBiometricEnrolled;
|
|
7
4
|
exports.enrollBiometric = enrollBiometric;
|
|
8
5
|
exports.sendBiometricMatch = sendBiometricMatch;
|
|
9
6
|
exports.toBiometricDomainComponent = toBiometricDomainComponent;
|
|
10
|
-
const
|
|
7
|
+
const utils_1 = require("../utils");
|
|
11
8
|
const ENROLLMENT_NOTIFICATION_RECEIVER = 'com.apple.BiometricKit.enrollmentChanged';
|
|
12
9
|
const BIOMETRICS = {
|
|
13
10
|
touchId: 'fingerTouch',
|
|
@@ -22,7 +19,7 @@ async function isBiometricEnrolled() {
|
|
|
22
19
|
'-g',
|
|
23
20
|
ENROLLMENT_NOTIFICATION_RECEIVER,
|
|
24
21
|
]);
|
|
25
|
-
const match = new RegExp(`${
|
|
22
|
+
const match = new RegExp(`${(0, utils_1.escapeRegExp)(ENROLLMENT_NOTIFICATION_RECEIVER)}\\s+([01])`).exec(stdout);
|
|
26
23
|
if (!match) {
|
|
27
24
|
throw new Error(`Cannot parse biometric enrollment state from '${stdout}'`);
|
|
28
25
|
}
|
|
@@ -65,7 +62,7 @@ async function sendBiometricMatch(shouldMatch = true, biometricName = 'touchId')
|
|
|
65
62
|
*/
|
|
66
63
|
function toBiometricDomainComponent(name) {
|
|
67
64
|
if (!BIOMETRICS[name]) {
|
|
68
|
-
throw new Error(`'${name}' is not a valid biometric. Use one of: ${JSON.stringify(
|
|
65
|
+
throw new Error(`'${name}' is not a valid biometric. Use one of: ${JSON.stringify(Object.keys(BIOMETRICS))}`);
|
|
69
66
|
}
|
|
70
67
|
return BIOMETRICS[name];
|
|
71
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biometric.js","sourceRoot":"","sources":["../../../lib/extensions/biometric.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"biometric.js","sourceRoot":"","sources":["../../../lib/extensions/biometric.ts"],"names":[],"mappings":";;AAcA,kDAcC;AAKD,0CAmBC;AASD,gDAYC;AAMD,gEAOC;AArFD,oCAAsC;AAItC,MAAM,gCAAgC,GAAG,0CAA0C,CAAC;AACpF,MAAM,UAAU,GAA2B;IACzC,OAAO,EAAE,aAAa;IACtB,MAAM,EAAE,OAAO;CAChB,CAAC;AAEF;;GAEG;AACI,KAAK,UAAU,mBAAmB;IACvC,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;QAC9C,YAAY;QACZ,IAAI;QACJ,gCAAgC;KACjC,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,GAAG,IAAA,oB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AM,MAAM,GAAG,8BAA8B,eAAe,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC;IAC/F,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7D,IAAI,CAAC,GAAG,CAAC,IAAI,CACX,qBAAqB,MAAM,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,IAAI,aAAa,aAAa;QACjG,OAAO,IAAI,CAAC,IAAI,YAAY,CAC/B,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAgB,0BAA0B,CAAC,IAAY;IACrD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,IAAI,IAAI,2CAA2C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,CAC7F,CAAC;IACJ,CAAC;IACD,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keychain.d.ts","sourceRoot":"","sources":["../../../lib/extensions/keychain.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"keychain.d.ts","sourceRoot":"","sources":["../../../lib/extensions/keychain.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,aAAa,EAAE,qBAAqB,EAAC,MAAM,UAAU,CAAC;AAEnE,KAAK,yBAAyB,GAAG,aAAa,GAAG,qBAAqB,CAAC;AAEvE;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,OAAO,CAAC,CAmCvF;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,yBAAyB,EAC/B,eAAe,GAAE,MAAM,EAAE,GAAG,MAAW,GACtC,OAAO,CAAC,OAAO,CAAC,CAwDlB;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAcnF"}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.backupKeychains = backupKeychains;
|
|
7
7
|
exports.restoreKeychains = restoreKeychains;
|
|
8
8
|
exports.clearKeychains = clearKeychains;
|
|
9
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
10
9
|
const node_path_1 = __importDefault(require("node:path"));
|
|
11
10
|
const support_1 = require("@appium/support");
|
|
12
11
|
const teen_process_1 = require("teen_process");
|
|
@@ -20,12 +19,13 @@ const teen_process_1 = require("teen_process");
|
|
|
20
19
|
*/
|
|
21
20
|
async function backupKeychains() {
|
|
22
21
|
const resetBackupPath = async (newPath) => {
|
|
23
|
-
if (
|
|
22
|
+
if (typeof this._keychainsBackupPath === 'string' &&
|
|
23
|
+
(await support_1.fs.exists(this._keychainsBackupPath))) {
|
|
24
24
|
await support_1.fs.unlink(this._keychainsBackupPath);
|
|
25
25
|
}
|
|
26
26
|
this._keychainsBackupPath = newPath;
|
|
27
27
|
};
|
|
28
|
-
if (!(await support_1.fs.exists(this.keychainPath)) ||
|
|
28
|
+
if (!(await support_1.fs.exists(this.keychainPath)) || (await support_1.fs.readdir(this.keychainPath)).length === 0) {
|
|
29
29
|
this.log.info(`There is nothing to backup from '${this.keychainPath}'`);
|
|
30
30
|
await resetBackupPath(null);
|
|
31
31
|
return false;
|
|
@@ -61,11 +61,12 @@ async function backupKeychains() {
|
|
|
61
61
|
* @throws {Error} If there is no keychains backup available for restore.
|
|
62
62
|
*/
|
|
63
63
|
async function restoreKeychains(excludePatterns = []) {
|
|
64
|
-
if (
|
|
64
|
+
if (typeof this._keychainsBackupPath !== 'string' ||
|
|
65
|
+
!(await support_1.fs.exists(this._keychainsBackupPath))) {
|
|
65
66
|
throw new Error(`The keychains backup archive does not exist. ` + `Are you sure it was created before?`);
|
|
66
67
|
}
|
|
67
68
|
let patterns = [];
|
|
68
|
-
if (
|
|
69
|
+
if (typeof excludePatterns === 'string') {
|
|
69
70
|
patterns = excludePatterns.split(',').map((x) => x.trim());
|
|
70
71
|
}
|
|
71
72
|
else {
|
|
@@ -90,7 +91,7 @@ async function restoreKeychains(excludePatterns = []) {
|
|
|
90
91
|
const unzipArgs = [
|
|
91
92
|
'-o',
|
|
92
93
|
backupPath,
|
|
93
|
-
...
|
|
94
|
+
...patterns.flatMap((x) => ['-x', x]),
|
|
94
95
|
'-d',
|
|
95
96
|
node_path_1.default.dirname(this.keychainPath),
|
|
96
97
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keychain.js","sourceRoot":"","sources":["../../../lib/extensions/keychain.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"keychain.js","sourceRoot":"","sources":["../../../lib/extensions/keychain.ts"],"names":[],"mappings":";;;;;AAeA,0CAmCC;AAcD,4CA2DC;AAQD,wCAcC;AAjJD,0DAA6B;AAC7B,6CAA0D;AAC1D,+CAAkC;AAKlC;;;;;;;GAOG;AACI,KAAK,UAAU,eAAe;IACnC,MAAM,eAAe,GAAG,KAAK,EAAE,OAAkC,EAAE,EAAE;QACnE,IACE,OAAO,IAAI,CAAC,oBAAoB,KAAK,QAAQ;YAC7C,CAAC,MAAM,YAAE,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,EAC5C,CAAC;YACD,MAAM,YAAE,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC;IACtC,CAAC,CAAC;IAEF,IAAI,CAAC,CAAC,MAAM,YAAE,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,MAAM,YAAE,CAAC,OAAO,CAAC,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CAAC,oBAAoB,EAAE,EAAE,2BAA2B,CAAC,CAAC;IAC/F,IAAI,CAAC,CAAC,MAAM,YAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,mCAAmC,SAAS,kBAAkB,CAAC,CAAC;IAClF,CAAC;IACD,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;IACnE,IAAI,CAAC;QACH,IAAI,MAAM,YAAE,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;YACvC,MAAM,YAAE,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACnC,MAAM,IAAA,gBAAM,EAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;IACnE,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../lib/extensions/permissions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../lib/extensions/permissions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAE,sBAAsB,EAAC,MAAM,UAAU,CAAC;AACpE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAEhD,KAAK,+BAA+B,GAAG,aAAa,GAAG,sBAAsB,CAAC;AAkC9E;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,+BAA+B,EACrC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,+BAA+B,EACrC,QAAQ,EAAE,MAAM,EAChB,kBAAkB,EAAE,YAAY,GAC/B,OAAO,CAAC,IAAI,CAAC,CAKf;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,+BAA+B,EACrC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CAIjB"}
|
|
@@ -6,11 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.setPermission = setPermission;
|
|
7
7
|
exports.setPermissions = setPermissions;
|
|
8
8
|
exports.getPermission = getPermission;
|
|
9
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
10
9
|
const support_1 = require("@appium/support");
|
|
11
10
|
const teen_process_1 = require("teen_process");
|
|
12
11
|
const node_path_1 = __importDefault(require("node:path"));
|
|
13
|
-
const bluebird_1 = __importDefault(require("bluebird"));
|
|
14
12
|
const asyncbox_1 = require("asyncbox");
|
|
15
13
|
const STATUS = Object.freeze({
|
|
16
14
|
UNSET: 'unset',
|
|
@@ -83,14 +81,14 @@ async function getPermission(bundleId, serviceName) {
|
|
|
83
81
|
return result;
|
|
84
82
|
}
|
|
85
83
|
function toInternalServiceName(serviceName) {
|
|
86
|
-
const lowerName =
|
|
87
|
-
if (
|
|
84
|
+
const lowerName = serviceName.toLowerCase();
|
|
85
|
+
if (Object.hasOwn(SERVICES, lowerName)) {
|
|
88
86
|
return SERVICES[lowerName];
|
|
89
87
|
}
|
|
90
|
-
throw new Error(`'${serviceName}' is unknown. Only the following service names are supported: ${JSON.stringify(
|
|
88
|
+
throw new Error(`'${serviceName}' is unknown. Only the following service names are supported: ${JSON.stringify(Object.keys(SERVICES))}`);
|
|
91
89
|
}
|
|
92
90
|
function formatStatus(status) {
|
|
93
|
-
return status === STATUS.UNSET || status === STATUS.NO ?
|
|
91
|
+
return status === STATUS.UNSET || status === STATUS.NO ? status.toUpperCase() : status;
|
|
94
92
|
}
|
|
95
93
|
/**
|
|
96
94
|
* Runs a command line sqlite3 query
|
|
@@ -155,7 +153,7 @@ async function setAccess(bundleId, permissionsMapping) {
|
|
|
155
153
|
else {
|
|
156
154
|
// xcrun simctl privacy expects to be lower case while AppleSimulatorUtils is upper case.
|
|
157
155
|
// To keep the compatibility, we should convert here to lower case explicitly.
|
|
158
|
-
switch (
|
|
156
|
+
switch (permissionsMapping[serviceName]?.toLowerCase()) {
|
|
159
157
|
case STATUS.YES:
|
|
160
158
|
grantPermissions.push(serviceName);
|
|
161
159
|
break;
|
|
@@ -171,31 +169,31 @@ async function setAccess(bundleId, permissionsMapping) {
|
|
|
171
169
|
}
|
|
172
170
|
}
|
|
173
171
|
const permissionPromises = [];
|
|
174
|
-
if (
|
|
172
|
+
if (grantPermissions.length > 0) {
|
|
175
173
|
this.log.debug(`Granting ${support_1.util.pluralize('permission', grantPermissions.length, false)} for ${bundleId}: ${grantPermissions}`);
|
|
176
174
|
for (const action of grantPermissions) {
|
|
177
175
|
permissionPromises.push(this.simctl.grantPermission(bundleId, action));
|
|
178
176
|
}
|
|
179
177
|
}
|
|
180
|
-
if (
|
|
178
|
+
if (revokePermissions.length > 0) {
|
|
181
179
|
this.log.debug(`Revoking ${support_1.util.pluralize('permission', revokePermissions.length, false)} for ${bundleId}: ${revokePermissions}`);
|
|
182
180
|
for (const action of revokePermissions) {
|
|
183
181
|
permissionPromises.push(this.simctl.revokePermission(bundleId, action));
|
|
184
182
|
}
|
|
185
183
|
}
|
|
186
|
-
if (
|
|
184
|
+
if (resetPermissions.length > 0) {
|
|
187
185
|
this.log.debug(`Resetting ${support_1.util.pluralize('permission', resetPermissions.length, false)} for ${bundleId}: ${resetPermissions}`);
|
|
188
186
|
for (const action of resetPermissions) {
|
|
189
187
|
permissionPromises.push(this.simctl.resetPermission(bundleId, action));
|
|
190
188
|
}
|
|
191
189
|
}
|
|
192
|
-
if (
|
|
193
|
-
await
|
|
190
|
+
if (permissionPromises.length > 0) {
|
|
191
|
+
await Promise.all(permissionPromises);
|
|
194
192
|
}
|
|
195
|
-
if (
|
|
196
|
-
this.log.debug(`Setting permissions for ${bundleId}
|
|
197
|
-
const permissionsArg =
|
|
198
|
-
.map((
|
|
193
|
+
if (Object.keys(wixPermissions).length > 0) {
|
|
194
|
+
this.log.debug(`Setting permissions for ${bundleId} with ${WIX_SIM_UTILS} as ${JSON.stringify(wixPermissions)}`);
|
|
195
|
+
const permissionsArg = Object.entries(wixPermissions)
|
|
196
|
+
.map(([name, status]) => `${name}=${formatStatus(status)}`)
|
|
199
197
|
.join(',');
|
|
200
198
|
const execWixFn = async () => await execWix.bind(this)([
|
|
201
199
|
'--byId',
|
|
@@ -205,7 +203,7 @@ async function setAccess(bundleId, permissionsMapping) {
|
|
|
205
203
|
'--setPermissions',
|
|
206
204
|
permissionsArg,
|
|
207
205
|
]);
|
|
208
|
-
const shouldWaitForSystemReadiness =
|
|
206
|
+
const shouldWaitForSystemReadiness = SERVICES_NEED_SPRINGBOARD_RESTART.some((service) => service in wixPermissions);
|
|
209
207
|
if (shouldWaitForSystemReadiness) {
|
|
210
208
|
const [didTimeout] = await runAndWaitForSystemReadiness.bind(this)(execWixFn, SYSTEM_SERVICE_RESTART_TIMEOUT_MS);
|
|
211
209
|
if (didTimeout) {
|
|
@@ -233,7 +231,7 @@ async function runAndWaitForSystemReadiness(fn, timeoutMs) {
|
|
|
233
231
|
await (0, asyncbox_1.waitForCondition)(async () => {
|
|
234
232
|
try {
|
|
235
233
|
const pid = (await this.ps()).find(({ name }) => bundleId === name)?.pid;
|
|
236
|
-
return
|
|
234
|
+
return Number.isInteger(pid) && initialPid !== pid;
|
|
237
235
|
}
|
|
238
236
|
catch {
|
|
239
237
|
return false;
|
|
@@ -250,7 +248,7 @@ async function runAndWaitForSystemReadiness(fn, timeoutMs) {
|
|
|
250
248
|
SPOTLIGHT_BUNDLE_ID,
|
|
251
249
|
].map((bundleId) => initialProcesses.find(({ name }) => bundleId === name)?.pid);
|
|
252
250
|
const result = await fn();
|
|
253
|
-
if (!
|
|
251
|
+
if (!Number.isInteger(initialSpringboardPid) || !Number.isInteger(initialSpotlightPid)) {
|
|
254
252
|
// there is no point to wait if relevant processes were not running before
|
|
255
253
|
return [false, result];
|
|
256
254
|
}
|