@mcesystems/apple-kit 1.0.90 → 1.0.92

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.
Files changed (78) hide show
  1. package/README.md +258 -258
  2. package/dist/index.js +74 -67
  3. package/dist/index.js.map +3 -3
  4. package/dist/index.mjs +74 -67
  5. package/dist/index.mjs.map +3 -3
  6. package/dist/resources/bin/darwin/idevice_id +0 -0
  7. package/dist/resources/bin/darwin/idevicedebug +0 -0
  8. package/dist/resources/bin/darwin/idevicediagnostics +0 -0
  9. package/dist/resources/bin/darwin/ideviceinfo +0 -0
  10. package/dist/resources/bin/darwin/ideviceinstaller +0 -0
  11. package/dist/resources/bin/darwin/idevicename +0 -0
  12. package/dist/resources/bin/darwin/idevicepair +0 -0
  13. package/dist/resources/bin/darwin/idevicescreenshot +0 -0
  14. package/dist/resources/bin/darwin/idevicesyslog +0 -0
  15. package/dist/resources/bin/darwin/iproxy +0 -0
  16. package/dist/resources/bin/darwin/libcrypto.3.dylib +0 -0
  17. package/dist/resources/bin/darwin/libimobiledevice-1.0.6.dylib +0 -0
  18. package/dist/resources/bin/darwin/libimobiledevice-glue-1.0.0.dylib +0 -0
  19. package/dist/resources/bin/darwin/liblzma.5.dylib +0 -0
  20. package/dist/resources/bin/darwin/libplist-2.0.4.dylib +0 -0
  21. package/dist/resources/bin/darwin/libssl.3.dylib +0 -0
  22. package/dist/resources/bin/darwin/libusbmuxd-2.0.7.dylib +0 -0
  23. package/dist/resources/bin/darwin/libzip.5.dylib +0 -0
  24. package/dist/resources/bin/darwin/libzstd.1.dylib +0 -0
  25. package/dist/resources/licenses/LGPL-2.1.txt +33 -0
  26. package/dist/resources/plist/certificate-trust.xml +43 -43
  27. package/dist/resources/plist/wifi-enterprise.xml +59 -59
  28. package/dist/resources/plist/wifi-standard.xml +50 -50
  29. package/dist/types/index.d.ts +7 -1
  30. package/dist/types/index.d.ts.map +1 -0
  31. package/dist/types/logic/actions/activation.d.ts +12 -0
  32. package/dist/types/logic/actions/activation.d.ts.map +1 -0
  33. package/dist/types/logic/actions/device.d.ts +15 -0
  34. package/dist/types/logic/actions/device.d.ts.map +1 -0
  35. package/dist/types/logic/actions/install.d.ts +10 -0
  36. package/dist/types/logic/actions/install.d.ts.map +1 -0
  37. package/dist/types/logic/actions/pair.d.ts +6 -0
  38. package/dist/types/logic/actions/pair.d.ts.map +1 -0
  39. package/dist/types/logic/actions/proxy.d.ts +23 -0
  40. package/dist/types/logic/actions/proxy.d.ts.map +1 -0
  41. package/dist/types/logic/actions/restore.d.ts +36 -0
  42. package/dist/types/logic/actions/restore.d.ts.map +1 -0
  43. package/dist/types/logic/actions/tool.d.ts +8 -0
  44. package/dist/types/logic/actions/tool.d.ts.map +1 -0
  45. package/dist/types/logic/activationFlow.d.ts +15 -0
  46. package/dist/types/logic/activationFlow.d.ts.map +1 -0
  47. package/dist/types/logic/appleDeviceKit.d.ts +164 -0
  48. package/dist/types/logic/appleDeviceKit.d.ts.map +1 -0
  49. package/dist/types/logic/dataParser.d.ts +23 -0
  50. package/dist/types/logic/dataParser.d.ts.map +1 -0
  51. package/dist/types/logic/iosCli.d.ts +6 -0
  52. package/dist/types/logic/iosCli.d.ts.map +1 -0
  53. package/dist/types/logic/utils/resolvePath.d.ts +13 -0
  54. package/dist/types/logic/utils/resolvePath.d.ts.map +1 -0
  55. package/dist/types/types/activation.d.ts +28 -0
  56. package/dist/types/types/activation.d.ts.map +1 -0
  57. package/dist/types/types/ios.d.ts +152 -0
  58. package/dist/types/types/ios.d.ts.map +1 -0
  59. package/dist/types/types/trust.d.ts +10 -0
  60. package/dist/types/types/trust.d.ts.map +1 -0
  61. package/dist/types/types/types.d.ts +47 -0
  62. package/dist/types/types/types.d.ts.map +1 -0
  63. package/dist/types/types/wifi.d.ts +19 -0
  64. package/dist/types/types/wifi.d.ts.map +1 -0
  65. package/dist/types/types.d.ts +140 -0
  66. package/dist/types/types.d.ts.map +1 -0
  67. package/dist/types/utils/debug.d.ts +17 -0
  68. package/dist/types/utils/debug.d.ts.map +1 -0
  69. package/dist/types/utils/templateLoader.d.ts +8 -0
  70. package/dist/types/utils/templateLoader.d.ts.map +1 -0
  71. package/dist/types/utils/wifiProfile.d.ts +14 -0
  72. package/dist/types/utils/wifiProfile.d.ts.map +1 -0
  73. package/package.json +5 -5
  74. package/scripts/README.md +209 -209
  75. package/scripts/build-windows.sh.template +222 -222
  76. package/resources/ios.exe +0 -0
  77. package/resources/wintun-LICENSE.txt +0 -84
  78. package/resources/wintun.dll +0 -0
