appium-ios-device 3.1.12 → 3.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/build/index.js +7 -8
- package/build/lib/afc/index.d.ts +2 -2
- package/build/lib/afc/index.d.ts.map +1 -1
- package/build/lib/afc/index.js +20 -21
- package/build/lib/afc/index.js.map +1 -1
- package/build/lib/afc/protocol.d.ts +12 -2
- package/build/lib/afc/protocol.d.ts.map +1 -1
- package/build/lib/afc/protocol.js +17 -12
- package/build/lib/afc/protocol.js.map +1 -1
- package/build/lib/afc/transformer/afcdecoder.d.ts +1 -1
- package/build/lib/afc/transformer/afcdecoder.d.ts.map +1 -1
- package/build/lib/afc/transformer/afcdecoder.js.map +1 -1
- package/build/lib/afc/transformer/afcencoder.d.ts +1 -1
- package/build/lib/afc/transformer/afcencoder.d.ts.map +1 -1
- package/build/lib/afc/transformer/afcencoder.js.map +1 -1
- package/build/lib/base-service.js.map +1 -1
- package/build/lib/constants.d.ts.map +1 -1
- package/build/lib/constants.js +2 -4
- package/build/lib/constants.js.map +1 -1
- package/build/lib/house-arrest/index.d.ts +2 -2
- package/build/lib/house-arrest/index.d.ts.map +1 -1
- package/build/lib/house-arrest/index.js +2 -3
- package/build/lib/house-arrest/index.js.map +1 -1
- package/build/lib/imagemounter/index.d.ts +1 -1
- package/build/lib/imagemounter/index.d.ts.map +1 -1
- package/build/lib/imagemounter/index.js +27 -28
- package/build/lib/imagemounter/index.js.map +1 -1
- package/build/lib/imagemounter/utils/list_developer_image.d.ts +10 -15
- package/build/lib/imagemounter/utils/list_developer_image.d.ts.map +1 -1
- package/build/lib/imagemounter/utils/list_developer_image.js +43 -43
- package/build/lib/imagemounter/utils/list_developer_image.js.map +1 -1
- package/build/lib/installation-proxy/index.d.ts +2 -2
- package/build/lib/installation-proxy/index.d.ts.map +1 -1
- package/build/lib/installation-proxy/index.js +2 -3
- package/build/lib/installation-proxy/index.js.map +1 -1
- package/build/lib/instrument/headers.d.ts +75 -100
- package/build/lib/instrument/headers.d.ts.map +1 -1
- package/build/lib/instrument/headers.js +78 -83
- package/build/lib/instrument/headers.js.map +1 -1
- package/build/lib/instrument/index.d.ts +7 -11
- package/build/lib/instrument/index.d.ts.map +1 -1
- package/build/lib/instrument/index.js +18 -20
- package/build/lib/instrument/index.js.map +1 -1
- package/build/lib/instrument/transformer/dtx-decode.js.map +1 -1
- package/build/lib/instrument/transformer/dtx-encode.js.map +1 -1
- package/build/lib/instrument/transformer/nskeyed.d.ts +30 -30
- package/build/lib/instrument/transformer/nskeyed.d.ts.map +1 -1
- package/build/lib/instrument/transformer/nskeyed.js +45 -45
- package/build/lib/instrument/transformer/nskeyed.js.map +1 -1
- package/build/lib/lockdown/index.d.ts +2 -2
- package/build/lib/lockdown/index.d.ts.map +1 -1
- package/build/lib/lockdown/index.js +2 -3
- package/build/lib/lockdown/index.js.map +1 -1
- package/build/lib/mcinstall/index.d.ts +2 -2
- package/build/lib/mcinstall/index.d.ts.map +1 -1
- package/build/lib/mcinstall/index.js +8 -9
- package/build/lib/mcinstall/index.js.map +1 -1
- package/build/lib/notification-proxy/index.d.ts +2 -2
- package/build/lib/notification-proxy/index.d.ts.map +1 -1
- package/build/lib/notification-proxy/index.js +2 -3
- package/build/lib/notification-proxy/index.js.map +1 -1
- package/build/lib/plist-service/index.d.ts +1 -1
- package/build/lib/plist-service/index.d.ts.map +1 -1
- package/build/lib/plist-service/index.js.map +1 -1
- package/build/lib/plist-service/transformer/plist-service-decoder.d.ts +1 -1
- package/build/lib/plist-service/transformer/plist-service-decoder.d.ts.map +1 -1
- package/build/lib/plist-service/transformer/plist-service-decoder.js.map +1 -1
- package/build/lib/plist-service/transformer/plist-service-encoder.d.ts +1 -1
- package/build/lib/plist-service/transformer/plist-service-encoder.d.ts.map +1 -1
- package/build/lib/plist-service/transformer/plist-service-encoder.js.map +1 -1
- package/build/lib/services.d.ts +94 -13
- package/build/lib/services.d.ts.map +1 -1
- package/build/lib/services.js +90 -1
- package/build/lib/services.js.map +1 -1
- package/build/lib/simulatelocation/index.d.ts +2 -2
- package/build/lib/simulatelocation/index.d.ts.map +1 -1
- package/build/lib/simulatelocation/index.js +2 -3
- package/build/lib/simulatelocation/index.js.map +1 -1
- package/build/lib/ssl-helper.d.ts +8 -2
- package/build/lib/ssl-helper.d.ts.map +1 -1
- package/build/lib/ssl-helper.js +7 -0
- package/build/lib/ssl-helper.js.map +1 -1
- package/build/lib/syslog/index.d.ts +2 -2
- package/build/lib/syslog/index.d.ts.map +1 -1
- package/build/lib/syslog/index.js +2 -3
- package/build/lib/syslog/index.js.map +1 -1
- package/build/lib/syslog/transformer/syslog-decoder.d.ts +8 -8
- package/build/lib/syslog/transformer/syslog-decoder.d.ts.map +1 -1
- package/build/lib/syslog/transformer/syslog-decoder.js +32 -32
- package/build/lib/syslog/transformer/syslog-decoder.js.map +1 -1
- package/build/lib/testmanagerd/index.d.ts +2 -2
- package/build/lib/testmanagerd/index.d.ts.map +1 -1
- package/build/lib/testmanagerd/index.js +4 -7
- package/build/lib/testmanagerd/index.js.map +1 -1
- package/build/lib/usbmux/index.d.ts +38 -38
- package/build/lib/usbmux/index.d.ts.map +1 -1
- package/build/lib/usbmux/index.js +93 -93
- package/build/lib/usbmux/index.js.map +1 -1
- package/build/lib/usbmux/transformer/usbmux-decoder.d.ts +1 -1
- package/build/lib/usbmux/transformer/usbmux-decoder.d.ts.map +1 -1
- package/build/lib/usbmux/transformer/usbmux-decoder.js.map +1 -1
- package/build/lib/usbmux/transformer/usbmux-encoder.d.ts +1 -1
- package/build/lib/usbmux/transformer/usbmux-encoder.d.ts.map +1 -1
- package/build/lib/usbmux/transformer/usbmux-encoder.js.map +1 -1
- package/build/lib/util/uuid/parse.d.ts +5 -0
- package/build/lib/util/uuid/parse.d.ts.map +1 -1
- package/build/lib/util/uuid/parse.js +5 -0
- package/build/lib/util/uuid/parse.js.map +1 -1
- package/build/lib/util/uuid/stringify.d.ts +6 -0
- package/build/lib/util/uuid/stringify.d.ts.map +1 -1
- package/build/lib/util/uuid/stringify.js +18 -12
- package/build/lib/util/uuid/stringify.js.map +1 -1
- package/build/lib/util/uuid/validate.d.ts +5 -0
- package/build/lib/util/uuid/validate.d.ts.map +1 -1
- package/build/lib/util/uuid/validate.js +5 -0
- package/build/lib/util/uuid/validate.js.map +1 -1
- package/build/lib/utilities.d.ts +58 -58
- package/build/lib/utilities.d.ts.map +1 -1
- package/build/lib/utilities.js +2 -2
- package/build/lib/utilities.js.map +1 -1
- package/build/lib/webinspector/index.d.ts +44 -39
- package/build/lib/webinspector/index.d.ts.map +1 -1
- package/build/lib/webinspector/index.js +39 -35
- package/build/lib/webinspector/index.js.map +1 -1
- package/build/lib/webinspector/transformer/webinspector-decoder.d.ts +1 -1
- package/build/lib/webinspector/transformer/webinspector-decoder.d.ts.map +1 -1
- package/build/lib/webinspector/transformer/webinspector-decoder.js.map +1 -1
- package/build/lib/webinspector/transformer/webinspector-encoder.d.ts +1 -1
- package/build/lib/webinspector/transformer/webinspector-encoder.d.ts.map +1 -1
- package/build/lib/webinspector/transformer/webinspector-encoder.js.map +1 -1
- package/build/lib/xctest.d.ts +17 -17
- package/build/lib/xctest.d.ts.map +1 -1
- package/build/lib/xctest.js.map +1 -1
- package/index.js +7 -9
- package/lib/afc/index.js +23 -24
- package/lib/afc/protocol.js +17 -17
- package/lib/afc/transformer/afcdecoder.js +1 -2
- package/lib/afc/transformer/afcencoder.js +1 -2
- package/lib/base-service.js +2 -4
- package/lib/constants.js +2 -4
- package/lib/house-arrest/index.js +2 -3
- package/lib/imagemounter/index.js +28 -29
- package/lib/imagemounter/utils/list_developer_image.js +52 -54
- package/lib/installation-proxy/index.js +2 -3
- package/lib/instrument/headers.js +74 -87
- package/lib/instrument/index.js +19 -21
- package/lib/instrument/transformer/dtx-decode.js +1 -3
- package/lib/instrument/transformer/dtx-encode.js +1 -3
- package/lib/instrument/transformer/nskeyed.js +56 -67
- package/lib/lockdown/index.js +2 -3
- package/lib/mcinstall/index.js +9 -10
- package/lib/notification-proxy/index.js +2 -3
- package/lib/plist-service/index.js +1 -2
- package/lib/plist-service/transformer/plist-service-decoder.js +1 -2
- package/lib/plist-service/transformer/plist-service-encoder.js +1 -2
- package/lib/services.js +101 -26
- package/lib/simulatelocation/index.js +2 -3
- package/lib/ssl-helper.js +9 -4
- package/lib/syslog/index.js +2 -3
- package/lib/syslog/transformer/syslog-decoder.js +35 -36
- package/lib/testmanagerd/index.js +4 -11
- package/lib/usbmux/index.js +111 -112
- package/lib/usbmux/transformer/usbmux-decoder.js +1 -2
- package/lib/usbmux/transformer/usbmux-encoder.js +1 -2
- package/lib/util/uuid/parse.ts +5 -0
- package/lib/util/uuid/stringify.ts +21 -15
- package/lib/util/uuid/validate.ts +5 -0
- package/lib/utilities.js +10 -23
- package/lib/webinspector/index.js +47 -43
- package/lib/webinspector/transformer/webinspector-decoder.js +1 -2
- package/lib/webinspector/transformer/webinspector-encoder.js +1 -2
- package/lib/xctest.js +1 -2
- package/package.json +1 -1
|
@@ -42,6 +42,44 @@ const { exists, readdir, mkdir, rimraf } = support_1.fs;
|
|
|
42
42
|
const DEFAULT_IMAGE_DIR_NAME = 'iOSDeviceSupport';
|
|
43
43
|
const DEVELOPER_IMAGE_FILE_NAME = 'DeveloperDiskImage.dmg';
|
|
44
44
|
const DEVELOPER_IMAGE_SIGNATURE_FILE_NAME = 'DeveloperDiskImage.dmg.signature';
|
|
45
|
+
/**
|
|
46
|
+
* Find developer image for certain version. If developer image does not exists,
|
|
47
|
+
* this will try to find and download developer image, unzip to `${APPIUM_HOME}/iOSSupport/`
|
|
48
|
+
* @param {string} version full version of iOS device. The first two parts of version
|
|
49
|
+
* will be preserved when sending the request, e.g. `14.7.1` will be changed to `14.7`
|
|
50
|
+
* @param {ImageFromGithubRepo} githubImageOption
|
|
51
|
+
* @returns {Promise<ImagePath>}
|
|
52
|
+
* @throws If developer image is not found, or error while downloading or unzipping.
|
|
53
|
+
*/
|
|
54
|
+
async function findDeveloperImage(version, githubImageOption) {
|
|
55
|
+
const finalVersion = version.split('.').splice(0, 2).join('.');
|
|
56
|
+
const fileName = `${finalVersion}.zip`;
|
|
57
|
+
const DEFAULT_IMAGE_DIR = (0, node_path_1.join)(await support_1.env.resolveAppiumHome(), DEFAULT_IMAGE_DIR_NAME);
|
|
58
|
+
const fullDownloadPath = (0, node_path_1.join)(DEFAULT_IMAGE_DIR, fileName);
|
|
59
|
+
if (!(await exists(DEFAULT_IMAGE_DIR))) {
|
|
60
|
+
await mkdir(DEFAULT_IMAGE_DIR, { recursive: true });
|
|
61
|
+
}
|
|
62
|
+
if (!(await exists(fullDownloadPath))) {
|
|
63
|
+
await searchAndDownloadDeveloperImageFromGithub(finalVersion, fullDownloadPath, githubImageOption);
|
|
64
|
+
}
|
|
65
|
+
const decompressPath = (0, node_path_1.join)(DEFAULT_IMAGE_DIR, finalVersion);
|
|
66
|
+
/** @type {string | undefined} */
|
|
67
|
+
let developerImageParentFolder;
|
|
68
|
+
if (await exists(decompressPath)) {
|
|
69
|
+
developerImageParentFolder = await findDeveloperImageFromDirectory(decompressPath);
|
|
70
|
+
}
|
|
71
|
+
if (!developerImageParentFolder) {
|
|
72
|
+
await support_1.zip.extractAllTo(fullDownloadPath, decompressPath);
|
|
73
|
+
developerImageParentFolder = await findDeveloperImageFromDirectory(decompressPath);
|
|
74
|
+
}
|
|
75
|
+
if (!developerImageParentFolder) {
|
|
76
|
+
throw new Error(`Unable to find unzipped developer image in ${decompressPath}`);
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
developerImage: (0, node_path_1.join)(developerImageParentFolder, DEVELOPER_IMAGE_FILE_NAME),
|
|
80
|
+
developerImageSignature: (0, node_path_1.join)(developerImageParentFolder, DEVELOPER_IMAGE_SIGNATURE_FILE_NAME),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
45
83
|
/**
|
|
46
84
|
* Use list api to return the file list of folder.
|
|
47
85
|
* @param {ImageFromGithubRepo} githubImageOption
|
|
@@ -83,6 +121,11 @@ async function listGithubImageList(githubImageOption) {
|
|
|
83
121
|
curUrl = nextItem.url;
|
|
84
122
|
}
|
|
85
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* @typedef {Object} ImagePath
|
|
126
|
+
* @property {string} developerImage
|
|
127
|
+
* @property {string} developerImageSignature
|
|
128
|
+
*/
|
|
86
129
|
/**
|
|
87
130
|
* Find `DeveloperDiskImage.dmg` recursively under folder and subfolder.
|
|
88
131
|
* @param {string} entry current folder
|
|
@@ -104,49 +147,6 @@ async function findDeveloperImageFromDirectory(entry) {
|
|
|
104
147
|
}
|
|
105
148
|
}
|
|
106
149
|
}
|
|
107
|
-
/**
|
|
108
|
-
* @typedef {Object} ImagePath
|
|
109
|
-
* @property {string} developerImage
|
|
110
|
-
* @property {string} developerImageSignature
|
|
111
|
-
*/
|
|
112
|
-
/**
|
|
113
|
-
* Find developer image for certain version. If developer image does not exists,
|
|
114
|
-
* this will try to find and download developer image, unzip to `${APPIUM_HOME}/iOSSupport/`
|
|
115
|
-
* @param {string} version full version of iOS device. The first two parts of version
|
|
116
|
-
* will be preserved when sending the request, e.g. `14.7.1` will be changed to `14.7`
|
|
117
|
-
* @param {ImageFromGithubRepo} githubImageOption
|
|
118
|
-
* @returns {Promise<ImagePath>}
|
|
119
|
-
* @throws If developer image is not found, or error while downloading or unzipping.
|
|
120
|
-
*/
|
|
121
|
-
async function findDeveloperImage(version, githubImageOption) {
|
|
122
|
-
const finalVersion = version.split('.').splice(0, 2).join('.');
|
|
123
|
-
const fileName = `${finalVersion}.zip`;
|
|
124
|
-
const DEFAULT_IMAGE_DIR = (0, node_path_1.join)(await support_1.env.resolveAppiumHome(), DEFAULT_IMAGE_DIR_NAME);
|
|
125
|
-
const fullDownloadPath = (0, node_path_1.join)(DEFAULT_IMAGE_DIR, fileName);
|
|
126
|
-
if (!(await exists(DEFAULT_IMAGE_DIR))) {
|
|
127
|
-
await mkdir(DEFAULT_IMAGE_DIR, { recursive: true });
|
|
128
|
-
}
|
|
129
|
-
if (!(await exists(fullDownloadPath))) {
|
|
130
|
-
await searchAndDownloadDeveloperImageFromGithub(finalVersion, fullDownloadPath, githubImageOption);
|
|
131
|
-
}
|
|
132
|
-
const decompressPath = (0, node_path_1.join)(DEFAULT_IMAGE_DIR, finalVersion);
|
|
133
|
-
/** @type {string | undefined} */
|
|
134
|
-
let developerImageParentFolder;
|
|
135
|
-
if (await exists(decompressPath)) {
|
|
136
|
-
developerImageParentFolder = await findDeveloperImageFromDirectory(decompressPath);
|
|
137
|
-
}
|
|
138
|
-
if (!developerImageParentFolder) {
|
|
139
|
-
await support_1.zip.extractAllTo(fullDownloadPath, decompressPath);
|
|
140
|
-
developerImageParentFolder = await findDeveloperImageFromDirectory(decompressPath);
|
|
141
|
-
}
|
|
142
|
-
if (!developerImageParentFolder) {
|
|
143
|
-
throw new Error(`Unable to find unzipped developer image in ${decompressPath}`);
|
|
144
|
-
}
|
|
145
|
-
return {
|
|
146
|
-
developerImage: (0, node_path_1.join)(developerImageParentFolder, DEVELOPER_IMAGE_FILE_NAME),
|
|
147
|
-
developerImageSignature: (0, node_path_1.join)(developerImageParentFolder, DEVELOPER_IMAGE_SIGNATURE_FILE_NAME),
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
150
|
/**
|
|
151
151
|
*
|
|
152
152
|
* @param {string} finalVersion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list_developer_image.js","sourceRoot":"","sources":["../../../../lib/imagemounter/utils/list_developer_image.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"list_developer_image.js","sourceRoot":"","sources":["../../../../lib/imagemounter/utils/list_developer_image.js"],"names":[],"mappings":";;;;;AAmDA,gDAmCC;AAtFD,oDAAuB;AACvB,6CAAkD;AAClD,yCAA2C;AAC3C,kDAA0B;AAC1B,yCAAiC;AAEjC,MAAM,EAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,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AAG,CAAC,GAAG,QAAQ,EAAE,CAAC;IACzE,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,GAAG,qCAAqC,UAAU,IAAI,MAAM,GAAG,aAAa,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;IAC1G,CAAC;IACD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,yCAAyC,YAAY,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,CAAC;QACH,YAAG,CAAC,IAAI,CACN,mCAAmC,YAAY,OAAO,gBAAgB,SAAS,OAAO,EAAE,CACzF,CAAC;QACF,MAAM,aAAG,CAAC,YAAY,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IACpD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,MAAM,CAAC,gBAAgB,CAAC,CAAC;QAC/B,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const INSTALLATION_PROXY_SERVICE_NAME: "com.apple.mobile.installation_proxy";
|
|
2
2
|
export class InstallationProxyService extends BaseServicePlist {
|
|
3
3
|
/**
|
|
4
4
|
* Install the application on the relative path on the phone
|
|
@@ -73,6 +73,6 @@ export class InstallationProxyService extends BaseServicePlist {
|
|
|
73
73
|
_waitMessageCompletion(timeout: any): Promise<any[]>;
|
|
74
74
|
_isFinished(response: any): boolean;
|
|
75
75
|
}
|
|
76
|
-
export
|
|
76
|
+
export default InstallationProxyService;
|
|
77
77
|
import { BaseServicePlist } from '../base-service';
|
|
78
78
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/installation-proxy/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/installation-proxy/index.js"],"names":[],"mappings":"AAOA,8CAA+C,qCAAqC,CAAC;AAErF;IACE;;;;;OAKG;IACH,yBAJW,MAAM,iCAEN,MAAM,kBAWhB;IAED;;;;;;;;OAQG;IACH,yBAJW,MAAM,iCAEN,MAAM,kBAWhB;IAED;;;;;OAKG;IAEH;;;;OAIG;IACH,wBAHW,OAAO;;;;yBANJ,MAAM;;;;;MAMsB,GAC7B,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CA0BrC;IAED;;;;;;OAMG;IAEH;;;;OAIG;IACH,0BAHW,OAAO;;;;yBAPJ,MAAM;;;;;;;;mBAEN,MAAM,QAAM;MAKkB,GAC/B,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CA6BrC;IAED;;;;OAIG;IACH,+BAHW,MAAM,YACN,MAAM,kBAUhB;IAED,qDAWC;IAED,oCASC;CACF;;iCApK8B,iBAAiB"}
|
|
@@ -3,14 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.InstallationProxyService = exports.INSTALLATION_PROXY_SERVICE_NAME = void 0;
|
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
8
|
const base_service_1 = require("../base-service");
|
|
9
9
|
/*
|
|
10
10
|
* https://github.com/tmothy20013/libimobiledevice-master/blob/ecd89b42021cf6f7efe9ad271b3bddc7dd4b281e/src/installation_proxy.c
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
exports.INSTALLATION_PROXY_SERVICE_NAME = INSTALLATION_PROXY_SERVICE_NAME;
|
|
12
|
+
exports.INSTALLATION_PROXY_SERVICE_NAME = 'com.apple.mobile.installation_proxy';
|
|
14
13
|
class InstallationProxyService extends base_service_1.BaseServicePlist {
|
|
15
14
|
/**
|
|
16
15
|
* Install the application on the relative path on the phone
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/installation-proxy/index.js"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,kDAAiD;AAEjD;;GAEG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/installation-proxy/index.js"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,kDAAiD;AAEjD;;GAEG;AAEU,QAAA,+BAA+B,GAAG,qCAAqC,CAAC;AAErF,MAAa,wBAAyB,SAAQ,+BAAgB;IAC5D;;;;;OAKG;IACH,KAAK,CAAC,kBAAkB,CAAC,IAAI,EAAE,aAAa,GAAG,EAAE,EAAE,OAAO,GAAG,KAAK;QAChE,MAAM,OAAO,GAAG;YACd,OAAO,EAAE,SAAS;YAClB,WAAW,EAAE,IAAI;YACjB,aAAa,EAAE,aAAa;SAC7B,CAAC;QAEF,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACtC,OAAO,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,kBAAkB,CAAC,IAAI,EAAE,aAAa,GAAG,EAAE,EAAE,OAAO,GAAG,KAAK;QAChE,MAAM,OAAO,GAAG;YACd,OAAO,EAAE,SAAS;YAClB,WAAW,EAAE,IAAI;YACjB,aAAa,EAAE,aAAa;SAC7B,CAAC;QAEF,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACtC,OAAO,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAED;;;;;OAKG;IAEH;;;;OAIG;IACH,KAAK,CAAC,gBAAgB,CAAC,IAAI,GAAG,EAAE;QAC9B,MAAM,OAAO,GAAG;YACd,OAAO,EAAE,QAAQ;YACjB,aAAa,EAAE,EAAE;SAClB,CAAC;QAEF,IAAI,IAAI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B,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,WAAW,CAAC,QAAQ;QAClB,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAClE,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YACrB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,QAAQ,CAAC,MAAM,KAAK,UAAU,CAAC;IACxC,CAAC;CACF;AA5JD,4DA4JC;AAED,kBAAe,wBAAwB,CAAC"}
|
|
@@ -1,70 +1,21 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
channelCode: number;
|
|
12
|
-
/**
|
|
13
|
-
* DTXMessageAuxBuffer.length(nullable) + selectorBuffer.length(nullable)
|
|
14
|
-
*/
|
|
15
|
-
payloadLength: number | null;
|
|
16
|
-
/**
|
|
17
|
-
* if true reply a ack message
|
|
18
|
-
*/
|
|
19
|
-
expectsReply: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* raw data +1 indicate a reply message
|
|
22
|
-
*/
|
|
23
|
-
conversationIndex: number;
|
|
24
|
-
/**
|
|
25
|
-
* message status
|
|
26
|
-
*/
|
|
27
|
-
flags: number;
|
|
28
|
-
};
|
|
29
|
-
export type DTXMessagePayloadHeaderObject = {
|
|
30
|
-
/**
|
|
31
|
-
* message status
|
|
32
|
-
*/
|
|
33
|
-
flags: number;
|
|
34
|
-
/**
|
|
35
|
-
* DTXMessageAuxBuffer.length(nullable)
|
|
36
|
-
*/
|
|
37
|
-
auxLength: number;
|
|
38
|
-
/**
|
|
39
|
-
* DTXMessageAuxBuffer.length(nullable) + selectorBuffer.length
|
|
40
|
-
*/
|
|
41
|
-
totalLength: bigint;
|
|
42
|
-
};
|
|
1
|
+
export const DTX_MESSAGE_PAYLOAD_HEADER_LENGTH: 16;
|
|
2
|
+
export const DTX_MESSAGE_HEADER_LENGTH: 32;
|
|
3
|
+
export const DTX_MESSAGE_HEADER_MAGIC: 524114809;
|
|
4
|
+
export const DTX_MESSAGE_HEADER_MAGIC_LEN: 4;
|
|
5
|
+
export const FLAG_TYPES: Readonly<{
|
|
6
|
+
push: 0;
|
|
7
|
+
recv: 1;
|
|
8
|
+
send: 2;
|
|
9
|
+
reply: 3;
|
|
10
|
+
}>;
|
|
43
11
|
/**
|
|
44
|
-
*
|
|
12
|
+
* DTXMessagePayloadHeader length 16
|
|
45
13
|
* struct DTXMessageHeader {
|
|
46
|
-
* u32
|
|
47
|
-
* u32
|
|
48
|
-
*
|
|
49
|
-
* u16 fragmentCount packets total number
|
|
50
|
-
* u32 payloadLength
|
|
51
|
-
* u32 identifier
|
|
52
|
-
* u32 conversationIndex
|
|
53
|
-
* u32 channel
|
|
54
|
-
* u32 expectsReply
|
|
14
|
+
* u32 flags FLAG_TYPES
|
|
15
|
+
* u32 auxLength
|
|
16
|
+
* u64 totalLength
|
|
55
17
|
* }
|
|
56
18
|
*/
|
|
57
|
-
/**
|
|
58
|
-
* @typedef {Object} DTXMessageOptions
|
|
59
|
-
* @property {any} selector
|
|
60
|
-
* @property {number} identifier packet transmission sequence, this value is incremented for each request
|
|
61
|
-
* @property {number} channelCode the data transmission of the service will use this channel code.
|
|
62
|
-
* Each service has a separate channel
|
|
63
|
-
* @property {number?} payloadLength DTXMessageAuxBuffer.length(nullable) + selectorBuffer.length(nullable)
|
|
64
|
-
* @property {boolean} expectsReply if true reply a ack message
|
|
65
|
-
* @property {number} conversationIndex raw data +1 indicate a reply message
|
|
66
|
-
* @property {number} flags message status
|
|
67
|
-
*/
|
|
68
19
|
export class DTXMessageHeader {
|
|
69
20
|
/**
|
|
70
21
|
* @param {Partial<DTXMessageOptions>} data
|
|
@@ -77,14 +28,6 @@ export class DTXMessageHeader {
|
|
|
77
28
|
*/
|
|
78
29
|
static parse(headerBuffer: any): any;
|
|
79
30
|
}
|
|
80
|
-
/**
|
|
81
|
-
* DTXMessagePayloadHeader length 16
|
|
82
|
-
* struct DTXMessageHeader {
|
|
83
|
-
* u32 flags FLAG_TYPES
|
|
84
|
-
* u32 auxLength
|
|
85
|
-
* u64 totalLength
|
|
86
|
-
* }
|
|
87
|
-
*/
|
|
88
31
|
/**
|
|
89
32
|
* @typedef {Object} DTXMessagePayloadHeaderObject
|
|
90
33
|
* @property {number} flags message status
|
|
@@ -103,6 +46,25 @@ export class DTXMessagePayloadHeader {
|
|
|
103
46
|
*/
|
|
104
47
|
static parse(headerBuffer: any): DTXMessagePayloadHeaderObject;
|
|
105
48
|
}
|
|
49
|
+
export class DTXMessageAux {
|
|
50
|
+
/**
|
|
51
|
+
* Parses nskeyed Buffer into js array
|
|
52
|
+
* @param {Buffer} headerBuffer
|
|
53
|
+
* @param {DTXMessagePayloadHeaderObject} payloadHeader
|
|
54
|
+
* @returns {any[]}
|
|
55
|
+
*/
|
|
56
|
+
static parse(headerBuffer: Buffer, payloadHeader: DTXMessagePayloadHeaderObject): any[];
|
|
57
|
+
/**
|
|
58
|
+
* @param {any[] | DTXMessageAuxBuffer} data
|
|
59
|
+
*/
|
|
60
|
+
constructor(data?: any[] | DTXMessageAuxBuffer);
|
|
61
|
+
data: any[] | DTXMessageAuxBuffer;
|
|
62
|
+
/**
|
|
63
|
+
* JS Array to Apple NSKeyed Buffer
|
|
64
|
+
* @returns {Buffer}
|
|
65
|
+
*/
|
|
66
|
+
build(): Buffer;
|
|
67
|
+
}
|
|
106
68
|
export class DTXMessageAuxBuffer {
|
|
107
69
|
_buf: Buffer<ArrayBuffer>;
|
|
108
70
|
/**
|
|
@@ -127,25 +89,6 @@ export class DTXMessageAuxBuffer {
|
|
|
127
89
|
appendObject(value: any): void;
|
|
128
90
|
getBytes(): Buffer<ArrayBuffer>;
|
|
129
91
|
}
|
|
130
|
-
export class DTXMessageAux {
|
|
131
|
-
/**
|
|
132
|
-
* Parses nskeyed Buffer into js array
|
|
133
|
-
* @param {Buffer} headerBuffer
|
|
134
|
-
* @param {DTXMessagePayloadHeaderObject} payloadHeader
|
|
135
|
-
* @returns {any[]}
|
|
136
|
-
*/
|
|
137
|
-
static parse(headerBuffer: Buffer, payloadHeader: DTXMessagePayloadHeaderObject): any[];
|
|
138
|
-
/**
|
|
139
|
-
* @param {any[] | DTXMessageAuxBuffer} data
|
|
140
|
-
*/
|
|
141
|
-
constructor(data?: any[] | DTXMessageAuxBuffer);
|
|
142
|
-
data: any[] | DTXMessageAuxBuffer;
|
|
143
|
-
/**
|
|
144
|
-
* JS Array to Apple NSKeyed Buffer
|
|
145
|
-
* @returns {Buffer}
|
|
146
|
-
*/
|
|
147
|
-
build(): Buffer;
|
|
148
|
-
}
|
|
149
92
|
export class DTXMessage {
|
|
150
93
|
/**
|
|
151
94
|
* Parses DTX buffer into an js object. Returned in DTXDecoder Stream.Transform
|
|
@@ -205,14 +148,46 @@ export class DTXMessage {
|
|
|
205
148
|
*/
|
|
206
149
|
build(): Buffer;
|
|
207
150
|
}
|
|
208
|
-
export
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
151
|
+
export type DTXMessageOptions = {
|
|
152
|
+
selector: any;
|
|
153
|
+
/**
|
|
154
|
+
* packet transmission sequence, this value is incremented for each request
|
|
155
|
+
*/
|
|
156
|
+
identifier: number;
|
|
157
|
+
/**
|
|
158
|
+
* the data transmission of the service will use this channel code.
|
|
159
|
+
* Each service has a separate channel
|
|
160
|
+
*/
|
|
161
|
+
channelCode: number;
|
|
162
|
+
/**
|
|
163
|
+
* DTXMessageAuxBuffer.length(nullable) + selectorBuffer.length(nullable)
|
|
164
|
+
*/
|
|
165
|
+
payloadLength: number | null;
|
|
166
|
+
/**
|
|
167
|
+
* if true reply a ack message
|
|
168
|
+
*/
|
|
169
|
+
expectsReply: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* raw data +1 indicate a reply message
|
|
172
|
+
*/
|
|
173
|
+
conversationIndex: number;
|
|
174
|
+
/**
|
|
175
|
+
* message status
|
|
176
|
+
*/
|
|
177
|
+
flags: number;
|
|
178
|
+
};
|
|
179
|
+
export type DTXMessagePayloadHeaderObject = {
|
|
180
|
+
/**
|
|
181
|
+
* message status
|
|
182
|
+
*/
|
|
183
|
+
flags: number;
|
|
184
|
+
/**
|
|
185
|
+
* DTXMessageAuxBuffer.length(nullable)
|
|
186
|
+
*/
|
|
187
|
+
auxLength: number;
|
|
188
|
+
/**
|
|
189
|
+
* DTXMessageAuxBuffer.length(nullable) + selectorBuffer.length
|
|
190
|
+
*/
|
|
191
|
+
totalLength: bigint;
|
|
192
|
+
};
|
|
218
193
|
//# sourceMappingURL=headers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../../lib/instrument/headers.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../../lib/instrument/headers.js"],"names":[],"mappings":"AAIA,gDAAiD,EAAE,CAAC;AACpD,wCAAyC,EAAE,CAAC;AAC5C,uCAAwC,SAAU,CAAC;AACnD,2CAA4C,CAAC,CAAC;AAI9C;;;;;GAKG;AA2CH;;;;;;;GAOG;AAEH;IACE;;;OAGG;IACH,mBAHW,OAAO,CAAC,iBAAiB,CAAC,GACxB,MAAM,CAclB;IAED;;;OAGG;IACH,qCAYC;CACF;AAED;;;;;GAKG;AACH;IACE;;;OAGG;IACH,mBAHgB,6BAA6B,GAChC,MAAM,CAQlB;IAED;;;OAGG;IACH,iCAFa,6BAA6B,CAQzC;CACF;AAED;IAQE;;;;;OAKG;IACH,2BAJW,MAAM,iBACN,6BAA6B,GAC3B,GAAG,EAAE,CAkDjB;IA7DD;;OAEG;IACH,mBAFW,GAAG,EAAE,GAAG,mBAAmB,EAIrC;IADC,kCAAgB;IA2DlB;;;OAGG;IACH,SAFa,MAAM,CAoBlB;CACF;AAED;IAEI,0BAA2B;IAG7B;;OAEG;IACH,iBAFW,MAAM,QAQhB;IAED;;OAEG;IACH,kBAFW,MAAM,QAQhB;IAED;;OAEG;IACH,uBAFW,MAAM,QAQhB;IAED;;OAEG;IACH,wBAFW,MAAM,QAQhB;IAED;;OAEG;IACH,+BAOC;IAED,gCAKC;CACF;AAED;IA0EE;;;;;OAKG;IACH,wBAJW,MAAM,cACN,MAAM,GACJ,UAAU,CAuCtB;IApHD;;OAEG;IACH,mBAFW,OAAO,CAAC,iBAAiB,CAAC,EAoBpC;IATC,oBAA+B;IAC/B,oBAA+B;IAC/B,gCAA6B;IAC7B,iCAA+B;IAC/B,mCAAiC;IACjC,eAAyB;IACzB,2BAA2C;IAC3C,eAAmB;IACnB,2BAAsC;IAGxC;;;OAGG;IACH,kBAFa,MAAM,CAIlB;IAED;;;;;OAKG;IACH,mBAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,oBAFa,OAAO,CAInB;IAkBD;;OAEG;IACH,mBAjBa,GAAC,EAmBb;IArBD;;;OAGG;IACH,gBAFa,GAAC,CAIb;IAED;;;OAGG;IACH,yBAFa,MAAM,CAIlB;IAsDD;;;OAGG;IACH,SAFa,MAAM,CAoBlB;CACF;;cA3Ya,GAAG;;;;gBACH,MAAM;;;;;iBACN,MAAM;;;;mBAEN,MAAM,OAAC;;;;kBACP,OAAO;;;;uBACP,MAAM;;;;WACN,MAAM;;;;;;WA0DN,MAAM;;;;eACN,MAAM;;;;iBACN,MAAM"}
|
|
@@ -3,27 +3,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.DTXMessage = exports.DTXMessageAuxBuffer = exports.DTXMessageAux = exports.DTXMessagePayloadHeader = exports.DTXMessageHeader = exports.FLAG_TYPES = exports.DTX_MESSAGE_HEADER_MAGIC_LEN = exports.DTX_MESSAGE_HEADER_MAGIC = exports.DTX_MESSAGE_HEADER_LENGTH = exports.DTX_MESSAGE_PAYLOAD_HEADER_LENGTH = void 0;
|
|
7
7
|
const nskeyed_1 = require("./transformer/nskeyed");
|
|
8
8
|
const bplist_parser_1 = require("bplist-parser");
|
|
9
9
|
const lodash_1 = __importDefault(require("lodash"));
|
|
10
|
-
|
|
11
|
-
exports.
|
|
12
|
-
|
|
13
|
-
exports.
|
|
14
|
-
const DTX_MESSAGE_HEADER_MAGIC = 0x1f3d5b79;
|
|
15
|
-
exports.DTX_MESSAGE_HEADER_MAGIC = DTX_MESSAGE_HEADER_MAGIC;
|
|
16
|
-
const DTX_MESSAGE_HEADER_MAGIC_LEN = 4;
|
|
17
|
-
exports.DTX_MESSAGE_HEADER_MAGIC_LEN = DTX_MESSAGE_HEADER_MAGIC_LEN;
|
|
10
|
+
exports.DTX_MESSAGE_PAYLOAD_HEADER_LENGTH = 16;
|
|
11
|
+
exports.DTX_MESSAGE_HEADER_LENGTH = 32;
|
|
12
|
+
exports.DTX_MESSAGE_HEADER_MAGIC = 0x1f3d5b79;
|
|
13
|
+
exports.DTX_MESSAGE_HEADER_MAGIC_LEN = 4;
|
|
18
14
|
const DTX_MESSAGE_AUX_HEADER = 0x01f0;
|
|
19
15
|
const DTX_AUXILIARY_MAGIC = 0xa;
|
|
20
|
-
|
|
16
|
+
exports.FLAG_TYPES = Object.freeze({
|
|
21
17
|
push: 0,
|
|
22
18
|
recv: 1,
|
|
23
19
|
send: 2,
|
|
24
20
|
reply: 3,
|
|
25
21
|
});
|
|
26
|
-
exports.FLAG_TYPES = FLAG_TYPES;
|
|
27
22
|
const AUX_TYPES = Object.freeze({
|
|
28
23
|
Text: 1,
|
|
29
24
|
NSKeyed: 2,
|
|
@@ -56,15 +51,28 @@ const AUX_TYPES = Object.freeze({
|
|
|
56
51
|
* @property {number} conversationIndex raw data +1 indicate a reply message
|
|
57
52
|
* @property {number} flags message status
|
|
58
53
|
*/
|
|
54
|
+
class InstrumentRPCParseError {
|
|
55
|
+
constructor(data) {
|
|
56
|
+
this.data = data;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* DTXMessagePayloadHeader length 16
|
|
61
|
+
* struct DTXMessageHeader {
|
|
62
|
+
* u32 flags FLAG_TYPES
|
|
63
|
+
* u32 auxLength
|
|
64
|
+
* u64 totalLength
|
|
65
|
+
* }
|
|
66
|
+
*/
|
|
59
67
|
class DTXMessageHeader {
|
|
60
68
|
/**
|
|
61
69
|
* @param {Partial<DTXMessageOptions>} data
|
|
62
70
|
* @returns {Buffer} DTXMessageHeaderBuffer
|
|
63
71
|
*/
|
|
64
72
|
static build(data) {
|
|
65
|
-
const messageHeader = Buffer.alloc(DTX_MESSAGE_HEADER_LENGTH);
|
|
66
|
-
messageHeader.writeUInt32LE(DTX_MESSAGE_HEADER_MAGIC, 0);
|
|
67
|
-
messageHeader.writeUInt32LE(DTX_MESSAGE_HEADER_LENGTH, 4);
|
|
73
|
+
const messageHeader = Buffer.alloc(exports.DTX_MESSAGE_HEADER_LENGTH);
|
|
74
|
+
messageHeader.writeUInt32LE(exports.DTX_MESSAGE_HEADER_MAGIC, 0);
|
|
75
|
+
messageHeader.writeUInt32LE(exports.DTX_MESSAGE_HEADER_LENGTH, 4);
|
|
68
76
|
messageHeader.writeUInt16LE(0, 8);
|
|
69
77
|
messageHeader.writeUInt16LE(1, 10);
|
|
70
78
|
messageHeader.writeUInt32LE(data.payloadLength ?? 0, 12);
|
|
@@ -93,14 +101,6 @@ class DTXMessageHeader {
|
|
|
93
101
|
}
|
|
94
102
|
}
|
|
95
103
|
exports.DTXMessageHeader = DTXMessageHeader;
|
|
96
|
-
/**
|
|
97
|
-
* DTXMessagePayloadHeader length 16
|
|
98
|
-
* struct DTXMessageHeader {
|
|
99
|
-
* u32 flags FLAG_TYPES
|
|
100
|
-
* u32 auxLength
|
|
101
|
-
* u64 totalLength
|
|
102
|
-
* }
|
|
103
|
-
*/
|
|
104
104
|
/**
|
|
105
105
|
* @typedef {Object} DTXMessagePayloadHeaderObject
|
|
106
106
|
* @property {number} flags message status
|
|
@@ -113,7 +113,7 @@ class DTXMessagePayloadHeader {
|
|
|
113
113
|
* @returns {Buffer} DTXMessagePayloadHeaderBuffer
|
|
114
114
|
*/
|
|
115
115
|
static build(data) {
|
|
116
|
-
const messageHeader = Buffer.alloc(DTX_MESSAGE_PAYLOAD_HEADER_LENGTH);
|
|
116
|
+
const messageHeader = Buffer.alloc(exports.DTX_MESSAGE_PAYLOAD_HEADER_LENGTH);
|
|
117
117
|
messageHeader.writeUInt32LE(data.flags, 0);
|
|
118
118
|
messageHeader.writeUInt32LE(data.auxLength, 4);
|
|
119
119
|
messageHeader.writeBigUInt64LE(data.totalLength, 8);
|
|
@@ -139,32 +139,6 @@ class DTXMessageAux {
|
|
|
139
139
|
constructor(data = []) {
|
|
140
140
|
this.data = data;
|
|
141
141
|
}
|
|
142
|
-
/**
|
|
143
|
-
* JS Array to Apple NSKeyed Buffer
|
|
144
|
-
* @returns {Buffer}
|
|
145
|
-
*/
|
|
146
|
-
build() {
|
|
147
|
-
if (this.data instanceof DTXMessageAuxBuffer) {
|
|
148
|
-
return this.data.getBytes();
|
|
149
|
-
}
|
|
150
|
-
const messageAux = new DTXMessageAuxBuffer();
|
|
151
|
-
let buf = Buffer.alloc(0);
|
|
152
|
-
for (const arg of this.data) {
|
|
153
|
-
if (arg instanceof DTXMessageAuxBuffer) {
|
|
154
|
-
buf = Buffer.concat([buf, arg.getBytes()]);
|
|
155
|
-
}
|
|
156
|
-
else if (lodash_1.default.isNumber(arg)) {
|
|
157
|
-
messageAux.appendInt(arg);
|
|
158
|
-
}
|
|
159
|
-
else if (typeof arg == 'bigint') {
|
|
160
|
-
messageAux.appendLong(arg);
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
messageAux.appendObject(arg);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
return Buffer.concat([buf, messageAux.getBytes()]);
|
|
167
|
-
}
|
|
168
142
|
/**
|
|
169
143
|
* Parses nskeyed Buffer into js array
|
|
170
144
|
* @param {Buffer} headerBuffer
|
|
@@ -177,7 +151,7 @@ class DTXMessageAux {
|
|
|
177
151
|
const length = headerBuffer.readBigInt64LE(8);
|
|
178
152
|
cursor += 16;
|
|
179
153
|
while (cursor <= length) {
|
|
180
|
-
if (payloadHeader.flags !== FLAG_TYPES.push) {
|
|
154
|
+
if (payloadHeader.flags !== exports.FLAG_TYPES.push) {
|
|
181
155
|
const m = headerBuffer.readUInt32LE(cursor);
|
|
182
156
|
cursor += 4;
|
|
183
157
|
if (m !== DTX_AUXILIARY_MAGIC) {
|
|
@@ -220,13 +194,34 @@ class DTXMessageAux {
|
|
|
220
194
|
}
|
|
221
195
|
return data;
|
|
222
196
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
197
|
+
/**
|
|
198
|
+
* JS Array to Apple NSKeyed Buffer
|
|
199
|
+
* @returns {Buffer}
|
|
200
|
+
*/
|
|
201
|
+
build() {
|
|
202
|
+
if (this.data instanceof DTXMessageAuxBuffer) {
|
|
203
|
+
return this.data.getBytes();
|
|
204
|
+
}
|
|
205
|
+
const messageAux = new DTXMessageAuxBuffer();
|
|
206
|
+
let buf = Buffer.alloc(0);
|
|
207
|
+
for (const arg of this.data) {
|
|
208
|
+
if (arg instanceof DTXMessageAuxBuffer) {
|
|
209
|
+
buf = Buffer.concat([buf, arg.getBytes()]);
|
|
210
|
+
}
|
|
211
|
+
else if (lodash_1.default.isNumber(arg)) {
|
|
212
|
+
messageAux.appendInt(arg);
|
|
213
|
+
}
|
|
214
|
+
else if (typeof arg == 'bigint') {
|
|
215
|
+
messageAux.appendLong(arg);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
messageAux.appendObject(arg);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return Buffer.concat([buf, messageAux.getBytes()]);
|
|
228
222
|
}
|
|
229
223
|
}
|
|
224
|
+
exports.DTXMessageAux = DTXMessageAux;
|
|
230
225
|
class DTXMessageAuxBuffer {
|
|
231
226
|
constructor() {
|
|
232
227
|
this._buf = Buffer.alloc(0);
|
|
@@ -295,7 +290,7 @@ class DTXMessage {
|
|
|
295
290
|
* @param {Partial<DTXMessageOptions>} opts
|
|
296
291
|
*/
|
|
297
292
|
constructor(opts = {}) {
|
|
298
|
-
const { identifier, channelCode, selector, expectsReply, conversationIndex = 0, flags = FLAG_TYPES.send, } = opts;
|
|
293
|
+
const { identifier, channelCode, selector, expectsReply, conversationIndex = 0, flags = exports.FLAG_TYPES.send, } = opts;
|
|
299
294
|
this._messageHeader = undefined;
|
|
300
295
|
this._payloadHeader = undefined;
|
|
301
296
|
this._identifier = identifier;
|
|
@@ -337,12 +332,6 @@ class DTXMessage {
|
|
|
337
332
|
get selector() {
|
|
338
333
|
return this._selector;
|
|
339
334
|
}
|
|
340
|
-
/**
|
|
341
|
-
* @param data
|
|
342
|
-
*/
|
|
343
|
-
set selector(data) {
|
|
344
|
-
this._selector = data;
|
|
345
|
-
}
|
|
346
335
|
/**
|
|
347
336
|
* get DTXMessageHeader conversationIndex
|
|
348
337
|
* @returns {number}
|
|
@@ -351,26 +340,10 @@ class DTXMessage {
|
|
|
351
340
|
return this._messageHeader?.conversationIndex;
|
|
352
341
|
}
|
|
353
342
|
/**
|
|
354
|
-
*
|
|
355
|
-
* @returns {Buffer}
|
|
343
|
+
* @param data
|
|
356
344
|
*/
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
const aux = this.auxiliaries.build();
|
|
360
|
-
const payloadHeader = DTXMessagePayloadHeader.build({
|
|
361
|
-
flags: this._flags,
|
|
362
|
-
auxLength: aux.length,
|
|
363
|
-
// need to convert to bigint in any case
|
|
364
|
-
totalLength: BigInt(aux.length + sel.length),
|
|
365
|
-
});
|
|
366
|
-
const messageHeader = DTXMessageHeader.build({
|
|
367
|
-
payloadLength: DTX_MESSAGE_PAYLOAD_HEADER_LENGTH + aux.length + sel.length,
|
|
368
|
-
identifier: this._identifier,
|
|
369
|
-
conversationIndex: this._conversationIndex,
|
|
370
|
-
channelCode: this._channelCode,
|
|
371
|
-
expectsReply: this._expectsReply,
|
|
372
|
-
});
|
|
373
|
-
return Buffer.concat([messageHeader, payloadHeader, aux, sel]);
|
|
345
|
+
set selector(data) {
|
|
346
|
+
this._selector = data;
|
|
374
347
|
}
|
|
375
348
|
/**
|
|
376
349
|
* Parses DTX buffer into an js object. Returned in DTXDecoder Stream.Transform
|
|
@@ -385,8 +358,8 @@ class DTXMessage {
|
|
|
385
358
|
if (ret._messageHeader.payloadLength === 0) {
|
|
386
359
|
return ret;
|
|
387
360
|
}
|
|
388
|
-
ret._payloadHeader = DTXMessagePayloadHeader.parse(payloadBuf.slice(cursor, DTX_MESSAGE_PAYLOAD_HEADER_LENGTH));
|
|
389
|
-
cursor += DTX_MESSAGE_PAYLOAD_HEADER_LENGTH;
|
|
361
|
+
ret._payloadHeader = DTXMessagePayloadHeader.parse(payloadBuf.slice(cursor, exports.DTX_MESSAGE_PAYLOAD_HEADER_LENGTH));
|
|
362
|
+
cursor += exports.DTX_MESSAGE_PAYLOAD_HEADER_LENGTH;
|
|
390
363
|
// totalLength is bigint use 0n
|
|
391
364
|
if (ret._payloadHeader.totalLength === 0n) {
|
|
392
365
|
return ret;
|
|
@@ -411,6 +384,28 @@ class DTXMessage {
|
|
|
411
384
|
}
|
|
412
385
|
return ret;
|
|
413
386
|
}
|
|
387
|
+
/**
|
|
388
|
+
* DTXMessage Buffer: DTXMessageHeader + PayloadHeader + DTXMessageAuxBuffer(nullable) + selector(nullable)
|
|
389
|
+
* @returns {Buffer}
|
|
390
|
+
*/
|
|
391
|
+
build() {
|
|
392
|
+
const sel = this._selector ? (0, nskeyed_1.archive)(this._selector) : Buffer.alloc(0);
|
|
393
|
+
const aux = this.auxiliaries.build();
|
|
394
|
+
const payloadHeader = DTXMessagePayloadHeader.build({
|
|
395
|
+
flags: this._flags,
|
|
396
|
+
auxLength: aux.length,
|
|
397
|
+
// need to convert to bigint in any case
|
|
398
|
+
totalLength: BigInt(aux.length + sel.length),
|
|
399
|
+
});
|
|
400
|
+
const messageHeader = DTXMessageHeader.build({
|
|
401
|
+
payloadLength: exports.DTX_MESSAGE_PAYLOAD_HEADER_LENGTH + aux.length + sel.length,
|
|
402
|
+
identifier: this._identifier,
|
|
403
|
+
conversationIndex: this._conversationIndex,
|
|
404
|
+
channelCode: this._channelCode,
|
|
405
|
+
expectsReply: this._expectsReply,
|
|
406
|
+
});
|
|
407
|
+
return Buffer.concat([messageHeader, payloadHeader, aux, sel]);
|
|
408
|
+
}
|
|
414
409
|
}
|
|
415
410
|
exports.DTXMessage = DTXMessage;
|
|
416
411
|
//# sourceMappingURL=headers.js.map
|