appium-ios-remotexpc 0.11.0 → 0.13.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/README.md +28 -0
- package/build/src/constants.d.ts +2 -0
- package/build/src/constants.d.ts.map +1 -0
- package/build/src/constants.js +3 -0
- package/build/src/index.d.ts +2 -1
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +2 -1
- package/build/src/lib/apple-tv/constants.d.ts +0 -1
- package/build/src/lib/apple-tv/constants.d.ts.map +1 -1
- package/build/src/lib/apple-tv/constants.js +0 -1
- package/build/src/lib/apple-tv/discovery/device-discovery.d.ts +10 -0
- package/build/src/lib/apple-tv/discovery/device-discovery.d.ts.map +1 -0
- package/build/src/lib/apple-tv/discovery/device-discovery.js +22 -0
- package/build/src/lib/apple-tv/discovery/index.d.ts +2 -0
- package/build/src/lib/apple-tv/discovery/index.d.ts.map +1 -0
- package/build/src/lib/apple-tv/discovery/index.js +1 -0
- package/build/src/lib/apple-tv/encryption/chacha20-poly1305.js +2 -2
- package/build/src/lib/apple-tv/encryption/ed25519.js +2 -2
- package/build/src/lib/apple-tv/encryption/hkdf.js +2 -2
- package/build/src/lib/apple-tv/index.d.ts +5 -0
- package/build/src/lib/apple-tv/index.d.ts.map +1 -1
- package/build/src/lib/apple-tv/index.js +5 -0
- package/build/src/lib/apple-tv/network/constants.d.ts +10 -0
- package/build/src/lib/apple-tv/network/constants.d.ts.map +1 -0
- package/build/src/lib/apple-tv/network/constants.js +9 -0
- package/build/src/lib/apple-tv/network/index.d.ts +4 -0
- package/build/src/lib/apple-tv/network/index.d.ts.map +1 -0
- package/build/src/lib/apple-tv/network/index.js +2 -0
- package/build/src/lib/apple-tv/network/network-client.d.ts +16 -0
- package/build/src/lib/apple-tv/network/network-client.d.ts.map +1 -0
- package/build/src/lib/apple-tv/network/network-client.js +169 -0
- package/build/src/lib/apple-tv/network/types.d.ts +8 -0
- package/build/src/lib/apple-tv/network/types.d.ts.map +1 -0
- package/build/src/lib/apple-tv/network/types.js +1 -0
- package/build/src/lib/apple-tv/pairing/index.d.ts +3 -0
- package/build/src/lib/apple-tv/pairing/index.d.ts.map +1 -0
- package/build/src/lib/apple-tv/pairing/index.js +2 -0
- package/build/src/lib/apple-tv/pairing/pairing-service.d.ts +15 -0
- package/build/src/lib/apple-tv/pairing/pairing-service.d.ts.map +1 -0
- package/build/src/lib/apple-tv/pairing/pairing-service.js +112 -0
- package/build/src/lib/apple-tv/pairing/user-input-service.d.ts +8 -0
- package/build/src/lib/apple-tv/pairing/user-input-service.d.ts.map +1 -0
- package/build/src/lib/apple-tv/pairing/user-input-service.js +61 -0
- package/build/src/lib/apple-tv/pairing-protocol/constants.d.ts +18 -0
- package/build/src/lib/apple-tv/pairing-protocol/constants.d.ts.map +1 -0
- package/build/src/lib/apple-tv/pairing-protocol/constants.js +17 -0
- package/build/src/lib/apple-tv/pairing-protocol/index.d.ts +4 -0
- package/build/src/lib/apple-tv/pairing-protocol/index.d.ts.map +1 -0
- package/build/src/lib/apple-tv/pairing-protocol/index.js +2 -0
- package/build/src/lib/apple-tv/pairing-protocol/pairing-protocol.d.ts +159 -0
- package/build/src/lib/apple-tv/pairing-protocol/pairing-protocol.d.ts.map +1 -0
- package/build/src/lib/apple-tv/pairing-protocol/pairing-protocol.js +494 -0
- package/build/src/lib/apple-tv/pairing-protocol/types.d.ts +57 -0
- package/build/src/lib/apple-tv/pairing-protocol/types.d.ts.map +1 -0
- package/build/src/lib/apple-tv/pairing-protocol/types.js +1 -0
- package/build/src/lib/apple-tv/srp/srp-client.js +2 -2
- package/build/src/lib/apple-tv/storage/index.d.ts +3 -0
- package/build/src/lib/apple-tv/storage/index.d.ts.map +1 -0
- package/build/src/lib/apple-tv/storage/index.js +1 -0
- package/build/src/lib/apple-tv/storage/pairing-storage.d.ts +12 -0
- package/build/src/lib/apple-tv/storage/pairing-storage.d.ts.map +1 -0
- package/build/src/lib/apple-tv/storage/pairing-storage.js +36 -0
- package/build/src/lib/apple-tv/storage/types.d.ts +5 -0
- package/build/src/lib/apple-tv/storage/types.d.ts.map +1 -0
- package/build/src/lib/apple-tv/storage/types.js +1 -0
- package/build/src/lib/apple-tv/types.d.ts +0 -1
- package/build/src/lib/apple-tv/types.d.ts.map +1 -1
- package/build/src/lib/bonjour/bonjour-discovery.d.ts.map +1 -1
- package/build/src/lib/bonjour/bonjour-discovery.js +4 -2
- package/build/src/lib/lockdown/index.d.ts.map +1 -1
- package/build/src/lib/lockdown/index.js +4 -4
- package/build/src/lib/logger.d.ts +2 -0
- package/build/src/lib/logger.d.ts.map +1 -0
- package/build/src/lib/logger.js +7 -0
- package/build/src/lib/pair-record/pair-record.d.ts.map +1 -1
- package/build/src/lib/pair-record/pair-record.js +2 -2
- package/build/src/lib/plist/binary-plist-parser.d.ts.map +1 -1
- package/build/src/lib/plist/binary-plist-parser.js +2 -2
- package/build/src/lib/plist/length-based-splitter.d.ts.map +1 -1
- package/build/src/lib/plist/length-based-splitter.js +2 -2
- package/build/src/lib/plist/plist-decoder.d.ts.map +1 -1
- package/build/src/lib/plist/plist-decoder.js +2 -2
- package/build/src/lib/plist/plist-parser.js +2 -2
- package/build/src/lib/plist/plist-service.d.ts.map +1 -1
- package/build/src/lib/plist/plist-service.js +3 -3
- package/build/src/lib/remote-xpc/remote-xpc-connection.js +2 -2
- package/build/src/lib/tss/index.js +2 -2
- package/build/src/lib/tunnel/index.d.ts.map +1 -1
- package/build/src/lib/tunnel/index.js +2 -2
- package/build/src/lib/tunnel/packet-stream-client.d.ts.map +1 -1
- package/build/src/lib/tunnel/packet-stream-client.js +2 -2
- package/build/src/lib/tunnel/packet-stream-server.d.ts.map +1 -1
- package/build/src/lib/tunnel/packet-stream-server.js +2 -2
- package/build/src/lib/tunnel/tunnel-api-client.d.ts.map +1 -1
- package/build/src/lib/tunnel/tunnel-api-client.js +2 -2
- package/build/src/lib/tunnel/tunnel-registry-server.js +2 -2
- package/build/src/lib/usbmux/index.d.ts.map +1 -1
- package/build/src/lib/usbmux/index.js +2 -2
- package/build/src/services/ios/afc/index.d.ts.map +1 -1
- package/build/src/services/ios/afc/index.js +2 -2
- package/build/src/services/ios/base-service.d.ts.map +1 -1
- package/build/src/services/ios/base-service.js +2 -2
- package/build/src/services/ios/diagnostic-service/index.d.ts.map +1 -1
- package/build/src/services/ios/diagnostic-service/index.js +2 -2
- package/build/src/services/ios/mobile-config/index.d.ts.map +1 -1
- package/build/src/services/ios/mobile-config/index.js +3 -2
- package/build/src/services/ios/mobile-image-mounter/index.js +2 -2
- package/build/src/services/ios/notification-proxy/index.d.ts.map +1 -1
- package/build/src/services/ios/notification-proxy/index.js +2 -2
- package/build/src/services/ios/power-assertion/index.d.ts.map +1 -1
- package/build/src/services/ios/power-assertion/index.js +2 -2
- package/build/src/services/ios/syslog-service/index.d.ts.map +1 -1
- package/build/src/services/ios/syslog-service/index.js +3 -3
- package/build/src/services/ios/tunnel-service/index.d.ts.map +1 -1
- package/build/src/services/ios/tunnel-service/index.js +2 -2
- package/build/src/services/ios/webinspector/index.js +2 -2
- package/package.json +4 -2
- package/scripts/pair-appletv.ts +79 -0
- package/scripts/test-tunnel-creation.ts +1 -1
- package/src/constants.ts +4 -0
- package/src/index.ts +2 -0
- package/src/lib/apple-tv/constants.ts +0 -1
- package/src/lib/apple-tv/discovery/device-discovery.ts +34 -0
- package/src/lib/apple-tv/discovery/index.ts +1 -0
- package/src/lib/apple-tv/encryption/chacha20-poly1305.ts +2 -2
- package/src/lib/apple-tv/encryption/ed25519.ts +2 -2
- package/src/lib/apple-tv/encryption/hkdf.ts +2 -2
- package/src/lib/apple-tv/index.ts +5 -0
- package/src/lib/apple-tv/network/constants.ts +9 -0
- package/src/lib/apple-tv/network/index.ts +3 -0
- package/src/lib/apple-tv/network/network-client.ts +214 -0
- package/src/lib/apple-tv/network/types.ts +7 -0
- package/src/lib/apple-tv/pairing/index.ts +2 -0
- package/src/lib/apple-tv/pairing/pairing-service.ts +175 -0
- package/src/lib/apple-tv/pairing/user-input-service.ts +71 -0
- package/src/lib/apple-tv/pairing-protocol/constants.ts +19 -0
- package/src/lib/apple-tv/pairing-protocol/index.ts +8 -0
- package/src/lib/apple-tv/pairing-protocol/pairing-protocol.ts +636 -0
- package/src/lib/apple-tv/pairing-protocol/types.ts +60 -0
- package/src/lib/apple-tv/srp/srp-client.ts +2 -2
- package/src/lib/apple-tv/storage/index.ts +2 -0
- package/src/lib/apple-tv/storage/pairing-storage.ts +60 -0
- package/src/lib/apple-tv/storage/types.ts +9 -0
- package/src/lib/apple-tv/types.ts +0 -1
- package/src/lib/bonjour/bonjour-discovery.ts +4 -2
- package/src/lib/lockdown/index.ts +4 -4
- package/src/lib/logger.ts +9 -0
- package/src/lib/pair-record/pair-record.ts +3 -2
- package/src/lib/plist/binary-plist-parser.ts +2 -3
- package/src/lib/plist/length-based-splitter.ts +2 -2
- package/src/lib/plist/plist-decoder.ts +2 -2
- package/src/lib/plist/plist-parser.ts +2 -2
- package/src/lib/plist/plist-service.ts +3 -3
- package/src/lib/remote-xpc/remote-xpc-connection.ts +2 -2
- package/src/lib/tss/index.ts +2 -2
- package/src/lib/tunnel/index.ts +2 -2
- package/src/lib/tunnel/packet-stream-client.ts +3 -2
- package/src/lib/tunnel/packet-stream-server.ts +3 -2
- package/src/lib/tunnel/tunnel-api-client.ts +2 -3
- package/src/lib/tunnel/tunnel-registry-server.ts +2 -2
- package/src/lib/usbmux/index.ts +2 -2
- package/src/services/ios/afc/index.ts +2 -2
- package/src/services/ios/base-service.ts +2 -3
- package/src/services/ios/diagnostic-service/index.ts +2 -3
- package/src/services/ios/mobile-config/index.ts +3 -2
- package/src/services/ios/mobile-image-mounter/index.ts +2 -2
- package/src/services/ios/notification-proxy/index.ts +2 -3
- package/src/services/ios/power-assertion/index.ts +2 -3
- package/src/services/ios/syslog-service/index.ts +3 -3
- package/src/services/ios/tunnel-service/index.ts +2 -2
- package/src/services/ios/webinspector/index.ts +2 -2
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { strongbox } from '@appium/strongbox';
|
|
2
|
+
import { logger } from '@appium/support';
|
|
3
|
+
|
|
4
|
+
import { STRONGBOX_CONTAINER_NAME } from '../../../constants.js';
|
|
5
|
+
import { createXmlPlist } from '../../plist/index.js';
|
|
6
|
+
import { PairingError } from '../errors.js';
|
|
7
|
+
import type { PairingConfig } from '../types.js';
|
|
8
|
+
import type { PairingStorageInterface } from './types.js';
|
|
9
|
+
|
|
10
|
+
/** Manages persistent storage of pairing credentials as plist files */
|
|
11
|
+
export class PairingStorage implements PairingStorageInterface {
|
|
12
|
+
private readonly log = logger.getLogger('PairingStorage');
|
|
13
|
+
private readonly box;
|
|
14
|
+
|
|
15
|
+
constructor(private readonly config: PairingConfig) {
|
|
16
|
+
this.box = strongbox(STRONGBOX_CONTAINER_NAME);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async save(
|
|
20
|
+
deviceId: string,
|
|
21
|
+
ltpk: Buffer,
|
|
22
|
+
ltsk: Buffer,
|
|
23
|
+
remoteUnlockHostKey = '',
|
|
24
|
+
): Promise<string> {
|
|
25
|
+
try {
|
|
26
|
+
const itemName = `appletv_pairing_${deviceId}`;
|
|
27
|
+
const plistContent = this.createPlistContent(
|
|
28
|
+
ltpk,
|
|
29
|
+
ltsk,
|
|
30
|
+
remoteUnlockHostKey,
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const item = await this.box.createItemWithValue(itemName, plistContent);
|
|
34
|
+
const itemPath = item.id;
|
|
35
|
+
|
|
36
|
+
this.log.info(`Pairing record saved to: ${itemPath}`);
|
|
37
|
+
|
|
38
|
+
return itemPath;
|
|
39
|
+
} catch (error) {
|
|
40
|
+
this.log.error('Save pairing record error:', error);
|
|
41
|
+
throw new PairingError(
|
|
42
|
+
'Failed to save pairing record',
|
|
43
|
+
'SAVE_ERROR',
|
|
44
|
+
error,
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private createPlistContent(
|
|
50
|
+
publicKey: Buffer,
|
|
51
|
+
privateKey: Buffer,
|
|
52
|
+
remoteUnlockHostKey: string,
|
|
53
|
+
): string {
|
|
54
|
+
return createXmlPlist({
|
|
55
|
+
private_key: privateKey,
|
|
56
|
+
public_key: publicKey,
|
|
57
|
+
remote_unlock_host_key: remoteUnlockHostKey,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import { type ChildProcess, spawn } from 'node:child_process';
|
|
3
2
|
import { lookup } from 'node:dns/promises';
|
|
4
3
|
import { EventEmitter } from 'node:events';
|
|
5
4
|
import { clearTimeout, setTimeout } from 'node:timers';
|
|
6
5
|
import { setTimeout as delay } from 'node:timers/promises';
|
|
7
6
|
|
|
7
|
+
import { getLogger } from '../logger.js';
|
|
8
8
|
import {
|
|
9
9
|
BONJOUR_DEFAULT_DOMAIN,
|
|
10
10
|
BONJOUR_SERVICE_TYPES,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
DNS_SD_PATTERNS,
|
|
15
15
|
} from './constants.js';
|
|
16
16
|
|
|
17
|
-
const log =
|
|
17
|
+
const log = getLogger('BonjourDiscovery');
|
|
18
18
|
|
|
19
19
|
const DNS_SD_COMMAND = 'dns-sd';
|
|
20
20
|
|
|
@@ -522,6 +522,8 @@ export class BonjourDiscovery extends EventEmitter {
|
|
|
522
522
|
return devices;
|
|
523
523
|
} finally {
|
|
524
524
|
this.stopBrowsing();
|
|
525
|
+
// Small delay to ensure cleanup logs are flushed before returning
|
|
526
|
+
await delay(100);
|
|
525
527
|
}
|
|
526
528
|
}
|
|
527
529
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import { Socket } from 'node:net';
|
|
3
2
|
import tls, { type ConnectionOptions, TLSSocket } from 'tls';
|
|
4
3
|
|
|
5
4
|
import { BasePlistService } from '../../base-plist-service.js';
|
|
5
|
+
import { getLogger } from '../logger.js';
|
|
6
6
|
import { type PairRecord } from '../pair-record/index.js';
|
|
7
7
|
import { PlistService } from '../plist/plist-service.js';
|
|
8
8
|
import type { PlistMessage, PlistValue } from '../types.js';
|
|
9
9
|
import { RelayService, createUsbmux } from '../usbmux/index.js';
|
|
10
10
|
|
|
11
|
-
const log =
|
|
11
|
+
const log = getLogger('Lockdown');
|
|
12
12
|
|
|
13
13
|
// Constants
|
|
14
14
|
const LABEL = 'appium-internal';
|
|
@@ -86,7 +86,7 @@ class DeviceNotFoundError extends Error {
|
|
|
86
86
|
|
|
87
87
|
// TLS Manager for handling TLS operations
|
|
88
88
|
class TLSManager {
|
|
89
|
-
private readonly log =
|
|
89
|
+
private readonly log = getLogger('TLSManager');
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* Upgrades a socket to TLS
|
|
@@ -127,7 +127,7 @@ class TLSManager {
|
|
|
127
127
|
|
|
128
128
|
// Device Manager for handling device operations
|
|
129
129
|
class DeviceManager {
|
|
130
|
-
private readonly log =
|
|
130
|
+
private readonly log = getLogger('DeviceManager');
|
|
131
131
|
|
|
132
132
|
/**
|
|
133
133
|
* Lists all connected devices
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import fs from 'fs';
|
|
3
2
|
import path from 'path';
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
import { getLogger } from '../logger.js';
|
|
5
|
+
|
|
6
|
+
const log = getLogger('PairRecord');
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Interface defining the structure of a pair record.
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
* This module provides functionality to parse binary property lists (bplists)
|
|
5
5
|
* commonly used in Apple's iOS and macOS systems.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
8
|
-
|
|
7
|
+
import { getLogger } from '../logger.js';
|
|
9
8
|
import type { PlistArray, PlistDictionary, PlistValue } from '../types.js';
|
|
10
9
|
import {
|
|
11
10
|
APPLE_EPOCH_OFFSET,
|
|
@@ -14,7 +13,7 @@ import {
|
|
|
14
13
|
BPLIST_TYPE,
|
|
15
14
|
} from './constants.js';
|
|
16
15
|
|
|
17
|
-
const log =
|
|
16
|
+
const log = getLogger('Plist');
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
19
|
* Represents a temporary object during binary plist parsing
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import { Transform, type TransformCallback } from 'stream';
|
|
3
2
|
|
|
3
|
+
import { getLogger } from '../logger.js';
|
|
4
4
|
import {
|
|
5
5
|
BINARY_PLIST_HEADER_LENGTH,
|
|
6
6
|
BINARY_PLIST_MAGIC,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from './constants.js';
|
|
17
17
|
import { isXmlPlistContent } from './utils.js';
|
|
18
18
|
|
|
19
|
-
const log =
|
|
19
|
+
const log = getLogger('Plist');
|
|
20
20
|
|
|
21
21
|
// Constants
|
|
22
22
|
const DEFAULT_MAX_FRAME_LENGTH = 100 * 1024 * 1024; // 100MB default for large IORegistry responses
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import { Transform, type TransformCallback } from 'stream';
|
|
3
2
|
|
|
3
|
+
import { getLogger } from '../logger.js';
|
|
4
4
|
import { UTF8_ENCODING } from './constants.js';
|
|
5
5
|
import { parsePlist } from './unified-plist-parser.js';
|
|
6
6
|
import {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
hasUnicodeReplacementCharacter,
|
|
11
11
|
} from './utils.js';
|
|
12
12
|
|
|
13
|
-
const log =
|
|
13
|
+
const log = getLogger('Plist');
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Decodes plist format data with length prefix to JavaScript objects
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import { DOMParser, Element, Node } from '@xmldom/xmldom';
|
|
3
2
|
|
|
3
|
+
import { getLogger } from '../logger.js';
|
|
4
4
|
import type { PlistArray, PlistDictionary, PlistValue } from '../types.js';
|
|
5
5
|
import { PlistService } from './plist-service.js';
|
|
6
6
|
import {
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
trimBeforeXmlDeclaration,
|
|
15
15
|
} from './utils.js';
|
|
16
16
|
|
|
17
|
-
const errorLog =
|
|
17
|
+
const errorLog = getLogger('PlistError');
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Parses an XML plist string into a JavaScript object
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import { Socket } from 'net';
|
|
3
2
|
import { TLSSocket } from 'tls';
|
|
4
3
|
|
|
4
|
+
import { getLogger } from '../logger.js';
|
|
5
5
|
import type { PlistDictionary } from '../types.js';
|
|
6
6
|
import { LengthBasedSplitter } from './length-based-splitter.js';
|
|
7
7
|
import { PlistServiceDecoder } from './plist-decoder.js';
|
|
8
8
|
import { PlistServiceEncoder } from './plist-encoder.js';
|
|
9
9
|
|
|
10
|
-
const log =
|
|
11
|
-
const errorLog =
|
|
10
|
+
const log = getLogger('Plist');
|
|
11
|
+
const errorLog = getLogger('PlistError');
|
|
12
12
|
|
|
13
13
|
const config = {
|
|
14
14
|
verboseErrorLogging: false,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import net from 'node:net';
|
|
3
2
|
|
|
3
|
+
import { getLogger } from '../logger.js';
|
|
4
4
|
import Handshake from './handshake.js';
|
|
5
5
|
|
|
6
|
-
const log =
|
|
6
|
+
const log = getLogger('RemoteXpcConnection');
|
|
7
7
|
|
|
8
8
|
// Timeout constants
|
|
9
9
|
const CONNECTION_TIMEOUT_MS = 30000; // 30 seconds
|
package/src/lib/tss/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import axios from 'axios';
|
|
3
2
|
import { randomUUID } from 'node:crypto';
|
|
4
3
|
|
|
4
|
+
import { getLogger } from '../logger.js';
|
|
5
5
|
import { createPlist, parsePlist } from '../plist/index.js';
|
|
6
6
|
import type { PlistDictionary } from '../types.js';
|
|
7
7
|
|
|
8
|
-
const log =
|
|
8
|
+
const log = getLogger('TSSRequestor');
|
|
9
9
|
|
|
10
10
|
// TSS Constants
|
|
11
11
|
const TSS_CONTROLLER_ACTION_URL = 'http://gs.apple.com/TSS/controller?action=2';
|
package/src/lib/tunnel/index.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import {
|
|
3
2
|
type TunnelConnection,
|
|
4
3
|
connectToTunnelLockdown,
|
|
5
4
|
} from 'appium-ios-tuntap';
|
|
6
5
|
import type { TLSSocket } from 'tls';
|
|
7
6
|
|
|
7
|
+
import { getLogger } from '../logger.js';
|
|
8
8
|
import { RemoteXpcConnection } from '../remote-xpc/remote-xpc-connection.js';
|
|
9
9
|
|
|
10
|
-
const log =
|
|
10
|
+
const log = getLogger('TunnelManager');
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Interface for tunnel registry entry
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import type { PacketConsumer, PacketData } from 'appium-ios-tuntap';
|
|
3
2
|
import { EventEmitter } from 'events';
|
|
4
3
|
import { type Socket, createConnection } from 'net';
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
import { getLogger } from '../logger.js';
|
|
6
|
+
|
|
7
|
+
const log = getLogger('PacketStreamClient');
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Constants for packet stream protocol
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import type { PacketConsumer, PacketData } from 'appium-ios-tuntap';
|
|
3
2
|
import { EventEmitter } from 'events';
|
|
4
3
|
import { type Server, type Socket, createServer } from 'net';
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
import { getLogger } from '../logger.js';
|
|
6
|
+
|
|
7
|
+
const log = getLogger('PacketStreamServer');
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Interface for serialized packet message
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { getLogger } from '../logger.js';
|
|
3
2
|
import type { TunnelRegistry, TunnelRegistryEntry } from '../types.js';
|
|
4
3
|
|
|
5
|
-
const log =
|
|
4
|
+
const log = getLogger('TunnelApiClient');
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* API client for tunnel registry operations
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import * as http from 'node:http';
|
|
3
2
|
import { URL } from 'node:url';
|
|
4
3
|
|
|
4
|
+
import { getLogger } from '../logger.js';
|
|
5
5
|
import type { TunnelRegistry, TunnelRegistryEntry } from '../types.js';
|
|
6
6
|
|
|
7
7
|
// Constants
|
|
@@ -9,7 +9,7 @@ const DEFAULT_TUNNEL_REGISTRY_PORT = 42314;
|
|
|
9
9
|
const API_BASE_PATH = '/remotexpc/tunnels';
|
|
10
10
|
|
|
11
11
|
// Logger instance
|
|
12
|
-
const log =
|
|
12
|
+
const log = getLogger('TunnelRegistryServer');
|
|
13
13
|
|
|
14
14
|
// Helper functions
|
|
15
15
|
/**
|
package/src/lib/usbmux/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import { Server, Socket, createConnection, createServer } from 'node:net';
|
|
3
2
|
import { release } from 'node:os';
|
|
4
3
|
|
|
5
4
|
import { BaseSocketService } from '../../base-socket-service.js';
|
|
5
|
+
import { getLogger } from '../logger.js';
|
|
6
6
|
import { type PairRecord, processPlistResponse } from '../pair-record/index.js';
|
|
7
7
|
import { type RawPairRecordResponse } from '../pair-record/pair-record.js';
|
|
8
8
|
import { LengthBasedSplitter, parsePlist } from '../plist/index.js';
|
|
@@ -32,7 +32,7 @@ export interface Device {
|
|
|
32
32
|
Properties: DeviceProperties;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
const log =
|
|
35
|
+
const log = getLogger('Usbmux');
|
|
36
36
|
|
|
37
37
|
export const USBMUXD_PORT = 27015;
|
|
38
38
|
export const DEFAULT_USBMUXD_SOCKET = '/var/run/usbmuxd';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import fs from 'node:fs';
|
|
3
2
|
import net from 'node:net';
|
|
4
3
|
import path from 'node:path';
|
|
5
4
|
import { Readable, Writable } from 'node:stream';
|
|
6
5
|
import { pipeline } from 'node:stream/promises';
|
|
7
6
|
|
|
7
|
+
import { getLogger } from '../../../lib/logger.js';
|
|
8
8
|
import {
|
|
9
9
|
buildClosePayload,
|
|
10
10
|
buildFopenPayload,
|
|
@@ -25,7 +25,7 @@ import { AFC_FOPEN_TEXTUAL_MODES, AFC_WRITE_THIS_LENGTH } from './constants.js';
|
|
|
25
25
|
import { AfcError, AfcFileMode, AfcOpcode } from './enums.js';
|
|
26
26
|
import { createAfcReadStream, createAfcWriteStream } from './stream-utils.js';
|
|
27
27
|
|
|
28
|
-
const log =
|
|
28
|
+
const log = getLogger('AfcService');
|
|
29
29
|
|
|
30
30
|
const NON_LISTABLE_ENTRIES = ['', '.', '..'];
|
|
31
31
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { getLogger } from '../../lib/logger.js';
|
|
3
2
|
import { ServiceConnection } from '../../service-connection.js';
|
|
4
3
|
|
|
5
|
-
const log =
|
|
4
|
+
const log = getLogger('BaseService');
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Interface for service information
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { getLogger } from '../../../lib/logger.js';
|
|
3
2
|
import { PlistServiceDecoder } from '../../../lib/plist/plist-decoder.js';
|
|
4
3
|
import type {
|
|
5
4
|
DiagnosticsService as DiagnosticsServiceInterface,
|
|
@@ -7,7 +6,7 @@ import type {
|
|
|
7
6
|
} from '../../../lib/types.js';
|
|
8
7
|
import { BaseService } from '../base-service.js';
|
|
9
8
|
|
|
10
|
-
const log =
|
|
9
|
+
const log = getLogger('DiagnosticService');
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* DiagnosticsService provides an API to:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { fs
|
|
1
|
+
import { fs } from '@appium/support';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
|
|
4
|
+
import { getLogger } from '../../../lib/logger.js';
|
|
4
5
|
import { SUPPORTED_EXTENSIONS } from '../../../lib/plist/constants.js';
|
|
5
6
|
import { createPlist, parsePlist } from '../../../lib/plist/index.js';
|
|
6
7
|
import {
|
|
@@ -11,7 +12,7 @@ import { ServiceConnection } from '../../../service-connection.js';
|
|
|
11
12
|
import { BaseService } from '../base-service.js';
|
|
12
13
|
|
|
13
14
|
const ERROR_CLOUD_CONFIGURATION_ALREADY_PRESENT = 14002;
|
|
14
|
-
const log =
|
|
15
|
+
const log = getLogger('MobileConfigService');
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* MobileConfigService provides an API to:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import { createHash } from 'crypto';
|
|
3
2
|
import { Stats, promises as fs } from 'fs';
|
|
4
3
|
import { performance } from 'perf_hooks';
|
|
5
4
|
import { Readable } from 'stream';
|
|
6
5
|
|
|
6
|
+
import { getLogger } from '../../../lib/logger.js';
|
|
7
7
|
import { parseXmlPlist } from '../../../lib/plist/index.js';
|
|
8
8
|
import { getManifestFromTSS } from '../../../lib/tss/index.js';
|
|
9
9
|
import type {
|
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
import { ServiceConnection } from '../../../service-connection.js';
|
|
14
14
|
import { BaseService } from '../base-service.js';
|
|
15
15
|
|
|
16
|
-
const log =
|
|
16
|
+
const log = getLogger('MobileImageMounterService');
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Base interface for service responses
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { getLogger } from '../../../lib/logger.js';
|
|
3
2
|
import type {
|
|
4
3
|
NotificationProxyService as NotificationProxyServiceInterface,
|
|
5
4
|
PlistDictionary,
|
|
@@ -8,7 +7,7 @@ import type {
|
|
|
8
7
|
import { ServiceConnection } from '../../../service-connection.js';
|
|
9
8
|
import { BaseService } from '../base-service.js';
|
|
10
9
|
|
|
11
|
-
const log =
|
|
10
|
+
const log = getLogger('NotificationProxyService');
|
|
12
11
|
|
|
13
12
|
export interface ObserveNotificationRequest extends PlistDictionary {
|
|
14
13
|
Command: 'ObserveNotification';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { getLogger } from '../../../lib/logger.js';
|
|
3
2
|
import type {
|
|
4
3
|
PlistDictionary,
|
|
5
4
|
PowerAssertionService as PowerAssertionServiceInterface,
|
|
@@ -7,7 +6,7 @@ import type {
|
|
|
7
6
|
import { ServiceConnection } from '../../../service-connection.js';
|
|
8
7
|
import { BaseService } from '../base-service.js';
|
|
9
8
|
|
|
10
|
-
const log =
|
|
9
|
+
const log = getLogger('PowerAssertionService');
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Power assertion types that can be used to prevent system sleep
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import type { PacketConsumer, PacketData } from 'appium-ios-tuntap';
|
|
3
2
|
import { EventEmitter } from 'events';
|
|
4
3
|
|
|
4
|
+
import { getLogger } from '../../../lib/logger.js';
|
|
5
5
|
import { isBinaryPlist } from '../../../lib/plist/binary-plist-parser.js';
|
|
6
6
|
import { parsePlist } from '../../../lib/plist/unified-plist-parser.js';
|
|
7
7
|
import type {
|
|
@@ -12,8 +12,8 @@ import type {
|
|
|
12
12
|
import { ServiceConnection } from '../../../service-connection.js';
|
|
13
13
|
import { BaseService, type Service } from '../base-service.js';
|
|
14
14
|
|
|
15
|
-
const syslogLog =
|
|
16
|
-
const log =
|
|
15
|
+
const syslogLog = getLogger('SyslogMessages');
|
|
16
|
+
const log = getLogger('Syslog');
|
|
17
17
|
|
|
18
18
|
const MIN_PRINTABLE_RATIO = 0.5;
|
|
19
19
|
const ASCII_PRINTABLE_MIN = 32;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import { TLSSocket } from 'tls';
|
|
3
2
|
|
|
4
3
|
import {
|
|
5
4
|
LockdownService,
|
|
6
5
|
upgradeSocketToTLS,
|
|
7
6
|
} from '../../../lib/lockdown/index.js';
|
|
7
|
+
import { getLogger } from '../../../lib/logger.js';
|
|
8
8
|
import { PlistService } from '../../../lib/plist/plist-service.js';
|
|
9
9
|
import { createUsbmux } from '../../../lib/usbmux/index.js';
|
|
10
10
|
|
|
11
|
-
const log =
|
|
11
|
+
const log = getLogger('TunnelService');
|
|
12
12
|
const LABEL = 'appium-internal';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { logger } from '@appium/support';
|
|
2
1
|
import { randomUUID } from 'crypto';
|
|
3
2
|
import { EventEmitter } from 'events';
|
|
4
3
|
|
|
4
|
+
import { getLogger } from '../../../lib/logger.js';
|
|
5
5
|
import type { PlistDictionary, PlistMessage } from '../../../lib/types.js';
|
|
6
6
|
import { ServiceConnection } from '../../../service-connection.js';
|
|
7
7
|
import { BaseService } from '../base-service.js';
|
|
8
8
|
|
|
9
|
-
const log =
|
|
9
|
+
const log = getLogger('WebInspectorService');
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Interface for WebInspector message structure
|