@eryxenx/fca 1.0.0
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 +325 -0
- package/DOCS.md +2712 -0
- package/README.md +455 -0
- package/func/checkUpdate.js +7 -0
- package/func/logAdapter.js +33 -0
- package/func/logger.js +48 -0
- package/index.d.ts +751 -0
- package/index.js +22 -0
- package/module/config.js +40 -0
- package/module/login.js +133 -0
- package/module/loginHelper.js +1365 -0
- package/module/options.js +44 -0
- package/package.json +98 -0
- package/src/api/action/addExternalModule.js +25 -0
- package/src/api/action/changeAvatar.js +137 -0
- package/src/api/action/changeBio.js +75 -0
- package/src/api/action/enableAutoSaveAppState.js +73 -0
- package/src/api/action/getCurrentUserID.js +7 -0
- package/src/api/action/handleFriendRequest.js +57 -0
- package/src/api/action/logout.js +76 -0
- package/src/api/action/refreshFb_dtsg.js +48 -0
- package/src/api/action/setPostReaction.js +106 -0
- package/src/api/action/unfriend.js +54 -0
- package/src/api/http/httpGet.js +46 -0
- package/src/api/http/httpPost.js +52 -0
- package/src/api/http/postFormData.js +47 -0
- package/src/api/messaging/addUserToGroup.js +68 -0
- package/src/api/messaging/changeAdminStatus.js +126 -0
- package/src/api/messaging/changeArchivedStatus.js +55 -0
- package/src/api/messaging/changeBlockedStatus.js +48 -0
- package/src/api/messaging/changeGroupImage.js +91 -0
- package/src/api/messaging/changeNickname.js +70 -0
- package/src/api/messaging/changeThreadColor.js +79 -0
- package/src/api/messaging/changeThreadEmoji.js +111 -0
- package/src/api/messaging/createNewGroup.js +88 -0
- package/src/api/messaging/createPoll.js +46 -0
- package/src/api/messaging/createThemeAI.js +98 -0
- package/src/api/messaging/deleteMessage.js +136 -0
- package/src/api/messaging/deleteThread.js +56 -0
- package/src/api/messaging/editMessage.js +105 -0
- package/src/api/messaging/forwardAttachment.js +57 -0
- package/src/api/messaging/forwardMessage.js +134 -0
- package/src/api/messaging/getEmojiUrl.js +29 -0
- package/src/api/messaging/getFriendsList.js +82 -0
- package/src/api/messaging/getMessage.js +829 -0
- package/src/api/messaging/getThemePictures.js +62 -0
- package/src/api/messaging/handleMessageRequest.js +65 -0
- package/src/api/messaging/markAsDelivered.js +57 -0
- package/src/api/messaging/markAsRead.js +88 -0
- package/src/api/messaging/markAsReadAll.js +56 -0
- package/src/api/messaging/markAsSeen.js +68 -0
- package/src/api/messaging/muteThread.js +50 -0
- package/src/api/messaging/pinMessage.js +115 -0
- package/src/api/messaging/removeUserFromGroup.js +62 -0
- package/src/api/messaging/resolvePhotoUrl.js +43 -0
- package/src/api/messaging/scheduler.js +264 -0
- package/src/api/messaging/searchForThread.js +53 -0
- package/src/api/messaging/sendBroadcast.js +93 -0
- package/src/api/messaging/sendMessage.js +269 -0
- package/src/api/messaging/sendTypingIndicator.js +90 -0
- package/src/api/messaging/sessionGuard.js +130 -0
- package/src/api/messaging/setMessageReaction.js +109 -0
- package/src/api/messaging/setTitle.js +124 -0
- package/src/api/messaging/shareContact.js +98 -0
- package/src/api/messaging/threadColors.js +128 -0
- package/src/api/messaging/unsendMessage.js +105 -0
- package/src/api/messaging/uploadAttachment.js +492 -0
- package/src/api/socket/OldMessage.js +186 -0
- package/src/api/socket/core/connectMqtt.js +269 -0
- package/src/api/socket/core/emitAuth.js +103 -0
- package/src/api/socket/core/getSeqID.js +321 -0
- package/src/api/socket/core/getTaskResponseData.js +25 -0
- package/src/api/socket/core/parseDelta.js +387 -0
- package/src/api/socket/detail/buildStream.js +215 -0
- package/src/api/socket/detail/constants.js +28 -0
- package/src/api/socket/e2ee/crypto.js +173 -0
- package/src/api/socket/e2ee/index.js +925 -0
- package/src/api/socket/e2ee/localMediaServer.js +59 -0
- package/src/api/socket/e2ee/mediaDecode.js +155 -0
- package/src/api/socket/e2ee/native/NOTICE.md +29 -0
- package/src/api/socket/e2ee/native/build/messagix.dll +0 -0
- package/src/api/socket/e2ee/native/build/messagix.so +0 -0
- package/src/api/socket/e2ee/native/lib/index.mjs +1426 -0
- package/src/api/socket/e2ee/native/nativeMediaBridge.js +233 -0
- package/src/api/socket/e2ee/proto/ArmadilloApplication.proto +281 -0
- package/src/api/socket/e2ee/proto/ArmadilloICDC.proto +14 -0
- package/src/api/socket/e2ee/proto/ConsumerApplication.proto +232 -0
- package/src/api/socket/e2ee/proto/MessageApplication.proto +82 -0
- package/src/api/socket/e2ee/proto/MessageTransport.proto +77 -0
- package/src/api/socket/e2ee/proto/WACommon.proto +66 -0
- package/src/api/socket/e2ee/proto/WAMediaTransport.proto +176 -0
- package/src/api/socket/e2ee/proto/proto-writer.ts +76 -0
- package/src/api/socket/e2ee/protocol.js +196 -0
- package/src/api/socket/e2ee/ratchet.js +219 -0
- package/src/api/socket/e2ee/store.js +182 -0
- package/src/api/socket/e2ee/vendor/fme/dist/index.cjs +6477 -0
- package/src/api/socket/e2ee/vendor/fme/proto/ArmadilloApplication.proto +281 -0
- package/src/api/socket/e2ee/vendor/fme/proto/ArmadilloICDC.proto +14 -0
- package/src/api/socket/e2ee/vendor/fme/proto/ConsumerApplication.proto +232 -0
- package/src/api/socket/e2ee/vendor/fme/proto/MessageApplication.proto +82 -0
- package/src/api/socket/e2ee/vendor/fme/proto/MessageTransport.proto +77 -0
- package/src/api/socket/e2ee/vendor/fme/proto/WACommon.proto +66 -0
- package/src/api/socket/e2ee/vendor/fme/proto/WAMediaTransport.proto +176 -0
- package/src/api/socket/listenE2EE.js +75 -0
- package/src/api/socket/listenMqtt.js +436 -0
- package/src/api/socket/middleware/index.js +216 -0
- package/src/api/socket/sendMessage.js +314 -0
- package/src/api/socket/sendMessageMqtt.js +69 -0
- package/src/api/threads/getThreadHistory.js +664 -0
- package/src/api/threads/getThreadInfo.js +329 -0
- package/src/api/threads/getThreadList.js +293 -0
- package/src/api/threads/getThreadPictures.js +78 -0
- package/src/api/users/getUserID.js +65 -0
- package/src/api/users/getUserInfo.js +402 -0
- package/src/api/users/getUserInfoV2.js +134 -0
- package/src/app/MessengerBot.js +209 -0
- package/src/app/MessengerContext.js +32 -0
- package/src/app/createFcaClient.js +136 -0
- package/src/app/threadInfoRealtimeSync.js +284 -0
- package/src/core/sendReqMqtt.js +96 -0
- package/src/database/helpers.js +53 -0
- package/src/database/models/index.js +88 -0
- package/src/database/models/thread.js +50 -0
- package/src/database/models/user.js +46 -0
- package/src/database/threadData.js +94 -0
- package/src/database/userData.js +98 -0
- package/src/remote/remoteClient.js +123 -0
- package/src/utils/broadcast.js +51 -0
- package/src/utils/client.js +10 -0
- package/src/utils/constants.js +23 -0
- package/src/utils/cookies.js +68 -0
- package/src/utils/format/attachment.js +357 -0
- package/src/utils/format/cookie.js +9 -0
- package/src/utils/format/date.js +50 -0
- package/src/utils/format/decode.js +44 -0
- package/src/utils/format/delta.js +194 -0
- package/src/utils/format/ids.js +64 -0
- package/src/utils/format/index.js +64 -0
- package/src/utils/format/message.js +88 -0
- package/src/utils/format/presence.js +132 -0
- package/src/utils/format/readTyp.js +44 -0
- package/src/utils/format/thread.js +42 -0
- package/src/utils/format/utils.js +141 -0
- package/src/utils/headers.js +128 -0
- package/src/utils/loginParser/autoLogin.js +125 -0
- package/src/utils/loginParser/helpers.js +43 -0
- package/src/utils/loginParser/index.js +10 -0
- package/src/utils/loginParser/parseAndCheckLogin.js +220 -0
- package/src/utils/loginParser/textUtils.js +28 -0
- package/src/utils/nexca-logger.js +144 -0
- package/src/utils/nexca-utils.js +686 -0
- package/src/utils/request/client.js +26 -0
- package/src/utils/request/config.js +23 -0
- package/src/utils/request/defaults.js +46 -0
- package/src/utils/request/helpers.js +46 -0
- package/src/utils/request/index.js +17 -0
- package/src/utils/request/methods.js +163 -0
- package/src/utils/request/proxy.js +21 -0
- package/src/utils/request/retry.js +77 -0
- package/src/utils/request/sanitize.js +49 -0
- package/src/utils/versionCheck.js +47 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Native E2EE media bridge — mautrix-go / mautrix-meta (MPL-2.0)
|
|
5
|
+
* Copyright (c) Tulir Asokan and mautrix-go/mautrix-meta contributors.
|
|
6
|
+
* Upstream: https://github.com/mautrix/go, https://github.com/mautrix/meta
|
|
7
|
+
* License: https://www.mozilla.org/en-US/MPL/2.0/
|
|
8
|
+
*
|
|
9
|
+
* fca-eryxenx's own hand-written Signal/Noise media encoder (vendor/fme)
|
|
10
|
+
* sends E2EE image/video/audio/document messages that Facebook's server
|
|
11
|
+
* accepts (valid messageId + CDN path returned) but that the real Messenger
|
|
12
|
+
* client silently fails to render — the reverse-engineered .proto schema
|
|
13
|
+
* used there doesn't match Messenger's actual wire format closely enough.
|
|
14
|
+
*
|
|
15
|
+
* This module instead calls into a precompiled native library built from
|
|
16
|
+
* mautrix-go/mautrix-meta (a maintained, protocol-accurate Go implementation
|
|
17
|
+
* of the same E2EE stack) via the `koffi` FFI, exactly like the reference
|
|
18
|
+
* "stfca" package does. Only MEDIA sending is routed through here — text
|
|
19
|
+
* messages keep using fca-eryxenx's existing, already-working E2EE path.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const path = require("path");
|
|
23
|
+
const logger = require("../../../../utils/nexca-logger");
|
|
24
|
+
|
|
25
|
+
const NATIVE_CALL_TIMEOUT_MS = 15000;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Wraps a native-engine call with a hard timeout. A hung native call (e.g.
|
|
29
|
+
* a stuck getDeviceList/usync query) was observed blocking the whole
|
|
30
|
+
* process — including the unrelated MQTT connection — for 80+ seconds,
|
|
31
|
+
* taking down the entire bot (all threads, not just the one send). This
|
|
32
|
+
* makes any single native call fail fast instead of hanging indefinitely.
|
|
33
|
+
*/
|
|
34
|
+
function withTimeout(promise, label) {
|
|
35
|
+
let timer;
|
|
36
|
+
const timeout = new Promise((_, reject) => {
|
|
37
|
+
timer = setTimeout(() => reject(new Error(`native ${label} timed out after ${NATIVE_CALL_TIMEOUT_MS}ms`)), NATIVE_CALL_TIMEOUT_MS);
|
|
38
|
+
});
|
|
39
|
+
return Promise.race([promise, timeout]).finally(() => clearTimeout(timer));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
let _clientPromise = null;
|
|
43
|
+
|
|
44
|
+
function _dynamicImport(specifier) {
|
|
45
|
+
// eslint-disable-next-line no-new-func
|
|
46
|
+
return new Function("s", "return import(s)")(specifier);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function _cookiesFromAppState(appState) {
|
|
50
|
+
const out = {};
|
|
51
|
+
if (!Array.isArray(appState)) return out;
|
|
52
|
+
appState.forEach((c) => {
|
|
53
|
+
if (c && c.key) out[c.key] = c.value;
|
|
54
|
+
});
|
|
55
|
+
if (!out.c_user && out.i_user) out.c_user = out.i_user;
|
|
56
|
+
return out;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let _clientInstance = null;
|
|
60
|
+
let _connected = false;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Returns a connected native Client, creating it once and reusing the same
|
|
64
|
+
* instance across reconnects (same pattern as the reference stfca package).
|
|
65
|
+
* Creating a brand-new Client (and thus a brand-new native Go-side handle)
|
|
66
|
+
* on every reconnect was never releasing the old handle fast enough and
|
|
67
|
+
* leaked native memory over a multi-hour uptime — reusing the instance and
|
|
68
|
+
* just re-calling .connect() avoids that entirely.
|
|
69
|
+
* @param {Array} appState fca-eryxenx's appState (from api.getAppState())
|
|
70
|
+
*/
|
|
71
|
+
async function getClient(appState) {
|
|
72
|
+
if (_connected && _clientInstance) return _clientInstance;
|
|
73
|
+
if (_clientPromise) return _clientPromise;
|
|
74
|
+
|
|
75
|
+
_clientPromise = (async () => {
|
|
76
|
+
if (!_clientInstance) {
|
|
77
|
+
const libUrl = require("url").pathToFileURL(
|
|
78
|
+
path.join(__dirname, "lib", "index.mjs")
|
|
79
|
+
).href;
|
|
80
|
+
|
|
81
|
+
let mod;
|
|
82
|
+
try {
|
|
83
|
+
mod = await _dynamicImport(libUrl);
|
|
84
|
+
} catch (err) {
|
|
85
|
+
throw new Error(
|
|
86
|
+
"Native E2EE media engine failed to load (" + libUrl + "): " +
|
|
87
|
+
(err && err.message ? err.message : String(err)) +
|
|
88
|
+
"\nMake sure `koffi` and `yumi-json-bigint` are installed, and that " +
|
|
89
|
+
"native/build/messagix.{so,dll} is present for this platform."
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const cookies = _cookiesFromAppState(appState);
|
|
94
|
+
if (!cookies.c_user || !cookies.xs) {
|
|
95
|
+
throw new Error("Native E2EE media engine: c_user/xs cookies missing from appState");
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
_clientInstance = new mod.Client(cookies, {
|
|
99
|
+
enableE2EE: true,
|
|
100
|
+
e2eeMemoryOnly: true,
|
|
101
|
+
autoReconnect: true,
|
|
102
|
+
logLevel: "none"
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
_clientInstance.on("error", (err) => {
|
|
106
|
+
logger.warn("E2EE", "[native-media] " + (err && err.message ? err.message : String(err)));
|
|
107
|
+
});
|
|
108
|
+
_clientInstance.on("disconnected", () => {
|
|
109
|
+
logger.warn("E2EE", "[native-media] native client disconnected, will reconnect on next send");
|
|
110
|
+
_connected = false;
|
|
111
|
+
_clientPromise = null;
|
|
112
|
+
// NOTE: we deliberately do NOT null/dispose _clientInstance
|
|
113
|
+
// here — it's reused on the next getClient() call via
|
|
114
|
+
// client.connect() below, avoiding a second native handle.
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
logger.info("E2EE", "[native-media] Connecting native mautrix-go client for media sends...");
|
|
119
|
+
await _clientInstance.connect();
|
|
120
|
+
await _clientInstance.connectE2EE();
|
|
121
|
+
_connected = true;
|
|
122
|
+
|
|
123
|
+
return _clientInstance;
|
|
124
|
+
})();
|
|
125
|
+
|
|
126
|
+
try {
|
|
127
|
+
return await _clientPromise;
|
|
128
|
+
} catch (err) {
|
|
129
|
+
_clientPromise = null;
|
|
130
|
+
throw err;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Sends an E2EE media attachment via the native engine.
|
|
136
|
+
* @param {Array} appState
|
|
137
|
+
* @param {string} chatJid numeric thread id (bare, no @suffix needed)
|
|
138
|
+
* @param {"image"|"video"|"audio"|"document"} mediaType
|
|
139
|
+
* @param {Buffer} data
|
|
140
|
+
* @param {string} mimeType
|
|
141
|
+
* @param {object} opts { caption, width, height, duration, fileName, replyToId, replyToSenderJid }
|
|
142
|
+
*/
|
|
143
|
+
async function sendMedia(appState, chatJid, mediaType, data, mimeType, opts) {
|
|
144
|
+
const client = await getClient(appState);
|
|
145
|
+
opts = opts || {};
|
|
146
|
+
|
|
147
|
+
// Native client needs a full JID (id@server). fca-eryxenx normalizes
|
|
148
|
+
// E2EE thread ids down to bare numeric strings for GoatBot's benefit,
|
|
149
|
+
// so re-attach the domain here if it's missing — groups use "@g.us",
|
|
150
|
+
// DMs use "@msgr". Using the wrong domain makes native try to look up
|
|
151
|
+
// device lists for a nonexistent entity, which hangs until it times out.
|
|
152
|
+
if (typeof chatJid === "string" && chatJid.indexOf("@") === -1) {
|
|
153
|
+
chatJid = chatJid + (opts.isGroup ? "@g.us" : "@msgr");
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
switch (mediaType) {
|
|
157
|
+
case "image":
|
|
158
|
+
return withTimeout(client.sendE2EEImage(chatJid, data, mimeType || "image/jpeg", {
|
|
159
|
+
caption: opts.caption, width: opts.width, height: opts.height,
|
|
160
|
+
replyToId: opts.replyToId, replyToSenderJid: opts.replyToSenderJid
|
|
161
|
+
}), "sendE2EEImage");
|
|
162
|
+
case "video":
|
|
163
|
+
return withTimeout(client.sendE2EEVideo(chatJid, data, mimeType || "video/mp4", {
|
|
164
|
+
caption: opts.caption, width: opts.width, height: opts.height,
|
|
165
|
+
duration: opts.duration,
|
|
166
|
+
replyToId: opts.replyToId, replyToSenderJid: opts.replyToSenderJid
|
|
167
|
+
}), "sendE2EEVideo");
|
|
168
|
+
case "audio":
|
|
169
|
+
return withTimeout(client.sendE2EEAudio(chatJid, data, mimeType || "audio/ogg; codecs=opus", {
|
|
170
|
+
ptt: false, duration: opts.duration,
|
|
171
|
+
replyToId: opts.replyToId, replyToSenderJid: opts.replyToSenderJid
|
|
172
|
+
}), "sendE2EEAudio");
|
|
173
|
+
case "document":
|
|
174
|
+
default:
|
|
175
|
+
return withTimeout(client.sendE2EEDocument(
|
|
176
|
+
chatJid, data, opts.fileName || "file.bin",
|
|
177
|
+
mimeType || "application/octet-stream",
|
|
178
|
+
{ replyToId: opts.replyToId, replyToSenderJid: opts.replyToSenderJid }
|
|
179
|
+
), "sendE2EEDocument");
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Sends/removes an E2EE reaction via the native engine.
|
|
185
|
+
* Pass emoji="" to remove a reaction.
|
|
186
|
+
*/
|
|
187
|
+
async function sendReaction(appState, chatJid, messageId, senderJid, emoji, isGroup) {
|
|
188
|
+
const client = await getClient(appState);
|
|
189
|
+
if (typeof chatJid === "string" && chatJid.indexOf("@") === -1) chatJid = chatJid + (isGroup ? "@g.us" : "@msgr");
|
|
190
|
+
return withTimeout(client.sendE2EEReaction(chatJid, messageId, senderJid, emoji || ""), "sendE2EEReaction");
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** Unsends/revokes an E2EE message via the native engine. */
|
|
194
|
+
async function unsendMessage(appState, chatJid, messageId, isGroup) {
|
|
195
|
+
const client = await getClient(appState);
|
|
196
|
+
if (typeof chatJid === "string" && chatJid.indexOf("@") === -1) chatJid = chatJid + (isGroup ? "@g.us" : "@msgr");
|
|
197
|
+
return withTimeout(client.unsendE2EEMessage(chatJid, messageId), "unsendE2EEMessage");
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** Edits an E2EE message via the native engine (chat-agnostic — messageId alone). */
|
|
201
|
+
async function editMessage(appState, messageId, newText) {
|
|
202
|
+
const client = await getClient(appState);
|
|
203
|
+
return withTimeout(client.editMessage(messageId, newText), "editMessage");
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** Marks an E2EE thread as read via the native engine. */
|
|
207
|
+
async function markRead(appState, chatJid, watermarkTs) {
|
|
208
|
+
const client = await getClient(appState);
|
|
209
|
+
// Unlike other native functions, MxMarkRead's threadId field is int64,
|
|
210
|
+
// not a JID string — strip any "@..." suffix and pass a plain number.
|
|
211
|
+
const numericId = typeof chatJid === "string" ? Number(chatJid.split("@")[0]) : Number(chatJid);
|
|
212
|
+
return withTimeout(client.markAsRead(numericId, watermarkTs ? BigInt(watermarkTs) : undefined), "markAsRead");
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Registers a listener on the native client for a given event name
|
|
217
|
+
* (e.g. "e2eeMessage", "e2eeReaction"). Used only for GROUP E2EE receiving —
|
|
218
|
+
* DM receiving continues to use the existing vendor engine, unchanged.
|
|
219
|
+
*/
|
|
220
|
+
async function onNativeEvent(appState, eventName, handler) {
|
|
221
|
+
const client = await getClient(appState);
|
|
222
|
+
client.on(eventName, handler);
|
|
223
|
+
return client;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/** Sends a text message to an E2EE group via the native engine's E2EE send. */
|
|
227
|
+
async function sendGroupMessage(appState, chatJid, text, replyToId) {
|
|
228
|
+
const client = await getClient(appState);
|
|
229
|
+
if (typeof chatJid === "string" && chatJid.indexOf("@") === -1) chatJid = chatJid + "@g.us";
|
|
230
|
+
return withTimeout(client.sendE2EEMessage(chatJid, text, { replyToId }), "sendE2EEMessage(group)");
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
module.exports = { getClient, sendMedia, sendReaction, unsendMessage, markRead, onNativeEvent, sendGroupMessage, editMessage };
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
syntax = "proto2";
|
|
2
|
+
package waArmadilloApplication;
|
|
3
|
+
|
|
4
|
+
import "WACommon.proto";
|
|
5
|
+
|
|
6
|
+
message Armadillo {
|
|
7
|
+
message Metadata {
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
message Payload {
|
|
11
|
+
oneof payload {
|
|
12
|
+
Content content = 1;
|
|
13
|
+
ApplicationData applicationData = 2;
|
|
14
|
+
Signal signal = 3;
|
|
15
|
+
SubProtocolPayload subProtocol = 4;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message SubProtocolPayload {
|
|
20
|
+
optional WACommon.FutureProofBehavior futureProof = 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message Signal {
|
|
24
|
+
message EncryptedBackupsSecrets {
|
|
25
|
+
message Epoch {
|
|
26
|
+
enum EpochStatus {
|
|
27
|
+
ES_OPEN = 1;
|
|
28
|
+
ES_CLOSE = 2;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
optional uint64 ID = 1;
|
|
32
|
+
optional bytes anonID = 2;
|
|
33
|
+
optional bytes rootKey = 3;
|
|
34
|
+
optional EpochStatus status = 4;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
optional uint64 backupID = 1;
|
|
38
|
+
optional uint64 serverDataID = 2;
|
|
39
|
+
repeated Epoch epoch = 3;
|
|
40
|
+
optional bytes tempOcmfClientState = 4;
|
|
41
|
+
optional bytes mailboxRootKey = 5;
|
|
42
|
+
optional bytes obliviousValidationToken = 6;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
oneof signal {
|
|
46
|
+
EncryptedBackupsSecrets encryptedBackupsSecrets = 1;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
message ApplicationData {
|
|
51
|
+
message MessageHistoryDocumentMessage {
|
|
52
|
+
optional WACommon.SubProtocol document = 1;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
message AIBotResponseMessage {
|
|
56
|
+
optional string summonToken = 1;
|
|
57
|
+
optional string messageText = 2;
|
|
58
|
+
optional string serializedExtras = 3;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message MetadataSyncAction {
|
|
62
|
+
message SyncAttachmentInterventionAction {
|
|
63
|
+
enum InterventionType {
|
|
64
|
+
UNKNOWN = 0;
|
|
65
|
+
NUDE = 1;
|
|
66
|
+
NOT_NUDE = 2;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
optional WACommon.MessageKey messageKey = 1;
|
|
70
|
+
optional InterventionType interventionType = 2;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
message SyncSpectraAction {
|
|
74
|
+
enum SpectraActionType {
|
|
75
|
+
TAKEDOWN = 0;
|
|
76
|
+
RESTORE = 1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
optional WACommon.MessageKey key = 1;
|
|
80
|
+
optional SpectraActionType actionType = 2;
|
|
81
|
+
optional int64 takedownActionID = 3;
|
|
82
|
+
optional string config = 4;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
message SyncMessageAction {
|
|
86
|
+
message ActionMessageDelete {
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
oneof action {
|
|
90
|
+
ActionMessageDelete messageDelete = 101;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
optional WACommon.MessageKey key = 1;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
message SyncChatAction {
|
|
97
|
+
message ActionChatRead {
|
|
98
|
+
optional SyncActionMessageRange messageRange = 1;
|
|
99
|
+
optional bool read = 2;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
message ActionChatDelete {
|
|
103
|
+
optional SyncActionMessageRange messageRange = 1;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
message ActionChatArchive {
|
|
107
|
+
optional SyncActionMessageRange messageRange = 1;
|
|
108
|
+
optional bool archived = 2;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
oneof action {
|
|
112
|
+
ActionChatArchive chatArchive = 101;
|
|
113
|
+
ActionChatDelete chatDelete = 102;
|
|
114
|
+
ActionChatRead chatRead = 103;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
optional string chatID = 1;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
message SyncActionMessage {
|
|
121
|
+
optional WACommon.MessageKey key = 1;
|
|
122
|
+
optional int64 timestamp = 2;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
message SyncActionMessageRange {
|
|
126
|
+
optional int64 lastMessageTimestamp = 1;
|
|
127
|
+
optional int64 lastSystemMessageTimestamp = 2;
|
|
128
|
+
repeated SyncActionMessage messages = 3;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
oneof actionType {
|
|
132
|
+
SyncChatAction chatAction = 101;
|
|
133
|
+
SyncMessageAction messageAction = 102;
|
|
134
|
+
SyncSpectraAction spectraAction = 103;
|
|
135
|
+
SyncAttachmentInterventionAction attachmentInterventionAction = 104;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
optional int64 actionTimestamp = 1;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
message MetadataSyncNotification {
|
|
142
|
+
repeated MetadataSyncAction actions = 2;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
oneof applicationData {
|
|
146
|
+
MetadataSyncNotification metadataSync = 1;
|
|
147
|
+
AIBotResponseMessage aiBotResponse = 2;
|
|
148
|
+
MessageHistoryDocumentMessage messageHistoryDocumentMessage = 3;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
message Content {
|
|
153
|
+
message PaymentsTransactionMessage {
|
|
154
|
+
enum PaymentStatus {
|
|
155
|
+
PAYMENT_UNKNOWN = 0;
|
|
156
|
+
REQUEST_INITED = 4;
|
|
157
|
+
REQUEST_DECLINED = 5;
|
|
158
|
+
REQUEST_TRANSFER_INITED = 6;
|
|
159
|
+
REQUEST_TRANSFER_COMPLETED = 7;
|
|
160
|
+
REQUEST_TRANSFER_FAILED = 8;
|
|
161
|
+
REQUEST_CANCELED = 9;
|
|
162
|
+
REQUEST_EXPIRED = 10;
|
|
163
|
+
TRANSFER_INITED = 11;
|
|
164
|
+
TRANSFER_PENDING = 12;
|
|
165
|
+
TRANSFER_PENDING_RECIPIENT_VERIFICATION = 13;
|
|
166
|
+
TRANSFER_CANCELED = 14;
|
|
167
|
+
TRANSFER_COMPLETED = 15;
|
|
168
|
+
TRANSFER_NO_RECEIVER_CREDENTIAL_NO_RTS_PENDING_CANCELED = 16;
|
|
169
|
+
TRANSFER_NO_RECEIVER_CREDENTIAL_NO_RTS_PENDING_OTHER = 17;
|
|
170
|
+
TRANSFER_REFUNDED = 18;
|
|
171
|
+
TRANSFER_PARTIAL_REFUND = 19;
|
|
172
|
+
TRANSFER_CHARGED_BACK = 20;
|
|
173
|
+
TRANSFER_EXPIRED = 21;
|
|
174
|
+
TRANSFER_DECLINED = 22;
|
|
175
|
+
TRANSFER_UNAVAILABLE = 23;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
optional uint64 transactionID = 1;
|
|
179
|
+
optional string amount = 2;
|
|
180
|
+
optional string currency = 3;
|
|
181
|
+
optional PaymentStatus paymentStatus = 4;
|
|
182
|
+
// optional waArmadilloXMA.ExtendedContentMessage extendedContentMessage = 5;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
message NetworkVerificationMessage {
|
|
186
|
+
optional string codeText = 1;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
message NoteReplyMessage {
|
|
190
|
+
oneof noteReplyContent {
|
|
191
|
+
WACommon.MessageText textContent = 4;
|
|
192
|
+
WACommon.SubProtocol stickerContent = 5;
|
|
193
|
+
WACommon.SubProtocol videoContent = 6;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
optional string noteID = 1;
|
|
197
|
+
optional WACommon.MessageText noteText = 2;
|
|
198
|
+
optional int64 noteTimestampMS = 3;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
message BumpExistingMessage {
|
|
202
|
+
optional WACommon.MessageKey key = 1;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
message ImageGalleryMessage {
|
|
206
|
+
repeated WACommon.SubProtocol images = 1;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
message ScreenshotAction {
|
|
210
|
+
enum ScreenshotType {
|
|
211
|
+
SCREENSHOT_IMAGE = 1;
|
|
212
|
+
SCREEN_RECORDING = 2;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
optional ScreenshotType screenshotType = 1;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
message ExtendedContentMessageWithSear {
|
|
219
|
+
optional string searID = 1;
|
|
220
|
+
optional bytes payload = 2;
|
|
221
|
+
optional string nativeURL = 3;
|
|
222
|
+
optional WACommon.SubProtocol searAssociatedMessage = 4;
|
|
223
|
+
optional string searSentWithMessageID = 5;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
message RavenActionNotifMessage {
|
|
227
|
+
enum ActionType {
|
|
228
|
+
PLAYED = 0;
|
|
229
|
+
SCREENSHOT = 1;
|
|
230
|
+
FORCE_DISABLE = 2;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
optional WACommon.MessageKey key = 1;
|
|
234
|
+
optional int64 actionTimestamp = 2;
|
|
235
|
+
optional ActionType actionType = 3;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
message RavenMessage {
|
|
239
|
+
enum EphemeralType {
|
|
240
|
+
VIEW_ONCE = 0;
|
|
241
|
+
ALLOW_REPLAY = 1;
|
|
242
|
+
KEEP_IN_CHAT = 2;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
oneof mediaContent {
|
|
246
|
+
WACommon.SubProtocol imageMessage = 2;
|
|
247
|
+
WACommon.SubProtocol videoMessage = 3;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
optional EphemeralType ephemeralType = 1;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
message CommonSticker {
|
|
254
|
+
enum StickerType {
|
|
255
|
+
SMALL_LIKE = 1;
|
|
256
|
+
MEDIUM_LIKE = 2;
|
|
257
|
+
LARGE_LIKE = 3;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
optional StickerType stickerType = 1;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
oneof content {
|
|
264
|
+
CommonSticker commonSticker = 1;
|
|
265
|
+
ScreenshotAction screenshotAction = 3;
|
|
266
|
+
// waArmadilloXMA.ExtendedContentMessage extendedContentMessage = 4;
|
|
267
|
+
RavenMessage ravenMessage = 5;
|
|
268
|
+
RavenActionNotifMessage ravenActionNotifMessage = 6;
|
|
269
|
+
ExtendedContentMessageWithSear extendedMessageContentWithSear = 7;
|
|
270
|
+
ImageGalleryMessage imageGalleryMessage = 8;
|
|
271
|
+
PaymentsTransactionMessage paymentsTransactionMessage = 10;
|
|
272
|
+
BumpExistingMessage bumpExistingMessage = 11;
|
|
273
|
+
NoteReplyMessage noteReplyMessage = 13;
|
|
274
|
+
RavenMessage ravenMessageMsgr = 14;
|
|
275
|
+
NetworkVerificationMessage networkVerificationMessage = 15;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
optional Payload payload = 1;
|
|
280
|
+
optional Metadata metadata = 2;
|
|
281
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
syntax = "proto2";
|
|
2
|
+
package waArmadilloICDC;
|
|
3
|
+
|
|
4
|
+
message ICDCIdentityList {
|
|
5
|
+
optional int32 seq = 1;
|
|
6
|
+
optional int64 timestamp = 2;
|
|
7
|
+
repeated bytes devices = 3;
|
|
8
|
+
optional int32 signingDeviceIndex = 4;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
message SignedICDCIdentityList {
|
|
12
|
+
optional bytes details = 1;
|
|
13
|
+
optional bytes signature = 2;
|
|
14
|
+
}
|