appium-ios-remotexpc 5.1.2 → 5.1.4
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/apple-tv/storage/pairing-storage.d.ts +1 -1
- package/build/src/lib/apple-tv/storage/pairing-storage.d.ts.map +1 -1
- package/build/src/lib/apple-tv/storage/pairing-storage.js +20 -14
- package/build/src/lib/apple-tv/storage/pairing-storage.js.map +1 -1
- package/package.json +2 -2
- package/scripts/start-appletv-tunnel.mjs +1 -0
- package/src/lib/apple-tv/storage/pairing-storage.ts +21 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [5.1.4](https://github.com/appium/appium-ios-remotexpc/compare/v5.1.3...v5.1.4) (2026-06-20)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* Loading pair records from strongbox ([#243](https://github.com/appium/appium-ios-remotexpc/issues/243)) ([5ae772f](https://github.com/appium/appium-ios-remotexpc/commit/5ae772f81becc419b74eb7e90422f1d11889726a))
|
|
6
|
+
|
|
7
|
+
## [5.1.3](https://github.com/appium/appium-ios-remotexpc/compare/v5.1.2...v5.1.3) (2026-06-20)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* reuse discovered devices when starting Apple TV tunnels ([c2ff387](https://github.com/appium/appium-ios-remotexpc/commit/c2ff38731e3eb16c994b337fd277f3fde2a3309d))
|
|
12
|
+
|
|
1
13
|
## [5.1.2](https://github.com/appium/appium-ios-remotexpc/compare/v5.1.1...v5.1.2) (2026-06-19)
|
|
2
14
|
|
|
3
15
|
### Bug Fixes
|
|
@@ -4,11 +4,11 @@ import type { PairRecord, PairingStorageInterface } from './types.js';
|
|
|
4
4
|
export declare class PairingStorage implements PairingStorageInterface {
|
|
5
5
|
private readonly config;
|
|
6
6
|
private readonly box;
|
|
7
|
-
private strongboxDir?;
|
|
8
7
|
constructor(config: PairingConfig);
|
|
9
8
|
save(deviceId: string, ltpk: Buffer, ltsk: Buffer, remoteUnlockHostKey?: string): Promise<string>;
|
|
10
9
|
load(deviceId: string): Promise<PairRecord | null>;
|
|
11
10
|
getAvailableDeviceIds(): Promise<string[]>;
|
|
12
11
|
private createPlistContent;
|
|
12
|
+
private getStrongboxSlugPrefix;
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=pairing-storage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pairing-storage.d.ts","sourceRoot":"","sources":["../../../../../src/lib/apple-tv/storage/pairing-storage.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAItE,uEAAuE;AACvE,qBAAa,cAAe,YAAW,uBAAuB;
|
|
1
|
+
{"version":3,"file":"pairing-storage.d.ts","sourceRoot":"","sources":["../../../../../src/lib/apple-tv/storage/pairing-storage.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAItE,uEAAuE;AACvE,qBAAa,cAAe,YAAW,uBAAuB;IAGhD,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAEQ,MAAM,EAAE,aAAa;IAI5C,IAAI,CACR,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,mBAAmB,SAAK,GACvB,OAAO,CAAC,MAAM,CAAC;IAyBZ,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAqClD,qBAAqB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAyBhD,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,sBAAsB;CAK/B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseItem, strongbox } from '@appium/strongbox';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { util } from '@appium/support';
|
|
3
|
+
import { basename } from 'node:path';
|
|
4
4
|
import { APPLETV_PAIRING_PREFIX, STRONGBOX_CONTAINER_NAME, } from '../../../constants.js';
|
|
5
5
|
import { getLogger } from '../../logger.js';
|
|
6
6
|
import { createXmlPlist, parseXmlPlist } from '../../plist/index.js';
|
|
@@ -10,7 +10,6 @@ const log = getLogger('PairingStorage');
|
|
|
10
10
|
export class PairingStorage {
|
|
11
11
|
config;
|
|
12
12
|
box;
|
|
13
|
-
strongboxDir;
|
|
14
13
|
constructor(config) {
|
|
15
14
|
this.config = config;
|
|
16
15
|
this.box = strongbox(STRONGBOX_CONTAINER_NAME);
|
|
@@ -62,18 +61,20 @@ export class PairingStorage {
|
|
|
62
61
|
}
|
|
63
62
|
async getAvailableDeviceIds() {
|
|
64
63
|
try {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
const deviceIds = new Set();
|
|
65
|
+
const slugPrefix = this.getStrongboxSlugPrefix();
|
|
66
|
+
for (const item of await this.box.listItems()) {
|
|
67
|
+
for (const itemName of [item.name, basename(item.id)]) {
|
|
68
|
+
if (itemName.startsWith(APPLETV_PAIRING_PREFIX)) {
|
|
69
|
+
deviceIds.add(itemName.slice(APPLETV_PAIRING_PREFIX.length));
|
|
70
|
+
}
|
|
71
|
+
else if (itemName.startsWith(slugPrefix)) {
|
|
72
|
+
deviceIds.add(itemName.slice(slugPrefix.length));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
70
75
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
.filter((file) => file.startsWith(APPLETV_PAIRING_PREFIX))
|
|
74
|
-
.map((file) => file.replace(APPLETV_PAIRING_PREFIX, ''));
|
|
75
|
-
log.debug(`Found ${deviceIds.length} pair record(s): ${deviceIds.join(', ')}`);
|
|
76
|
-
return deviceIds;
|
|
76
|
+
log.debug(`Found ${util.pluralize('pair record', deviceIds.size, true)}: ${[...deviceIds].join(', ')}`);
|
|
77
|
+
return [...deviceIds];
|
|
77
78
|
}
|
|
78
79
|
catch (error) {
|
|
79
80
|
log.debug('Error getting available device IDs:', error);
|
|
@@ -87,5 +88,10 @@ export class PairingStorage {
|
|
|
87
88
|
remote_unlock_host_key: remoteUnlockHostKey,
|
|
88
89
|
});
|
|
89
90
|
}
|
|
91
|
+
getStrongboxSlugPrefix() {
|
|
92
|
+
const sentinel = 'x';
|
|
93
|
+
const item = new BaseItem(`${APPLETV_PAIRING_PREFIX}${sentinel}`, this.box);
|
|
94
|
+
return basename(item.id).slice(0, -sentinel.length);
|
|
95
|
+
}
|
|
90
96
|
}
|
|
91
97
|
//# sourceMappingURL=pairing-storage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pairing-storage.js","sourceRoot":"","sources":["../../../../../src/lib/apple-tv/storage/pairing-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"pairing-storage.js","sourceRoot":"","sources":["../../../../../src/lib/apple-tv/storage/pairing-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EACL,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,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GAAG,CAAC;QACrB,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,GAAG,sBAAsB,GAAG,QAAQ,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5E,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appium-ios-remotexpc",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.4",
|
|
4
4
|
"main": "build/src/index.js",
|
|
5
5
|
"types": "build/src/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"typescript": "^6.0.2"
|
|
103
103
|
},
|
|
104
104
|
"dependencies": {
|
|
105
|
-
"@appium/strongbox": "^1.
|
|
105
|
+
"@appium/strongbox": "^1.1.2",
|
|
106
106
|
"@appium/support": "^7.2.2",
|
|
107
107
|
"@xmldom/xmldom": "^0.x",
|
|
108
108
|
"appium-ios-tuntap": "^1.0.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseItem, strongbox } from '@appium/strongbox';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { util } from '@appium/support';
|
|
3
|
+
import { basename } from 'node:path';
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
APPLETV_PAIRING_PREFIX,
|
|
@@ -17,7 +17,6 @@ const log = getLogger('PairingStorage');
|
|
|
17
17
|
/** Manages persistent storage of pairing credentials as plist files */
|
|
18
18
|
export class PairingStorage implements PairingStorageInterface {
|
|
19
19
|
private readonly box;
|
|
20
|
-
private strongboxDir?: string;
|
|
21
20
|
|
|
22
21
|
constructor(private readonly config: PairingConfig) {
|
|
23
22
|
this.box = strongbox(STRONGBOX_CONTAINER_NAME);
|
|
@@ -92,22 +91,23 @@ export class PairingStorage implements PairingStorageInterface {
|
|
|
92
91
|
|
|
93
92
|
async getAvailableDeviceIds(): Promise<string[]> {
|
|
94
93
|
try {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
94
|
+
const deviceIds = new Set<string>();
|
|
95
|
+
const slugPrefix = this.getStrongboxSlugPrefix();
|
|
96
|
+
|
|
97
|
+
for (const item of await this.box.listItems()) {
|
|
98
|
+
for (const itemName of [item.name, basename(item.id)]) {
|
|
99
|
+
if (itemName.startsWith(APPLETV_PAIRING_PREFIX)) {
|
|
100
|
+
deviceIds.add(itemName.slice(APPLETV_PAIRING_PREFIX.length));
|
|
101
|
+
} else if (itemName.startsWith(slugPrefix)) {
|
|
102
|
+
deviceIds.add(itemName.slice(slugPrefix.length));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
100
105
|
}
|
|
101
106
|
|
|
102
|
-
const files = await readdir(this.strongboxDir);
|
|
103
|
-
const deviceIds = files
|
|
104
|
-
.filter((file: string) => file.startsWith(APPLETV_PAIRING_PREFIX))
|
|
105
|
-
.map((file: string) => file.replace(APPLETV_PAIRING_PREFIX, ''));
|
|
106
|
-
|
|
107
107
|
log.debug(
|
|
108
|
-
`Found ${
|
|
108
|
+
`Found ${util.pluralize('pair record', deviceIds.size, true)}: ${[...deviceIds].join(', ')}`,
|
|
109
109
|
);
|
|
110
|
-
return deviceIds;
|
|
110
|
+
return [...deviceIds];
|
|
111
111
|
} catch (error) {
|
|
112
112
|
log.debug('Error getting available device IDs:', error);
|
|
113
113
|
return [];
|
|
@@ -125,4 +125,10 @@ export class PairingStorage implements PairingStorageInterface {
|
|
|
125
125
|
remote_unlock_host_key: remoteUnlockHostKey,
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
+
|
|
129
|
+
private getStrongboxSlugPrefix(): string {
|
|
130
|
+
const sentinel = 'x';
|
|
131
|
+
const item = new BaseItem(`${APPLETV_PAIRING_PREFIX}${sentinel}`, this.box);
|
|
132
|
+
return basename(item.id).slice(0, -sentinel.length);
|
|
133
|
+
}
|
|
128
134
|
}
|