appium-ios-remotexpc 0.18.1 → 0.20.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.
- package/CHANGELOG.md +12 -0
- package/build/src/lib/types.d.ts +46 -0
- package/build/src/lib/types.d.ts.map +1 -1
- package/build/src/services/ios/afc/index.d.ts +74 -1
- package/build/src/services/ios/afc/index.d.ts.map +1 -1
- package/build/src/services/ios/afc/index.js +173 -7
- package/build/src/services/ios/dvt/channel.d.ts +5 -0
- package/build/src/services/ios/dvt/channel.d.ts.map +1 -1
- package/build/src/services/ios/dvt/channel.js +7 -0
- package/build/src/services/ios/dvt/instruments/notifications.d.ts +85 -0
- package/build/src/services/ios/dvt/instruments/notifications.d.ts.map +1 -0
- package/build/src/services/ios/dvt/instruments/notifications.js +68 -0
- package/build/src/services.d.ts.map +1 -1
- package/build/src/services.js +3 -0
- package/package.json +5 -1
- package/src/lib/types.ts +47 -0
- package/src/services/ios/afc/index.ts +257 -6
- package/src/services/ios/dvt/channel.ts +8 -0
- package/src/services/ios/dvt/instruments/notifications.ts +144 -0
- package/src/services.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [0.20.0](https://github.com/appium/appium-ios-remotexpc/compare/v0.19.0...v0.20.0) (2025-12-19)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **afc:** add `recursive` option to pull, `mkdir` method and fix race condition in `pull` ([#113](https://github.com/appium/appium-ios-remotexpc/issues/113)) ([9a7d61f](https://github.com/appium/appium-ios-remotexpc/commit/9a7d61fcb0a47e5e1e4fbacf2cdc9e76d922e09f))
|
|
6
|
+
|
|
7
|
+
## [0.19.0](https://github.com/appium/appium-ios-remotexpc/compare/v0.18.1...v0.19.0) (2025-12-17)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **dvt:** implement notifications DVT instrument ([#112](https://github.com/appium/appium-ios-remotexpc/issues/112)) ([e8f2c08](https://github.com/appium/appium-ios-remotexpc/commit/e8f2c08d8cf3e6215d117e21251640ba659ab85f))
|
|
12
|
+
|
|
1
13
|
## [0.18.1](https://github.com/appium/appium-ios-remotexpc/compare/v0.18.0...v0.18.1) (2025-12-16)
|
|
2
14
|
|
|
3
15
|
### Miscellaneous Chores
|
package/build/src/lib/types.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { ServiceConnection } from '../service-connection.js';
|
|
|
7
7
|
import type { BaseService, Service } from '../services/ios/base-service.js';
|
|
8
8
|
import type { iOSApplication } from '../services/ios/dvt/instruments/application-listing.js';
|
|
9
9
|
import type { LocationCoordinates } from '../services/ios/dvt/instruments/location-simulation.js';
|
|
10
|
+
import type { NotificationMessage } from '../services/ios/dvt/instruments/notifications.js';
|
|
10
11
|
import { ProvisioningProfile } from '../services/ios/misagent/provisioning-profile.js';
|
|
11
12
|
import type { PowerAssertionOptions } from '../services/ios/power-assertion/index.js';
|
|
12
13
|
import { PowerAssertionType } from '../services/ios/power-assertion/index.js';
|
|
@@ -714,6 +715,49 @@ export interface DeviceInfoService {
|
|
|
714
715
|
*/
|
|
715
716
|
nameForGid(gid: number): Promise<string>;
|
|
716
717
|
}
|
|
718
|
+
/**
|
|
719
|
+
* Notification service monitor memory and app notifications
|
|
720
|
+
*/
|
|
721
|
+
export interface NotificationService {
|
|
722
|
+
/**
|
|
723
|
+
* Yields notification from memory and application state changes
|
|
724
|
+
* @example:
|
|
725
|
+
* {
|
|
726
|
+
* selector: 'applicationStateNotification:',
|
|
727
|
+
* data:
|
|
728
|
+
* {
|
|
729
|
+
* mach_absolute_time: 58061793038,
|
|
730
|
+
* execName: '/Applications/Spotlight.app',
|
|
731
|
+
* appName: 'Spotlight',
|
|
732
|
+
* pid: 327,
|
|
733
|
+
* state_description: 'Suspended'
|
|
734
|
+
* }
|
|
735
|
+
* },
|
|
736
|
+
* {
|
|
737
|
+
* selector: 'applicationStateNotification:',
|
|
738
|
+
* data:
|
|
739
|
+
* {
|
|
740
|
+
* mach_absolute_time: 58061827502,
|
|
741
|
+
* execName: '/private/var/containers/Bundle/Application/28AF0B11-363A-4242-9164-CF690064402B/MobileCal.app',
|
|
742
|
+
* appName: 'MobileCal',
|
|
743
|
+
* pid: 449,
|
|
744
|
+
* state_description: 'Suspended'
|
|
745
|
+
* }
|
|
746
|
+
* },
|
|
747
|
+
* {
|
|
748
|
+
* selector: 'memoryLevelNotification:',
|
|
749
|
+
* data:
|
|
750
|
+
* {
|
|
751
|
+
* code: 3,
|
|
752
|
+
* mach_absolute_time: 101524320437,
|
|
753
|
+
* timestamp: [Object],
|
|
754
|
+
* pid: -1
|
|
755
|
+
* }
|
|
756
|
+
*
|
|
757
|
+
* }
|
|
758
|
+
*/
|
|
759
|
+
messages(): AsyncGenerator<NotificationMessage, void, undefined>;
|
|
760
|
+
}
|
|
717
761
|
/**
|
|
718
762
|
* DVT service with connection
|
|
719
763
|
* This allows callers to properly manage the connection lifecycle
|
|
@@ -733,6 +777,8 @@ export interface DVTServiceWithConnection {
|
|
|
733
777
|
graphics: GraphicsService;
|
|
734
778
|
/** The DeviceInfo service instance */
|
|
735
779
|
deviceInfo: DeviceInfoService;
|
|
780
|
+
/** The Notifications service instance */
|
|
781
|
+
notification: NotificationService;
|
|
736
782
|
/** The RemoteXPC connection that can be used to close the connection */
|
|
737
783
|
remoteXPC: RemoteXpcConnection;
|
|
738
784
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,iCAAiC,CA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,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C;;;OAGG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,QAAQ,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,6BAA6B;IAC5C,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,mBAAmB,CAAC;CAChC"}
|
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
import { Readable, Writable } from 'node:stream';
|
|
2
2
|
import { AFC_FOPEN_TEXTUAL_MODES } from './constants.js';
|
|
3
3
|
import { AfcFileMode } from './enums.js';
|
|
4
|
+
/**
|
|
5
|
+
* Callback invoked for each file successfully pulled from the device.
|
|
6
|
+
*
|
|
7
|
+
* @param remotePath - The remote file path on the device
|
|
8
|
+
* @param localPath - The local file path where it was saved
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* If the callback throws an error, the pull operation will be aborted immediately.
|
|
12
|
+
*/
|
|
13
|
+
export type PullRecursiveCallback = (remotePath: string, localPath: string) => unknown | Promise<unknown>;
|
|
14
|
+
/** Options for the pull method. */
|
|
15
|
+
export interface PullOptions {
|
|
16
|
+
/**
|
|
17
|
+
* If true, recursively pull directories.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
recursive?: boolean;
|
|
21
|
+
/** Glob pattern to filter files (e.g., '*.txt', '**\/*.log'). */
|
|
22
|
+
match?: string;
|
|
23
|
+
/**
|
|
24
|
+
* If false, throws error when local file exists.
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
overwrite?: boolean;
|
|
28
|
+
/** Callback invoked for each pulled file. */
|
|
29
|
+
callback?: PullRecursiveCallback;
|
|
30
|
+
}
|
|
4
31
|
export interface StatInfo {
|
|
5
32
|
st_ifmt: AfcFileMode;
|
|
6
33
|
st_size: bigint;
|
|
@@ -39,7 +66,30 @@ export declare class AfcService {
|
|
|
39
66
|
setFileContents(filePath: string, data: Buffer): Promise<void>;
|
|
40
67
|
readToStream(filePath: string): Promise<Readable>;
|
|
41
68
|
writeFromStream(filePath: string, stream: Readable): Promise<void>;
|
|
42
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Pull file(s) or directory from the device to the local filesystem.
|
|
71
|
+
*
|
|
72
|
+
* @param remoteSrc - Remote path on the device (file or directory)
|
|
73
|
+
* @param localDst - Local destination path
|
|
74
|
+
* @param options - Optional configuration
|
|
75
|
+
*
|
|
76
|
+
* @throws {Error} If the remote source path does not exist
|
|
77
|
+
* @throws {Error} If overwrite is false and local file already exists
|
|
78
|
+
*
|
|
79
|
+
* @remarks
|
|
80
|
+
* When pulling a directory with `recursive: true`, the directory itself will be created
|
|
81
|
+
* inside the destination. For example, pulling `/Downloads` to `/tmp` will create `/tmp/Downloads`.
|
|
82
|
+
*/
|
|
83
|
+
pull(remoteSrc: string, localDst: string, options?: PullOptions): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Create a directory on the device.
|
|
86
|
+
*
|
|
87
|
+
* Creates parent directories automatically and is idempotent (no error if the directory exists).
|
|
88
|
+
*
|
|
89
|
+
* @param dirPath - Path of the directory to create.
|
|
90
|
+
* @returns A promise that resolves when the directory has been created.
|
|
91
|
+
*/
|
|
92
|
+
mkdir(dirPath: string): Promise<void>;
|
|
43
93
|
rmSingle(filePath: string, force?: boolean): Promise<boolean>;
|
|
44
94
|
rm(filePath: string, force?: boolean): Promise<string[]>;
|
|
45
95
|
rename(src: string, dst: string): Promise<void>;
|
|
@@ -53,6 +103,29 @@ export declare class AfcService {
|
|
|
53
103
|
* Close the underlying socket
|
|
54
104
|
*/
|
|
55
105
|
close(): void;
|
|
106
|
+
/**
|
|
107
|
+
* Private primitive to pull a single file from device to local filesystem.
|
|
108
|
+
*
|
|
109
|
+
* @param remoteSrc - Remote file path on the device (must be a file)
|
|
110
|
+
* @param localDst - Local destination file path
|
|
111
|
+
*/
|
|
112
|
+
private _pullFile;
|
|
113
|
+
/**
|
|
114
|
+
* Recursively pull directory contents from device to local filesystem.
|
|
115
|
+
*
|
|
116
|
+
* @remarks
|
|
117
|
+
* This method is intended for directories only. Caller must validate that remoteSrcDir
|
|
118
|
+
* is a directory before invoking.
|
|
119
|
+
*/
|
|
120
|
+
private _pullRecursiveInternal;
|
|
121
|
+
/**
|
|
122
|
+
* Helper to check if a local filesystem path exists and is a directory.
|
|
123
|
+
*/
|
|
124
|
+
private _isLocalDirectory;
|
|
125
|
+
/**
|
|
126
|
+
* Helper to check if a local path (file or directory) exists.
|
|
127
|
+
*/
|
|
128
|
+
private _localPathExists;
|
|
56
129
|
/**
|
|
57
130
|
* Connect to RSD port and perform RSDCheckin.
|
|
58
131
|
* Keeps the underlying socket for raw AFC I/O.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/services/ios/afc/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/services/ios/afc/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAqBjD,OAAO,EAAE,uBAAuB,EAAyB,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAY,WAAW,EAAa,MAAM,YAAY,CAAC;AAO9D;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,KACd,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEhC,mCAAmC;AACnC,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAA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AAI,CACR,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAoBnE;;OAEG;IACH,KAAK,IAAI,IAAI;IAUb;;;;;OAKG;YACW,SAAS;IAuBvB;;;;;;OAMG;YACW,sBAAsB;IAoEpC;;OAEG;YACW,iBAAiB;IAS/B;;OAEG;YACW,gBAAgB;IAY9B;;;OAGG;YACW,QAAQ;YAyBR,YAAY;YAYZ,SAAS;YAST,QAAQ;IAMtB;;;;OAIG;YACW,YAAY;CA2B3B;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { minimatch } from 'minimatch';
|
|
1
2
|
import fs from 'node:fs';
|
|
3
|
+
import fsp from 'node:fs/promises';
|
|
2
4
|
import net from 'node:net';
|
|
3
5
|
import path from 'node:path';
|
|
4
6
|
import { Readable, Writable } from 'node:stream';
|
|
5
7
|
import { pipeline } from 'node:stream/promises';
|
|
6
8
|
import { getLogger } from '../../../lib/logger.js';
|
|
7
|
-
import { buildClosePayload, buildFopenPayload, buildReadPayload, buildRemovePayload, buildRenamePayload, buildStatPayload, nanosecondsToMilliseconds, nextReadChunkSize, parseCStringArray, parseKeyValueNullList, readAfcResponse, rsdHandshakeForRawService, sendAfcPacket, writeUInt64LE, } from './codec.js';
|
|
9
|
+
import { buildClosePayload, buildFopenPayload, buildMkdirPayload, buildReadPayload, buildRemovePayload, buildRenamePayload, buildStatPayload, nanosecondsToMilliseconds, nextReadChunkSize, parseCStringArray, parseKeyValueNullList, readAfcResponse, rsdHandshakeForRawService, sendAfcPacket, writeUInt64LE, } from './codec.js';
|
|
8
10
|
import { AFC_FOPEN_TEXTUAL_MODES, AFC_WRITE_THIS_LENGTH } from './constants.js';
|
|
9
11
|
import { AfcError, AfcFileMode, AfcOpcode } from './enums.js';
|
|
10
12
|
import { createAfcReadStream, createAfcWriteStream } from './stream-utils.js';
|
|
@@ -200,12 +202,70 @@ export class AfcService {
|
|
|
200
202
|
await this.fclose(handle);
|
|
201
203
|
}
|
|
202
204
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
/**
|
|
206
|
+
* Pull file(s) or directory from the device to the local filesystem.
|
|
207
|
+
*
|
|
208
|
+
* @param remoteSrc - Remote path on the device (file or directory)
|
|
209
|
+
* @param localDst - Local destination path
|
|
210
|
+
* @param options - Optional configuration
|
|
211
|
+
*
|
|
212
|
+
* @throws {Error} If the remote source path does not exist
|
|
213
|
+
* @throws {Error} If overwrite is false and local file already exists
|
|
214
|
+
*
|
|
215
|
+
* @remarks
|
|
216
|
+
* When pulling a directory with `recursive: true`, the directory itself will be created
|
|
217
|
+
* inside the destination. For example, pulling `/Downloads` to `/tmp` will create `/tmp/Downloads`.
|
|
218
|
+
*/
|
|
219
|
+
async pull(remoteSrc, localDst, options) {
|
|
220
|
+
const { recursive = false, match, overwrite = true, callback, } = options ?? {};
|
|
221
|
+
if (!(await this.exists(remoteSrc))) {
|
|
222
|
+
throw new Error(`Remote path does not exist: ${remoteSrc}`);
|
|
223
|
+
}
|
|
224
|
+
const pullSingleFile = async (remoteFilePath, localFilePath) => {
|
|
225
|
+
log.debug(`Pulling file from '${remoteFilePath}' to '${localFilePath}'`);
|
|
226
|
+
if (!overwrite && (await this._localPathExists(localFilePath))) {
|
|
227
|
+
throw new Error(`Local file already exists: ${localFilePath}`);
|
|
228
|
+
}
|
|
229
|
+
await this._pullFile(remoteFilePath, localFilePath);
|
|
230
|
+
if (callback) {
|
|
231
|
+
await callback(remoteFilePath, localFilePath);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
const isDir = await this.isdir(remoteSrc);
|
|
235
|
+
if (!isDir) {
|
|
236
|
+
const baseName = path.posix.basename(remoteSrc);
|
|
237
|
+
if (match && !minimatch(baseName, match)) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
const localDstIsDirectory = await this._isLocalDirectory(localDst);
|
|
241
|
+
const targetPath = localDstIsDirectory
|
|
242
|
+
? path.join(localDst, baseName)
|
|
243
|
+
: localDst;
|
|
244
|
+
await pullSingleFile(remoteSrc, targetPath);
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
// Source is a directory, recursive option required
|
|
248
|
+
if (!recursive) {
|
|
249
|
+
throw new Error(`Cannot pull directory '${remoteSrc}' without recursive option. Set recursive: true to pull directories.`);
|
|
250
|
+
}
|
|
251
|
+
log.debug(`Starting recursive pull from '${remoteSrc}' to '${localDst}'`);
|
|
252
|
+
await this._pullRecursiveInternal(remoteSrc, localDst, {
|
|
253
|
+
match,
|
|
254
|
+
overwrite,
|
|
255
|
+
callback,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Create a directory on the device.
|
|
260
|
+
*
|
|
261
|
+
* Creates parent directories automatically and is idempotent (no error if the directory exists).
|
|
262
|
+
*
|
|
263
|
+
* @param dirPath - Path of the directory to create.
|
|
264
|
+
* @returns A promise that resolves when the directory has been created.
|
|
265
|
+
*/
|
|
266
|
+
async mkdir(dirPath) {
|
|
267
|
+
await this._doOperation(AfcOpcode.MAKE_DIR, buildMkdirPayload(dirPath));
|
|
268
|
+
log.debug(`Successfully created directory: ${dirPath}`);
|
|
209
269
|
}
|
|
210
270
|
async rmSingle(filePath, force = false) {
|
|
211
271
|
log.debug(`Removing single path: ${filePath} (force: ${force})`);
|
|
@@ -315,6 +375,112 @@ export class AfcService {
|
|
|
315
375
|
}
|
|
316
376
|
this.socket = null;
|
|
317
377
|
}
|
|
378
|
+
/**
|
|
379
|
+
* Private primitive to pull a single file from device to local filesystem.
|
|
380
|
+
*
|
|
381
|
+
* @param remoteSrc - Remote file path on the device (must be a file)
|
|
382
|
+
* @param localDst - Local destination file path
|
|
383
|
+
*/
|
|
384
|
+
async _pullFile(remoteSrc, localDst) {
|
|
385
|
+
log.debug(`Pulling file from '${remoteSrc}' to '${localDst}'`);
|
|
386
|
+
const resolved = await this._resolvePath(remoteSrc);
|
|
387
|
+
const st = await this.stat(resolved);
|
|
388
|
+
if (st.st_ifmt !== AfcFileMode.S_IFREG) {
|
|
389
|
+
throw new Error(`'${resolved}' isn't a regular file`);
|
|
390
|
+
}
|
|
391
|
+
const handle = await this.fopen(resolved, 'r');
|
|
392
|
+
try {
|
|
393
|
+
const stream = this.createReadStream(handle, st.st_size);
|
|
394
|
+
const writeStream = fs.createWriteStream(localDst);
|
|
395
|
+
await pipeline(stream, writeStream);
|
|
396
|
+
log.debug(`Successfully pulled file to '${localDst}' (${st.st_size} bytes)`);
|
|
397
|
+
}
|
|
398
|
+
finally {
|
|
399
|
+
await this.fclose(handle);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Recursively pull directory contents from device to local filesystem.
|
|
404
|
+
*
|
|
405
|
+
* @remarks
|
|
406
|
+
* This method is intended for directories only. Caller must validate that remoteSrcDir
|
|
407
|
+
* is a directory before invoking.
|
|
408
|
+
*/
|
|
409
|
+
async _pullRecursiveInternal(remoteSrcDir, localDstDir, options, relativePath = '') {
|
|
410
|
+
const { match, overwrite = true, callback } = options ?? {};
|
|
411
|
+
let localDirPath;
|
|
412
|
+
if (!relativePath) {
|
|
413
|
+
const localDstIsDirectory = await this._isLocalDirectory(localDstDir);
|
|
414
|
+
if (!localDstIsDirectory) {
|
|
415
|
+
const stat = await fsp.stat(localDstDir).catch((err) => {
|
|
416
|
+
if (err.code === 'ENOENT') {
|
|
417
|
+
return null;
|
|
418
|
+
}
|
|
419
|
+
throw err;
|
|
420
|
+
});
|
|
421
|
+
if (stat?.isFile()) {
|
|
422
|
+
throw new Error(`Local destination exists and is a file, not a directory: ${localDstDir}`);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
const baseName = path.posix.basename(remoteSrcDir);
|
|
426
|
+
localDirPath = localDstIsDirectory
|
|
427
|
+
? path.join(localDstDir, baseName)
|
|
428
|
+
: localDstDir;
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
localDirPath = localDstDir;
|
|
432
|
+
}
|
|
433
|
+
await fsp.mkdir(localDirPath, { recursive: true });
|
|
434
|
+
for (const entry of await this.listdir(remoteSrcDir)) {
|
|
435
|
+
const entryPath = path.posix.join(remoteSrcDir, entry);
|
|
436
|
+
const entryRelativePath = relativePath
|
|
437
|
+
? path.posix.join(relativePath, entry)
|
|
438
|
+
: entry;
|
|
439
|
+
if (await this.isdir(entryPath)) {
|
|
440
|
+
await this._pullRecursiveInternal(entryPath, path.join(localDirPath, entry), options, entryRelativePath);
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
if (match && !minimatch(entryRelativePath, match)) {
|
|
444
|
+
continue;
|
|
445
|
+
}
|
|
446
|
+
const targetPath = path.join(localDirPath, entry);
|
|
447
|
+
if (!overwrite && (await this._localPathExists(targetPath))) {
|
|
448
|
+
throw new Error(`Local file already exists: ${targetPath}`);
|
|
449
|
+
}
|
|
450
|
+
await this._pullFile(entryPath, targetPath);
|
|
451
|
+
if (callback) {
|
|
452
|
+
await callback(entryPath, targetPath);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Helper to check if a local filesystem path exists and is a directory.
|
|
459
|
+
*/
|
|
460
|
+
async _isLocalDirectory(localPath) {
|
|
461
|
+
try {
|
|
462
|
+
const stats = await fsp.stat(localPath);
|
|
463
|
+
return stats.isDirectory();
|
|
464
|
+
}
|
|
465
|
+
catch {
|
|
466
|
+
return false;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Helper to check if a local path (file or directory) exists.
|
|
471
|
+
*/
|
|
472
|
+
async _localPathExists(localPath) {
|
|
473
|
+
try {
|
|
474
|
+
await fsp.access(localPath, fsp.constants.F_OK);
|
|
475
|
+
return true;
|
|
476
|
+
}
|
|
477
|
+
catch (err) {
|
|
478
|
+
if (err.code === 'ENOENT') {
|
|
479
|
+
return false;
|
|
480
|
+
}
|
|
481
|
+
throw err;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
318
484
|
/**
|
|
319
485
|
* Connect to RSD port and perform RSDCheckin.
|
|
320
486
|
* Keeps the underlying socket for raw AFC I/O.
|
|
@@ -12,6 +12,11 @@ export declare class Channel {
|
|
|
12
12
|
* Receive a plist response from the channel
|
|
13
13
|
*/
|
|
14
14
|
receivePlist(): Promise<any>;
|
|
15
|
+
/**
|
|
16
|
+
* Receive a plist response from the channel with auxiliaries
|
|
17
|
+
* @returns Tuple of [selector, auxiliaries]
|
|
18
|
+
*/
|
|
19
|
+
receivePlistWithAux(): Promise<[string, any[]]>;
|
|
15
20
|
/**
|
|
16
21
|
* Call a method on this channel with automatic ObjectiveC selector conversion
|
|
17
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../../../src/services/ios/dvt/channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,MAAM,iBAAiB,GAAG,CAC9B,IAAI,CAAC,EAAE,UAAU,EACjB,YAAY,CAAC,EAAE,OAAO,KACnB,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB;;GAEG;AACH,qBAAa,OAAO;IAEhB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,2BAA2B;IAGvD;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC;IAKlC;;;;;;;;;;OAUG;IACH,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB;IAY3C;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAM1B"}
|
|
1
|
+
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../../../src/services/ios/dvt/channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,MAAM,iBAAiB,GAAG,CAC9B,IAAI,CAAC,EAAE,UAAU,EACjB,YAAY,CAAC,EAAE,OAAO,KACnB,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB;;GAEG;AACH,qBAAa,OAAO;IAEhB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,2BAA2B;IAGvD;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC;IAKlC;;;OAGG;IACG,mBAAmB,IAAI,OAAO,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAIrD;;;;;;;;;;OAUG;IACH,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB;IAY3C;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAM1B"}
|
|
@@ -15,6 +15,13 @@ export class Channel {
|
|
|
15
15
|
const [data] = await this.service.recvPlist(this.channelCode);
|
|
16
16
|
return data;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Receive a plist response from the channel with auxiliaries
|
|
20
|
+
* @returns Tuple of [selector, auxiliaries]
|
|
21
|
+
*/
|
|
22
|
+
async receivePlistWithAux() {
|
|
23
|
+
return await this.service.recvPlist(this.channelCode);
|
|
24
|
+
}
|
|
18
25
|
/**
|
|
19
26
|
* Call a method on this channel with automatic ObjectiveC selector conversion
|
|
20
27
|
*
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { BaseInstrument } from './base-instrument.js';
|
|
2
|
+
/**
|
|
3
|
+
* Application state notification data structure
|
|
4
|
+
*/
|
|
5
|
+
export interface ApplicationStateNotificationData {
|
|
6
|
+
/** High-precision Mach absolute time timestamp */
|
|
7
|
+
mach_absolute_time: bigint;
|
|
8
|
+
/** Full path to the executable (e.g., '/private/var/containers/Bundle/Application/.../MobileCal.app') */
|
|
9
|
+
execName: string;
|
|
10
|
+
/** Short application name (e.g., 'MobileCal') */
|
|
11
|
+
appName: string;
|
|
12
|
+
/** Process ID of the application */
|
|
13
|
+
pid: number;
|
|
14
|
+
/** Application state: 'Foreground' | 'Background' | 'Suspended' | 'Terminated' */
|
|
15
|
+
state_description: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Memory level notification data structure
|
|
19
|
+
*/
|
|
20
|
+
export interface MemoryLevelNotificationData {
|
|
21
|
+
/** Memory pressure level code (0=Normal, 1=Warning, 2=Critical, 3=...) */
|
|
22
|
+
code: number;
|
|
23
|
+
/** High-precision Mach absolute time timestamp */
|
|
24
|
+
mach_absolute_time: bigint;
|
|
25
|
+
/** NSDate timestamp object with NS.time property */
|
|
26
|
+
timestamp: number;
|
|
27
|
+
/** Process ID (-1 for system-wide notifications) */
|
|
28
|
+
pid: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Application state notification message
|
|
32
|
+
*/
|
|
33
|
+
export interface ApplicationStateNotification {
|
|
34
|
+
selector: 'applicationStateNotification:';
|
|
35
|
+
data: ApplicationStateNotificationData;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Memory level notification message
|
|
39
|
+
*/
|
|
40
|
+
export interface MemoryLevelNotification {
|
|
41
|
+
selector: 'memoryLevelNotification:';
|
|
42
|
+
data: MemoryLevelNotificationData;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Monitor memory and app notification
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* for await (const msg of notifications.messages()) {
|
|
50
|
+
* if (!msg) continue;
|
|
51
|
+
*
|
|
52
|
+
* if (msg.selector === 'applicationStateNotification:') {
|
|
53
|
+
* const notif = msg.data;
|
|
54
|
+
* console.log(`${notif.appName} is ${notif.state_description}`);
|
|
55
|
+
* }
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export type NotificationMessage = ApplicationStateNotification | MemoryLevelNotification;
|
|
60
|
+
/**
|
|
61
|
+
* Notifications service for monitoring iOS system events
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* for await (const msg of dvtService.notifications.messages()) {
|
|
66
|
+
* if (!msg) continue;
|
|
67
|
+
*
|
|
68
|
+
* if (msg.selector === 'applicationStateNotification:') {
|
|
69
|
+
* const app = msg.data;
|
|
70
|
+
* console.log(`${app.appName}: ${app.state_description}`);
|
|
71
|
+
* }
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export declare class Notifications extends BaseInstrument {
|
|
76
|
+
/** DTX service identifier for mobile notifications */
|
|
77
|
+
static readonly IDENTIFIER = "com.apple.instruments.server.services.mobilenotifications";
|
|
78
|
+
start(): Promise<void>;
|
|
79
|
+
stop(): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Yields notification messages from the iOS device
|
|
82
|
+
*/
|
|
83
|
+
messages(): AsyncGenerator<NotificationMessage, void, undefined>;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../../../../src/services/ios/dvt/instruments/notifications.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C,kDAAkD;IAClD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,yGAAyG;IACzG,QAAQ,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,+BAA+B,CAAC;IAC1C,IAAI,EAAE,gCAAgC,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,0BAA0B,CAAC;IACrC,IAAI,EAAE,2BAA2B,CAAC;CACnC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,mBAAmB,GAC3B,4BAA4B,GAC5B,uBAAuB,CAAC;AAE5B;;;;;;;;;;;;;;GAcG;AACH,qBAAa,aAAc,SAAQ,cAAc;IAC/C,sDAAsD;IACtD,MAAM,CAAC,QAAQ,CAAC,UAAU,+DACoC;IAExD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAOtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAM3B;;OAEG;IACI,QAAQ,IAAI,cAAc,CAAC,mBAAmB,EAAE,IAAI,EAAE,SAAS,CAAC;CAmCxE"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { getLogger } from '../../../../lib/logger.js';
|
|
2
|
+
import { MessageAux } from '../dtx-message.js';
|
|
3
|
+
import { decodeNSKeyedArchiver } from '../nskeyedarchiver-decoder.js';
|
|
4
|
+
import { BaseInstrument } from './base-instrument.js';
|
|
5
|
+
const log = getLogger('Notifications');
|
|
6
|
+
/**
|
|
7
|
+
* Notifications service for monitoring iOS system events
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* for await (const msg of dvtService.notifications.messages()) {
|
|
12
|
+
* if (!msg) continue;
|
|
13
|
+
*
|
|
14
|
+
* if (msg.selector === 'applicationStateNotification:') {
|
|
15
|
+
* const app = msg.data;
|
|
16
|
+
* console.log(`${app.appName}: ${app.state_description}`);
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export class Notifications extends BaseInstrument {
|
|
22
|
+
/** DTX service identifier for mobile notifications */
|
|
23
|
+
static IDENTIFIER = 'com.apple.instruments.server.services.mobilenotifications';
|
|
24
|
+
async start() {
|
|
25
|
+
await this.initialize();
|
|
26
|
+
const args = new MessageAux().appendObj(true);
|
|
27
|
+
await this.channel.call('setApplicationStateNotificationsEnabled_')(args);
|
|
28
|
+
await this.channel.call('setMemoryNotificationsEnabled_')(args);
|
|
29
|
+
}
|
|
30
|
+
async stop() {
|
|
31
|
+
const args = new MessageAux().appendObj(false);
|
|
32
|
+
await this.channel.call('setApplicationStateNotificationsEnabled_')(args);
|
|
33
|
+
await this.channel.call('setMemoryNotificationsEnabled_')(args);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Yields notification messages from the iOS device
|
|
37
|
+
*/
|
|
38
|
+
async *messages() {
|
|
39
|
+
log.debug('Network monitoring has started');
|
|
40
|
+
await this.start();
|
|
41
|
+
try {
|
|
42
|
+
while (true) {
|
|
43
|
+
const [selector, auxiliaries] = await this.channel.receivePlistWithAux();
|
|
44
|
+
// Decode NSKeyedArchiver format in auxiliaries first index
|
|
45
|
+
const decodedData = auxiliaries[0];
|
|
46
|
+
if (decodedData &&
|
|
47
|
+
typeof decodedData === 'object' &&
|
|
48
|
+
decodedData.$archiver === 'NSKeyedArchiver') {
|
|
49
|
+
try {
|
|
50
|
+
const data = decodeNSKeyedArchiver(decodedData);
|
|
51
|
+
yield {
|
|
52
|
+
selector: selector,
|
|
53
|
+
data,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
log.warn('Failed to decode NSKeyedArchiver data:', error);
|
|
58
|
+
await this.stop();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
log.debug('Network monitoring has ended');
|
|
65
|
+
await this.stop();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAGhF,OAAO,KAAK,EACV,wBAAwB,EACxB,gCAAgC,EAChC,6BAA6B,EAC7B,iCAAiC,EACjC,uCAAuC,EACvC,sCAAsC,EACtC,mCAAmC,EACnC,gCAAgC,EAChC,aAAa,IAAI,iBAAiB,EAClC,iCAAiC,EAClC,MAAM,gBAAgB,CAAC;AACxB,OAAO,UAAU,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAGhF,OAAO,KAAK,EACV,wBAAwB,EACxB,gCAAgC,EAChC,6BAA6B,EAC7B,iCAAiC,EACjC,uCAAuC,EACvC,sCAAsC,EACtC,mCAAmC,EACnC,gCAAgC,EAChC,aAAa,IAAI,iBAAiB,EAClC,iCAAiC,EAClC,MAAM,gBAAgB,CAAC;AACxB,OAAO,UAAU,MAAM,6BAA6B,CAAC;AAsBrD,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,gCAAgC,CAAC,CAY3C;AAED,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,sCAAsC,CAAC,CAYjD;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,iCAAiC,CAAC,CAY5C;AAED,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,uCAAuC,CAAC,CAYlD;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,gCAAgC,CAAC,CAY3C;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,6BAA6B,CAAC,CAYxC;AAED,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,mCAAmC,CAAC,CAY9C;AAED,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,iBAAiB,CAAC,CAG5B;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAOvE;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,iCAAiC,CAAC,CAY5C;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,wBAAwB,CAAC,CAmCnC;AAED,wBAAsB,yBAAyB,CAAC,IAAI,EAAE,MAAM;;;;;;;;GAO3D"}
|
package/build/src/services.js
CHANGED
|
@@ -10,6 +10,7 @@ import { ConditionInducer } from './services/ios/dvt/instruments/condition-induc
|
|
|
10
10
|
import { DeviceInfo } from './services/ios/dvt/instruments/device-info.js';
|
|
11
11
|
import { Graphics } from './services/ios/dvt/instruments/graphics.js';
|
|
12
12
|
import { LocationSimulation } from './services/ios/dvt/instruments/location-simulation.js';
|
|
13
|
+
import { Notifications } from './services/ios/dvt/instruments/notifications.js';
|
|
13
14
|
import { Screenshot } from './services/ios/dvt/instruments/screenshot.js';
|
|
14
15
|
import { MisagentService } from './services/ios/misagent/index.js';
|
|
15
16
|
import { MobileConfigService } from './services/ios/mobile-config/index.js';
|
|
@@ -142,6 +143,7 @@ export async function startDVTService(udid) {
|
|
|
142
143
|
const appListing = new ApplicationListing(dvtService);
|
|
143
144
|
const graphics = new Graphics(dvtService);
|
|
144
145
|
const deviceInfo = new DeviceInfo(dvtService);
|
|
146
|
+
const notification = new Notifications(dvtService);
|
|
145
147
|
return {
|
|
146
148
|
remoteXPC: remoteXPC,
|
|
147
149
|
dvtService,
|
|
@@ -151,6 +153,7 @@ export async function startDVTService(udid) {
|
|
|
151
153
|
appListing,
|
|
152
154
|
graphics,
|
|
153
155
|
deviceInfo,
|
|
156
|
+
notification,
|
|
154
157
|
};
|
|
155
158
|
}
|
|
156
159
|
export async function createRemoteXPCConnection(udid) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appium-ios-remotexpc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"main": "build/src/index.js",
|
|
5
5
|
"types": "build/src/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"test:dvt:screenshot": "mocha test/integration/dvt_instruments/screenshot-test.ts --exit --timeout 1m",
|
|
47
47
|
"test:dvt:device-info": "mocha test/integration/dvt_instruments/device-info-test.ts --exit --timeout 1m",
|
|
48
48
|
"test:dvt:applist": "mocha test/integration/dvt_instruments/app-listing-test.ts --exit --timeout 1m",
|
|
49
|
+
"test:dvt:notification": "mocha test/integration/dvt_instruments/notifications-test.ts --exit --timeout 1m",
|
|
49
50
|
"test:tunnel-creation": "sudo tsx scripts/test-tunnel-creation.ts",
|
|
50
51
|
"test:tunnel-creation:lsof": "sudo tsx scripts/test-tunnel-creation.ts --keep-open"
|
|
51
52
|
},
|
|
@@ -69,6 +70,7 @@
|
|
|
69
70
|
"@types/chai": "^5.2.1",
|
|
70
71
|
"@types/chai-as-promised": "^8.0.2",
|
|
71
72
|
"@types/mocha": "^10.0.10",
|
|
73
|
+
"@types/sinon": "^21.0.0",
|
|
72
74
|
"chai": "^6.0.1",
|
|
73
75
|
"chai-as-promised": "^8.0.1",
|
|
74
76
|
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
@@ -77,6 +79,7 @@
|
|
|
77
79
|
"prettier": "^3.5.3",
|
|
78
80
|
"rimraf": "^6.0.1",
|
|
79
81
|
"semantic-release": "^25.0.2",
|
|
82
|
+
"sinon": "^21.0.0",
|
|
80
83
|
"ts-node": "^10.9.2",
|
|
81
84
|
"tsx": "^4.7.0",
|
|
82
85
|
"typescript": "^5.2.2"
|
|
@@ -88,6 +91,7 @@
|
|
|
88
91
|
"@xmldom/xmldom": "^0.9.8",
|
|
89
92
|
"appium-ios-tuntap": "^0.x",
|
|
90
93
|
"axios": "^1.12.0",
|
|
94
|
+
"minimatch": "^10.1.1",
|
|
91
95
|
"npm-run-all2": "^8.0.4"
|
|
92
96
|
},
|
|
93
97
|
"files": [
|
package/src/lib/types.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { ServiceConnection } from '../service-connection.js';
|
|
|
8
8
|
import type { BaseService, Service } from '../services/ios/base-service.js';
|
|
9
9
|
import type { iOSApplication } from '../services/ios/dvt/instruments/application-listing.js';
|
|
10
10
|
import type { LocationCoordinates } from '../services/ios/dvt/instruments/location-simulation.js';
|
|
11
|
+
import type { NotificationMessage } from '../services/ios/dvt/instruments/notifications.js';
|
|
11
12
|
import { ProvisioningProfile } from '../services/ios/misagent/provisioning-profile.js';
|
|
12
13
|
import type { PowerAssertionOptions } from '../services/ios/power-assertion/index.js';
|
|
13
14
|
import { PowerAssertionType } from '../services/ios/power-assertion/index.js';
|
|
@@ -796,6 +797,50 @@ export interface DeviceInfoService {
|
|
|
796
797
|
nameForGid(gid: number): Promise<string>;
|
|
797
798
|
}
|
|
798
799
|
|
|
800
|
+
/**
|
|
801
|
+
* Notification service monitor memory and app notifications
|
|
802
|
+
*/
|
|
803
|
+
export interface NotificationService {
|
|
804
|
+
/**
|
|
805
|
+
* Yields notification from memory and application state changes
|
|
806
|
+
* @example:
|
|
807
|
+
* {
|
|
808
|
+
* selector: 'applicationStateNotification:',
|
|
809
|
+
* data:
|
|
810
|
+
* {
|
|
811
|
+
* mach_absolute_time: 58061793038,
|
|
812
|
+
* execName: '/Applications/Spotlight.app',
|
|
813
|
+
* appName: 'Spotlight',
|
|
814
|
+
* pid: 327,
|
|
815
|
+
* state_description: 'Suspended'
|
|
816
|
+
* }
|
|
817
|
+
* },
|
|
818
|
+
* {
|
|
819
|
+
* selector: 'applicationStateNotification:',
|
|
820
|
+
* data:
|
|
821
|
+
* {
|
|
822
|
+
* mach_absolute_time: 58061827502,
|
|
823
|
+
* execName: '/private/var/containers/Bundle/Application/28AF0B11-363A-4242-9164-CF690064402B/MobileCal.app',
|
|
824
|
+
* appName: 'MobileCal',
|
|
825
|
+
* pid: 449,
|
|
826
|
+
* state_description: 'Suspended'
|
|
827
|
+
* }
|
|
828
|
+
* },
|
|
829
|
+
* {
|
|
830
|
+
* selector: 'memoryLevelNotification:',
|
|
831
|
+
* data:
|
|
832
|
+
* {
|
|
833
|
+
* code: 3,
|
|
834
|
+
* mach_absolute_time: 101524320437,
|
|
835
|
+
* timestamp: [Object],
|
|
836
|
+
* pid: -1
|
|
837
|
+
* }
|
|
838
|
+
*
|
|
839
|
+
* }
|
|
840
|
+
*/
|
|
841
|
+
messages(): AsyncGenerator<NotificationMessage, void, undefined>;
|
|
842
|
+
}
|
|
843
|
+
|
|
799
844
|
/**
|
|
800
845
|
* DVT service with connection
|
|
801
846
|
* This allows callers to properly manage the connection lifecycle
|
|
@@ -815,6 +860,8 @@ export interface DVTServiceWithConnection {
|
|
|
815
860
|
graphics: GraphicsService;
|
|
816
861
|
/** The DeviceInfo service instance */
|
|
817
862
|
deviceInfo: DeviceInfoService;
|
|
863
|
+
/** The Notifications service instance */
|
|
864
|
+
notification: NotificationService;
|
|
818
865
|
/** The RemoteXPC connection that can be used to close the connection */
|
|
819
866
|
remoteXPC: RemoteXpcConnection;
|
|
820
867
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { minimatch } from 'minimatch';
|
|
1
2
|
import fs from 'node:fs';
|
|
3
|
+
import fsp from 'node:fs/promises';
|
|
2
4
|
import net from 'node:net';
|
|
3
5
|
import path from 'node:path';
|
|
4
6
|
import { Readable, Writable } from 'node:stream';
|
|
@@ -8,6 +10,7 @@ import { getLogger } from '../../../lib/logger.js';
|
|
|
8
10
|
import {
|
|
9
11
|
buildClosePayload,
|
|
10
12
|
buildFopenPayload,
|
|
13
|
+
buildMkdirPayload,
|
|
11
14
|
buildReadPayload,
|
|
12
15
|
buildRemovePayload,
|
|
13
16
|
buildRenamePayload,
|
|
@@ -29,6 +32,38 @@ const log = getLogger('AfcService');
|
|
|
29
32
|
|
|
30
33
|
const NON_LISTABLE_ENTRIES = ['', '.', '..'];
|
|
31
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Callback invoked for each file successfully pulled from the device.
|
|
37
|
+
*
|
|
38
|
+
* @param remotePath - The remote file path on the device
|
|
39
|
+
* @param localPath - The local file path where it was saved
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* If the callback throws an error, the pull operation will be aborted immediately.
|
|
43
|
+
*/
|
|
44
|
+
export type PullRecursiveCallback = (
|
|
45
|
+
remotePath: string,
|
|
46
|
+
localPath: string,
|
|
47
|
+
) => unknown | Promise<unknown>;
|
|
48
|
+
|
|
49
|
+
/** Options for the pull method. */
|
|
50
|
+
export interface PullOptions {
|
|
51
|
+
/**
|
|
52
|
+
* If true, recursively pull directories.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
recursive?: boolean;
|
|
56
|
+
/** Glob pattern to filter files (e.g., '*.txt', '**\/*.log'). */
|
|
57
|
+
match?: string;
|
|
58
|
+
/**
|
|
59
|
+
* If false, throws error when local file exists.
|
|
60
|
+
* @default true
|
|
61
|
+
*/
|
|
62
|
+
overwrite?: boolean;
|
|
63
|
+
/** Callback invoked for each pulled file. */
|
|
64
|
+
callback?: PullRecursiveCallback;
|
|
65
|
+
}
|
|
66
|
+
|
|
32
67
|
export interface StatInfo {
|
|
33
68
|
st_ifmt: AfcFileMode;
|
|
34
69
|
st_size: bigint;
|
|
@@ -288,12 +323,97 @@ export class AfcService {
|
|
|
288
323
|
}
|
|
289
324
|
}
|
|
290
325
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
326
|
+
/**
|
|
327
|
+
* Pull file(s) or directory from the device to the local filesystem.
|
|
328
|
+
*
|
|
329
|
+
* @param remoteSrc - Remote path on the device (file or directory)
|
|
330
|
+
* @param localDst - Local destination path
|
|
331
|
+
* @param options - Optional configuration
|
|
332
|
+
*
|
|
333
|
+
* @throws {Error} If the remote source path does not exist
|
|
334
|
+
* @throws {Error} If overwrite is false and local file already exists
|
|
335
|
+
*
|
|
336
|
+
* @remarks
|
|
337
|
+
* When pulling a directory with `recursive: true`, the directory itself will be created
|
|
338
|
+
* inside the destination. For example, pulling `/Downloads` to `/tmp` will create `/tmp/Downloads`.
|
|
339
|
+
*/
|
|
340
|
+
async pull(
|
|
341
|
+
remoteSrc: string,
|
|
342
|
+
localDst: string,
|
|
343
|
+
options?: PullOptions,
|
|
344
|
+
): Promise<void> {
|
|
345
|
+
const {
|
|
346
|
+
recursive = false,
|
|
347
|
+
match,
|
|
348
|
+
overwrite = true,
|
|
349
|
+
callback,
|
|
350
|
+
} = options ?? {};
|
|
351
|
+
|
|
352
|
+
if (!(await this.exists(remoteSrc))) {
|
|
353
|
+
throw new Error(`Remote path does not exist: ${remoteSrc}`);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
const pullSingleFile = async (
|
|
357
|
+
remoteFilePath: string,
|
|
358
|
+
localFilePath: string,
|
|
359
|
+
): Promise<void> => {
|
|
360
|
+
log.debug(`Pulling file from '${remoteFilePath}' to '${localFilePath}'`);
|
|
361
|
+
|
|
362
|
+
if (!overwrite && (await this._localPathExists(localFilePath))) {
|
|
363
|
+
throw new Error(`Local file already exists: ${localFilePath}`);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
await this._pullFile(remoteFilePath, localFilePath);
|
|
367
|
+
|
|
368
|
+
if (callback) {
|
|
369
|
+
await callback(remoteFilePath, localFilePath);
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
const isDir = await this.isdir(remoteSrc);
|
|
374
|
+
|
|
375
|
+
if (!isDir) {
|
|
376
|
+
const baseName = path.posix.basename(remoteSrc);
|
|
377
|
+
|
|
378
|
+
if (match && !minimatch(baseName, match)) {
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
const localDstIsDirectory = await this._isLocalDirectory(localDst);
|
|
383
|
+
const targetPath = localDstIsDirectory
|
|
384
|
+
? path.join(localDst, baseName)
|
|
385
|
+
: localDst;
|
|
386
|
+
|
|
387
|
+
await pullSingleFile(remoteSrc, targetPath);
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// Source is a directory, recursive option required
|
|
392
|
+
if (!recursive) {
|
|
393
|
+
throw new Error(
|
|
394
|
+
`Cannot pull directory '${remoteSrc}' without recursive option. Set recursive: true to pull directories.`,
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
log.debug(`Starting recursive pull from '${remoteSrc}' to '${localDst}'`);
|
|
399
|
+
await this._pullRecursiveInternal(remoteSrc, localDst, {
|
|
400
|
+
match,
|
|
401
|
+
overwrite,
|
|
402
|
+
callback,
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Create a directory on the device.
|
|
408
|
+
*
|
|
409
|
+
* Creates parent directories automatically and is idempotent (no error if the directory exists).
|
|
410
|
+
*
|
|
411
|
+
* @param dirPath - Path of the directory to create.
|
|
412
|
+
* @returns A promise that resolves when the directory has been created.
|
|
413
|
+
*/
|
|
414
|
+
async mkdir(dirPath: string): Promise<void> {
|
|
415
|
+
await this._doOperation(AfcOpcode.MAKE_DIR, buildMkdirPayload(dirPath));
|
|
416
|
+
log.debug(`Successfully created directory: ${dirPath}`);
|
|
297
417
|
}
|
|
298
418
|
|
|
299
419
|
async rmSingle(filePath: string, force = false): Promise<boolean> {
|
|
@@ -418,6 +538,137 @@ export class AfcService {
|
|
|
418
538
|
this.socket = null;
|
|
419
539
|
}
|
|
420
540
|
|
|
541
|
+
/**
|
|
542
|
+
* Private primitive to pull a single file from device to local filesystem.
|
|
543
|
+
*
|
|
544
|
+
* @param remoteSrc - Remote file path on the device (must be a file)
|
|
545
|
+
* @param localDst - Local destination file path
|
|
546
|
+
*/
|
|
547
|
+
private async _pullFile(remoteSrc: string, localDst: string): Promise<void> {
|
|
548
|
+
log.debug(`Pulling file from '${remoteSrc}' to '${localDst}'`);
|
|
549
|
+
|
|
550
|
+
const resolved = await this._resolvePath(remoteSrc);
|
|
551
|
+
const st = await this.stat(resolved);
|
|
552
|
+
|
|
553
|
+
if (st.st_ifmt !== AfcFileMode.S_IFREG) {
|
|
554
|
+
throw new Error(`'${resolved}' isn't a regular file`);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
const handle = await this.fopen(resolved, 'r');
|
|
558
|
+
try {
|
|
559
|
+
const stream = this.createReadStream(handle, st.st_size);
|
|
560
|
+
const writeStream = fs.createWriteStream(localDst);
|
|
561
|
+
await pipeline(stream, writeStream);
|
|
562
|
+
log.debug(
|
|
563
|
+
`Successfully pulled file to '${localDst}' (${st.st_size} bytes)`,
|
|
564
|
+
);
|
|
565
|
+
} finally {
|
|
566
|
+
await this.fclose(handle);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Recursively pull directory contents from device to local filesystem.
|
|
572
|
+
*
|
|
573
|
+
* @remarks
|
|
574
|
+
* This method is intended for directories only. Caller must validate that remoteSrcDir
|
|
575
|
+
* is a directory before invoking.
|
|
576
|
+
*/
|
|
577
|
+
private async _pullRecursiveInternal(
|
|
578
|
+
remoteSrcDir: string,
|
|
579
|
+
localDstDir: string,
|
|
580
|
+
options?: Omit<PullOptions, 'recursive'>,
|
|
581
|
+
relativePath = '',
|
|
582
|
+
): Promise<void> {
|
|
583
|
+
const { match, overwrite = true, callback } = options ?? {};
|
|
584
|
+
|
|
585
|
+
let localDirPath: string;
|
|
586
|
+
if (!relativePath) {
|
|
587
|
+
const localDstIsDirectory = await this._isLocalDirectory(localDstDir);
|
|
588
|
+
|
|
589
|
+
if (!localDstIsDirectory) {
|
|
590
|
+
const stat = await fsp.stat(localDstDir).catch((err) => {
|
|
591
|
+
if (err.code === 'ENOENT') {
|
|
592
|
+
return null;
|
|
593
|
+
}
|
|
594
|
+
throw err;
|
|
595
|
+
});
|
|
596
|
+
if (stat?.isFile()) {
|
|
597
|
+
throw new Error(
|
|
598
|
+
`Local destination exists and is a file, not a directory: ${localDstDir}`,
|
|
599
|
+
);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
const baseName = path.posix.basename(remoteSrcDir);
|
|
604
|
+
localDirPath = localDstIsDirectory
|
|
605
|
+
? path.join(localDstDir, baseName)
|
|
606
|
+
: localDstDir;
|
|
607
|
+
} else {
|
|
608
|
+
localDirPath = localDstDir;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
await fsp.mkdir(localDirPath, { recursive: true });
|
|
612
|
+
|
|
613
|
+
for (const entry of await this.listdir(remoteSrcDir)) {
|
|
614
|
+
const entryPath = path.posix.join(remoteSrcDir, entry);
|
|
615
|
+
const entryRelativePath = relativePath
|
|
616
|
+
? path.posix.join(relativePath, entry)
|
|
617
|
+
: entry;
|
|
618
|
+
|
|
619
|
+
if (await this.isdir(entryPath)) {
|
|
620
|
+
await this._pullRecursiveInternal(
|
|
621
|
+
entryPath,
|
|
622
|
+
path.join(localDirPath, entry),
|
|
623
|
+
options,
|
|
624
|
+
entryRelativePath,
|
|
625
|
+
);
|
|
626
|
+
} else {
|
|
627
|
+
if (match && !minimatch(entryRelativePath, match)) {
|
|
628
|
+
continue;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
const targetPath = path.join(localDirPath, entry);
|
|
632
|
+
if (!overwrite && (await this._localPathExists(targetPath))) {
|
|
633
|
+
throw new Error(`Local file already exists: ${targetPath}`);
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
await this._pullFile(entryPath, targetPath);
|
|
637
|
+
|
|
638
|
+
if (callback) {
|
|
639
|
+
await callback(entryPath, targetPath);
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Helper to check if a local filesystem path exists and is a directory.
|
|
647
|
+
*/
|
|
648
|
+
private async _isLocalDirectory(localPath: string): Promise<boolean> {
|
|
649
|
+
try {
|
|
650
|
+
const stats = await fsp.stat(localPath);
|
|
651
|
+
return stats.isDirectory();
|
|
652
|
+
} catch {
|
|
653
|
+
return false;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Helper to check if a local path (file or directory) exists.
|
|
659
|
+
*/
|
|
660
|
+
private async _localPathExists(localPath: string): Promise<boolean> {
|
|
661
|
+
try {
|
|
662
|
+
await fsp.access(localPath, fsp.constants.F_OK);
|
|
663
|
+
return true;
|
|
664
|
+
} catch (err: any) {
|
|
665
|
+
if (err.code === 'ENOENT') {
|
|
666
|
+
return false;
|
|
667
|
+
}
|
|
668
|
+
throw err;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
|
|
421
672
|
/**
|
|
422
673
|
* Connect to RSD port and perform RSDCheckin.
|
|
423
674
|
* Keeps the underlying socket for raw AFC I/O.
|
|
@@ -23,6 +23,14 @@ export class Channel {
|
|
|
23
23
|
return data;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Receive a plist response from the channel with auxiliaries
|
|
28
|
+
* @returns Tuple of [selector, auxiliaries]
|
|
29
|
+
*/
|
|
30
|
+
async receivePlistWithAux(): Promise<[string, any[]]> {
|
|
31
|
+
return await this.service.recvPlist(this.channelCode);
|
|
32
|
+
}
|
|
33
|
+
|
|
26
34
|
/**
|
|
27
35
|
* Call a method on this channel with automatic ObjectiveC selector conversion
|
|
28
36
|
*
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { getLogger } from '../../../../lib/logger.js';
|
|
2
|
+
import { MessageAux } from '../dtx-message.js';
|
|
3
|
+
import { decodeNSKeyedArchiver } from '../nskeyedarchiver-decoder.js';
|
|
4
|
+
import { BaseInstrument } from './base-instrument.js';
|
|
5
|
+
|
|
6
|
+
const log = getLogger('Notifications');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Application state notification data structure
|
|
10
|
+
*/
|
|
11
|
+
export interface ApplicationStateNotificationData {
|
|
12
|
+
/** High-precision Mach absolute time timestamp */
|
|
13
|
+
mach_absolute_time: bigint;
|
|
14
|
+
/** Full path to the executable (e.g., '/private/var/containers/Bundle/Application/.../MobileCal.app') */
|
|
15
|
+
execName: string;
|
|
16
|
+
/** Short application name (e.g., 'MobileCal') */
|
|
17
|
+
appName: string;
|
|
18
|
+
/** Process ID of the application */
|
|
19
|
+
pid: number;
|
|
20
|
+
/** Application state: 'Foreground' | 'Background' | 'Suspended' | 'Terminated' */
|
|
21
|
+
state_description: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Memory level notification data structure
|
|
26
|
+
*/
|
|
27
|
+
export interface MemoryLevelNotificationData {
|
|
28
|
+
/** Memory pressure level code (0=Normal, 1=Warning, 2=Critical, 3=...) */
|
|
29
|
+
code: number;
|
|
30
|
+
/** High-precision Mach absolute time timestamp */
|
|
31
|
+
mach_absolute_time: bigint;
|
|
32
|
+
/** NSDate timestamp object with NS.time property */
|
|
33
|
+
timestamp: number;
|
|
34
|
+
/** Process ID (-1 for system-wide notifications) */
|
|
35
|
+
pid: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Application state notification message
|
|
40
|
+
*/
|
|
41
|
+
export interface ApplicationStateNotification {
|
|
42
|
+
selector: 'applicationStateNotification:';
|
|
43
|
+
data: ApplicationStateNotificationData;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Memory level notification message
|
|
48
|
+
*/
|
|
49
|
+
export interface MemoryLevelNotification {
|
|
50
|
+
selector: 'memoryLevelNotification:';
|
|
51
|
+
data: MemoryLevelNotificationData;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Monitor memory and app notification
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* for await (const msg of notifications.messages()) {
|
|
60
|
+
* if (!msg) continue;
|
|
61
|
+
*
|
|
62
|
+
* if (msg.selector === 'applicationStateNotification:') {
|
|
63
|
+
* const notif = msg.data;
|
|
64
|
+
* console.log(`${notif.appName} is ${notif.state_description}`);
|
|
65
|
+
* }
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export type NotificationMessage =
|
|
70
|
+
| ApplicationStateNotification
|
|
71
|
+
| MemoryLevelNotification;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Notifications service for monitoring iOS system events
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* for await (const msg of dvtService.notifications.messages()) {
|
|
79
|
+
* if (!msg) continue;
|
|
80
|
+
*
|
|
81
|
+
* if (msg.selector === 'applicationStateNotification:') {
|
|
82
|
+
* const app = msg.data;
|
|
83
|
+
* console.log(`${app.appName}: ${app.state_description}`);
|
|
84
|
+
* }
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export class Notifications extends BaseInstrument {
|
|
89
|
+
/** DTX service identifier for mobile notifications */
|
|
90
|
+
static readonly IDENTIFIER =
|
|
91
|
+
'com.apple.instruments.server.services.mobilenotifications';
|
|
92
|
+
|
|
93
|
+
async start(): Promise<void> {
|
|
94
|
+
await this.initialize();
|
|
95
|
+
const args = new MessageAux().appendObj(true);
|
|
96
|
+
await this.channel!.call('setApplicationStateNotificationsEnabled_')(args);
|
|
97
|
+
await this.channel!.call('setMemoryNotificationsEnabled_')(args);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async stop(): Promise<void> {
|
|
101
|
+
const args = new MessageAux().appendObj(false);
|
|
102
|
+
await this.channel!.call('setApplicationStateNotificationsEnabled_')(args);
|
|
103
|
+
await this.channel!.call('setMemoryNotificationsEnabled_')(args);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Yields notification messages from the iOS device
|
|
108
|
+
*/
|
|
109
|
+
async *messages(): AsyncGenerator<NotificationMessage, void, undefined> {
|
|
110
|
+
log.debug('Network monitoring has started');
|
|
111
|
+
await this.start();
|
|
112
|
+
|
|
113
|
+
try {
|
|
114
|
+
while (true) {
|
|
115
|
+
const [selector, auxiliaries] =
|
|
116
|
+
await this.channel!.receivePlistWithAux();
|
|
117
|
+
|
|
118
|
+
// Decode NSKeyedArchiver format in auxiliaries first index
|
|
119
|
+
const decodedData = auxiliaries[0];
|
|
120
|
+
if (
|
|
121
|
+
decodedData &&
|
|
122
|
+
typeof decodedData === 'object' &&
|
|
123
|
+
decodedData.$archiver === 'NSKeyedArchiver'
|
|
124
|
+
) {
|
|
125
|
+
try {
|
|
126
|
+
const data = decodeNSKeyedArchiver(decodedData);
|
|
127
|
+
yield {
|
|
128
|
+
selector: selector as
|
|
129
|
+
| 'applicationStateNotification:'
|
|
130
|
+
| 'memoryLevelNotification:',
|
|
131
|
+
data,
|
|
132
|
+
} as NotificationMessage;
|
|
133
|
+
} catch (error) {
|
|
134
|
+
log.warn('Failed to decode NSKeyedArchiver data:', error);
|
|
135
|
+
await this.stop();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
} finally {
|
|
140
|
+
log.debug('Network monitoring has ended');
|
|
141
|
+
await this.stop();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
package/src/services.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { ConditionInducer } from './services/ios/dvt/instruments/condition-induc
|
|
|
23
23
|
import { DeviceInfo } from './services/ios/dvt/instruments/device-info.js';
|
|
24
24
|
import { Graphics } from './services/ios/dvt/instruments/graphics.js';
|
|
25
25
|
import { LocationSimulation } from './services/ios/dvt/instruments/location-simulation.js';
|
|
26
|
+
import { Notifications } from './services/ios/dvt/instruments/notifications.js';
|
|
26
27
|
import { Screenshot } from './services/ios/dvt/instruments/screenshot.js';
|
|
27
28
|
import { MisagentService } from './services/ios/misagent/index.js';
|
|
28
29
|
import { MobileConfigService } from './services/ios/mobile-config/index.js';
|
|
@@ -208,6 +209,7 @@ export async function startDVTService(
|
|
|
208
209
|
const appListing = new ApplicationListing(dvtService);
|
|
209
210
|
const graphics = new Graphics(dvtService);
|
|
210
211
|
const deviceInfo = new DeviceInfo(dvtService);
|
|
212
|
+
const notification = new Notifications(dvtService);
|
|
211
213
|
|
|
212
214
|
return {
|
|
213
215
|
remoteXPC: remoteXPC as RemoteXpcConnection,
|
|
@@ -218,6 +220,7 @@ export async function startDVTService(
|
|
|
218
220
|
appListing,
|
|
219
221
|
graphics,
|
|
220
222
|
deviceInfo,
|
|
223
|
+
notification,
|
|
221
224
|
};
|
|
222
225
|
}
|
|
223
226
|
|