@mcesystems/apple-kit 1.0.94 → 1.0.95
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 +53 -50
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +53 -50
- package/dist/index.mjs.map +3 -3
- package/dist/types/index.d.ts +13 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1226,14 +1226,14 @@ function createLoggers(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
1226
1226
|
const logInfo8 = (0, import_debug.default)(`${namespace}:info`);
|
|
1227
1227
|
const logTask5 = (0, import_debug.default)(`${namespace}:task`);
|
|
1228
1228
|
const logError4 = (0, import_debug.default)(`${namespace}:error`);
|
|
1229
|
-
const
|
|
1229
|
+
const logDetail3 = (0, import_debug.default)(`${namespace}:detail`);
|
|
1230
1230
|
const logDebug = (0, import_debug.default)(`${namespace}:debug`);
|
|
1231
1231
|
const logWarning2 = (0, import_debug.default)(`${namespace}:warning`);
|
|
1232
1232
|
const logColor = (0, import_debug.default)(`${namespace}:color`);
|
|
1233
1233
|
logInfo8.color = "19";
|
|
1234
1234
|
logTask5.color = "25";
|
|
1235
1235
|
logError4.color = "1";
|
|
1236
|
-
|
|
1236
|
+
logDetail3.color = "199";
|
|
1237
1237
|
logWarning2.color = "186";
|
|
1238
1238
|
logDebug.color = "211";
|
|
1239
1239
|
logColor.enabled = true;
|
|
@@ -1241,7 +1241,7 @@ function createLoggers(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
1241
1241
|
logInfo8.namespace = `${namespace2}:info`;
|
|
1242
1242
|
logTask5.namespace = `${namespace2}:task`;
|
|
1243
1243
|
logError4.namespace = `${namespace2}:error`;
|
|
1244
|
-
|
|
1244
|
+
logDetail3.namespace = `${namespace2}:detail`;
|
|
1245
1245
|
logWarning2.namespace = `${namespace2}:warning`;
|
|
1246
1246
|
logDebug.namespace = `${namespace2}:debug`;
|
|
1247
1247
|
}
|
|
@@ -1252,7 +1252,7 @@ function createLoggers(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
1252
1252
|
logTask5.enabled = true;
|
|
1253
1253
|
logError4.enabled = true;
|
|
1254
1254
|
logWarning2.enabled = true;
|
|
1255
|
-
|
|
1255
|
+
logDetail3.enabled = false;
|
|
1256
1256
|
logDebug.enabled = false;
|
|
1257
1257
|
break;
|
|
1258
1258
|
case "debug":
|
|
@@ -1260,7 +1260,7 @@ function createLoggers(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
1260
1260
|
logTask5.enabled = true;
|
|
1261
1261
|
logError4.enabled = true;
|
|
1262
1262
|
logWarning2.enabled = true;
|
|
1263
|
-
|
|
1263
|
+
logDetail3.enabled = true;
|
|
1264
1264
|
logDebug.enabled = true;
|
|
1265
1265
|
break;
|
|
1266
1266
|
case "none":
|
|
@@ -1268,7 +1268,7 @@ function createLoggers(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
1268
1268
|
logTask5.enabled = false;
|
|
1269
1269
|
logError4.enabled = false;
|
|
1270
1270
|
logWarning2.enabled = false;
|
|
1271
|
-
|
|
1271
|
+
logDetail3.enabled = false;
|
|
1272
1272
|
logDebug.enabled = false;
|
|
1273
1273
|
break;
|
|
1274
1274
|
}
|
|
@@ -1286,7 +1286,7 @@ function createLoggers(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
1286
1286
|
logError4.color = color;
|
|
1287
1287
|
break;
|
|
1288
1288
|
case "detail":
|
|
1289
|
-
|
|
1289
|
+
logDetail3.color = color;
|
|
1290
1290
|
break;
|
|
1291
1291
|
case "warning":
|
|
1292
1292
|
logWarning2.color = color;
|
|
@@ -1344,7 +1344,7 @@ ${" ".repeat(padding)}${"=".repeat(80)}`;
|
|
|
1344
1344
|
function logHeader(title) {
|
|
1345
1345
|
logInfo8(`${header(title, 2)}`);
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function logDataObject3(title, ...args) {
|
|
1348
1348
|
const stack = new Error().stack?.split("\n")[2] || "";
|
|
1349
1349
|
const stackMatch = stack.match(/\((.*):(\d+):(\d+)\)$/) || stack.match(/at (.*):(\d+):(\d+)$/);
|
|
1350
1350
|
let callerDetails = "";
|
|
@@ -1353,7 +1353,7 @@ ${" ".repeat(padding)}${"=".repeat(80)}`;
|
|
|
1353
1353
|
const functionName = functionMatch ? functionMatch[1] : "<anonymous>";
|
|
1354
1354
|
callerDetails = `${functionName}`;
|
|
1355
1355
|
}
|
|
1356
|
-
|
|
1356
|
+
logDetail3(`${header(`*${title}* ${callerDetails}`)}
|
|
1357
1357
|
${args.reduce((acc, arg) => `${acc}
|
|
1358
1358
|
${logDataDetail(arg)}`, "")}
|
|
1359
1359
|
|
|
@@ -1376,14 +1376,14 @@ ${"=".repeat(80)}`);
|
|
|
1376
1376
|
logInfo: logInfo8,
|
|
1377
1377
|
logTask: logTask5,
|
|
1378
1378
|
logError: logError4,
|
|
1379
|
-
logDetail:
|
|
1379
|
+
logDetail: logDetail3,
|
|
1380
1380
|
logDebug,
|
|
1381
1381
|
logWarning: logWarning2,
|
|
1382
1382
|
logColor,
|
|
1383
1383
|
setColors,
|
|
1384
1384
|
printColors,
|
|
1385
1385
|
logHeader,
|
|
1386
|
-
logDataObject:
|
|
1386
|
+
logDataObject: logDataObject3,
|
|
1387
1387
|
logErrorObject,
|
|
1388
1388
|
setLogLevel,
|
|
1389
1389
|
setNamespace: setNamespace7
|
|
@@ -37019,14 +37019,14 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
37019
37019
|
const logInfo222 = (0, import_debug2.default)(`${namespace}:info`);
|
|
37020
37020
|
const logTask5 = (0, import_debug2.default)(`${namespace}:task`);
|
|
37021
37021
|
const logError22 = (0, import_debug2.default)(`${namespace}:error`);
|
|
37022
|
-
const
|
|
37022
|
+
const logDetail3 = (0, import_debug2.default)(`${namespace}:detail`);
|
|
37023
37023
|
const logDebug = (0, import_debug2.default)(`${namespace}:debug`);
|
|
37024
37024
|
const logWarning2 = (0, import_debug2.default)(`${namespace}:warning`);
|
|
37025
37025
|
const logColor = (0, import_debug2.default)(`${namespace}:color`);
|
|
37026
37026
|
logInfo222.color = "19";
|
|
37027
37027
|
logTask5.color = "25";
|
|
37028
37028
|
logError22.color = "1";
|
|
37029
|
-
|
|
37029
|
+
logDetail3.color = "199";
|
|
37030
37030
|
logWarning2.color = "186";
|
|
37031
37031
|
logDebug.color = "211";
|
|
37032
37032
|
logColor.enabled = true;
|
|
@@ -37034,7 +37034,7 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
37034
37034
|
logInfo222.namespace = `${namespace2}:info`;
|
|
37035
37035
|
logTask5.namespace = `${namespace2}:task`;
|
|
37036
37036
|
logError22.namespace = `${namespace2}:error`;
|
|
37037
|
-
|
|
37037
|
+
logDetail3.namespace = `${namespace2}:detail`;
|
|
37038
37038
|
logWarning2.namespace = `${namespace2}:warning`;
|
|
37039
37039
|
logDebug.namespace = `${namespace2}:debug`;
|
|
37040
37040
|
}
|
|
@@ -37045,7 +37045,7 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
37045
37045
|
logTask5.enabled = true;
|
|
37046
37046
|
logError22.enabled = true;
|
|
37047
37047
|
logWarning2.enabled = true;
|
|
37048
|
-
|
|
37048
|
+
logDetail3.enabled = false;
|
|
37049
37049
|
logDebug.enabled = false;
|
|
37050
37050
|
break;
|
|
37051
37051
|
case "debug":
|
|
@@ -37053,7 +37053,7 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
37053
37053
|
logTask5.enabled = true;
|
|
37054
37054
|
logError22.enabled = true;
|
|
37055
37055
|
logWarning2.enabled = true;
|
|
37056
|
-
|
|
37056
|
+
logDetail3.enabled = true;
|
|
37057
37057
|
logDebug.enabled = true;
|
|
37058
37058
|
break;
|
|
37059
37059
|
case "none":
|
|
@@ -37061,7 +37061,7 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
37061
37061
|
logTask5.enabled = false;
|
|
37062
37062
|
logError22.enabled = false;
|
|
37063
37063
|
logWarning2.enabled = false;
|
|
37064
|
-
|
|
37064
|
+
logDetail3.enabled = false;
|
|
37065
37065
|
logDebug.enabled = false;
|
|
37066
37066
|
break;
|
|
37067
37067
|
}
|
|
@@ -37079,7 +37079,7 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
37079
37079
|
logError22.color = color;
|
|
37080
37080
|
break;
|
|
37081
37081
|
case "detail":
|
|
37082
|
-
|
|
37082
|
+
logDetail3.color = color;
|
|
37083
37083
|
break;
|
|
37084
37084
|
case "warning":
|
|
37085
37085
|
logWarning2.color = color;
|
|
@@ -37137,7 +37137,7 @@ ${" ".repeat(padding)}${"=".repeat(80)}`;
|
|
|
37137
37137
|
function logHeader(title) {
|
|
37138
37138
|
logInfo222(`${header(title, 2)}`);
|
|
37139
37139
|
}
|
|
37140
|
-
function
|
|
37140
|
+
function logDataObject22(title, ...args) {
|
|
37141
37141
|
const stack = new Error().stack?.split("\n")[2] || "";
|
|
37142
37142
|
const stackMatch = stack.match(/\((.*):(\d+):(\d+)\)$/) || stack.match(/at (.*):(\d+):(\d+)$/);
|
|
37143
37143
|
let callerDetails = "";
|
|
@@ -37146,7 +37146,7 @@ ${" ".repeat(padding)}${"=".repeat(80)}`;
|
|
|
37146
37146
|
const functionName = functionMatch ? functionMatch[1] : "<anonymous>";
|
|
37147
37147
|
callerDetails = `${functionName}`;
|
|
37148
37148
|
}
|
|
37149
|
-
|
|
37149
|
+
logDetail3(`${header(`*${title}* ${callerDetails}`)}
|
|
37150
37150
|
${args.reduce((acc, arg) => `${acc}
|
|
37151
37151
|
${logDataDetail(arg)}`, "")}
|
|
37152
37152
|
|
|
@@ -37169,14 +37169,14 @@ ${"=".repeat(80)}`);
|
|
|
37169
37169
|
logInfo: logInfo222,
|
|
37170
37170
|
logTask: logTask5,
|
|
37171
37171
|
logError: logError22,
|
|
37172
|
-
logDetail:
|
|
37172
|
+
logDetail: logDetail3,
|
|
37173
37173
|
logDebug,
|
|
37174
37174
|
logWarning: logWarning2,
|
|
37175
37175
|
logColor,
|
|
37176
37176
|
setColors,
|
|
37177
37177
|
printColors,
|
|
37178
37178
|
logHeader,
|
|
37179
|
-
logDataObject:
|
|
37179
|
+
logDataObject: logDataObject22,
|
|
37180
37180
|
logErrorObject,
|
|
37181
37181
|
setLogLevel,
|
|
37182
37182
|
setNamespace: setNamespace7
|
|
@@ -38116,14 +38116,14 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
|
|
|
38116
38116
|
const logInfo32 = (0, import_debug22.default)(`${namespace}:info`);
|
|
38117
38117
|
const logTask5 = (0, import_debug22.default)(`${namespace}:task`);
|
|
38118
38118
|
const logError22 = (0, import_debug22.default)(`${namespace}:error`);
|
|
38119
|
-
const
|
|
38119
|
+
const logDetail3 = (0, import_debug22.default)(`${namespace}:detail`);
|
|
38120
38120
|
const logDebug = (0, import_debug22.default)(`${namespace}:debug`);
|
|
38121
38121
|
const logWarning2 = (0, import_debug22.default)(`${namespace}:warning`);
|
|
38122
38122
|
const logColor = (0, import_debug22.default)(`${namespace}:color`);
|
|
38123
38123
|
logInfo32.color = "19";
|
|
38124
38124
|
logTask5.color = "25";
|
|
38125
38125
|
logError22.color = "1";
|
|
38126
|
-
|
|
38126
|
+
logDetail3.color = "199";
|
|
38127
38127
|
logWarning2.color = "186";
|
|
38128
38128
|
logDebug.color = "211";
|
|
38129
38129
|
logColor.enabled = true;
|
|
@@ -38131,7 +38131,7 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
|
|
|
38131
38131
|
logInfo32.namespace = `${namespace2}:info`;
|
|
38132
38132
|
logTask5.namespace = `${namespace2}:task`;
|
|
38133
38133
|
logError22.namespace = `${namespace2}:error`;
|
|
38134
|
-
|
|
38134
|
+
logDetail3.namespace = `${namespace2}:detail`;
|
|
38135
38135
|
logWarning2.namespace = `${namespace2}:warning`;
|
|
38136
38136
|
logDebug.namespace = `${namespace2}:debug`;
|
|
38137
38137
|
}
|
|
@@ -38142,7 +38142,7 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
|
|
|
38142
38142
|
logTask5.enabled = true;
|
|
38143
38143
|
logError22.enabled = true;
|
|
38144
38144
|
logWarning2.enabled = true;
|
|
38145
|
-
|
|
38145
|
+
logDetail3.enabled = false;
|
|
38146
38146
|
logDebug.enabled = false;
|
|
38147
38147
|
break;
|
|
38148
38148
|
case "debug":
|
|
@@ -38150,7 +38150,7 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
|
|
|
38150
38150
|
logTask5.enabled = true;
|
|
38151
38151
|
logError22.enabled = true;
|
|
38152
38152
|
logWarning2.enabled = true;
|
|
38153
|
-
|
|
38153
|
+
logDetail3.enabled = true;
|
|
38154
38154
|
logDebug.enabled = true;
|
|
38155
38155
|
break;
|
|
38156
38156
|
case "none":
|
|
@@ -38158,7 +38158,7 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
|
|
|
38158
38158
|
logTask5.enabled = false;
|
|
38159
38159
|
logError22.enabled = false;
|
|
38160
38160
|
logWarning2.enabled = false;
|
|
38161
|
-
|
|
38161
|
+
logDetail3.enabled = false;
|
|
38162
38162
|
logDebug.enabled = false;
|
|
38163
38163
|
break;
|
|
38164
38164
|
}
|
|
@@ -38176,7 +38176,7 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
|
|
|
38176
38176
|
logError22.color = color;
|
|
38177
38177
|
break;
|
|
38178
38178
|
case "detail":
|
|
38179
|
-
|
|
38179
|
+
logDetail3.color = color;
|
|
38180
38180
|
break;
|
|
38181
38181
|
case "warning":
|
|
38182
38182
|
logWarning2.color = color;
|
|
@@ -38234,7 +38234,7 @@ ${" ".repeat(padding)}${"=".repeat(80)}`;
|
|
|
38234
38234
|
function logHeader(title) {
|
|
38235
38235
|
logInfo32(`${header(title, 2)}`);
|
|
38236
38236
|
}
|
|
38237
|
-
function
|
|
38237
|
+
function logDataObject22(title, ...args) {
|
|
38238
38238
|
const stack = new Error().stack?.split("\n")[2] || "";
|
|
38239
38239
|
const stackMatch = stack.match(/\((.*):(\d+):(\d+)\)$/) || stack.match(/at (.*):(\d+):(\d+)$/);
|
|
38240
38240
|
let callerDetails = "";
|
|
@@ -38243,7 +38243,7 @@ ${" ".repeat(padding)}${"=".repeat(80)}`;
|
|
|
38243
38243
|
const functionName = functionMatch ? functionMatch[1] : "<anonymous>";
|
|
38244
38244
|
callerDetails = `${functionName}`;
|
|
38245
38245
|
}
|
|
38246
|
-
|
|
38246
|
+
logDetail3(`${header(`*${title}* ${callerDetails}`)}
|
|
38247
38247
|
${args.reduce((acc, arg) => `${acc}
|
|
38248
38248
|
${logDataDetail(arg)}`, "")}
|
|
38249
38249
|
|
|
@@ -38266,14 +38266,14 @@ ${"=".repeat(80)}`);
|
|
|
38266
38266
|
logInfo: logInfo32,
|
|
38267
38267
|
logTask: logTask5,
|
|
38268
38268
|
logError: logError22,
|
|
38269
|
-
logDetail:
|
|
38269
|
+
logDetail: logDetail3,
|
|
38270
38270
|
logDebug,
|
|
38271
38271
|
logWarning: logWarning2,
|
|
38272
38272
|
logColor,
|
|
38273
38273
|
setColors,
|
|
38274
38274
|
printColors,
|
|
38275
38275
|
logHeader,
|
|
38276
|
-
logDataObject:
|
|
38276
|
+
logDataObject: logDataObject22,
|
|
38277
38277
|
logErrorObject,
|
|
38278
38278
|
setLogLevel,
|
|
38279
38279
|
setNamespace: setNamespace7
|
|
@@ -38364,7 +38364,7 @@ async function createMDMClient(options) {
|
|
|
38364
38364
|
}
|
|
38365
38365
|
|
|
38366
38366
|
// src/logic/actions/install.ts
|
|
38367
|
-
var { logInfo: logInfo3, setNamespace: setNamespace2 } = createLoggers("apple-kit:install");
|
|
38367
|
+
var { logInfo: logInfo3, setNamespace: setNamespace2, logDataObject: logDataObject2 } = createLoggers("apple-kit:install");
|
|
38368
38368
|
var InstallActions = class {
|
|
38369
38369
|
constructor(udid, iosClient) {
|
|
38370
38370
|
this.udid = udid;
|
|
@@ -38377,12 +38377,16 @@ var InstallActions = class {
|
|
|
38377
38377
|
}
|
|
38378
38378
|
async installManagedApp(ipaPath, options) {
|
|
38379
38379
|
const result = await this.iosClient.installApp(ipaPath);
|
|
38380
|
+
logDataObject2("Installing app result", { result });
|
|
38381
|
+
return await this.installManagedAppFromMDM(options);
|
|
38382
|
+
}
|
|
38383
|
+
async installManagedAppFromMDM(options) {
|
|
38380
38384
|
logInfo3("Installing app via MDM for management takeover");
|
|
38381
38385
|
const mdmClient = await createMDMClient(options.clientConfig);
|
|
38382
38386
|
if (!mdmClient) {
|
|
38383
38387
|
throw new Error("Failed to create MDM client");
|
|
38384
38388
|
}
|
|
38385
|
-
await mdmClient.installApp(this.udid, options);
|
|
38389
|
+
const result = await mdmClient.installApp(this.udid, options);
|
|
38386
38390
|
return result;
|
|
38387
38391
|
}
|
|
38388
38392
|
async uninstallApp(bundleId) {
|
|
@@ -38409,7 +38413,7 @@ var InstallActions = class {
|
|
|
38409
38413
|
};
|
|
38410
38414
|
|
|
38411
38415
|
// src/logic/actions/proxy.ts
|
|
38412
|
-
var { logTask: logTask2, logInfo: logInfo4, setNamespace: setNamespace3
|
|
38416
|
+
var { logTask: logTask2, logInfo: logInfo4, setNamespace: setNamespace3 } = createLoggers("");
|
|
38413
38417
|
var ProxyActions = class {
|
|
38414
38418
|
constructor(udid, iosClient) {
|
|
38415
38419
|
this.udid = udid;
|
|
@@ -38426,7 +38430,6 @@ var ProxyActions = class {
|
|
|
38426
38430
|
reject(new Error("Port forwarding timed out"));
|
|
38427
38431
|
}, timeoutMs);
|
|
38428
38432
|
result.stderr?.on("data", (data) => {
|
|
38429
|
-
logDetail("port forward stderr", data.toString());
|
|
38430
38433
|
if (data.toString().includes("Started")) {
|
|
38431
38434
|
clearTimeout(timeout2);
|
|
38432
38435
|
resolve2({
|
|
@@ -39030,7 +39033,7 @@ var ProfileParser = class {
|
|
|
39030
39033
|
};
|
|
39031
39034
|
|
|
39032
39035
|
// src/logic/iosClient.ts
|
|
39033
|
-
var { logDetail
|
|
39036
|
+
var { logDetail, setNamespace: setNamespace5, logTask: logTask4 } = createLoggers("");
|
|
39034
39037
|
var IosClient = class {
|
|
39035
39038
|
constructor(iosPath, udid, _usbmuxdAddress) {
|
|
39036
39039
|
this.iosPath = iosPath;
|
|
@@ -39185,7 +39188,7 @@ var IosClient = class {
|
|
|
39185
39188
|
}
|
|
39186
39189
|
async tunnelStart(userspace = false) {
|
|
39187
39190
|
const args = ["tunnel", "start", "--udid", this.udid, ...userspace ? ["--userspace"] : []];
|
|
39188
|
-
|
|
39191
|
+
logDetail(`Spawning tunnel: ${this.iosPath} ${args.join(" ")}`);
|
|
39189
39192
|
const child = (0, import_node_child_process.spawn)(this.iosPath, args, {
|
|
39190
39193
|
windowsHide: true,
|
|
39191
39194
|
env: {
|
|
@@ -39328,7 +39331,7 @@ var IosClient = class {
|
|
|
39328
39331
|
};
|
|
39329
39332
|
|
|
39330
39333
|
// src/logic/appleDeviceKit.ts
|
|
39331
|
-
var { logInfo: logInfo7, setNamespace: setNamespace6, logError: logError3, logDetail:
|
|
39334
|
+
var { logInfo: logInfo7, setNamespace: setNamespace6, logError: logError3, logDetail: logDetail2 } = createLoggers("apple-kit");
|
|
39332
39335
|
var AppleDeviceKit = class _AppleDeviceKit {
|
|
39333
39336
|
constructor(udid, logicalPort, usbmuxdAddress) {
|
|
39334
39337
|
this.logicalPort = logicalPort;
|
|
@@ -39346,11 +39349,7 @@ var AppleDeviceKit = class _AppleDeviceKit {
|
|
|
39346
39349
|
this.installActions = new InstallActions(this.deviceId, this.iosClient);
|
|
39347
39350
|
this.activationFlow = new ActivationFlow(this.deviceId, this.iosClient, this.deviceActions);
|
|
39348
39351
|
this.proxyActions = new ProxyActions(this.deviceId, this.iosClient);
|
|
39349
|
-
this.
|
|
39350
|
-
this.tunnelProcess = process3;
|
|
39351
|
-
}).catch((error) => {
|
|
39352
|
-
logError3(`Failed to start tunnel: ${error.message}`);
|
|
39353
|
-
});
|
|
39352
|
+
this.ensureTunnel();
|
|
39354
39353
|
}
|
|
39355
39354
|
deviceId;
|
|
39356
39355
|
proxyProcess = null;
|
|
@@ -39385,12 +39384,12 @@ var AppleDeviceKit = class _AppleDeviceKit {
|
|
|
39385
39384
|
async ensureTunnel() {
|
|
39386
39385
|
const requiresTunnel = await this.requiresTunneling();
|
|
39387
39386
|
if (!requiresTunnel) {
|
|
39388
|
-
|
|
39387
|
+
logDetail2(`Device ${this.deviceId} does not require tunneling (iOS < 17)`);
|
|
39389
39388
|
return;
|
|
39390
39389
|
}
|
|
39391
39390
|
const existingTunnel = this.tunnelProcess;
|
|
39392
39391
|
if (existingTunnel && !existingTunnel.killed) {
|
|
39393
|
-
|
|
39392
|
+
logDetail2(`Tunnel already running for device ${this.deviceId}`);
|
|
39394
39393
|
return;
|
|
39395
39394
|
}
|
|
39396
39395
|
logInfo7(`Starting tunnel for device ${this.deviceId} (iOS 17+)`);
|
|
@@ -39499,6 +39498,10 @@ var AppleDeviceKit = class _AppleDeviceKit {
|
|
|
39499
39498
|
this.ensureNotDisposed();
|
|
39500
39499
|
return this.installActions.installManagedApp(ipaPath, options);
|
|
39501
39500
|
}
|
|
39501
|
+
async installAppFromMDM(options) {
|
|
39502
|
+
this.ensureNotDisposed();
|
|
39503
|
+
return this.installActions.installManagedAppFromMDM(options);
|
|
39504
|
+
}
|
|
39502
39505
|
/**
|
|
39503
39506
|
* Uninstall an app by bundle ID (uninstall agent)
|
|
39504
39507
|
*
|
|
@@ -39619,7 +39622,7 @@ var AppleDeviceKit = class _AppleDeviceKit {
|
|
|
39619
39622
|
await (0, import_promises3.mkdir)(tmpDir, { recursive: true });
|
|
39620
39623
|
await (0, import_promises4.writeFile)(tmpFilePath, fileData);
|
|
39621
39624
|
const stats = await (0, import_promises3.stat)(tmpFilePath);
|
|
39622
|
-
|
|
39625
|
+
logDetail2(`Temp file written: ${tmpFilePath}, size: ${stats.size} bytes`);
|
|
39623
39626
|
if (stats.size !== fileData.length) {
|
|
39624
39627
|
throw new Error(
|
|
39625
39628
|
`File size mismatch: expected ${fileData.length} bytes, got ${stats.size} bytes`
|
|
@@ -39631,7 +39634,7 @@ var AppleDeviceKit = class _AppleDeviceKit {
|
|
|
39631
39634
|
srcPath: tmpFilePath,
|
|
39632
39635
|
dstPath: devicePath
|
|
39633
39636
|
});
|
|
39634
|
-
|
|
39637
|
+
logDetail2(`Push: ${JSON.stringify(pushResult)}`);
|
|
39635
39638
|
if (pushResult.exitCode !== 0) {
|
|
39636
39639
|
const errorMessages = pushResult.logMessages.filter((msg) => msg.level === "error").map((msg) => msg.msg).join("; ");
|
|
39637
39640
|
const allMessages = pushResult.logMessages.map((msg) => `${msg.level}: ${msg.msg}`).join("; ");
|
|
@@ -39668,7 +39671,7 @@ var AppleDeviceKit = class _AppleDeviceKit {
|
|
|
39668
39671
|
srcPath: devicePath,
|
|
39669
39672
|
dstPath: tmpDir
|
|
39670
39673
|
});
|
|
39671
|
-
|
|
39674
|
+
logDetail2(`Pull: ${JSON.stringify(pullResult)}`);
|
|
39672
39675
|
if (pullResult.exitCode !== 0) {
|
|
39673
39676
|
const errorMessages = pullResult.logMessages.filter((msg) => msg.level === "error").map((msg) => msg.msg).join("; ");
|
|
39674
39677
|
const allMessages = pullResult.logMessages.map((msg) => `${msg.level}: ${msg.msg}`).join("; ");
|