package/dist/index.mjs CHANGED
@@ -1206,24 +1206,24 @@ var import_debug = __toESM2(require_src());
1206
1206
  function createLoggers(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
1207
1207
  const logInfo8 = (0, import_debug.default)(`${namespace}:info`);
1208
1208
  const logTask5 = (0, import_debug.default)(`${namespace}:task`);
1209
- const logError3 = (0, import_debug.default)(`${namespace}:error`);
1209
+ const logError4 = (0, import_debug.default)(`${namespace}:error`);
1210
1210
  const logDetail3 = (0, import_debug.default)(`${namespace}:detail`);
1211
1211
  const logDebug = (0, import_debug.default)(`${namespace}:debug`);
1212
- const logWarning3 = (0, import_debug.default)(`${namespace}:warning`);
1212
+ const logWarning2 = (0, import_debug.default)(`${namespace}:warning`);
1213
1213
  const logColor = (0, import_debug.default)(`${namespace}:color`);
1214
1214
  logInfo8.color = "19";
1215
1215
  logTask5.color = "25";
1216
- logError3.color = "1";
1216
+ logError4.color = "1";
1217
1217
  logDetail3.color = "199";
1218
- logWarning3.color = "186";
1218
+ logWarning2.color = "186";
1219
1219
  logDebug.color = "211";
1220
1220
  logColor.enabled = true;
1221
1221
  function setNamespace7(namespace2) {
1222
1222
  logInfo8.namespace = `${namespace2}:info`;
1223
1223
  logTask5.namespace = `${namespace2}:task`;
1224
- logError3.namespace = `${namespace2}:error`;
1224
+ logError4.namespace = `${namespace2}:error`;
1225
1225
  logDetail3.namespace = `${namespace2}:detail`;
1226
- logWarning3.namespace = `${namespace2}:warning`;
1226
+ logWarning2.namespace = `${namespace2}:warning`;
1227
1227
  logDebug.namespace = `${namespace2}:debug`;
1228
1228
  }
1229
1229
  function setLogLevel(level) {
@@ -1231,24 +1231,24 @@ function createLoggers(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
1231
1231
  case "info":
1232
1232
  logInfo8.enabled = true;
1233
1233
  logTask5.enabled = true;
1234
- logError3.enabled = true;
1235
- logWarning3.enabled = true;
1234
+ logError4.enabled = true;
1235
+ logWarning2.enabled = true;
1236
1236
  logDetail3.enabled = false;
1237
1237
  logDebug.enabled = false;
1238
1238
  break;
1239
1239
  case "debug":
1240
1240
  logInfo8.enabled = true;
1241
1241
  logTask5.enabled = true;
1242
- logError3.enabled = true;
1243
- logWarning3.enabled = true;
1242
+ logError4.enabled = true;
1243
+ logWarning2.enabled = true;
1244
1244
  logDetail3.enabled = true;
1245
1245
  logDebug.enabled = true;
1246
1246
  break;
1247
1247
  case "none":
1248
1248
  logInfo8.enabled = false;
1249
1249
  logTask5.enabled = false;
1250
- logError3.enabled = false;
1251
- logWarning3.enabled = false;
1250
+ logError4.enabled = false;
1251
+ logWarning2.enabled = false;
1252
1252
  logDetail3.enabled = false;
1253
1253
  logDebug.enabled = false;
1254
1254
  break;
@@ -1264,13 +1264,13 @@ function createLoggers(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
1264
1264
  logTask5.color = color;
1265
1265
  break;
1266
1266
  case "error":
1267
- logError3.color = color;
1267
+ logError4.color = color;
1268
1268
  break;
1269
1269
  case "detail":
1270
1270
  logDetail3.color = color;
1271
1271
  break;
1272
1272
  case "warning":
1273
- logWarning3.color = color;
1273
+ logWarning2.color = color;
1274
1274
  break;
1275
1275
  case "debug":
1276
1276
  logDebug.color = color;
@@ -1325,7 +1325,7 @@ ${" ".repeat(padding)}${"=".repeat(80)}`;
1325
1325
  function logHeader(title) {
1326
1326
  logInfo8(`${header(title, 2)}`);
1327
1327
  }
1328
- function logDataObject3(title, ...args) {
1328
+ function logDataObject2(title, ...args) {
1329
1329
  const stack = new Error().stack?.split("\n")[2] || "";
1330
1330
  const stackMatch = stack.match(/\((.*):(\d+):(\d+)\)$/) || stack.match(/at (.*):(\d+):(\d+)$/);
1331
1331
  let callerDetails = "";
@@ -1342,29 +1342,29 @@ ${"=".repeat(80)}`);
1342
1342
  }
1343
1343
  function logErrorObject(error, extraDetails) {
1344
1344
  if (error instanceof Error) {
1345
- logError3(`${extraDetails ? header(extraDetails, 1) : header(error.message, 1)}
1345
+ logError4(`${extraDetails ? header(extraDetails, 1) : header(error.message, 1)}
1346
1346
  Error Message:
1347
1347
  ${error.message}
1348
1348
  Error Stack:
1349
1349
  ${error.stack}
1350
1350
  ${"=".repeat(80)}`);
1351
1351
  } else {
1352
- logError3(`${extraDetails ? header(extraDetails, 1) : header(String(error), 1)}
1352
+ logError4(`${extraDetails ? header(extraDetails, 1) : header(String(error), 1)}
1353
1353
  ${"=".repeat(80)}`);
1354
1354
  }
1355
1355
  }
1356
1356
  return {
1357
1357
  logInfo: logInfo8,
1358
1358
  logTask: logTask5,
1359
- logError: logError3,
1359
+ logError: logError4,
1360
1360
  logDetail: logDetail3,
1361
1361
  logDebug,
1362
- logWarning: logWarning3,
1362
+ logWarning: logWarning2,
1363
1363
  logColor,
1364
1364
  setColors,
1365
1365
  printColors,
1366
1366
  logHeader,
1367
- logDataObject: logDataObject3,
1367
+ logDataObject: logDataObject2,
1368
1368
  logErrorObject,
1369
1369
  setLogLevel,
1370
1370
  setNamespace: setNamespace7
@@ -1633,13 +1633,29 @@ var DeviceActions = class {
1633
1633
  const startTime = Date.now();
1634
1634
  while (Date.now() - startTime < timeout2) {
1635
1635
  throwIfAborted(signal);
1636
- await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
1637
- if (await this.pair()) {
1636
+ if (await this.isPairedViaInfo()) {
1638
1637
  return true;
1639
1638
  }
1639
+ await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
1640
1640
  }
1641
1641
  throw new Error(`Timeout waiting for device pairing after ${timeout2}ms`);
1642
1642
  }
1643
+ /**
1644
+ * Returns true if device is paired and trusted.
1645
+ * Uses info() which only succeeds when full pairing is established (user has accepted Trust).
1646
+ * Prefer this over lockdown file check since file location/timing can vary by platform.
1647
+ */
1648
+ async isPairedViaInfo() {
1649
+ try {
1650
+ const result = await this.iosClient.info();
1651
+ if (result.exitCode === 0 && result.output[0]) {
1652
+ const info = result.output[0];
1653
+ return info?.ActivationState !== void 0;
1654
+ }
1655
+ } catch {
1656
+ }
1657
+ return false;
1658
+ }
1643
1659
  async isWifiConnected(timeoutMs = 5e3) {
1644
1660
  logInfo(`Checking WiFi connection for device ${this.udid}`);
1645
1661
  const combined = (out) => `${out.stdout}
@@ -36986,13 +37002,13 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
36986
37002
  const logError22 = (0, import_debug2.default)(`${namespace}:error`);
36987
37003
  const logDetail3 = (0, import_debug2.default)(`${namespace}:detail`);
36988
37004
  const logDebug = (0, import_debug2.default)(`${namespace}:debug`);
36989
- const logWarning22 = (0, import_debug2.default)(`${namespace}:warning`);
37005
+ const logWarning2 = (0, import_debug2.default)(`${namespace}:warning`);
36990
37006
  const logColor = (0, import_debug2.default)(`${namespace}:color`);
36991
37007
  logInfo222.color = "19";
36992
37008
  logTask5.color = "25";
36993
37009
  logError22.color = "1";
36994
37010
  logDetail3.color = "199";
36995
- logWarning22.color = "186";
37011
+ logWarning2.color = "186";
36996
37012
  logDebug.color = "211";
36997
37013
  logColor.enabled = true;
36998
37014
  function setNamespace7(namespace2) {
@@ -37000,7 +37016,7 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
37000
37016
  logTask5.namespace = `${namespace2}:task`;
37001
37017
  logError22.namespace = `${namespace2}:error`;
37002
37018
  logDetail3.namespace = `${namespace2}:detail`;
37003
- logWarning22.namespace = `${namespace2}:warning`;
37019
+ logWarning2.namespace = `${namespace2}:warning`;
37004
37020
  logDebug.namespace = `${namespace2}:debug`;
37005
37021
  }
37006
37022
  function setLogLevel(level) {
@@ -37009,7 +37025,7 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
37009
37025
  logInfo222.enabled = true;
37010
37026
  logTask5.enabled = true;
37011
37027
  logError22.enabled = true;
37012
- logWarning22.enabled = true;
37028
+ logWarning2.enabled = true;
37013
37029
  logDetail3.enabled = false;
37014
37030
  logDebug.enabled = false;
37015
37031
  break;
@@ -37017,7 +37033,7 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
37017
37033
  logInfo222.enabled = true;
37018
37034
  logTask5.enabled = true;
37019
37035
  logError22.enabled = true;
37020
- logWarning22.enabled = true;
37036
+ logWarning2.enabled = true;
37021
37037
  logDetail3.enabled = true;
37022
37038
  logDebug.enabled = true;
37023
37039
  break;
@@ -37025,7 +37041,7 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
37025
37041
  logInfo222.enabled = false;
37026
37042
  logTask5.enabled = false;
37027
37043
  logError22.enabled = false;
37028
- logWarning22.enabled = false;
37044
+ logWarning2.enabled = false;
37029
37045
  logDetail3.enabled = false;
37030
37046
  logDebug.enabled = false;
37031
37047
  break;
@@ -37047,7 +37063,7 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
37047
37063
  logDetail3.color = color;
37048
37064
  break;
37049
37065
  case "warning":
37050
- logWarning22.color = color;
37066
+ logWarning2.color = color;
37051
37067
  break;
37052
37068
  case "debug":
37053
37069
  logDebug.color = color;
@@ -37102,7 +37118,7 @@ ${" ".repeat(padding)}${"=".repeat(80)}`;
37102
37118
  function logHeader(title) {
37103
37119
  logInfo222(`${header(title, 2)}`);
37104
37120
  }
37105
- function logDataObject22(title, ...args) {
37121
+ function logDataObject2(title, ...args) {
37106
37122
  const stack = new Error().stack?.split("\n")[2] || "";
37107
37123
  const stackMatch = stack.match(/\((.*):(\d+):(\d+)\)$/) || stack.match(/at (.*):(\d+):(\d+)$/);
37108
37124
  let callerDetails = "";
@@ -37136,12 +37152,12 @@ ${"=".repeat(80)}`);
37136
37152
  logError: logError22,
37137
37153
  logDetail: logDetail3,
37138
37154
  logDebug,
37139
- logWarning: logWarning22,
37155
+ logWarning: logWarning2,
37140
37156
  logColor,
37141
37157
  setColors,
37142
37158
  printColors,
37143
37159
  logHeader,
37144
- logDataObject: logDataObject22,
37160
+ logDataObject: logDataObject2,
37145
37161
  logErrorObject,
37146
37162
  setLogLevel,
37147
37163
  setNamespace: setNamespace7
@@ -38083,13 +38099,13 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
38083
38099
  const logError22 = (0, import_debug22.default)(`${namespace}:error`);
38084
38100
  const logDetail3 = (0, import_debug22.default)(`${namespace}:detail`);
38085
38101
  const logDebug = (0, import_debug22.default)(`${namespace}:debug`);
38086
- const logWarning22 = (0, import_debug22.default)(`${namespace}:warning`);
38102
+ const logWarning2 = (0, import_debug22.default)(`${namespace}:warning`);
38087
38103
  const logColor = (0, import_debug22.default)(`${namespace}:color`);
38088
38104
  logInfo32.color = "19";
38089
38105
  logTask5.color = "25";
38090
38106
  logError22.color = "1";
38091
38107
  logDetail3.color = "199";
38092
- logWarning22.color = "186";
38108
+ logWarning2.color = "186";
38093
38109
  logDebug.color = "211";
38094
38110
  logColor.enabled = true;
38095
38111
  function setNamespace7(namespace2) {
@@ -38097,7 +38113,7 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
38097
38113
  logTask5.namespace = `${namespace2}:task`;
38098
38114
  logError22.namespace = `${namespace2}:error`;
38099
38115
  logDetail3.namespace = `${namespace2}:detail`;
38100
- logWarning22.namespace = `${namespace2}:warning`;
38116
+ logWarning2.namespace = `${namespace2}:warning`;
38101
38117
  logDebug.namespace = `${namespace2}:debug`;
38102
38118
  }
38103
38119
  function setLogLevel(level) {
@@ -38106,7 +38122,7 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
38106
38122
  logInfo32.enabled = true;
38107
38123
  logTask5.enabled = true;
38108
38124
  logError22.enabled = true;
38109
- logWarning22.enabled = true;
38125
+ logWarning2.enabled = true;
38110
38126
  logDetail3.enabled = false;
38111
38127
  logDebug.enabled = false;
38112
38128
  break;
@@ -38114,7 +38130,7 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
38114
38130
  logInfo32.enabled = true;
38115
38131
  logTask5.enabled = true;
38116
38132
  logError22.enabled = true;
38117
- logWarning22.enabled = true;
38133
+ logWarning2.enabled = true;
38118
38134
  logDetail3.enabled = true;
38119
38135
  logDebug.enabled = true;
38120
38136
  break;
@@ -38122,7 +38138,7 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
38122
38138
  logInfo32.enabled = false;
38123
38139
  logTask5.enabled = false;
38124
38140
  logError22.enabled = false;
38125
- logWarning22.enabled = false;
38141
+ logWarning2.enabled = false;
38126
38142
  logDetail3.enabled = false;
38127
38143
  logDebug.enabled = false;
38128
38144
  break;
@@ -38144,7 +38160,7 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
38144
38160
  logDetail3.color = color;
38145
38161
  break;
38146
38162
  case "warning":
38147
- logWarning22.color = color;
38163
+ logWarning2.color = color;
38148
38164
  break;
38149
38165
  case "debug":
38150
38166
  logDebug.color = color;
@@ -38199,7 +38215,7 @@ ${" ".repeat(padding)}${"=".repeat(80)}`;
38199
38215
  function logHeader(title) {
38200
38216
  logInfo32(`${header(title, 2)}`);
38201
38217
  }
38202
- function logDataObject22(title, ...args) {
38218
+ function logDataObject2(title, ...args) {
38203
38219
  const stack = new Error().stack?.split("\n")[2] || "";
38204
38220
  const stackMatch = stack.match(/\((.*):(\d+):(\d+)\)$/) || stack.match(/at (.*):(\d+):(\d+)$/);
38205
38221
  let callerDetails = "";
@@ -38233,12 +38249,12 @@ ${"=".repeat(80)}`);
38233
38249
  logError: logError22,
38234
38250
  logDetail: logDetail3,
38235
38251
  logDebug,
38236
- logWarning: logWarning22,
38252
+ logWarning: logWarning2,
38237
38253
  logColor,
38238
38254
  setColors,
38239
38255
  printColors,
38240
38256
  logHeader,
38241
- logDataObject: logDataObject22,
38257
+ logDataObject: logDataObject2,
38242
38258
  logErrorObject,
38243
38259
  setLogLevel,
38244
38260
  setNamespace: setNamespace7
@@ -38726,7 +38742,7 @@ var ActivationFlow = class {
38726
38742
  }
38727
38743
  }
38728
38744
  await this.retryActivateCommand("activate device", () => this.iosClient.activate(), signal);
38729
- events.emit(ACTIVATION_FLOW_EVENT_ACTIVATION_DONE, { attempt: 1 });
38745
+ events.emit(ACTIVATION_FLOW_EVENT_ACTIVATION_DONE);
38730
38746
  throwIfAborted2(signal);
38731
38747
  let wifiProfileIdentifier;
38732
38748
  if (config?.withMdm) {
@@ -38740,7 +38756,9 @@ var ActivationFlow = class {
38740
38756
  const expectedSsid = config.wifiProfileConfig?.ssid;
38741
38757
  if (expectedSsid) {
38742
38758
  if (await this.deviceActions.isWifiConnected(15e3) !== expectedSsid) {
38743
- throw new Error("WiFi profile not installed correctly");
38759
+ throw new Error(
38760
+ `WiFi profile not installed correctly, expected ${expectedSsid} but got ${await this.deviceActions.isWifiConnected(15e3)}`
38761
+ );
38744
38762
  }
38745
38763
  }
38746
38764
  await this.installMdmProfile(events, signal);
@@ -38789,7 +38807,7 @@ var ActivationFlow = class {
38789
38807
  () => this.iosClient.installProfile(profilePath),
38790
38808
  signal
38791
38809
  );
38792
- events.emit(ACTIVATION_FLOW_EVENT_MDM_PROFILE_INSTALLED, { retries: 0 });
38810
+ events.emit(ACTIVATION_FLOW_EVENT_MDM_PROFILE_INSTALLED);
38793
38811
  await removeTempFile(profilePath, "mdm profile");
38794
38812
  }
38795
38813
  async retryMdmEnrollmentProfile(signal) {
@@ -39290,30 +39308,10 @@ var IosClient = class {
39290
39308
  };
39291
39309
 
39292
39310
  // src/logic/appleDeviceKit.ts
39293
- var { logInfo: logInfo7, setNamespace: setNamespace6, logDataObject: logDataObject2, logWarning: logWarning2 } = createLoggers("apple-kit");
39311
+ var { logInfo: logInfo7, setNamespace: setNamespace6, logError: logError3 } = createLoggers("apple-kit");
39294
39312
  var AppleDeviceKit = class {
39295
39313
  constructor(udid, logicalPort, usbmuxdAddress) {
39296
39314
  this.logicalPort = logicalPort;
39297
- const requiredEnvVars = {
39298
- USBIPD_PATH: process.env.USBIPD_PATH,
39299
- LOCKDOWN_WINDOWS_PATH: process.env.LOCKDOWN_WINDOWS_PATH,
39300
- MDM_ENDPOINT: process.env.MDM_ENDPOINT,
39301
- AUTH_API_URL: process.env.AUTH_API_URL,
39302
- CREDENTIALS_PATH: process.env.CREDENTIALS_PATH,
39303
- RESOURCES_PATH: process.env.RESOURCES_PATH,
39304
- WIFI_SSID: process.env.WIFI_SSID,
39305
- WIFI_PASSWORD: process.env.WIFI_PASSWORD,
39306
- WIFI_ENCRYPTION: process.env.WIFI_ENCRYPTION,
39307
- WIFI_HIDDEN: process.env.WIFI_HIDDEN,
39308
- WIFI_ENTERPRISE: process.env.WIFI_ENTERPRISE,
39309
- WIFI_EAP_TYPE: process.env.WIFI_EAP_TYPE,
39310
- CERT_FILE: process.env.CERT_FILE,
39311
- ORGANIZATION_NAME: process.env.ORGANIZATION_NAME
39312
- };
39313
- if (Object.values(requiredEnvVars).some((value) => !value)) {
39314
- logWarning2("Required environment variables are not set");
39315
- logDataObject2("Required Env Variables", requiredEnvVars);
39316
- }
39317
39315
  this.deviceId = udid;
39318
39316
  setNamespace6(`apple-${udid}`);
39319
39317
  logInfo7(
@@ -39328,6 +39326,11 @@ var AppleDeviceKit = class {
39328
39326
  this.installActions = new InstallActions(this.deviceId, this.iosClient);
39329
39327
  this.activationFlow = new ActivationFlow(this.deviceId, this.iosClient, this.deviceActions);
39330
39328
  this.proxyActions = new ProxyActions(this.deviceId, this.iosClient);
39329
+ this.iosClient.tunnelStart(true).then((process3) => {
39330
+ this.tunnelProcess = process3;
39331
+ }).catch((error) => {
39332
+ logError3(`Failed to start tunnel: ${error.message}`);
39333
+ });
39331
39334
  }
39332
39335
  deviceId;
39333
39336
  proxyProcess = null;
@@ -39367,7 +39370,11 @@ var AppleDeviceKit = class {
39367
39370
  */
39368
39371
  async waitForPairing(timeout2 = 12e4, pollInterval = 1e3, signal) {
39369
39372
  this.ensureNotDisposed();
39370
- return this.deviceActions.waitForPairing({ timeout: timeout2, pollInterval, signal });
39373
+ return this.deviceActions.waitForPairing({
39374
+ timeout: timeout2,
39375
+ pollInterval,
39376
+ signal
39377
+ });
39371
39378
  }
39372
39379
  /**
39373
39380
  * Attempt to pair/trust the device