@mcesystems/apple-kit 1.0.91 → 1.0.93
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/README.md +258 -258
- package/dist/index.js +238 -85
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +238 -85
- package/dist/index.mjs.map +4 -4
- package/dist/resources/bin/darwin/idevice_id +0 -0
- package/dist/resources/bin/darwin/idevicedebug +0 -0
- package/dist/resources/bin/darwin/idevicediagnostics +0 -0
- package/dist/resources/bin/darwin/ideviceinfo +0 -0
- package/dist/resources/bin/darwin/ideviceinstaller +0 -0
- package/dist/resources/bin/darwin/idevicename +0 -0
- package/dist/resources/bin/darwin/idevicepair +0 -0
- package/dist/resources/bin/darwin/idevicescreenshot +0 -0
- package/dist/resources/bin/darwin/idevicesyslog +0 -0
- package/dist/resources/bin/darwin/iproxy +0 -0
- package/dist/resources/bin/darwin/libcrypto.3.dylib +0 -0
- package/dist/resources/bin/darwin/libimobiledevice-1.0.6.dylib +0 -0
- package/dist/resources/bin/darwin/libimobiledevice-glue-1.0.0.dylib +0 -0
- package/dist/resources/bin/darwin/liblzma.5.dylib +0 -0
- package/dist/resources/bin/darwin/libplist-2.0.4.dylib +0 -0
- package/dist/resources/bin/darwin/libssl.3.dylib +0 -0
- package/dist/resources/bin/darwin/libusbmuxd-2.0.7.dylib +0 -0
- package/dist/resources/bin/darwin/libzip.5.dylib +0 -0
- package/dist/resources/bin/darwin/libzstd.1.dylib +0 -0
- package/dist/resources/licenses/LGPL-2.1.txt +33 -0
- package/dist/resources/plist/certificate-trust.xml +43 -43
- package/dist/resources/plist/wifi-enterprise.xml +59 -59
- package/dist/resources/plist/wifi-standard.xml +50 -50
- package/dist/types/index.d.ts +21 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/logic/actions/activation.d.ts +12 -0
- package/dist/types/logic/actions/activation.d.ts.map +1 -0
- package/dist/types/logic/actions/device.d.ts +15 -0
- package/dist/types/logic/actions/device.d.ts.map +1 -0
- package/dist/types/logic/actions/install.d.ts +10 -0
- package/dist/types/logic/actions/install.d.ts.map +1 -0
- package/dist/types/logic/actions/pair.d.ts +6 -0
- package/dist/types/logic/actions/pair.d.ts.map +1 -0
- package/dist/types/logic/actions/proxy.d.ts +23 -0
- package/dist/types/logic/actions/proxy.d.ts.map +1 -0
- package/dist/types/logic/actions/restore.d.ts +36 -0
- package/dist/types/logic/actions/restore.d.ts.map +1 -0
- package/dist/types/logic/actions/tool.d.ts +8 -0
- package/dist/types/logic/actions/tool.d.ts.map +1 -0
- package/dist/types/logic/activationFlow.d.ts +15 -0
- package/dist/types/logic/activationFlow.d.ts.map +1 -0
- package/dist/types/logic/appleDeviceKit.d.ts +164 -0
- package/dist/types/logic/appleDeviceKit.d.ts.map +1 -0
- package/dist/types/logic/dataParser.d.ts +23 -0
- package/dist/types/logic/dataParser.d.ts.map +1 -0
- package/dist/types/logic/iosCli.d.ts +6 -0
- package/dist/types/logic/iosCli.d.ts.map +1 -0
- package/dist/types/logic/utils/resolvePath.d.ts +13 -0
- package/dist/types/logic/utils/resolvePath.d.ts.map +1 -0
- package/dist/types/types/activation.d.ts +28 -0
- package/dist/types/types/activation.d.ts.map +1 -0
- package/dist/types/types/ios.d.ts +152 -0
- package/dist/types/types/ios.d.ts.map +1 -0
- package/dist/types/types/trust.d.ts +10 -0
- package/dist/types/types/trust.d.ts.map +1 -0
- package/dist/types/types/types.d.ts +47 -0
- package/dist/types/types/types.d.ts.map +1 -0
- package/dist/types/types/wifi.d.ts +19 -0
- package/dist/types/types/wifi.d.ts.map +1 -0
- package/dist/types/types.d.ts +140 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/utils/debug.d.ts +17 -0
- package/dist/types/utils/debug.d.ts.map +1 -0
- package/dist/types/utils/templateLoader.d.ts +8 -0
- package/dist/types/utils/templateLoader.d.ts.map +1 -0
- package/dist/types/utils/wifiProfile.d.ts +14 -0
- package/dist/types/utils/wifiProfile.d.ts.map +1 -0
- package/package.json +3 -3
- package/scripts/README.md +209 -209
- package/scripts/build-windows.sh.template +222 -222
- package/resources/ios.exe +0 -0
- package/resources/wintun-LICENSE.txt +0 -84
- package/resources/wintun.dll +0 -0
package/dist/index.js
CHANGED
|
@@ -387,6 +387,12 @@ __export(index_exports, {
|
|
|
387
387
|
});
|
|
388
388
|
module.exports = __toCommonJS(index_exports);
|
|
389
389
|
|
|
390
|
+
// src/logic/appleDeviceKit.ts
|
|
391
|
+
var import_node_fs5 = require("node:fs");
|
|
392
|
+
var import_promises3 = require("node:fs/promises");
|
|
393
|
+
var import_promises4 = require("node:fs/promises");
|
|
394
|
+
var import_node_path5 = require("node:path");
|
|
395
|
+
|
|
390
396
|
// ../tool-debug/dist/index.mjs
|
|
391
397
|
var import_node_process = __toESM(require("node:process"), 1);
|
|
392
398
|
var import_node_os = __toESM(require("node:os"), 1);
|
|
@@ -1220,14 +1226,14 @@ function createLoggers(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
1220
1226
|
const logInfo8 = (0, import_debug.default)(`${namespace}:info`);
|
|
1221
1227
|
const logTask5 = (0, import_debug.default)(`${namespace}:task`);
|
|
1222
1228
|
const logError4 = (0, import_debug.default)(`${namespace}:error`);
|
|
1223
|
-
const
|
|
1229
|
+
const logDetail4 = (0, import_debug.default)(`${namespace}:detail`);
|
|
1224
1230
|
const logDebug = (0, import_debug.default)(`${namespace}:debug`);
|
|
1225
1231
|
const logWarning2 = (0, import_debug.default)(`${namespace}:warning`);
|
|
1226
1232
|
const logColor = (0, import_debug.default)(`${namespace}:color`);
|
|
1227
1233
|
logInfo8.color = "19";
|
|
1228
1234
|
logTask5.color = "25";
|
|
1229
1235
|
logError4.color = "1";
|
|
1230
|
-
|
|
1236
|
+
logDetail4.color = "199";
|
|
1231
1237
|
logWarning2.color = "186";
|
|
1232
1238
|
logDebug.color = "211";
|
|
1233
1239
|
logColor.enabled = true;
|
|
@@ -1235,7 +1241,7 @@ function createLoggers(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
1235
1241
|
logInfo8.namespace = `${namespace2}:info`;
|
|
1236
1242
|
logTask5.namespace = `${namespace2}:task`;
|
|
1237
1243
|
logError4.namespace = `${namespace2}:error`;
|
|
1238
|
-
|
|
1244
|
+
logDetail4.namespace = `${namespace2}:detail`;
|
|
1239
1245
|
logWarning2.namespace = `${namespace2}:warning`;
|
|
1240
1246
|
logDebug.namespace = `${namespace2}:debug`;
|
|
1241
1247
|
}
|
|
@@ -1246,7 +1252,7 @@ function createLoggers(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
1246
1252
|
logTask5.enabled = true;
|
|
1247
1253
|
logError4.enabled = true;
|
|
1248
1254
|
logWarning2.enabled = true;
|
|
1249
|
-
|
|
1255
|
+
logDetail4.enabled = false;
|
|
1250
1256
|
logDebug.enabled = false;
|
|
1251
1257
|
break;
|
|
1252
1258
|
case "debug":
|
|
@@ -1254,7 +1260,7 @@ function createLoggers(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
1254
1260
|
logTask5.enabled = true;
|
|
1255
1261
|
logError4.enabled = true;
|
|
1256
1262
|
logWarning2.enabled = true;
|
|
1257
|
-
|
|
1263
|
+
logDetail4.enabled = true;
|
|
1258
1264
|
logDebug.enabled = true;
|
|
1259
1265
|
break;
|
|
1260
1266
|
case "none":
|
|
@@ -1262,7 +1268,7 @@ function createLoggers(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
1262
1268
|
logTask5.enabled = false;
|
|
1263
1269
|
logError4.enabled = false;
|
|
1264
1270
|
logWarning2.enabled = false;
|
|
1265
|
-
|
|
1271
|
+
logDetail4.enabled = false;
|
|
1266
1272
|
logDebug.enabled = false;
|
|
1267
1273
|
break;
|
|
1268
1274
|
}
|
|
@@ -1280,7 +1286,7 @@ function createLoggers(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
1280
1286
|
logError4.color = color;
|
|
1281
1287
|
break;
|
|
1282
1288
|
case "detail":
|
|
1283
|
-
|
|
1289
|
+
logDetail4.color = color;
|
|
1284
1290
|
break;
|
|
1285
1291
|
case "warning":
|
|
1286
1292
|
logWarning2.color = color;
|
|
@@ -1347,7 +1353,7 @@ ${" ".repeat(padding)}${"=".repeat(80)}`;
|
|
|
1347
1353
|
const functionName = functionMatch ? functionMatch[1] : "<anonymous>";
|
|
1348
1354
|
callerDetails = `${functionName}`;
|
|
1349
1355
|
}
|
|
1350
|
-
|
|
1356
|
+
logDetail4(`${header(`*${title}* ${callerDetails}`)}
|
|
1351
1357
|
${args.reduce((acc, arg) => `${acc}
|
|
1352
1358
|
${logDataDetail(arg)}`, "")}
|
|
1353
1359
|
|
|
@@ -1370,7 +1376,7 @@ ${"=".repeat(80)}`);
|
|
|
1370
1376
|
logInfo: logInfo8,
|
|
1371
1377
|
logTask: logTask5,
|
|
1372
1378
|
logError: logError4,
|
|
1373
|
-
logDetail:
|
|
1379
|
+
logDetail: logDetail4,
|
|
1374
1380
|
logDebug,
|
|
1375
1381
|
logWarning: logWarning2,
|
|
1376
1382
|
logColor,
|
|
@@ -11727,12 +11733,12 @@ var require_form_data = __commonJS3({
|
|
|
11727
11733
|
if (value.end != void 0 && value.end != Infinity && value.start != void 0) {
|
|
11728
11734
|
callback(null, value.end + 1 - (value.start ? value.start : 0));
|
|
11729
11735
|
} else {
|
|
11730
|
-
fs.stat(value.path, function(err,
|
|
11736
|
+
fs.stat(value.path, function(err, stat2) {
|
|
11731
11737
|
if (err) {
|
|
11732
11738
|
callback(err);
|
|
11733
11739
|
return;
|
|
11734
11740
|
}
|
|
11735
|
-
var fileSize =
|
|
11741
|
+
var fileSize = stat2.size - (value.start ? value.start : 0);
|
|
11736
11742
|
callback(null, fileSize);
|
|
11737
11743
|
});
|
|
11738
11744
|
}
|
|
@@ -15810,16 +15816,16 @@ var require_printer = __commonJS3({
|
|
|
15810
15816
|
},
|
|
15811
15817
|
// Document
|
|
15812
15818
|
Document: {
|
|
15813
|
-
leave: (node) =>
|
|
15819
|
+
leave: (node) => join6(node.definitions, "\n\n")
|
|
15814
15820
|
},
|
|
15815
15821
|
OperationDefinition: {
|
|
15816
15822
|
leave(node) {
|
|
15817
|
-
const varDefs = hasMultilineItems(node.variableDefinitions) ? wrap("(\n",
|
|
15818
|
-
const prefix = wrap("", node.description, "\n") +
|
|
15823
|
+
const varDefs = hasMultilineItems(node.variableDefinitions) ? wrap("(\n", join6(node.variableDefinitions, "\n"), "\n)") : wrap("(", join6(node.variableDefinitions, ", "), ")");
|
|
15824
|
+
const prefix = wrap("", node.description, "\n") + join6(
|
|
15819
15825
|
[
|
|
15820
15826
|
node.operation,
|
|
15821
|
-
|
|
15822
|
-
|
|
15827
|
+
join6([node.name, varDefs]),
|
|
15828
|
+
join6(node.directives, " ")
|
|
15823
15829
|
],
|
|
15824
15830
|
" "
|
|
15825
15831
|
);
|
|
@@ -15827,7 +15833,7 @@ var require_printer = __commonJS3({
|
|
|
15827
15833
|
}
|
|
15828
15834
|
},
|
|
15829
15835
|
VariableDefinition: {
|
|
15830
|
-
leave: ({ variable, type, defaultValue, directives, description }) => wrap("", description, "\n") + variable + ": " + type + wrap(" = ", defaultValue) + wrap(" ",
|
|
15836
|
+
leave: ({ variable, type, defaultValue, directives, description }) => wrap("", description, "\n") + variable + ": " + type + wrap(" = ", defaultValue) + wrap(" ", join6(directives, " "))
|
|
15831
15837
|
},
|
|
15832
15838
|
SelectionSet: {
|
|
15833
15839
|
leave: ({ selections }) => block(selections)
|
|
@@ -15835,11 +15841,11 @@ var require_printer = __commonJS3({
|
|
|
15835
15841
|
Field: {
|
|
15836
15842
|
leave({ alias, name, arguments: args, directives, selectionSet }) {
|
|
15837
15843
|
const prefix = wrap("", alias, ": ") + name;
|
|
15838
|
-
let argsLine = prefix + wrap("(",
|
|
15844
|
+
let argsLine = prefix + wrap("(", join6(args, ", "), ")");
|
|
15839
15845
|
if (argsLine.length > MAX_LINE_LENGTH) {
|
|
15840
|
-
argsLine = prefix + wrap("(\n", indent(
|
|
15846
|
+
argsLine = prefix + wrap("(\n", indent(join6(args, "\n")), "\n)");
|
|
15841
15847
|
}
|
|
15842
|
-
return
|
|
15848
|
+
return join6([argsLine, join6(directives, " "), selectionSet], " ");
|
|
15843
15849
|
}
|
|
15844
15850
|
},
|
|
15845
15851
|
Argument: {
|
|
@@ -15847,14 +15853,14 @@ var require_printer = __commonJS3({
|
|
|
15847
15853
|
},
|
|
15848
15854
|
// Fragments
|
|
15849
15855
|
FragmentSpread: {
|
|
15850
|
-
leave: ({ name, directives }) => "..." + name + wrap(" ",
|
|
15856
|
+
leave: ({ name, directives }) => "..." + name + wrap(" ", join6(directives, " "))
|
|
15851
15857
|
},
|
|
15852
15858
|
InlineFragment: {
|
|
15853
|
-
leave: ({ typeCondition, directives, selectionSet }) =>
|
|
15859
|
+
leave: ({ typeCondition, directives, selectionSet }) => join6(
|
|
15854
15860
|
[
|
|
15855
15861
|
"...",
|
|
15856
15862
|
wrap("on ", typeCondition),
|
|
15857
|
-
|
|
15863
|
+
join6(directives, " "),
|
|
15858
15864
|
selectionSet
|
|
15859
15865
|
],
|
|
15860
15866
|
" "
|
|
@@ -15870,7 +15876,7 @@ var require_printer = __commonJS3({
|
|
|
15870
15876
|
description
|
|
15871
15877
|
}) => wrap("", description, "\n") + // Note: fragment variable definitions are experimental and may be changed
|
|
15872
15878
|
// or removed in the future.
|
|
15873
|
-
`fragment ${name}${wrap("(",
|
|
15879
|
+
`fragment ${name}${wrap("(", join6(variableDefinitions, ", "), ")")} on ${typeCondition} ${wrap("", join6(directives, " "), " ")}` + selectionSet
|
|
15874
15880
|
},
|
|
15875
15881
|
// Value
|
|
15876
15882
|
IntValue: {
|
|
@@ -15892,17 +15898,17 @@ var require_printer = __commonJS3({
|
|
|
15892
15898
|
leave: ({ value }) => value
|
|
15893
15899
|
},
|
|
15894
15900
|
ListValue: {
|
|
15895
|
-
leave: ({ values }) => "[" +
|
|
15901
|
+
leave: ({ values }) => "[" + join6(values, ", ") + "]"
|
|
15896
15902
|
},
|
|
15897
15903
|
ObjectValue: {
|
|
15898
|
-
leave: ({ fields }) => "{" +
|
|
15904
|
+
leave: ({ fields }) => "{" + join6(fields, ", ") + "}"
|
|
15899
15905
|
},
|
|
15900
15906
|
ObjectField: {
|
|
15901
15907
|
leave: ({ name, value }) => name + ": " + value
|
|
15902
15908
|
},
|
|
15903
15909
|
// Directive
|
|
15904
15910
|
Directive: {
|
|
15905
|
-
leave: ({ name, arguments: args }) => "@" + name + wrap("(",
|
|
15911
|
+
leave: ({ name, arguments: args }) => "@" + name + wrap("(", join6(args, ", "), ")")
|
|
15906
15912
|
},
|
|
15907
15913
|
// Type
|
|
15908
15914
|
NamedType: {
|
|
@@ -15916,138 +15922,138 @@ var require_printer = __commonJS3({
|
|
|
15916
15922
|
},
|
|
15917
15923
|
// Type System Definitions
|
|
15918
15924
|
SchemaDefinition: {
|
|
15919
|
-
leave: ({ description, directives, operationTypes }) => wrap("", description, "\n") +
|
|
15925
|
+
leave: ({ description, directives, operationTypes }) => wrap("", description, "\n") + join6(["schema", join6(directives, " "), block(operationTypes)], " ")
|
|
15920
15926
|
},
|
|
15921
15927
|
OperationTypeDefinition: {
|
|
15922
15928
|
leave: ({ operation, type }) => operation + ": " + type
|
|
15923
15929
|
},
|
|
15924
15930
|
ScalarTypeDefinition: {
|
|
15925
|
-
leave: ({ description, name, directives }) => wrap("", description, "\n") +
|
|
15931
|
+
leave: ({ description, name, directives }) => wrap("", description, "\n") + join6(["scalar", name, join6(directives, " ")], " ")
|
|
15926
15932
|
},
|
|
15927
15933
|
ObjectTypeDefinition: {
|
|
15928
|
-
leave: ({ description, name, interfaces, directives, fields }) => wrap("", description, "\n") +
|
|
15934
|
+
leave: ({ description, name, interfaces, directives, fields }) => wrap("", description, "\n") + join6(
|
|
15929
15935
|
[
|
|
15930
15936
|
"type",
|
|
15931
15937
|
name,
|
|
15932
|
-
wrap("implements ",
|
|
15933
|
-
|
|
15938
|
+
wrap("implements ", join6(interfaces, " & ")),
|
|
15939
|
+
join6(directives, " "),
|
|
15934
15940
|
block(fields)
|
|
15935
15941
|
],
|
|
15936
15942
|
" "
|
|
15937
15943
|
)
|
|
15938
15944
|
},
|
|
15939
15945
|
FieldDefinition: {
|
|
15940
|
-
leave: ({ description, name, arguments: args, type, directives }) => wrap("", description, "\n") + name + (hasMultilineItems(args) ? wrap("(\n", indent(
|
|
15946
|
+
leave: ({ description, name, arguments: args, type, directives }) => wrap("", description, "\n") + name + (hasMultilineItems(args) ? wrap("(\n", indent(join6(args, "\n")), "\n)") : wrap("(", join6(args, ", "), ")")) + ": " + type + wrap(" ", join6(directives, " "))
|
|
15941
15947
|
},
|
|
15942
15948
|
InputValueDefinition: {
|
|
15943
|
-
leave: ({ description, name, type, defaultValue, directives }) => wrap("", description, "\n") +
|
|
15944
|
-
[name + ": " + type, wrap("= ", defaultValue),
|
|
15949
|
+
leave: ({ description, name, type, defaultValue, directives }) => wrap("", description, "\n") + join6(
|
|
15950
|
+
[name + ": " + type, wrap("= ", defaultValue), join6(directives, " ")],
|
|
15945
15951
|
" "
|
|
15946
15952
|
)
|
|
15947
15953
|
},
|
|
15948
15954
|
InterfaceTypeDefinition: {
|
|
15949
|
-
leave: ({ description, name, interfaces, directives, fields }) => wrap("", description, "\n") +
|
|
15955
|
+
leave: ({ description, name, interfaces, directives, fields }) => wrap("", description, "\n") + join6(
|
|
15950
15956
|
[
|
|
15951
15957
|
"interface",
|
|
15952
15958
|
name,
|
|
15953
|
-
wrap("implements ",
|
|
15954
|
-
|
|
15959
|
+
wrap("implements ", join6(interfaces, " & ")),
|
|
15960
|
+
join6(directives, " "),
|
|
15955
15961
|
block(fields)
|
|
15956
15962
|
],
|
|
15957
15963
|
" "
|
|
15958
15964
|
)
|
|
15959
15965
|
},
|
|
15960
15966
|
UnionTypeDefinition: {
|
|
15961
|
-
leave: ({ description, name, directives, types }) => wrap("", description, "\n") +
|
|
15962
|
-
["union", name,
|
|
15967
|
+
leave: ({ description, name, directives, types }) => wrap("", description, "\n") + join6(
|
|
15968
|
+
["union", name, join6(directives, " "), wrap("= ", join6(types, " | "))],
|
|
15963
15969
|
" "
|
|
15964
15970
|
)
|
|
15965
15971
|
},
|
|
15966
15972
|
EnumTypeDefinition: {
|
|
15967
|
-
leave: ({ description, name, directives, values }) => wrap("", description, "\n") +
|
|
15973
|
+
leave: ({ description, name, directives, values }) => wrap("", description, "\n") + join6(["enum", name, join6(directives, " "), block(values)], " ")
|
|
15968
15974
|
},
|
|
15969
15975
|
EnumValueDefinition: {
|
|
15970
|
-
leave: ({ description, name, directives }) => wrap("", description, "\n") +
|
|
15976
|
+
leave: ({ description, name, directives }) => wrap("", description, "\n") + join6([name, join6(directives, " ")], " ")
|
|
15971
15977
|
},
|
|
15972
15978
|
InputObjectTypeDefinition: {
|
|
15973
|
-
leave: ({ description, name, directives, fields }) => wrap("", description, "\n") +
|
|
15979
|
+
leave: ({ description, name, directives, fields }) => wrap("", description, "\n") + join6(["input", name, join6(directives, " "), block(fields)], " ")
|
|
15974
15980
|
},
|
|
15975
15981
|
DirectiveDefinition: {
|
|
15976
|
-
leave: ({ description, name, arguments: args, repeatable, locations }) => wrap("", description, "\n") + "directive @" + name + (hasMultilineItems(args) ? wrap("(\n", indent(
|
|
15982
|
+
leave: ({ description, name, arguments: args, repeatable, locations }) => wrap("", description, "\n") + "directive @" + name + (hasMultilineItems(args) ? wrap("(\n", indent(join6(args, "\n")), "\n)") : wrap("(", join6(args, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join6(locations, " | ")
|
|
15977
15983
|
},
|
|
15978
15984
|
SchemaExtension: {
|
|
15979
|
-
leave: ({ directives, operationTypes }) =>
|
|
15980
|
-
["extend schema",
|
|
15985
|
+
leave: ({ directives, operationTypes }) => join6(
|
|
15986
|
+
["extend schema", join6(directives, " "), block(operationTypes)],
|
|
15981
15987
|
" "
|
|
15982
15988
|
)
|
|
15983
15989
|
},
|
|
15984
15990
|
ScalarTypeExtension: {
|
|
15985
|
-
leave: ({ name, directives }) =>
|
|
15991
|
+
leave: ({ name, directives }) => join6(["extend scalar", name, join6(directives, " ")], " ")
|
|
15986
15992
|
},
|
|
15987
15993
|
ObjectTypeExtension: {
|
|
15988
|
-
leave: ({ name, interfaces, directives, fields }) =>
|
|
15994
|
+
leave: ({ name, interfaces, directives, fields }) => join6(
|
|
15989
15995
|
[
|
|
15990
15996
|
"extend type",
|
|
15991
15997
|
name,
|
|
15992
|
-
wrap("implements ",
|
|
15993
|
-
|
|
15998
|
+
wrap("implements ", join6(interfaces, " & ")),
|
|
15999
|
+
join6(directives, " "),
|
|
15994
16000
|
block(fields)
|
|
15995
16001
|
],
|
|
15996
16002
|
" "
|
|
15997
16003
|
)
|
|
15998
16004
|
},
|
|
15999
16005
|
InterfaceTypeExtension: {
|
|
16000
|
-
leave: ({ name, interfaces, directives, fields }) =>
|
|
16006
|
+
leave: ({ name, interfaces, directives, fields }) => join6(
|
|
16001
16007
|
[
|
|
16002
16008
|
"extend interface",
|
|
16003
16009
|
name,
|
|
16004
|
-
wrap("implements ",
|
|
16005
|
-
|
|
16010
|
+
wrap("implements ", join6(interfaces, " & ")),
|
|
16011
|
+
join6(directives, " "),
|
|
16006
16012
|
block(fields)
|
|
16007
16013
|
],
|
|
16008
16014
|
" "
|
|
16009
16015
|
)
|
|
16010
16016
|
},
|
|
16011
16017
|
UnionTypeExtension: {
|
|
16012
|
-
leave: ({ name, directives, types }) =>
|
|
16018
|
+
leave: ({ name, directives, types }) => join6(
|
|
16013
16019
|
[
|
|
16014
16020
|
"extend union",
|
|
16015
16021
|
name,
|
|
16016
|
-
|
|
16017
|
-
wrap("= ",
|
|
16022
|
+
join6(directives, " "),
|
|
16023
|
+
wrap("= ", join6(types, " | "))
|
|
16018
16024
|
],
|
|
16019
16025
|
" "
|
|
16020
16026
|
)
|
|
16021
16027
|
},
|
|
16022
16028
|
EnumTypeExtension: {
|
|
16023
|
-
leave: ({ name, directives, values }) =>
|
|
16029
|
+
leave: ({ name, directives, values }) => join6(["extend enum", name, join6(directives, " "), block(values)], " ")
|
|
16024
16030
|
},
|
|
16025
16031
|
InputObjectTypeExtension: {
|
|
16026
|
-
leave: ({ name, directives, fields }) =>
|
|
16032
|
+
leave: ({ name, directives, fields }) => join6(["extend input", name, join6(directives, " "), block(fields)], " ")
|
|
16027
16033
|
},
|
|
16028
16034
|
// Schema Coordinates
|
|
16029
16035
|
TypeCoordinate: {
|
|
16030
16036
|
leave: ({ name }) => name
|
|
16031
16037
|
},
|
|
16032
16038
|
MemberCoordinate: {
|
|
16033
|
-
leave: ({ name, memberName }) =>
|
|
16039
|
+
leave: ({ name, memberName }) => join6([name, wrap(".", memberName)])
|
|
16034
16040
|
},
|
|
16035
16041
|
ArgumentCoordinate: {
|
|
16036
|
-
leave: ({ name, fieldName, argumentName }) =>
|
|
16042
|
+
leave: ({ name, fieldName, argumentName }) => join6([name, wrap(".", fieldName), wrap("(", argumentName, ":)")])
|
|
16037
16043
|
},
|
|
16038
16044
|
DirectiveCoordinate: {
|
|
16039
|
-
leave: ({ name }) =>
|
|
16045
|
+
leave: ({ name }) => join6(["@", name])
|
|
16040
16046
|
},
|
|
16041
16047
|
DirectiveArgumentCoordinate: {
|
|
16042
|
-
leave: ({ name, argumentName }) =>
|
|
16048
|
+
leave: ({ name, argumentName }) => join6(["@", name, wrap("(", argumentName, ":)")])
|
|
16043
16049
|
}
|
|
16044
16050
|
};
|
|
16045
|
-
function
|
|
16051
|
+
function join6(maybeArray, separator = "") {
|
|
16046
16052
|
var _maybeArray$filter$jo;
|
|
16047
16053
|
return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter((x) => x).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : "";
|
|
16048
16054
|
}
|
|
16049
16055
|
function block(array) {
|
|
16050
|
-
return wrap("{\n", indent(
|
|
16056
|
+
return wrap("{\n", indent(join6(array, "\n")), "\n}");
|
|
16051
16057
|
}
|
|
16052
16058
|
function wrap(start, maybeString, end = "") {
|
|
16053
16059
|
return maybeString != null && maybeString !== "" ? start + maybeString + end : "";
|
|
@@ -37013,14 +37019,14 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
37013
37019
|
const logInfo222 = (0, import_debug2.default)(`${namespace}:info`);
|
|
37014
37020
|
const logTask5 = (0, import_debug2.default)(`${namespace}:task`);
|
|
37015
37021
|
const logError22 = (0, import_debug2.default)(`${namespace}:error`);
|
|
37016
|
-
const
|
|
37022
|
+
const logDetail4 = (0, import_debug2.default)(`${namespace}:detail`);
|
|
37017
37023
|
const logDebug = (0, import_debug2.default)(`${namespace}:debug`);
|
|
37018
37024
|
const logWarning2 = (0, import_debug2.default)(`${namespace}:warning`);
|
|
37019
37025
|
const logColor = (0, import_debug2.default)(`${namespace}:color`);
|
|
37020
37026
|
logInfo222.color = "19";
|
|
37021
37027
|
logTask5.color = "25";
|
|
37022
37028
|
logError22.color = "1";
|
|
37023
|
-
|
|
37029
|
+
logDetail4.color = "199";
|
|
37024
37030
|
logWarning2.color = "186";
|
|
37025
37031
|
logDebug.color = "211";
|
|
37026
37032
|
logColor.enabled = true;
|
|
@@ -37028,7 +37034,7 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
37028
37034
|
logInfo222.namespace = `${namespace2}:info`;
|
|
37029
37035
|
logTask5.namespace = `${namespace2}:task`;
|
|
37030
37036
|
logError22.namespace = `${namespace2}:error`;
|
|
37031
|
-
|
|
37037
|
+
logDetail4.namespace = `${namespace2}:detail`;
|
|
37032
37038
|
logWarning2.namespace = `${namespace2}:warning`;
|
|
37033
37039
|
logDebug.namespace = `${namespace2}:debug`;
|
|
37034
37040
|
}
|
|
@@ -37039,7 +37045,7 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
37039
37045
|
logTask5.enabled = true;
|
|
37040
37046
|
logError22.enabled = true;
|
|
37041
37047
|
logWarning2.enabled = true;
|
|
37042
|
-
|
|
37048
|
+
logDetail4.enabled = false;
|
|
37043
37049
|
logDebug.enabled = false;
|
|
37044
37050
|
break;
|
|
37045
37051
|
case "debug":
|
|
@@ -37047,7 +37053,7 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
37047
37053
|
logTask5.enabled = true;
|
|
37048
37054
|
logError22.enabled = true;
|
|
37049
37055
|
logWarning2.enabled = true;
|
|
37050
|
-
|
|
37056
|
+
logDetail4.enabled = true;
|
|
37051
37057
|
logDebug.enabled = true;
|
|
37052
37058
|
break;
|
|
37053
37059
|
case "none":
|
|
@@ -37055,7 +37061,7 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
37055
37061
|
logTask5.enabled = false;
|
|
37056
37062
|
logError22.enabled = false;
|
|
37057
37063
|
logWarning2.enabled = false;
|
|
37058
|
-
|
|
37064
|
+
logDetail4.enabled = false;
|
|
37059
37065
|
logDebug.enabled = false;
|
|
37060
37066
|
break;
|
|
37061
37067
|
}
|
|
@@ -37073,7 +37079,7 @@ function createLoggers2(namespace, logLevel = process.env.LOG_LEVEL ?? "none") {
|
|
|
37073
37079
|
logError22.color = color;
|
|
37074
37080
|
break;
|
|
37075
37081
|
case "detail":
|
|
37076
|
-
|
|
37082
|
+
logDetail4.color = color;
|
|
37077
37083
|
break;
|
|
37078
37084
|
case "warning":
|
|
37079
37085
|
logWarning2.color = color;
|
|
@@ -37140,7 +37146,7 @@ ${" ".repeat(padding)}${"=".repeat(80)}`;
|
|
|
37140
37146
|
const functionName = functionMatch ? functionMatch[1] : "<anonymous>";
|
|
37141
37147
|
callerDetails = `${functionName}`;
|
|
37142
37148
|
}
|
|
37143
|
-
|
|
37149
|
+
logDetail4(`${header(`*${title}* ${callerDetails}`)}
|
|
37144
37150
|
${args.reduce((acc, arg) => `${acc}
|
|
37145
37151
|
${logDataDetail(arg)}`, "")}
|
|
37146
37152
|
|
|
@@ -37163,7 +37169,7 @@ ${"=".repeat(80)}`);
|
|
|
37163
37169
|
logInfo: logInfo222,
|
|
37164
37170
|
logTask: logTask5,
|
|
37165
37171
|
logError: logError22,
|
|
37166
|
-
logDetail:
|
|
37172
|
+
logDetail: logDetail4,
|
|
37167
37173
|
logDebug,
|
|
37168
37174
|
logWarning: logWarning2,
|
|
37169
37175
|
logColor,
|
|
@@ -38110,14 +38116,14 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
|
|
|
38110
38116
|
const logInfo32 = (0, import_debug22.default)(`${namespace}:info`);
|
|
38111
38117
|
const logTask5 = (0, import_debug22.default)(`${namespace}:task`);
|
|
38112
38118
|
const logError22 = (0, import_debug22.default)(`${namespace}:error`);
|
|
38113
|
-
const
|
|
38119
|
+
const logDetail4 = (0, import_debug22.default)(`${namespace}:detail`);
|
|
38114
38120
|
const logDebug = (0, import_debug22.default)(`${namespace}:debug`);
|
|
38115
38121
|
const logWarning2 = (0, import_debug22.default)(`${namespace}:warning`);
|
|
38116
38122
|
const logColor = (0, import_debug22.default)(`${namespace}:color`);
|
|
38117
38123
|
logInfo32.color = "19";
|
|
38118
38124
|
logTask5.color = "25";
|
|
38119
38125
|
logError22.color = "1";
|
|
38120
|
-
|
|
38126
|
+
logDetail4.color = "199";
|
|
38121
38127
|
logWarning2.color = "186";
|
|
38122
38128
|
logDebug.color = "211";
|
|
38123
38129
|
logColor.enabled = true;
|
|
@@ -38125,7 +38131,7 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
|
|
|
38125
38131
|
logInfo32.namespace = `${namespace2}:info`;
|
|
38126
38132
|
logTask5.namespace = `${namespace2}:task`;
|
|
38127
38133
|
logError22.namespace = `${namespace2}:error`;
|
|
38128
|
-
|
|
38134
|
+
logDetail4.namespace = `${namespace2}:detail`;
|
|
38129
38135
|
logWarning2.namespace = `${namespace2}:warning`;
|
|
38130
38136
|
logDebug.namespace = `${namespace2}:debug`;
|
|
38131
38137
|
}
|
|
@@ -38136,7 +38142,7 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
|
|
|
38136
38142
|
logTask5.enabled = true;
|
|
38137
38143
|
logError22.enabled = true;
|
|
38138
38144
|
logWarning2.enabled = true;
|
|
38139
|
-
|
|
38145
|
+
logDetail4.enabled = false;
|
|
38140
38146
|
logDebug.enabled = false;
|
|
38141
38147
|
break;
|
|
38142
38148
|
case "debug":
|
|
@@ -38144,7 +38150,7 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
|
|
|
38144
38150
|
logTask5.enabled = true;
|
|
38145
38151
|
logError22.enabled = true;
|
|
38146
38152
|
logWarning2.enabled = true;
|
|
38147
|
-
|
|
38153
|
+
logDetail4.enabled = true;
|
|
38148
38154
|
logDebug.enabled = true;
|
|
38149
38155
|
break;
|
|
38150
38156
|
case "none":
|
|
@@ -38152,7 +38158,7 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
|
|
|
38152
38158
|
logTask5.enabled = false;
|
|
38153
38159
|
logError22.enabled = false;
|
|
38154
38160
|
logWarning2.enabled = false;
|
|
38155
|
-
|
|
38161
|
+
logDetail4.enabled = false;
|
|
38156
38162
|
logDebug.enabled = false;
|
|
38157
38163
|
break;
|
|
38158
38164
|
}
|
|
@@ -38170,7 +38176,7 @@ function createLoggers22(namespace, logLevel = process.env.LOG_LEVEL ?? "none")
|
|
|
38170
38176
|
logError22.color = color;
|
|
38171
38177
|
break;
|
|
38172
38178
|
case "detail":
|
|
38173
|
-
|
|
38179
|
+
logDetail4.color = color;
|
|
38174
38180
|
break;
|
|
38175
38181
|
case "warning":
|
|
38176
38182
|
logWarning2.color = color;
|
|
@@ -38237,7 +38243,7 @@ ${" ".repeat(padding)}${"=".repeat(80)}`;
|
|
|
38237
38243
|
const functionName = functionMatch ? functionMatch[1] : "<anonymous>";
|
|
38238
38244
|
callerDetails = `${functionName}`;
|
|
38239
38245
|
}
|
|
38240
|
-
|
|
38246
|
+
logDetail4(`${header(`*${title}* ${callerDetails}`)}
|
|
38241
38247
|
${args.reduce((acc, arg) => `${acc}
|
|
38242
38248
|
${logDataDetail(arg)}`, "")}
|
|
38243
38249
|
|
|
@@ -38260,7 +38266,7 @@ ${"=".repeat(80)}`);
|
|
|
38260
38266
|
logInfo: logInfo32,
|
|
38261
38267
|
logTask: logTask5,
|
|
38262
38268
|
logError: logError22,
|
|
38263
|
-
logDetail:
|
|
38269
|
+
logDetail: logDetail4,
|
|
38264
38270
|
logDebug,
|
|
38265
38271
|
logWarning: logWarning2,
|
|
38266
38272
|
logColor,
|
|
@@ -39322,8 +39328,8 @@ var IosClient = class {
|
|
|
39322
39328
|
};
|
|
39323
39329
|
|
|
39324
39330
|
// src/logic/appleDeviceKit.ts
|
|
39325
|
-
var { logInfo: logInfo7, setNamespace: setNamespace6, logError: logError3 } = createLoggers("apple-kit");
|
|
39326
|
-
var AppleDeviceKit = class {
|
|
39331
|
+
var { logInfo: logInfo7, setNamespace: setNamespace6, logError: logError3, logDetail: logDetail3 } = createLoggers("apple-kit");
|
|
39332
|
+
var AppleDeviceKit = class _AppleDeviceKit {
|
|
39327
39333
|
constructor(udid, logicalPort, usbmuxdAddress) {
|
|
39328
39334
|
this.logicalPort = logicalPort;
|
|
39329
39335
|
this.deviceId = udid;
|
|
@@ -39356,6 +39362,69 @@ var AppleDeviceKit = class {
|
|
|
39356
39362
|
activationFlow;
|
|
39357
39363
|
proxyActions;
|
|
39358
39364
|
tunnelProcess = null;
|
|
39365
|
+
static IOS_17_VERSION = 17;
|
|
39366
|
+
/**
|
|
39367
|
+
* Check if iOS version requires tunneling (iOS 17+)
|
|
39368
|
+
*/
|
|
39369
|
+
async requiresTunneling() {
|
|
39370
|
+
try {
|
|
39371
|
+
const deviceInfo = await this.info();
|
|
39372
|
+
const productVersion = deviceInfo.ProductVersion;
|
|
39373
|
+
const majorVersion = Number.parseInt(productVersion.split(".")[0] || "0", 10);
|
|
39374
|
+
return majorVersion >= _AppleDeviceKit.IOS_17_VERSION;
|
|
39375
|
+
} catch (error) {
|
|
39376
|
+
logError3(
|
|
39377
|
+
`Failed to check iOS version for device ${this.deviceId}, assuming tunneling required: ${error instanceof Error ? error.message : String(error)}`
|
|
39378
|
+
);
|
|
39379
|
+
return true;
|
|
39380
|
+
}
|
|
39381
|
+
}
|
|
39382
|
+
/**
|
|
39383
|
+
* Ensure tunnel is started for iOS 17+ devices
|
|
39384
|
+
*/
|
|
39385
|
+
async ensureTunnel() {
|
|
39386
|
+
const requiresTunnel = await this.requiresTunneling();
|
|
39387
|
+
if (!requiresTunnel) {
|
|
39388
|
+
logDetail3(`Device ${this.deviceId} does not require tunneling (iOS < 17)`);
|
|
39389
|
+
return;
|
|
39390
|
+
}
|
|
39391
|
+
const existingTunnel = this.tunnelProcess;
|
|
39392
|
+
if (existingTunnel && !existingTunnel.killed) {
|
|
39393
|
+
logDetail3(`Tunnel already running for device ${this.deviceId}`);
|
|
39394
|
+
return;
|
|
39395
|
+
}
|
|
39396
|
+
logInfo7(`Starting tunnel for device ${this.deviceId} (iOS 17+)`);
|
|
39397
|
+
try {
|
|
39398
|
+
const tunnelProcess = await this.iosClient.tunnelStart(true);
|
|
39399
|
+
this.tunnelProcess = tunnelProcess;
|
|
39400
|
+
tunnelProcess.on("exit", (code) => {
|
|
39401
|
+
logError3(`Tunnel process for device ${this.deviceId} exited with code ${code}`);
|
|
39402
|
+
this.tunnelProcess = null;
|
|
39403
|
+
});
|
|
39404
|
+
tunnelProcess.on("error", (error) => {
|
|
39405
|
+
logError3(`Tunnel process error for device ${this.deviceId}: ${error.message}`);
|
|
39406
|
+
this.tunnelProcess = null;
|
|
39407
|
+
});
|
|
39408
|
+
await new Promise((resolve2) => setTimeout(resolve2, 1e3));
|
|
39409
|
+
logInfo7(`Tunnel started successfully for device ${this.deviceId}`);
|
|
39410
|
+
} catch (error) {
|
|
39411
|
+
logError3(
|
|
39412
|
+
`Failed to start tunnel for device ${this.deviceId}: ${error instanceof Error ? error.message : String(error)}`
|
|
39413
|
+
);
|
|
39414
|
+
throw error;
|
|
39415
|
+
}
|
|
39416
|
+
}
|
|
39417
|
+
/**
|
|
39418
|
+
* Stop tunnel for a device
|
|
39419
|
+
*/
|
|
39420
|
+
stopTunnel() {
|
|
39421
|
+
const tunnelProcess = this.tunnelProcess;
|
|
39422
|
+
if (tunnelProcess && !tunnelProcess.killed) {
|
|
39423
|
+
logInfo7(`Stopping tunnel for device ${this.deviceId}`);
|
|
39424
|
+
tunnelProcess.kill();
|
|
39425
|
+
this.tunnelProcess = null;
|
|
39426
|
+
}
|
|
39427
|
+
}
|
|
39359
39428
|
static setResourcesDir(dir) {
|
|
39360
39429
|
setResourcesDir(dir);
|
|
39361
39430
|
}
|
|
@@ -39536,6 +39605,90 @@ var AppleDeviceKit = class {
|
|
|
39536
39605
|
this.ensureNotDisposed();
|
|
39537
39606
|
return this.activationFlow.run(void 0, signal, config);
|
|
39538
39607
|
}
|
|
39608
|
+
/**
|
|
39609
|
+
* Push a file to the device using fsync
|
|
39610
|
+
*/
|
|
39611
|
+
async pushFile(bundleId, fileName, fileData) {
|
|
39612
|
+
const requiresTunnel = await this.requiresTunneling();
|
|
39613
|
+
if (requiresTunnel) {
|
|
39614
|
+
await this.ensureTunnel();
|
|
39615
|
+
}
|
|
39616
|
+
const tmpDir = (0, import_node_path5.join)(process.cwd(), "tmp");
|
|
39617
|
+
const tmpFilePath = (0, import_node_path5.join)(tmpDir, fileName);
|
|
39618
|
+
try {
|
|
39619
|
+
await (0, import_promises3.mkdir)(tmpDir, { recursive: true });
|
|
39620
|
+
await (0, import_promises4.writeFile)(tmpFilePath, fileData);
|
|
39621
|
+
const stats = await (0, import_promises3.stat)(tmpFilePath);
|
|
39622
|
+
logDetail3(`Temp file written: ${tmpFilePath}, size: ${stats.size} bytes`);
|
|
39623
|
+
if (stats.size !== fileData.length) {
|
|
39624
|
+
throw new Error(
|
|
39625
|
+
`File size mismatch: expected ${fileData.length} bytes, got ${stats.size} bytes`
|
|
39626
|
+
);
|
|
39627
|
+
}
|
|
39628
|
+
const devicePath = `Documents/${fileName}`;
|
|
39629
|
+
const pushResult = await this.iosClient.fsyncPush({
|
|
39630
|
+
app: bundleId,
|
|
39631
|
+
srcPath: tmpFilePath,
|
|
39632
|
+
dstPath: devicePath
|
|
39633
|
+
});
|
|
39634
|
+
logDetail3(`Push: ${JSON.stringify(pushResult)}`);
|
|
39635
|
+
if (pushResult.exitCode !== 0) {
|
|
39636
|
+
const errorMessages = pushResult.logMessages.filter((msg) => msg.level === "error").map((msg) => msg.msg).join("; ");
|
|
39637
|
+
const allMessages = pushResult.logMessages.map((msg) => `${msg.level}: ${msg.msg}`).join("; ");
|
|
39638
|
+
throw new Error(
|
|
39639
|
+
`fsync push failed (exit code ${pushResult.exitCode}): ${errorMessages || allMessages || "Unknown error"}`
|
|
39640
|
+
);
|
|
39641
|
+
}
|
|
39642
|
+
logInfo7(`File ${fileName} pushed to device ${this.deviceId}`);
|
|
39643
|
+
} finally {
|
|
39644
|
+
if (requiresTunnel) {
|
|
39645
|
+
this.stopTunnel();
|
|
39646
|
+
}
|
|
39647
|
+
try {
|
|
39648
|
+
(0, import_node_fs5.unlinkSync)(tmpFilePath);
|
|
39649
|
+
} catch (_error) {
|
|
39650
|
+
}
|
|
39651
|
+
}
|
|
39652
|
+
}
|
|
39653
|
+
/**
|
|
39654
|
+
* Pull a file from the device using fsync
|
|
39655
|
+
*/
|
|
39656
|
+
async pullFile(bundleId, fileName) {
|
|
39657
|
+
const requiresTunnel = await this.requiresTunneling();
|
|
39658
|
+
if (requiresTunnel) {
|
|
39659
|
+
await this.ensureTunnel();
|
|
39660
|
+
}
|
|
39661
|
+
const tmpDir = (0, import_node_path5.join)(process.cwd(), "tmp");
|
|
39662
|
+
const tmpFilePath = (0, import_node_path5.join)(tmpDir, fileName);
|
|
39663
|
+
try {
|
|
39664
|
+
await (0, import_promises3.mkdir)(tmpDir, { recursive: true });
|
|
39665
|
+
const devicePath = `Documents/${fileName}`;
|
|
39666
|
+
const pullResult = await this.iosClient.fsyncPull({
|
|
39667
|
+
app: bundleId,
|
|
39668
|
+
srcPath: devicePath,
|
|
39669
|
+
dstPath: tmpDir
|
|
39670
|
+
});
|
|
39671
|
+
logDetail3(`Pull: ${JSON.stringify(pullResult)}`);
|
|
39672
|
+
if (pullResult.exitCode !== 0) {
|
|
39673
|
+
const errorMessages = pullResult.logMessages.filter((msg) => msg.level === "error").map((msg) => msg.msg).join("; ");
|
|
39674
|
+
const allMessages = pullResult.logMessages.map((msg) => `${msg.level}: ${msg.msg}`).join("; ");
|
|
39675
|
+
throw new Error(
|
|
39676
|
+
`fsync pull failed (exit code ${pullResult.exitCode}): ${errorMessages || allMessages || "Unknown error"}`
|
|
39677
|
+
);
|
|
39678
|
+
}
|
|
39679
|
+
const fileData = (0, import_node_fs5.readFileSync)(tmpFilePath);
|
|
39680
|
+
logInfo7(`File ${fileName} pulled from device ${this.deviceId}`);
|
|
39681
|
+
return fileData;
|
|
39682
|
+
} finally {
|
|
39683
|
+
if (requiresTunnel) {
|
|
39684
|
+
this.stopTunnel();
|
|
39685
|
+
}
|
|
39686
|
+
try {
|
|
39687
|
+
(0, import_node_fs5.unlinkSync)(tmpFilePath);
|
|
39688
|
+
} catch (_error) {
|
|
39689
|
+
}
|
|
39690
|
+
}
|
|
39691
|
+
}
|
|
39539
39692
|
/**
|
|
39540
39693
|
* Get the device UDID
|
|
39541
39694
|
*/
|
|
@@ -39579,7 +39732,7 @@ var AppleDeviceKit = class {
|
|
|
39579
39732
|
}
|
|
39580
39733
|
logInfo7(`Disposing AppleDeviceKit for device: ${this.deviceId}`);
|
|
39581
39734
|
this.closePortForward();
|
|
39582
|
-
this.
|
|
39735
|
+
this.stopTunnel();
|
|
39583
39736
|
this.isDisposed = true;
|
|
39584
39737
|
}
|
|
39585
39738
|
/**
|