@mcesystems/apple-kit 1.0.78 → 1.0.80
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/dist/index.js +235 -143
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +231 -143
- package/dist/index.mjs.map +4 -4
- package/dist/types/index.d.ts +622 -10
- package/package.json +9 -7
- package/dist/resources/plist/ddm-managed-app.xml +0 -55
- package/dist/types/graphql/queries.d.ts +0 -9
- package/dist/types/graphql/queries.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/logic/actions/activation.d.ts +0 -12
- package/dist/types/logic/actions/activation.d.ts.map +0 -1
- package/dist/types/logic/actions/appState.d.ts +0 -2
- package/dist/types/logic/actions/appState.d.ts.map +0 -1
- package/dist/types/logic/actions/device.d.ts +0 -24
- package/dist/types/logic/actions/device.d.ts.map +0 -1
- package/dist/types/logic/actions/install.d.ts +0 -15
- package/dist/types/logic/actions/install.d.ts.map +0 -1
- package/dist/types/logic/actions/pair.d.ts +0 -6
- package/dist/types/logic/actions/pair.d.ts.map +0 -1
- package/dist/types/logic/actions/proxy.d.ts +0 -11
- package/dist/types/logic/actions/proxy.d.ts.map +0 -1
- package/dist/types/logic/actions/restore.d.ts +0 -36
- package/dist/types/logic/actions/restore.d.ts.map +0 -1
- package/dist/types/logic/actions/tool.d.ts +0 -8
- package/dist/types/logic/actions/tool.d.ts.map +0 -1
- package/dist/types/logic/actions/usbmuxd.d.ts +0 -10
- package/dist/types/logic/actions/usbmuxd.d.ts.map +0 -1
- package/dist/types/logic/activationFlow.d.ts +0 -16
- package/dist/types/logic/activationFlow.d.ts.map +0 -1
- package/dist/types/logic/appleDeviceKit.d.ts +0 -165
- package/dist/types/logic/appleDeviceKit.d.ts.map +0 -1
- package/dist/types/logic/dataParser.d.ts +0 -23
- package/dist/types/logic/dataParser.d.ts.map +0 -1
- package/dist/types/logic/iosCli.d.ts +0 -6
- package/dist/types/logic/iosCli.d.ts.map +0 -1
- package/dist/types/logic/iosClient.d.ts +0 -50
- package/dist/types/logic/iosClient.d.ts.map +0 -1
- package/dist/types/logic/profileParser.d.ts +0 -13
- package/dist/types/logic/profileParser.d.ts.map +0 -1
- package/dist/types/logic/utils/resolvePath.d.ts +0 -13
- package/dist/types/logic/utils/resolvePath.d.ts.map +0 -1
- package/dist/types/types/activation.d.ts +0 -28
- package/dist/types/types/activation.d.ts.map +0 -1
- package/dist/types/types/auth.d.ts +0 -13
- package/dist/types/types/auth.d.ts.map +0 -1
- package/dist/types/types/install.d.ts +0 -13
- package/dist/types/types/install.d.ts.map +0 -1
- package/dist/types/types/ios.d.ts +0 -166
- package/dist/types/types/ios.d.ts.map +0 -1
- package/dist/types/types/mdm.d.ts +0 -33
- package/dist/types/types/mdm.d.ts.map +0 -1
- package/dist/types/types/trust.d.ts +0 -10
- package/dist/types/types/trust.d.ts.map +0 -1
- package/dist/types/types/types.d.ts +0 -47
- package/dist/types/types/types.d.ts.map +0 -1
- package/dist/types/types/wifi.d.ts +0 -19
- package/dist/types/types/wifi.d.ts.map +0 -1
- package/dist/types/types.d.ts +0 -173
- package/dist/types/types.d.ts.map +0 -1
- package/dist/types/utils/authClient.d.ts +0 -7
- package/dist/types/utils/authClient.d.ts.map +0 -1
- package/dist/types/utils/ddmDeclaration.d.ts +0 -8
- package/dist/types/utils/ddmDeclaration.d.ts.map +0 -1
- package/dist/types/utils/debug.d.ts +0 -17
- package/dist/types/utils/debug.d.ts.map +0 -1
- package/dist/types/utils/installRawProfileRetry.d.ts +0 -7
- package/dist/types/utils/installRawProfileRetry.d.ts.map +0 -1
- package/dist/types/utils/mdmClient.d.ts +0 -7
- package/dist/types/utils/mdmClient.d.ts.map +0 -1
- package/dist/types/utils/templateLoader.d.ts +0 -8
- package/dist/types/utils/templateLoader.d.ts.map +0 -1
- package/dist/types/utils/trustProfile.d.ts +0 -12
- package/dist/types/utils/trustProfile.d.ts.map +0 -1
- package/dist/types/utils/wifiProfile.d.ts +0 -14
- package/dist/types/utils/wifiProfile.d.ts.map +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,14 +1,626 @@
|
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
+
|
|
3
|
+
import { ChildProcess } from 'node:child_process';
|
|
4
|
+
import { EventEmitter } from 'node:events';
|
|
5
|
+
|
|
6
|
+
export interface DeviceListOutput {
|
|
7
|
+
deviceList: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface IosCommandResult {
|
|
10
|
+
command: string;
|
|
11
|
+
args: string[];
|
|
12
|
+
output: CommandOutput;
|
|
13
|
+
logMessages: LogMessage[];
|
|
14
|
+
exitCode: number;
|
|
15
|
+
raw: {
|
|
16
|
+
stdout: string;
|
|
17
|
+
stderr: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface LogMessage {
|
|
21
|
+
level: "info" | "error" | "warn" | "debug";
|
|
22
|
+
msg: string;
|
|
23
|
+
time: string;
|
|
24
|
+
err?: string;
|
|
25
|
+
}
|
|
26
|
+
export type CommandOutput = Record<string, unknown>[] | DeviceListOutput[] | [
|
|
27
|
+
LockdownInfo
|
|
28
|
+
];
|
|
29
|
+
export interface IosListResult {
|
|
30
|
+
udids: string[];
|
|
31
|
+
raw: IosCommandResult;
|
|
32
|
+
}
|
|
33
|
+
export interface IosFsyncTreeResult {
|
|
34
|
+
/** File/directory names listed in the app container path (e.g. ["qr.png", "test.jpg"]) */
|
|
35
|
+
entries: string[];
|
|
36
|
+
raw: IosCommandResult;
|
|
37
|
+
}
|
|
38
|
+
export interface IosProfileManifest {
|
|
39
|
+
Description?: string;
|
|
40
|
+
IsActive?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface IosProfileMetadata {
|
|
43
|
+
PayloadDescription?: string;
|
|
44
|
+
PayloadDisplayName?: string;
|
|
45
|
+
PayloadRemovalDisallowed?: boolean;
|
|
46
|
+
PayloadUUID?: string;
|
|
47
|
+
PayloadVersion?: number;
|
|
48
|
+
}
|
|
49
|
+
export interface IosProfileListEntry {
|
|
50
|
+
Identifier?: string;
|
|
51
|
+
Manifest?: IosProfileManifest;
|
|
52
|
+
Metadata?: IosProfileMetadata;
|
|
53
|
+
Status?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface IosProfileListResult {
|
|
56
|
+
profiles: IosProfileListEntry[];
|
|
57
|
+
raw: IosCommandResult;
|
|
58
|
+
}
|
|
59
|
+
export interface BasebandKeyHashInformation {
|
|
60
|
+
AKeyStatus: number;
|
|
61
|
+
SKeyHash: string;
|
|
62
|
+
SKeyStatus: number;
|
|
63
|
+
}
|
|
64
|
+
export interface NonVolatileRAM {
|
|
65
|
+
StartupMute?: string;
|
|
66
|
+
SystemAudioVolumeSaved?: string;
|
|
67
|
+
"auto-boot"?: string;
|
|
68
|
+
"backlight-level"?: string;
|
|
69
|
+
"backlight-nits"?: string;
|
|
70
|
+
"boot-args"?: string;
|
|
71
|
+
bootdelay?: string;
|
|
72
|
+
"fm-account-masked"?: string;
|
|
73
|
+
"fm-activation-locked"?: string;
|
|
74
|
+
"fm-spkeys"?: string;
|
|
75
|
+
"fm-spstatus"?: string;
|
|
76
|
+
obliteration?: string;
|
|
77
|
+
"panicmedic-telemetry"?: string;
|
|
78
|
+
usbcfwflasherResult?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface LockdownInfo {
|
|
81
|
+
ActivationState: string;
|
|
82
|
+
ActivationStateAcknowledged: boolean;
|
|
83
|
+
BasebandActivationTicketVersion: string;
|
|
84
|
+
BasebandCertId: number;
|
|
85
|
+
BasebandChipID: number;
|
|
86
|
+
BasebandKeyHashInformation: BasebandKeyHashInformation;
|
|
87
|
+
BasebandMasterKeyHash: string;
|
|
88
|
+
BasebandRegionSKU: string;
|
|
89
|
+
BasebandSerialNumber: string;
|
|
90
|
+
BasebandStatus: string;
|
|
91
|
+
BasebandVersion: string;
|
|
92
|
+
BluetoothAddress: string;
|
|
93
|
+
BoardId: number;
|
|
94
|
+
BootSessionID: string;
|
|
95
|
+
BrickState: boolean;
|
|
96
|
+
BuildVersion: string;
|
|
97
|
+
CPUArchitecture: string;
|
|
98
|
+
CarrierBundleInfoArray: unknown[];
|
|
99
|
+
CertID: number;
|
|
100
|
+
ChipID: number;
|
|
101
|
+
ChipSerialNo: string;
|
|
102
|
+
DeviceClass: string;
|
|
103
|
+
DeviceColor: string;
|
|
104
|
+
DeviceName: string;
|
|
105
|
+
DieID: number;
|
|
106
|
+
EthernetAddress: string;
|
|
107
|
+
FirmwareVersion: string;
|
|
108
|
+
FusingStatus: number;
|
|
109
|
+
HardwareModel: string;
|
|
110
|
+
HardwarePlatform: string;
|
|
111
|
+
HasSiDP: boolean;
|
|
112
|
+
HostAttached: boolean;
|
|
113
|
+
HumanReadableProductVersionString: string;
|
|
114
|
+
InternationalMobileEquipmentIdentity: string;
|
|
115
|
+
InternationalMobileEquipmentIdentity2: string;
|
|
116
|
+
MLBSerialNumber: string;
|
|
117
|
+
MobileEquipmentIdentifier: string;
|
|
118
|
+
MobileSubscriberCountryCode: string;
|
|
119
|
+
MobileSubscriberNetworkCode: string;
|
|
120
|
+
ModelNumber: string;
|
|
121
|
+
NonVolatileRAM: NonVolatileRAM;
|
|
122
|
+
PairRecordProtectionClass: number;
|
|
123
|
+
PartitionType: string;
|
|
124
|
+
PasswordProtected: boolean;
|
|
125
|
+
PkHash: string;
|
|
126
|
+
ProductName: string;
|
|
127
|
+
ProductType: string;
|
|
128
|
+
ProductVersion: string;
|
|
129
|
+
ProductionSOC: boolean;
|
|
130
|
+
ProtocolVersion: string;
|
|
131
|
+
ProximitySensorCalibration: string;
|
|
132
|
+
RegionInfo: string;
|
|
133
|
+
ReleaseType: string;
|
|
134
|
+
SIMStatus: string;
|
|
135
|
+
SIMTrayStatus: string;
|
|
136
|
+
SerialNumber: string;
|
|
137
|
+
SoftwareBehavior: string;
|
|
138
|
+
SoftwareBundleVersion: string;
|
|
139
|
+
SupportedDeviceFamilies: number[];
|
|
140
|
+
TelephonyCapability: boolean;
|
|
141
|
+
TimeIntervalSince1970: number;
|
|
142
|
+
TimeZone: string;
|
|
143
|
+
TimeZoneOffsetFromUTC: number;
|
|
144
|
+
TrustedHostAttached: boolean;
|
|
145
|
+
UniqueChipID: number;
|
|
146
|
+
UniqueDeviceID: string;
|
|
147
|
+
UntrustedHostBUID: string;
|
|
148
|
+
UseRaptorCerts: boolean;
|
|
149
|
+
Uses24HourClock: boolean;
|
|
150
|
+
WiFiAddress: string;
|
|
151
|
+
WirelessBoardSerialNumber: string;
|
|
152
|
+
kCTPostponementInfoServiceProvisioningState: boolean;
|
|
153
|
+
kCTPostponementStatus: string;
|
|
154
|
+
}
|
|
1
155
|
/**
|
|
2
|
-
*
|
|
156
|
+
* Installed application info
|
|
157
|
+
*/
|
|
158
|
+
export interface AppInfo {
|
|
159
|
+
/**
|
|
160
|
+
* Bundle identifier (e.g., "com.example.app")
|
|
161
|
+
*/
|
|
162
|
+
bundleId: string;
|
|
163
|
+
/**
|
|
164
|
+
* Display name shown to user
|
|
165
|
+
*/
|
|
166
|
+
displayName: string;
|
|
167
|
+
/**
|
|
168
|
+
* App version (CFBundleShortVersionString)
|
|
169
|
+
*/
|
|
170
|
+
version: string;
|
|
171
|
+
/**
|
|
172
|
+
* Bundle version (CFBundleVersion)
|
|
173
|
+
*/
|
|
174
|
+
bundleVersion: string;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Port forwarding result
|
|
178
|
+
*/
|
|
179
|
+
export interface PortForwardResult {
|
|
180
|
+
/** The local port being forwarded */
|
|
181
|
+
localPort: number;
|
|
182
|
+
/** The device port being forwarded to */
|
|
183
|
+
devicePort: number;
|
|
184
|
+
}
|
|
185
|
+
export interface InstallAppMdmOptions {
|
|
186
|
+
appId?: string;
|
|
187
|
+
url?: string;
|
|
188
|
+
waitForInstalled?: boolean;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* AppleDeviceKit - iOS device operations wrapper
|
|
3
192
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* activation, and device property access.
|
|
193
|
+
* Uses idevice command-line tools for iOS device operations.
|
|
194
|
+
* Each instance is associated with a specific device by UDID.
|
|
7
195
|
*
|
|
8
|
-
*
|
|
196
|
+
* Port forwarding is managed automatically - each logical port (USB hub position)
|
|
197
|
+
* gets a dynamically allocated local port that is tracked and cleaned up on dispose.
|
|
198
|
+
*
|
|
199
|
+
* IMPORTANT: Call dispose() when the kit is no longer needed to clean up
|
|
200
|
+
* any running proxy processes and release port allocations.
|
|
201
|
+
*/
|
|
202
|
+
export declare class AppleDeviceKit {
|
|
203
|
+
private readonly logicalPort;
|
|
204
|
+
private deviceId;
|
|
205
|
+
private proxyProcess;
|
|
206
|
+
private localDevicePort;
|
|
207
|
+
private isDisposed;
|
|
208
|
+
private readonly iosClient;
|
|
209
|
+
private readonly deviceActions;
|
|
210
|
+
private readonly installActions;
|
|
211
|
+
private readonly activationFlow;
|
|
212
|
+
private readonly proxyActions;
|
|
213
|
+
private tunnelProcess;
|
|
214
|
+
constructor(udid: string, logicalPort: number, usbmuxdAddress?: string);
|
|
215
|
+
static setResourcesDir(dir: string): void;
|
|
216
|
+
/**
|
|
217
|
+
* Throws if the kit has been disposed
|
|
218
|
+
*/
|
|
219
|
+
private ensureNotDisposed;
|
|
220
|
+
info(): Promise<LockdownInfo>;
|
|
221
|
+
listDevices(): Promise<IosListResult>;
|
|
222
|
+
/**
|
|
223
|
+
* Wait for device to be paired
|
|
224
|
+
* Polls the pairing status until successful or timeout
|
|
225
|
+
*
|
|
226
|
+
* @param timeout Timeout in milliseconds (default: 120000)
|
|
227
|
+
* @param pollInterval Poll interval in milliseconds (default: 1000)
|
|
228
|
+
*/
|
|
229
|
+
waitForPairing(timeout?: number, pollInterval?: number, signal?: AbortSignal): Promise<boolean>;
|
|
230
|
+
/**
|
|
231
|
+
* Attempt to pair/trust the device
|
|
232
|
+
* User must accept the trust dialog on the device
|
|
233
|
+
*/
|
|
234
|
+
pair(): Promise<boolean>;
|
|
235
|
+
/**
|
|
236
|
+
* Trust/pair the device - initiates pairing and waits for user to accept
|
|
237
|
+
*
|
|
238
|
+
* This is the recommended method for establishing trust with a device.
|
|
239
|
+
* It will:
|
|
240
|
+
* 1. Check if already paired
|
|
241
|
+
* 2. If not, initiate pairing (shows "Trust This Computer?" on device)
|
|
242
|
+
* 3. Wait for user to accept the trust dialog
|
|
243
|
+
*
|
|
244
|
+
* @param timeout Timeout in milliseconds to wait for user acceptance (default: 60000)
|
|
245
|
+
* @param onWaitingForTrust Callback when waiting for user to accept trust dialog
|
|
246
|
+
* @returns true if device is now trusted
|
|
247
|
+
*/
|
|
248
|
+
trustDevice(timeout?: number, pollInterval?: number, onWaitingForTrust?: () => void, signal?: AbortSignal): Promise<boolean>;
|
|
249
|
+
/**
|
|
250
|
+
* Unpair/untrust the device
|
|
251
|
+
*/
|
|
252
|
+
unpair(): Promise<boolean>;
|
|
253
|
+
/**
|
|
254
|
+
* Install an IPA file on the device (install agent)
|
|
255
|
+
*
|
|
256
|
+
* @param ipaPath Path to the IPA file
|
|
257
|
+
*/
|
|
258
|
+
installApp(ipaPath: string, options: InstallAppMdmOptions): Promise<IosCommandResult>;
|
|
259
|
+
/**
|
|
260
|
+
* Uninstall an app by bundle ID (uninstall agent)
|
|
261
|
+
*
|
|
262
|
+
* @param bundleId Application bundle identifier
|
|
263
|
+
*/
|
|
264
|
+
uninstallApp(bundleId: string): Promise<IosCommandResult>;
|
|
265
|
+
/**
|
|
266
|
+
* Check if an app is installed on the device
|
|
267
|
+
*
|
|
268
|
+
* @param bundleId Application bundle identifier
|
|
269
|
+
*/
|
|
270
|
+
isAppInstalled(bundleId: string): Promise<boolean>;
|
|
271
|
+
/**
|
|
272
|
+
* List all installed user applications
|
|
273
|
+
*/
|
|
274
|
+
listApps(): Promise<AppInfo[]>;
|
|
275
|
+
/**
|
|
276
|
+
* Start port forwarding and wait for it to be ready.
|
|
277
|
+
* The local port is automatically allocated based on the logical port.
|
|
278
|
+
*
|
|
279
|
+
* We need port forwarding to be able to connect to the device from the computer
|
|
280
|
+
* and communicate with it using the local port.
|
|
281
|
+
*
|
|
282
|
+
* Note: Only one port forward can be active at a time per kit instance.
|
|
283
|
+
* Starting a new port forward will kill any existing one.
|
|
284
|
+
*
|
|
285
|
+
* @param devicePort Device port to forward to
|
|
286
|
+
* @param startupTimeout Time to wait for proxy to start (ms)
|
|
287
|
+
* @returns The port forward result with the allocated local port
|
|
288
|
+
*/
|
|
289
|
+
startPortForwardAsync(devicePort: number): Promise<PortForwardResult>;
|
|
290
|
+
/**
|
|
291
|
+
* Kill the current port forwarding process if running
|
|
292
|
+
*/
|
|
293
|
+
private killProxyProcess;
|
|
294
|
+
/**
|
|
295
|
+
* Close the current port forwarding session and release the port
|
|
296
|
+
*/
|
|
297
|
+
closePortForward(): void;
|
|
298
|
+
/**
|
|
299
|
+
* Wipe the device
|
|
300
|
+
*/
|
|
301
|
+
wipe(): Promise<void>;
|
|
302
|
+
removeProfile(profileIdentifier: string): Promise<void>;
|
|
303
|
+
listProfiles(): Promise<IosProfileListResult>;
|
|
304
|
+
/**
|
|
305
|
+
* Activate the device using the activation flow.
|
|
306
|
+
*
|
|
307
|
+
* This flow can install WiFi/MDM/trust profiles and skip setup steps.
|
|
308
|
+
* Returns { promise, events } so callers can attach listeners before the flow completes.
|
|
309
|
+
* Pass an AbortSignal to cancel the flow (on each retry or between steps).
|
|
310
|
+
*
|
|
311
|
+
* Note: This requires a valid activation record or Apple server access.
|
|
312
|
+
*
|
|
313
|
+
* Precondition: the device must be paired and trusted.
|
|
314
|
+
*/
|
|
315
|
+
activate(signal?: AbortSignal): {
|
|
316
|
+
promise: Promise<(() => Promise<void>) | undefined>;
|
|
317
|
+
events: EventEmitter;
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* Get the device UDID
|
|
321
|
+
*/
|
|
322
|
+
getDeviceId(): string;
|
|
323
|
+
/**
|
|
324
|
+
* Get the logical port number (USB hub position)
|
|
325
|
+
*/
|
|
326
|
+
getLogicalPort(): number;
|
|
327
|
+
/**
|
|
328
|
+
* Get the currently allocated local port for forwarding
|
|
329
|
+
* Returns undefined if no port forward is active
|
|
330
|
+
*/
|
|
331
|
+
getDevicePort(): number | null;
|
|
332
|
+
/**
|
|
333
|
+
* Check if this kit has been disposed
|
|
334
|
+
*/
|
|
335
|
+
get disposed(): boolean;
|
|
336
|
+
/**
|
|
337
|
+
* Check if a port forward is currently active
|
|
338
|
+
*/
|
|
339
|
+
get hasActivePortForward(): boolean;
|
|
340
|
+
/**
|
|
341
|
+
* Dispose of the kit and clean up all resources.
|
|
342
|
+
* This will kill any running proxy processes and release port allocations.
|
|
343
|
+
*
|
|
344
|
+
* After calling dispose(), the kit instance should not be used.
|
|
345
|
+
*/
|
|
346
|
+
dispose(): void;
|
|
347
|
+
/**
|
|
348
|
+
* Symbol.dispose implementation for using with `using` keyword (TypeScript 5.2+)
|
|
349
|
+
*/
|
|
350
|
+
[Symbol.dispose](): void;
|
|
351
|
+
}
|
|
352
|
+
export declare class IosClient {
|
|
353
|
+
private iosPath;
|
|
354
|
+
private udid;
|
|
355
|
+
private readonly _usbmuxdAddress?;
|
|
356
|
+
constructor(iosPath: string, udid: string, _usbmuxdAddress?: string | undefined);
|
|
357
|
+
get usbmuxdAddress(): string | undefined;
|
|
358
|
+
private safeParseJson;
|
|
359
|
+
private parseFsyncTreeStdout;
|
|
360
|
+
private parseIosOutput;
|
|
361
|
+
spawnIosCommand(args: string[]): import("child_process").ChildProcessByStdio<null, import("stream").Readable, import("stream").Readable>;
|
|
362
|
+
private runIosCommand;
|
|
363
|
+
listDevices(): Promise<IosListResult>;
|
|
364
|
+
wipe(): Promise<IosCommandResult>;
|
|
365
|
+
installProfile(profilePath: string): Promise<IosCommandResult>;
|
|
366
|
+
removeProfile(profileName: string): Promise<IosCommandResult>;
|
|
367
|
+
listProfiles(): Promise<IosProfileListResult>;
|
|
368
|
+
skipSteps(steps?: string[]): Promise<IosCommandResult>;
|
|
369
|
+
listSteps(): Promise<IosCommandResult>;
|
|
370
|
+
activate(): Promise<IosCommandResult>;
|
|
371
|
+
pair(): Promise<IosCommandResult>;
|
|
372
|
+
forward({ fromPort, toPort }: {
|
|
373
|
+
fromPort: number;
|
|
374
|
+
toPort: number;
|
|
375
|
+
}): Promise<import("child_process").ChildProcessByStdio<null, import("stream").Readable, import("stream").Readable>>;
|
|
376
|
+
info(): Promise<IosCommandResult>;
|
|
377
|
+
installApp(ipaPath: string): Promise<IosCommandResult>;
|
|
378
|
+
uninstallApp(bundleId: string): Promise<IosCommandResult>;
|
|
379
|
+
listApps(): Promise<{
|
|
380
|
+
bundleId: string;
|
|
381
|
+
displayName: string;
|
|
382
|
+
version: string;
|
|
383
|
+
}[]>;
|
|
384
|
+
devMode(): Promise<IosCommandResult>;
|
|
385
|
+
tunnelStart(userspace?: boolean): Promise<import("child_process").ChildProcessByStdio<null, import("stream").Readable, import("stream").Readable>>;
|
|
386
|
+
fsyncPull({ app, srcPath, dstPath, }: {
|
|
387
|
+
app: string;
|
|
388
|
+
srcPath: string;
|
|
389
|
+
dstPath: string;
|
|
390
|
+
}): Promise<IosCommandResult>;
|
|
391
|
+
fsyncPush({ app, srcPath, dstPath, }: {
|
|
392
|
+
app: string;
|
|
393
|
+
srcPath: string;
|
|
394
|
+
dstPath: string;
|
|
395
|
+
}): Promise<IosCommandResult>;
|
|
396
|
+
fsyncTree({ app, path, }: {
|
|
397
|
+
app: string;
|
|
398
|
+
path?: string;
|
|
399
|
+
}): Promise<IosFsyncTreeResult>;
|
|
400
|
+
}
|
|
401
|
+
export declare class ActivationFlow {
|
|
402
|
+
private readonly udid;
|
|
403
|
+
private readonly iosClient;
|
|
404
|
+
private mdmClient;
|
|
405
|
+
constructor(udid: string, iosClient: IosClient);
|
|
406
|
+
run(steps?: string[], signal?: AbortSignal): {
|
|
407
|
+
promise: Promise<(() => Promise<void>) | undefined>;
|
|
408
|
+
events: EventEmitter;
|
|
409
|
+
};
|
|
410
|
+
private runInternal;
|
|
411
|
+
private installWifiProfile;
|
|
412
|
+
private installMdmProfile;
|
|
413
|
+
private removeWifiProfile;
|
|
414
|
+
private retryIosCommand;
|
|
415
|
+
private retryActivateCommand;
|
|
416
|
+
private retry;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Activation flow event names (use with EventEmitter.on/emit).
|
|
420
|
+
*/
|
|
421
|
+
export declare const ACTIVATION_FLOW_EVENT_ACTIVATION_DONE = "activationDone";
|
|
422
|
+
export declare const ACTIVATION_FLOW_EVENT_WIFI_INSTALLED = "wifiInstalled";
|
|
423
|
+
export declare const ACTIVATION_FLOW_EVENT_MDM_PROFILE_INSTALLED = "mdmProfileInstalled";
|
|
424
|
+
export declare const ACTIVATION_FLOW_EVENT_STEPS_SKIPPED = "stepsSkipped";
|
|
425
|
+
/**
|
|
426
|
+
* Payload when activation completes (1-based attempt that succeeded).
|
|
427
|
+
*/
|
|
428
|
+
export interface ActivationDonePayload {
|
|
429
|
+
attempt: number;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Payload for steps that complete after retries (0 = first try succeeded).
|
|
433
|
+
*/
|
|
434
|
+
export interface RetriesPayload {
|
|
435
|
+
retries: number;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Payload when skip-steps command completes (steps requested to skip).
|
|
439
|
+
*/
|
|
440
|
+
export interface StepsSkippedPayload {
|
|
441
|
+
steps: string[];
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Event name to payload type map for activation flow events.
|
|
9
445
|
*/
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
446
|
+
export interface ActivationFlowEventMap {
|
|
447
|
+
[ACTIVATION_FLOW_EVENT_ACTIVATION_DONE]: ActivationDonePayload;
|
|
448
|
+
[ACTIVATION_FLOW_EVENT_WIFI_INSTALLED]: RetriesPayload;
|
|
449
|
+
[ACTIVATION_FLOW_EVENT_MDM_PROFILE_INSTALLED]: RetriesPayload;
|
|
450
|
+
[ACTIVATION_FLOW_EVENT_STEPS_SKIPPED]: StepsSkippedPayload;
|
|
451
|
+
}
|
|
452
|
+
interface DeviceListOutput$1 {
|
|
453
|
+
deviceList: string[];
|
|
454
|
+
}
|
|
455
|
+
interface IosCommandResult$1 {
|
|
456
|
+
command: string;
|
|
457
|
+
args: string[];
|
|
458
|
+
output: CommandOutput$1;
|
|
459
|
+
logMessages: LogMessage$1[];
|
|
460
|
+
exitCode: number;
|
|
461
|
+
raw: {
|
|
462
|
+
stdout: string;
|
|
463
|
+
stderr: string;
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
interface LogMessage$1 {
|
|
467
|
+
level: "info" | "error" | "warn" | "debug";
|
|
468
|
+
msg: string;
|
|
469
|
+
time: string;
|
|
470
|
+
err?: string;
|
|
471
|
+
}
|
|
472
|
+
type CommandOutput$1 = Record<string, unknown>[] | DeviceListOutput$1[] | [
|
|
473
|
+
LockdownInfo$1
|
|
474
|
+
];
|
|
475
|
+
interface IosListResult$1 {
|
|
476
|
+
udids: string[];
|
|
477
|
+
raw: IosCommandResult$1;
|
|
478
|
+
}
|
|
479
|
+
interface IosFsyncTreeResult$1 {
|
|
480
|
+
/** File/directory names listed in the app container path (e.g. ["qr.png", "test.jpg"]) */
|
|
481
|
+
entries: string[];
|
|
482
|
+
raw: IosCommandResult$1;
|
|
483
|
+
}
|
|
484
|
+
interface IosProfileManifest$1 {
|
|
485
|
+
Description?: string;
|
|
486
|
+
IsActive?: boolean;
|
|
487
|
+
}
|
|
488
|
+
interface IosProfileMetadata$1 {
|
|
489
|
+
PayloadDescription?: string;
|
|
490
|
+
PayloadDisplayName?: string;
|
|
491
|
+
PayloadRemovalDisallowed?: boolean;
|
|
492
|
+
PayloadUUID?: string;
|
|
493
|
+
PayloadVersion?: number;
|
|
494
|
+
}
|
|
495
|
+
interface IosProfileListEntry$1 {
|
|
496
|
+
Identifier?: string;
|
|
497
|
+
Manifest?: IosProfileManifest$1;
|
|
498
|
+
Metadata?: IosProfileMetadata$1;
|
|
499
|
+
Status?: string;
|
|
500
|
+
}
|
|
501
|
+
interface IosProfileListResult$1 {
|
|
502
|
+
profiles: IosProfileListEntry$1[];
|
|
503
|
+
raw: IosCommandResult$1;
|
|
504
|
+
}
|
|
505
|
+
interface BasebandKeyHashInformation$1 {
|
|
506
|
+
AKeyStatus: number;
|
|
507
|
+
SKeyHash: string;
|
|
508
|
+
SKeyStatus: number;
|
|
509
|
+
}
|
|
510
|
+
interface NonVolatileRAM$1 {
|
|
511
|
+
StartupMute?: string;
|
|
512
|
+
SystemAudioVolumeSaved?: string;
|
|
513
|
+
"auto-boot"?: string;
|
|
514
|
+
"backlight-level"?: string;
|
|
515
|
+
"backlight-nits"?: string;
|
|
516
|
+
"boot-args"?: string;
|
|
517
|
+
bootdelay?: string;
|
|
518
|
+
"fm-account-masked"?: string;
|
|
519
|
+
"fm-activation-locked"?: string;
|
|
520
|
+
"fm-spkeys"?: string;
|
|
521
|
+
"fm-spstatus"?: string;
|
|
522
|
+
obliteration?: string;
|
|
523
|
+
"panicmedic-telemetry"?: string;
|
|
524
|
+
usbcfwflasherResult?: string;
|
|
525
|
+
}
|
|
526
|
+
interface LockdownInfo$1 {
|
|
527
|
+
ActivationState: string;
|
|
528
|
+
ActivationStateAcknowledged: boolean;
|
|
529
|
+
BasebandActivationTicketVersion: string;
|
|
530
|
+
BasebandCertId: number;
|
|
531
|
+
BasebandChipID: number;
|
|
532
|
+
BasebandKeyHashInformation: BasebandKeyHashInformation$1;
|
|
533
|
+
BasebandMasterKeyHash: string;
|
|
534
|
+
BasebandRegionSKU: string;
|
|
535
|
+
BasebandSerialNumber: string;
|
|
536
|
+
BasebandStatus: string;
|
|
537
|
+
BasebandVersion: string;
|
|
538
|
+
BluetoothAddress: string;
|
|
539
|
+
BoardId: number;
|
|
540
|
+
BootSessionID: string;
|
|
541
|
+
BrickState: boolean;
|
|
542
|
+
BuildVersion: string;
|
|
543
|
+
CPUArchitecture: string;
|
|
544
|
+
CarrierBundleInfoArray: unknown[];
|
|
545
|
+
CertID: number;
|
|
546
|
+
ChipID: number;
|
|
547
|
+
ChipSerialNo: string;
|
|
548
|
+
DeviceClass: string;
|
|
549
|
+
DeviceColor: string;
|
|
550
|
+
DeviceName: string;
|
|
551
|
+
DieID: number;
|
|
552
|
+
EthernetAddress: string;
|
|
553
|
+
FirmwareVersion: string;
|
|
554
|
+
FusingStatus: number;
|
|
555
|
+
HardwareModel: string;
|
|
556
|
+
HardwarePlatform: string;
|
|
557
|
+
HasSiDP: boolean;
|
|
558
|
+
HostAttached: boolean;
|
|
559
|
+
HumanReadableProductVersionString: string;
|
|
560
|
+
InternationalMobileEquipmentIdentity: string;
|
|
561
|
+
InternationalMobileEquipmentIdentity2: string;
|
|
562
|
+
MLBSerialNumber: string;
|
|
563
|
+
MobileEquipmentIdentifier: string;
|
|
564
|
+
MobileSubscriberCountryCode: string;
|
|
565
|
+
MobileSubscriberNetworkCode: string;
|
|
566
|
+
ModelNumber: string;
|
|
567
|
+
NonVolatileRAM: NonVolatileRAM$1;
|
|
568
|
+
PairRecordProtectionClass: number;
|
|
569
|
+
PartitionType: string;
|
|
570
|
+
PasswordProtected: boolean;
|
|
571
|
+
PkHash: string;
|
|
572
|
+
ProductName: string;
|
|
573
|
+
ProductType: string;
|
|
574
|
+
ProductVersion: string;
|
|
575
|
+
ProductionSOC: boolean;
|
|
576
|
+
ProtocolVersion: string;
|
|
577
|
+
ProximitySensorCalibration: string;
|
|
578
|
+
RegionInfo: string;
|
|
579
|
+
ReleaseType: string;
|
|
580
|
+
SIMStatus: string;
|
|
581
|
+
SIMTrayStatus: string;
|
|
582
|
+
SerialNumber: string;
|
|
583
|
+
SoftwareBehavior: string;
|
|
584
|
+
SoftwareBundleVersion: string;
|
|
585
|
+
SupportedDeviceFamilies: number[];
|
|
586
|
+
TelephonyCapability: boolean;
|
|
587
|
+
TimeIntervalSince1970: number;
|
|
588
|
+
TimeZone: string;
|
|
589
|
+
TimeZoneOffsetFromUTC: number;
|
|
590
|
+
TrustedHostAttached: boolean;
|
|
591
|
+
UniqueChipID: number;
|
|
592
|
+
UniqueDeviceID: string;
|
|
593
|
+
UntrustedHostBUID: string;
|
|
594
|
+
UseRaptorCerts: boolean;
|
|
595
|
+
Uses24HourClock: boolean;
|
|
596
|
+
WiFiAddress: string;
|
|
597
|
+
WirelessBoardSerialNumber: string;
|
|
598
|
+
kCTPostponementInfoServiceProvisioningState: boolean;
|
|
599
|
+
kCTPostponementStatus: string;
|
|
600
|
+
}
|
|
601
|
+
export interface IosCli {
|
|
602
|
+
listDevices(): Promise<IosListResult$1>;
|
|
603
|
+
wipe(deviceId: string): Promise<IosCommandResult$1>;
|
|
604
|
+
installProfile(deviceId: string, profilePath: string): Promise<IosCommandResult$1>;
|
|
605
|
+
removeProfile(deviceId: string, profileName: string): Promise<IosCommandResult$1>;
|
|
606
|
+
skipSteps(deviceId: string, steps?: string[]): Promise<IosCommandResult$1>;
|
|
607
|
+
printSteps(): Promise<IosCommandResult$1>;
|
|
608
|
+
activate(deviceId: string): Promise<IosCommandResult$1>;
|
|
609
|
+
pair(deviceId: string): Promise<IosCommandResult$1>;
|
|
610
|
+
forward(deviceId: string, fromPort: number, toPort: number): Promise<IosCommandResult$1>;
|
|
611
|
+
info(deviceId: string): Promise<IosCommandResult$1>;
|
|
612
|
+
listProfiles(deviceId: string): Promise<IosProfileListResult$1>;
|
|
613
|
+
installApp(deviceId: string, ipaPath: string): Promise<IosCommandResult$1>;
|
|
614
|
+
tunnelStart(deviceId: string, userspace?: boolean): Promise<ChildProcess>;
|
|
615
|
+
fsyncPull(deviceId: string, app: string, srcPath: string, dstPath: string): Promise<IosCommandResult$1>;
|
|
616
|
+
fsyncPush(deviceId: string, app: string, srcPath: string, dstPath: string): Promise<IosCommandResult$1>;
|
|
617
|
+
fsyncTree(deviceId: string, app: string, path?: string): Promise<IosFsyncTreeResult$1>;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
export {
|
|
621
|
+
IosCommandResult$1 as IosCommandResult,
|
|
622
|
+
IosFsyncTreeResult$1 as IosFsyncTreeResult,
|
|
623
|
+
IosListResult$1 as IosListResult,
|
|
624
|
+
};
|
|
625
|
+
|
|
626
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcesystems/apple-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.80",
|
|
4
4
|
"description": "iOS device management toolkit using libimobiledevice command-line tools",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -37,9 +37,8 @@
|
|
|
37
37
|
"graphql-request": "^5.2.0",
|
|
38
38
|
"tsx": "^4.21.0",
|
|
39
39
|
"plist": "^3.1.0",
|
|
40
|
-
"@mcesystems/
|
|
41
|
-
"@mcesystems/
|
|
42
|
-
"@mcesystems/usbmuxd-instance-manager": "1.0.78"
|
|
40
|
+
"@mcesystems/mdm-client-g4": "1.0.80",
|
|
41
|
+
"@mcesystems/tool-debug-g4": "1.0.80"
|
|
43
42
|
},
|
|
44
43
|
"devDependencies": {
|
|
45
44
|
"@types/node": "^22.10.2",
|
|
@@ -47,12 +46,15 @@
|
|
|
47
46
|
"dotenv": "^17.2.3",
|
|
48
47
|
"esbuild": "^0.27.0",
|
|
49
48
|
"esbuild-plugin-copy": "^2.1.1",
|
|
49
|
+
"esbuild-plugin-d.ts": "^1.3.1",
|
|
50
50
|
"go-ios": "^1.0.188",
|
|
51
51
|
"pnpm": "10.24.0",
|
|
52
52
|
"rimraf": "^6.0.1",
|
|
53
53
|
"typescript": "^5.7.2",
|
|
54
54
|
"vitest": "^2.1.8",
|
|
55
|
-
"@types/plist": "^3.0.5"
|
|
55
|
+
"@types/plist": "^3.0.5",
|
|
56
|
+
"@mcesystems/usb-device-listener": "1.0.80",
|
|
57
|
+
"@mcesystems/usbmuxd-instance-manager": "1.0.80"
|
|
56
58
|
},
|
|
57
59
|
"files": [
|
|
58
60
|
"dist",
|
|
@@ -67,13 +69,13 @@
|
|
|
67
69
|
"export-apple-resources": "./scripts/export-resources.ts"
|
|
68
70
|
},
|
|
69
71
|
"scripts": {
|
|
70
|
-
"build": "tsx esbuild.config.mts
|
|
72
|
+
"build": "tsx esbuild.config.mts",
|
|
71
73
|
"build:all": "pnpm --filter @mcesystems/apple-kit... build",
|
|
72
74
|
"clean": "rimraf dist",
|
|
73
75
|
"check:types": "tsc --noEmit",
|
|
74
76
|
"activate:example": "tsx src/examples/activationExample.ts",
|
|
75
77
|
"ios:example": "tsx src/examples/iosExample.ts",
|
|
76
|
-
"usbmuxd:example": "
|
|
78
|
+
"usbmuxd:example": "tsx src/examples/usbmuxdIntegrationExample.ts",
|
|
77
79
|
"pack": "npm pack",
|
|
78
80
|
"test": "vitest run",
|
|
79
81
|
"test:watch": "vitest"
|