@aseppxyzz12/baileys 1.1.8
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/LICENSE +25 -0
- package/README.md +2579 -0
- package/WAProto/AICommon/AICommon.js +19396 -0
- package/WAProto/AICommon/AICommon.proto +820 -0
- package/WAProto/Adv/Adv.js +1137 -0
- package/WAProto/Adv/Adv.proto +42 -0
- package/WAProto/BotMetadata/BotMetadata.js +8975 -0
- package/WAProto/BotMetadata/BotMetadata.proto +484 -0
- package/WAProto/Cert/Cert.js +893 -0
- package/WAProto/Cert/Cert.proto +30 -0
- package/WAProto/ChatLockSettings/ChatLockSettings.js +673 -0
- package/WAProto/ChatLockSettings/ChatLockSettings.proto +9 -0
- package/WAProto/CompanionReg/CompanionReg.js +2457 -0
- package/WAProto/CompanionReg/CompanionReg.proto +103 -0
- package/WAProto/DeviceCapabilities/DeviceCapabilities.js +846 -0
- package/WAProto/DeviceCapabilities/DeviceCapabilities.proto +38 -0
- package/WAProto/E2E/E2E.js +78728 -0
- package/WAProto/E2E/E2E.proto +1970 -0
- package/WAProto/Ephemeral/Ephemeral.js +143 -0
- package/WAProto/Ephemeral/Ephemeral.proto +7 -0
- package/WAProto/HistorySync/HistorySync.js +95931 -0
- package/WAProto/HistorySync/HistorySync.proto +229 -0
- package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.js +414 -0
- package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.proto +13 -0
- package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.js +980 -0
- package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.proto +38 -0
- package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.js +81185 -0
- package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.proto +88 -0
- package/WAProto/MmsRetry/MmsRetry.js +310 -0
- package/WAProto/MmsRetry/MmsRetry.proto +19 -0
- package/WAProto/Protocol/Protocol.js +399 -0
- package/WAProto/Protocol/Protocol.proto +22 -0
- package/WAProto/Reporting/Reporting.js +535 -0
- package/WAProto/Reporting/Reporting.proto +22 -0
- package/WAProto/ServerSync/ServerSync.js +1830 -0
- package/WAProto/ServerSync/ServerSync.proto +70 -0
- package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.js +3267 -0
- package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.proto +95 -0
- package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.js +1140 -0
- package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.proto +44 -0
- package/WAProto/StatusAttributions/StatusAttributions.js +1604 -0
- package/WAProto/StatusAttributions/StatusAttributions.proto +89 -0
- package/WAProto/SyncAction/SyncAction.js +17424 -0
- package/WAProto/SyncAction/SyncAction.proto +663 -0
- package/WAProto/UserPassword/UserPassword.js +544 -0
- package/WAProto/UserPassword/UserPassword.proto +28 -0
- package/WAProto/VnameCert/VnameCert.js +1466 -0
- package/WAProto/VnameCert/VnameCert.proto +65 -0
- package/WAProto/Wa6/Wa6.js +4601 -0
- package/WAProto/Wa6/Wa6.proto +241 -0
- package/WAProto/Web/Web.js +90819 -0
- package/WAProto/Web/Web.proto +605 -0
- package/WAProto/index.js +30 -0
- package/engine-requirements.js +9 -0
- package/lib/Defaults/baileys-version.json +3 -0
- package/lib/Defaults/connection.js +39 -0
- package/lib/Defaults/constants.js +50 -0
- package/lib/Defaults/history.js +13 -0
- package/lib/Defaults/index.js +36 -0
- package/lib/Defaults/media.js +43 -0
- package/lib/Defaults/phonenumber-mcc.json +223 -0
- package/lib/Defaults/prefix.js +12 -0
- package/lib/Function/Download/tiktok.js +19 -0
- package/lib/Function/Tools/bypass.js +19 -0
- package/lib/Function/index.js +13 -0
- package/lib/Signal/Group/ciphertext-message.js +14 -0
- package/lib/Signal/Group/group-session-builder.js +46 -0
- package/lib/Signal/Group/group_cipher.js +104 -0
- package/lib/Signal/Group/index.js +42 -0
- package/lib/Signal/Group/keyhelper.js +21 -0
- package/lib/Signal/Group/queue-job.js +57 -0
- package/lib/Signal/Group/sender-chain-key.js +34 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
- package/lib/Signal/Group/sender-key-message.js +78 -0
- package/lib/Signal/Group/sender-key-name.js +49 -0
- package/lib/Signal/Group/sender-key-record.js +45 -0
- package/lib/Signal/Group/sender-key-state.js +100 -0
- package/lib/Signal/Group/sender-message-key.js +28 -0
- package/lib/Signal/libsignal.js +364 -0
- package/lib/Signal/lid-mapping.js +164 -0
- package/lib/Socket/Client/abstract-socket-client.js +13 -0
- package/lib/Socket/Client/index.js +31 -0
- package/lib/Socket/Client/mobile-socket-client.js +65 -0
- package/lib/Socket/Client/types.js +12 -0
- package/lib/Socket/Client/web-socket-client.js +62 -0
- package/lib/Socket/Client/websocket.js +67 -0
- package/lib/Socket/business.js +291 -0
- package/lib/Socket/chats.js +874 -0
- package/lib/Socket/community.js +454 -0
- package/lib/Socket/dugong.js +658 -0
- package/lib/Socket/groups.js +357 -0
- package/lib/Socket/index.js +13 -0
- package/lib/Socket/messages-recv.js +1509 -0
- package/lib/Socket/messages-send.js +1505 -0
- package/lib/Socket/mex.js +54 -0
- package/lib/Socket/newsletter.js +171 -0
- package/lib/Socket/registration.js +167 -0
- package/lib/Socket/rich-content.js +279 -0
- package/lib/Socket/socket.js +905 -0
- package/lib/Socket/username.js +157 -0
- package/lib/Socket/usync.js +70 -0
- package/lib/Store/index.js +37 -0
- package/lib/Store/keyed-db.js +114 -0
- package/lib/Store/make-cache-manager-store.js +77 -0
- package/lib/Store/make-in-memory-store.js +423 -0
- package/lib/Store/make-ordered-dictionary.js +78 -0
- package/lib/Store/object-repository.js +26 -0
- package/lib/Types/Auth.js +2 -0
- package/lib/Types/Bussines.js +2 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Chat.js +10 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/Label.js +25 -0
- package/lib/Types/LabelAssociation.js +4 -0
- package/lib/Types/Message.js +11 -0
- package/lib/Types/Mex.js +40 -0
- package/lib/Types/MexUpdates.js +15 -0
- package/lib/Types/Newsletter.js +32 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Socket.js +2 -0
- package/lib/Types/State.js +9 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/index.js +60 -0
- package/lib/Utils/auth-utils.js +256 -0
- package/lib/Utils/baileys-event-stream.js +63 -0
- package/lib/Utils/bot-toolkit.js +455 -0
- package/lib/Utils/browser-utils.js +29 -0
- package/lib/Utils/business.js +233 -0
- package/lib/Utils/chat-utils.js +904 -0
- package/lib/Utils/companion-reg-client-utils.js +41 -0
- package/lib/Utils/crypto.js +144 -0
- package/lib/Utils/decode-wa-message.js +305 -0
- package/lib/Utils/event-buffer.js +555 -0
- package/lib/Utils/generics.js +411 -0
- package/lib/Utils/history.js +100 -0
- package/lib/Utils/identity-change-handler.js +53 -0
- package/lib/Utils/index.js +57 -0
- package/lib/Utils/link-preview.js +76 -0
- package/lib/Utils/logger.js +4 -0
- package/lib/Utils/lt-hash.js +45 -0
- package/lib/Utils/make-mutex.js +33 -0
- package/lib/Utils/message-composer.js +289 -0
- package/lib/Utils/message-retry-manager.js +134 -0
- package/lib/Utils/messages-media.js +806 -0
- package/lib/Utils/messages.js +1908 -0
- package/lib/Utils/noise-handler.js +157 -0
- package/lib/Utils/offline-node-processor.js +42 -0
- package/lib/Utils/pre-key-manager.js +86 -0
- package/lib/Utils/process-message.js +814 -0
- package/lib/Utils/reporting-utils.js +264 -0
- package/lib/Utils/signal.js +183 -0
- package/lib/Utils/stanza-ack.js +36 -0
- package/lib/Utils/sync-action-utils.js +52 -0
- package/lib/Utils/tc-token-utils.js +167 -0
- package/lib/Utils/use-multi-file-auth-state.js +104 -0
- package/lib/Utils/validate-connection.js +229 -0
- package/lib/Utils/vialeys-event-stream.js +41 -0
- package/lib/WABinary/constants.js +1308 -0
- package/lib/WABinary/decode.js +233 -0
- package/lib/WABinary/encode.js +212 -0
- package/lib/WABinary/generic-utils.js +124 -0
- package/lib/WABinary/index.js +36 -0
- package/lib/WABinary/jid-utils.js +101 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WAM/BinaryInfo.js +12 -0
- package/lib/WAM/constants.js +20491 -0
- package/lib/WAM/encode.js +148 -0
- package/lib/WAM/index.js +34 -0
- package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +62 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +38 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +50 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +25 -0
- package/lib/WAUSync/Protocols/USyncLIDProtocol.js +24 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +32 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +24 -0
- package/lib/WAUSync/Protocols/index.js +38 -0
- package/lib/WAUSync/USyncQuery.js +97 -0
- package/lib/WAUSync/USyncUser.js +33 -0
- package/lib/WAUSync/index.js +34 -0
- package/lib/index.js +113 -0
- package/lib/messages-send.js +1496 -0
- package/package.json +100 -0
|
@@ -0,0 +1,3267 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var $protobuf = require("protobufjs/minimal");
|
|
3
|
+
var $Reader = $protobuf.Reader,
|
|
4
|
+
$Writer = $protobuf.Writer,
|
|
5
|
+
$util = $protobuf.util;
|
|
6
|
+
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
|
|
7
|
+
$root.SignalLocalStorageProtocol = (function () {
|
|
8
|
+
var SignalLocalStorageProtocol = {};
|
|
9
|
+
SignalLocalStorageProtocol.SenderKeyRecordStructure = (function () {
|
|
10
|
+
function SenderKeyRecordStructure(properties) {
|
|
11
|
+
this.senderKeyStates = [];
|
|
12
|
+
if (properties)
|
|
13
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
14
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
15
|
+
}
|
|
16
|
+
SenderKeyRecordStructure.prototype.senderKeyStates = $util.emptyArray;
|
|
17
|
+
SenderKeyRecordStructure.create = function create(properties) {
|
|
18
|
+
return new SenderKeyRecordStructure(properties);
|
|
19
|
+
};
|
|
20
|
+
SenderKeyRecordStructure.encode = function encode(message, writer) {
|
|
21
|
+
if (!writer) writer = $Writer.create();
|
|
22
|
+
if (message.senderKeyStates != null && message.senderKeyStates.length)
|
|
23
|
+
for (var i = 0; i < message.senderKeyStates.length; ++i)
|
|
24
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.encode(
|
|
25
|
+
message.senderKeyStates[i],
|
|
26
|
+
writer.uint32(10).fork()
|
|
27
|
+
).ldelim();
|
|
28
|
+
return writer;
|
|
29
|
+
};
|
|
30
|
+
SenderKeyRecordStructure.encodeDelimited = function encodeDelimited(message, writer) {
|
|
31
|
+
return this.encode(message, writer).ldelim();
|
|
32
|
+
};
|
|
33
|
+
SenderKeyRecordStructure.decode = function decode(reader, length, error) {
|
|
34
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
35
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
36
|
+
message = new $root.SignalLocalStorageProtocol.SenderKeyRecordStructure();
|
|
37
|
+
while (reader.pos < end) {
|
|
38
|
+
var tag = reader.uint32();
|
|
39
|
+
if (tag === error) break;
|
|
40
|
+
switch (tag >>> 3) {
|
|
41
|
+
case 1: {
|
|
42
|
+
if (!(message.senderKeyStates && message.senderKeyStates.length))
|
|
43
|
+
message.senderKeyStates = [];
|
|
44
|
+
message.senderKeyStates.push(
|
|
45
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.decode(
|
|
46
|
+
reader,
|
|
47
|
+
reader.uint32()
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
default:
|
|
53
|
+
reader.skipType(tag & 7);
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return message;
|
|
58
|
+
};
|
|
59
|
+
SenderKeyRecordStructure.decodeDelimited = function decodeDelimited(reader) {
|
|
60
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
61
|
+
return this.decode(reader, reader.uint32());
|
|
62
|
+
};
|
|
63
|
+
SenderKeyRecordStructure.verify = function verify(message) {
|
|
64
|
+
if (typeof message !== "object" || message === null) return "object expected";
|
|
65
|
+
if (message.senderKeyStates != null && message.hasOwnProperty("senderKeyStates")) {
|
|
66
|
+
if (!Array.isArray(message.senderKeyStates))
|
|
67
|
+
return "senderKeyStates: array expected";
|
|
68
|
+
for (var i = 0; i < message.senderKeyStates.length; ++i) {
|
|
69
|
+
var error = $root.SignalLocalStorageProtocol.SenderKeyStateStructure.verify(
|
|
70
|
+
message.senderKeyStates[i]
|
|
71
|
+
);
|
|
72
|
+
if (error) return "senderKeyStates." + error;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
};
|
|
77
|
+
SenderKeyRecordStructure.fromObject = function fromObject(object) {
|
|
78
|
+
if (object instanceof $root.SignalLocalStorageProtocol.SenderKeyRecordStructure)
|
|
79
|
+
return object;
|
|
80
|
+
var message = new $root.SignalLocalStorageProtocol.SenderKeyRecordStructure();
|
|
81
|
+
if (object.senderKeyStates) {
|
|
82
|
+
if (!Array.isArray(object.senderKeyStates))
|
|
83
|
+
throw TypeError(
|
|
84
|
+
".SignalLocalStorageProtocol.SenderKeyRecordStructure.senderKeyStates: array expected"
|
|
85
|
+
);
|
|
86
|
+
message.senderKeyStates = [];
|
|
87
|
+
for (var i = 0; i < object.senderKeyStates.length; ++i) {
|
|
88
|
+
if (typeof object.senderKeyStates[i] !== "object")
|
|
89
|
+
throw TypeError(
|
|
90
|
+
".SignalLocalStorageProtocol.SenderKeyRecordStructure.senderKeyStates: object expected"
|
|
91
|
+
);
|
|
92
|
+
message.senderKeyStates[i] =
|
|
93
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.fromObject(
|
|
94
|
+
object.senderKeyStates[i]
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return message;
|
|
99
|
+
};
|
|
100
|
+
SenderKeyRecordStructure.toObject = function toObject(message, options) {
|
|
101
|
+
if (!options) options = {};
|
|
102
|
+
var object = {};
|
|
103
|
+
if (options.arrays || options.defaults) object.senderKeyStates = [];
|
|
104
|
+
if (message.senderKeyStates && message.senderKeyStates.length) {
|
|
105
|
+
object.senderKeyStates = [];
|
|
106
|
+
for (var j = 0; j < message.senderKeyStates.length; ++j)
|
|
107
|
+
object.senderKeyStates[j] =
|
|
108
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.toObject(
|
|
109
|
+
message.senderKeyStates[j],
|
|
110
|
+
options
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
return object;
|
|
114
|
+
};
|
|
115
|
+
SenderKeyRecordStructure.prototype.toJSON = function toJSON() {
|
|
116
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
117
|
+
};
|
|
118
|
+
SenderKeyRecordStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
119
|
+
if (typeUrlPrefix === undefined) {
|
|
120
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
121
|
+
}
|
|
122
|
+
return typeUrlPrefix + "/SignalLocalStorageProtocol.SenderKeyRecordStructure";
|
|
123
|
+
};
|
|
124
|
+
return SenderKeyRecordStructure;
|
|
125
|
+
})();
|
|
126
|
+
SignalLocalStorageProtocol.SenderKeyStateStructure = (function () {
|
|
127
|
+
function SenderKeyStateStructure(properties) {
|
|
128
|
+
this.senderMessageKeys = [];
|
|
129
|
+
if (properties)
|
|
130
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
131
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
132
|
+
}
|
|
133
|
+
SenderKeyStateStructure.prototype.senderKeyId = null;
|
|
134
|
+
SenderKeyStateStructure.prototype.senderChainKey = null;
|
|
135
|
+
SenderKeyStateStructure.prototype.senderSigningKey = null;
|
|
136
|
+
SenderKeyStateStructure.prototype.senderMessageKeys = $util.emptyArray;
|
|
137
|
+
var $oneOfFields;
|
|
138
|
+
Object.defineProperty(SenderKeyStateStructure.prototype, "_senderKeyId", {
|
|
139
|
+
get: $util.oneOfGetter(($oneOfFields = ["senderKeyId"])),
|
|
140
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
141
|
+
});
|
|
142
|
+
Object.defineProperty(SenderKeyStateStructure.prototype, "_senderChainKey", {
|
|
143
|
+
get: $util.oneOfGetter(($oneOfFields = ["senderChainKey"])),
|
|
144
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
145
|
+
});
|
|
146
|
+
Object.defineProperty(SenderKeyStateStructure.prototype, "_senderSigningKey", {
|
|
147
|
+
get: $util.oneOfGetter(($oneOfFields = ["senderSigningKey"])),
|
|
148
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
149
|
+
});
|
|
150
|
+
SenderKeyStateStructure.create = function create(properties) {
|
|
151
|
+
return new SenderKeyStateStructure(properties);
|
|
152
|
+
};
|
|
153
|
+
SenderKeyStateStructure.encode = function encode(message, writer) {
|
|
154
|
+
if (!writer) writer = $Writer.create();
|
|
155
|
+
if (message.senderKeyId != null && Object.hasOwnProperty.call(message, "senderKeyId"))
|
|
156
|
+
writer.uint32(8).uint32(message.senderKeyId);
|
|
157
|
+
if (
|
|
158
|
+
message.senderChainKey != null &&
|
|
159
|
+
Object.hasOwnProperty.call(message, "senderChainKey")
|
|
160
|
+
)
|
|
161
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey.encode(
|
|
162
|
+
message.senderChainKey,
|
|
163
|
+
writer.uint32(18).fork()
|
|
164
|
+
).ldelim();
|
|
165
|
+
if (
|
|
166
|
+
message.senderSigningKey != null &&
|
|
167
|
+
Object.hasOwnProperty.call(message, "senderSigningKey")
|
|
168
|
+
)
|
|
169
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey.encode(
|
|
170
|
+
message.senderSigningKey,
|
|
171
|
+
writer.uint32(26).fork()
|
|
172
|
+
).ldelim();
|
|
173
|
+
if (message.senderMessageKeys != null && message.senderMessageKeys.length)
|
|
174
|
+
for (var i = 0; i < message.senderMessageKeys.length; ++i)
|
|
175
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey.encode(
|
|
176
|
+
message.senderMessageKeys[i],
|
|
177
|
+
writer.uint32(34).fork()
|
|
178
|
+
).ldelim();
|
|
179
|
+
return writer;
|
|
180
|
+
};
|
|
181
|
+
SenderKeyStateStructure.encodeDelimited = function encodeDelimited(message, writer) {
|
|
182
|
+
return this.encode(message, writer).ldelim();
|
|
183
|
+
};
|
|
184
|
+
SenderKeyStateStructure.decode = function decode(reader, length, error) {
|
|
185
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
186
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
187
|
+
message = new $root.SignalLocalStorageProtocol.SenderKeyStateStructure();
|
|
188
|
+
while (reader.pos < end) {
|
|
189
|
+
var tag = reader.uint32();
|
|
190
|
+
if (tag === error) break;
|
|
191
|
+
switch (tag >>> 3) {
|
|
192
|
+
case 1: {
|
|
193
|
+
message.senderKeyId = reader.uint32();
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
case 2: {
|
|
197
|
+
message.senderChainKey =
|
|
198
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey.decode(
|
|
199
|
+
reader,
|
|
200
|
+
reader.uint32()
|
|
201
|
+
);
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
case 3: {
|
|
205
|
+
message.senderSigningKey =
|
|
206
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey.decode(
|
|
207
|
+
reader,
|
|
208
|
+
reader.uint32()
|
|
209
|
+
);
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
case 4: {
|
|
213
|
+
if (!(message.senderMessageKeys && message.senderMessageKeys.length))
|
|
214
|
+
message.senderMessageKeys = [];
|
|
215
|
+
message.senderMessageKeys.push(
|
|
216
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey.decode(
|
|
217
|
+
reader,
|
|
218
|
+
reader.uint32()
|
|
219
|
+
)
|
|
220
|
+
);
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
default:
|
|
224
|
+
reader.skipType(tag & 7);
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return message;
|
|
229
|
+
};
|
|
230
|
+
SenderKeyStateStructure.decodeDelimited = function decodeDelimited(reader) {
|
|
231
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
232
|
+
return this.decode(reader, reader.uint32());
|
|
233
|
+
};
|
|
234
|
+
SenderKeyStateStructure.verify = function verify(message) {
|
|
235
|
+
if (typeof message !== "object" || message === null) return "object expected";
|
|
236
|
+
var properties = {};
|
|
237
|
+
if (message.senderKeyId != null && message.hasOwnProperty("senderKeyId")) {
|
|
238
|
+
properties._senderKeyId = 1;
|
|
239
|
+
if (!$util.isInteger(message.senderKeyId)) return "senderKeyId: integer expected";
|
|
240
|
+
}
|
|
241
|
+
if (message.senderChainKey != null && message.hasOwnProperty("senderChainKey")) {
|
|
242
|
+
properties._senderChainKey = 1;
|
|
243
|
+
{
|
|
244
|
+
var error =
|
|
245
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey.verify(
|
|
246
|
+
message.senderChainKey
|
|
247
|
+
);
|
|
248
|
+
if (error) return "senderChainKey." + error;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
if (message.senderSigningKey != null && message.hasOwnProperty("senderSigningKey")) {
|
|
252
|
+
properties._senderSigningKey = 1;
|
|
253
|
+
{
|
|
254
|
+
var error =
|
|
255
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey.verify(
|
|
256
|
+
message.senderSigningKey
|
|
257
|
+
);
|
|
258
|
+
if (error) return "senderSigningKey." + error;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
if (message.senderMessageKeys != null && message.hasOwnProperty("senderMessageKeys")) {
|
|
262
|
+
if (!Array.isArray(message.senderMessageKeys))
|
|
263
|
+
return "senderMessageKeys: array expected";
|
|
264
|
+
for (var i = 0; i < message.senderMessageKeys.length; ++i) {
|
|
265
|
+
var error =
|
|
266
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey.verify(
|
|
267
|
+
message.senderMessageKeys[i]
|
|
268
|
+
);
|
|
269
|
+
if (error) return "senderMessageKeys." + error;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return null;
|
|
273
|
+
};
|
|
274
|
+
SenderKeyStateStructure.fromObject = function fromObject(object) {
|
|
275
|
+
if (object instanceof $root.SignalLocalStorageProtocol.SenderKeyStateStructure)
|
|
276
|
+
return object;
|
|
277
|
+
var message = new $root.SignalLocalStorageProtocol.SenderKeyStateStructure();
|
|
278
|
+
if (object.senderKeyId != null) message.senderKeyId = object.senderKeyId >>> 0;
|
|
279
|
+
if (object.senderChainKey != null) {
|
|
280
|
+
if (typeof object.senderChainKey !== "object")
|
|
281
|
+
throw TypeError(
|
|
282
|
+
".SignalLocalStorageProtocol.SenderKeyStateStructure.senderChainKey: object expected"
|
|
283
|
+
);
|
|
284
|
+
message.senderChainKey =
|
|
285
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey.fromObject(
|
|
286
|
+
object.senderChainKey
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
if (object.senderSigningKey != null) {
|
|
290
|
+
if (typeof object.senderSigningKey !== "object")
|
|
291
|
+
throw TypeError(
|
|
292
|
+
".SignalLocalStorageProtocol.SenderKeyStateStructure.senderSigningKey: object expected"
|
|
293
|
+
);
|
|
294
|
+
message.senderSigningKey =
|
|
295
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey.fromObject(
|
|
296
|
+
object.senderSigningKey
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
if (object.senderMessageKeys) {
|
|
300
|
+
if (!Array.isArray(object.senderMessageKeys))
|
|
301
|
+
throw TypeError(
|
|
302
|
+
".SignalLocalStorageProtocol.SenderKeyStateStructure.senderMessageKeys: array expected"
|
|
303
|
+
);
|
|
304
|
+
message.senderMessageKeys = [];
|
|
305
|
+
for (var i = 0; i < object.senderMessageKeys.length; ++i) {
|
|
306
|
+
if (typeof object.senderMessageKeys[i] !== "object")
|
|
307
|
+
throw TypeError(
|
|
308
|
+
".SignalLocalStorageProtocol.SenderKeyStateStructure.senderMessageKeys: object expected"
|
|
309
|
+
);
|
|
310
|
+
message.senderMessageKeys[i] =
|
|
311
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey.fromObject(
|
|
312
|
+
object.senderMessageKeys[i]
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return message;
|
|
317
|
+
};
|
|
318
|
+
SenderKeyStateStructure.toObject = function toObject(message, options) {
|
|
319
|
+
if (!options) options = {};
|
|
320
|
+
var object = {};
|
|
321
|
+
if (options.arrays || options.defaults) object.senderMessageKeys = [];
|
|
322
|
+
if (message.senderKeyId != null && message.hasOwnProperty("senderKeyId")) {
|
|
323
|
+
object.senderKeyId = message.senderKeyId;
|
|
324
|
+
if (options.oneofs) object._senderKeyId = "senderKeyId";
|
|
325
|
+
}
|
|
326
|
+
if (message.senderChainKey != null && message.hasOwnProperty("senderChainKey")) {
|
|
327
|
+
object.senderChainKey =
|
|
328
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey.toObject(
|
|
329
|
+
message.senderChainKey,
|
|
330
|
+
options
|
|
331
|
+
);
|
|
332
|
+
if (options.oneofs) object._senderChainKey = "senderChainKey";
|
|
333
|
+
}
|
|
334
|
+
if (message.senderSigningKey != null && message.hasOwnProperty("senderSigningKey")) {
|
|
335
|
+
object.senderSigningKey =
|
|
336
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey.toObject(
|
|
337
|
+
message.senderSigningKey,
|
|
338
|
+
options
|
|
339
|
+
);
|
|
340
|
+
if (options.oneofs) object._senderSigningKey = "senderSigningKey";
|
|
341
|
+
}
|
|
342
|
+
if (message.senderMessageKeys && message.senderMessageKeys.length) {
|
|
343
|
+
object.senderMessageKeys = [];
|
|
344
|
+
for (var j = 0; j < message.senderMessageKeys.length; ++j)
|
|
345
|
+
object.senderMessageKeys[j] =
|
|
346
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey.toObject(
|
|
347
|
+
message.senderMessageKeys[j],
|
|
348
|
+
options
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
return object;
|
|
352
|
+
};
|
|
353
|
+
SenderKeyStateStructure.prototype.toJSON = function toJSON() {
|
|
354
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
355
|
+
};
|
|
356
|
+
SenderKeyStateStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
357
|
+
if (typeUrlPrefix === undefined) {
|
|
358
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
359
|
+
}
|
|
360
|
+
return typeUrlPrefix + "/SignalLocalStorageProtocol.SenderKeyStateStructure";
|
|
361
|
+
};
|
|
362
|
+
SenderKeyStateStructure.SenderChainKey = (function () {
|
|
363
|
+
function SenderChainKey(properties) {
|
|
364
|
+
if (properties)
|
|
365
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
366
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
367
|
+
}
|
|
368
|
+
SenderChainKey.prototype.iteration = null;
|
|
369
|
+
SenderChainKey.prototype.seed = null;
|
|
370
|
+
var $oneOfFields;
|
|
371
|
+
Object.defineProperty(SenderChainKey.prototype, "_iteration", {
|
|
372
|
+
get: $util.oneOfGetter(($oneOfFields = ["iteration"])),
|
|
373
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
374
|
+
});
|
|
375
|
+
Object.defineProperty(SenderChainKey.prototype, "_seed", {
|
|
376
|
+
get: $util.oneOfGetter(($oneOfFields = ["seed"])),
|
|
377
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
378
|
+
});
|
|
379
|
+
SenderChainKey.create = function create(properties) {
|
|
380
|
+
return new SenderChainKey(properties);
|
|
381
|
+
};
|
|
382
|
+
SenderChainKey.encode = function encode(message, writer) {
|
|
383
|
+
if (!writer) writer = $Writer.create();
|
|
384
|
+
if (message.iteration != null && Object.hasOwnProperty.call(message, "iteration"))
|
|
385
|
+
writer.uint32(8).uint32(message.iteration);
|
|
386
|
+
if (message.seed != null && Object.hasOwnProperty.call(message, "seed"))
|
|
387
|
+
writer.uint32(18).bytes(message.seed);
|
|
388
|
+
return writer;
|
|
389
|
+
};
|
|
390
|
+
SenderChainKey.encodeDelimited = function encodeDelimited(message, writer) {
|
|
391
|
+
return this.encode(message, writer).ldelim();
|
|
392
|
+
};
|
|
393
|
+
SenderChainKey.decode = function decode(reader, length, error) {
|
|
394
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
395
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
396
|
+
message =
|
|
397
|
+
new $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey();
|
|
398
|
+
while (reader.pos < end) {
|
|
399
|
+
var tag = reader.uint32();
|
|
400
|
+
if (tag === error) break;
|
|
401
|
+
switch (tag >>> 3) {
|
|
402
|
+
case 1: {
|
|
403
|
+
message.iteration = reader.uint32();
|
|
404
|
+
break;
|
|
405
|
+
}
|
|
406
|
+
case 2: {
|
|
407
|
+
message.seed = reader.bytes();
|
|
408
|
+
break;
|
|
409
|
+
}
|
|
410
|
+
default:
|
|
411
|
+
reader.skipType(tag & 7);
|
|
412
|
+
break;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return message;
|
|
416
|
+
};
|
|
417
|
+
SenderChainKey.decodeDelimited = function decodeDelimited(reader) {
|
|
418
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
419
|
+
return this.decode(reader, reader.uint32());
|
|
420
|
+
};
|
|
421
|
+
SenderChainKey.verify = function verify(message) {
|
|
422
|
+
if (typeof message !== "object" || message === null) return "object expected";
|
|
423
|
+
var properties = {};
|
|
424
|
+
if (message.iteration != null && message.hasOwnProperty("iteration")) {
|
|
425
|
+
properties._iteration = 1;
|
|
426
|
+
if (!$util.isInteger(message.iteration)) return "iteration: integer expected";
|
|
427
|
+
}
|
|
428
|
+
if (message.seed != null && message.hasOwnProperty("seed")) {
|
|
429
|
+
properties._seed = 1;
|
|
430
|
+
if (
|
|
431
|
+
!(
|
|
432
|
+
(message.seed && typeof message.seed.length === "number") ||
|
|
433
|
+
$util.isString(message.seed)
|
|
434
|
+
)
|
|
435
|
+
)
|
|
436
|
+
return "seed: buffer expected";
|
|
437
|
+
}
|
|
438
|
+
return null;
|
|
439
|
+
};
|
|
440
|
+
SenderChainKey.fromObject = function fromObject(object) {
|
|
441
|
+
if (
|
|
442
|
+
object instanceof
|
|
443
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey
|
|
444
|
+
)
|
|
445
|
+
return object;
|
|
446
|
+
var message =
|
|
447
|
+
new $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey();
|
|
448
|
+
if (object.iteration != null) message.iteration = object.iteration >>> 0;
|
|
449
|
+
if (object.seed != null)
|
|
450
|
+
if (typeof object.seed === "string")
|
|
451
|
+
$util.base64.decode(
|
|
452
|
+
object.seed,
|
|
453
|
+
(message.seed = $util.newBuffer($util.base64.length(object.seed))),
|
|
454
|
+
0
|
|
455
|
+
);
|
|
456
|
+
else if (object.seed.length >= 0) message.seed = object.seed;
|
|
457
|
+
return message;
|
|
458
|
+
};
|
|
459
|
+
SenderChainKey.toObject = function toObject(message, options) {
|
|
460
|
+
if (!options) options = {};
|
|
461
|
+
var object = {};
|
|
462
|
+
if (message.iteration != null && message.hasOwnProperty("iteration")) {
|
|
463
|
+
object.iteration = message.iteration;
|
|
464
|
+
if (options.oneofs) object._iteration = "iteration";
|
|
465
|
+
}
|
|
466
|
+
if (message.seed != null && message.hasOwnProperty("seed")) {
|
|
467
|
+
object.seed =
|
|
468
|
+
options.bytes === String
|
|
469
|
+
? $util.base64.encode(message.seed, 0, message.seed.length)
|
|
470
|
+
: options.bytes === Array
|
|
471
|
+
? Array.prototype.slice.call(message.seed)
|
|
472
|
+
: message.seed;
|
|
473
|
+
if (options.oneofs) object._seed = "seed";
|
|
474
|
+
}
|
|
475
|
+
return object;
|
|
476
|
+
};
|
|
477
|
+
SenderChainKey.prototype.toJSON = function toJSON() {
|
|
478
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
479
|
+
};
|
|
480
|
+
SenderChainKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
481
|
+
if (typeUrlPrefix === undefined) {
|
|
482
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
483
|
+
}
|
|
484
|
+
return (
|
|
485
|
+
typeUrlPrefix +
|
|
486
|
+
"/SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey"
|
|
487
|
+
);
|
|
488
|
+
};
|
|
489
|
+
return SenderChainKey;
|
|
490
|
+
})();
|
|
491
|
+
SenderKeyStateStructure.SenderMessageKey = (function () {
|
|
492
|
+
function SenderMessageKey(properties) {
|
|
493
|
+
if (properties)
|
|
494
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
495
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
496
|
+
}
|
|
497
|
+
SenderMessageKey.prototype.iteration = null;
|
|
498
|
+
SenderMessageKey.prototype.seed = null;
|
|
499
|
+
var $oneOfFields;
|
|
500
|
+
Object.defineProperty(SenderMessageKey.prototype, "_iteration", {
|
|
501
|
+
get: $util.oneOfGetter(($oneOfFields = ["iteration"])),
|
|
502
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
503
|
+
});
|
|
504
|
+
Object.defineProperty(SenderMessageKey.prototype, "_seed", {
|
|
505
|
+
get: $util.oneOfGetter(($oneOfFields = ["seed"])),
|
|
506
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
507
|
+
});
|
|
508
|
+
SenderMessageKey.create = function create(properties) {
|
|
509
|
+
return new SenderMessageKey(properties);
|
|
510
|
+
};
|
|
511
|
+
SenderMessageKey.encode = function encode(message, writer) {
|
|
512
|
+
if (!writer) writer = $Writer.create();
|
|
513
|
+
if (message.iteration != null && Object.hasOwnProperty.call(message, "iteration"))
|
|
514
|
+
writer.uint32(8).uint32(message.iteration);
|
|
515
|
+
if (message.seed != null && Object.hasOwnProperty.call(message, "seed"))
|
|
516
|
+
writer.uint32(18).bytes(message.seed);
|
|
517
|
+
return writer;
|
|
518
|
+
};
|
|
519
|
+
SenderMessageKey.encodeDelimited = function encodeDelimited(message, writer) {
|
|
520
|
+
return this.encode(message, writer).ldelim();
|
|
521
|
+
};
|
|
522
|
+
SenderMessageKey.decode = function decode(reader, length, error) {
|
|
523
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
524
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
525
|
+
message =
|
|
526
|
+
new $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey();
|
|
527
|
+
while (reader.pos < end) {
|
|
528
|
+
var tag = reader.uint32();
|
|
529
|
+
if (tag === error) break;
|
|
530
|
+
switch (tag >>> 3) {
|
|
531
|
+
case 1: {
|
|
532
|
+
message.iteration = reader.uint32();
|
|
533
|
+
break;
|
|
534
|
+
}
|
|
535
|
+
case 2: {
|
|
536
|
+
message.seed = reader.bytes();
|
|
537
|
+
break;
|
|
538
|
+
}
|
|
539
|
+
default:
|
|
540
|
+
reader.skipType(tag & 7);
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
return message;
|
|
545
|
+
};
|
|
546
|
+
SenderMessageKey.decodeDelimited = function decodeDelimited(reader) {
|
|
547
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
548
|
+
return this.decode(reader, reader.uint32());
|
|
549
|
+
};
|
|
550
|
+
SenderMessageKey.verify = function verify(message) {
|
|
551
|
+
if (typeof message !== "object" || message === null) return "object expected";
|
|
552
|
+
var properties = {};
|
|
553
|
+
if (message.iteration != null && message.hasOwnProperty("iteration")) {
|
|
554
|
+
properties._iteration = 1;
|
|
555
|
+
if (!$util.isInteger(message.iteration)) return "iteration: integer expected";
|
|
556
|
+
}
|
|
557
|
+
if (message.seed != null && message.hasOwnProperty("seed")) {
|
|
558
|
+
properties._seed = 1;
|
|
559
|
+
if (
|
|
560
|
+
!(
|
|
561
|
+
(message.seed && typeof message.seed.length === "number") ||
|
|
562
|
+
$util.isString(message.seed)
|
|
563
|
+
)
|
|
564
|
+
)
|
|
565
|
+
return "seed: buffer expected";
|
|
566
|
+
}
|
|
567
|
+
return null;
|
|
568
|
+
};
|
|
569
|
+
SenderMessageKey.fromObject = function fromObject(object) {
|
|
570
|
+
if (
|
|
571
|
+
object instanceof
|
|
572
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey
|
|
573
|
+
)
|
|
574
|
+
return object;
|
|
575
|
+
var message =
|
|
576
|
+
new $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey();
|
|
577
|
+
if (object.iteration != null) message.iteration = object.iteration >>> 0;
|
|
578
|
+
if (object.seed != null)
|
|
579
|
+
if (typeof object.seed === "string")
|
|
580
|
+
$util.base64.decode(
|
|
581
|
+
object.seed,
|
|
582
|
+
(message.seed = $util.newBuffer($util.base64.length(object.seed))),
|
|
583
|
+
0
|
|
584
|
+
);
|
|
585
|
+
else if (object.seed.length >= 0) message.seed = object.seed;
|
|
586
|
+
return message;
|
|
587
|
+
};
|
|
588
|
+
SenderMessageKey.toObject = function toObject(message, options) {
|
|
589
|
+
if (!options) options = {};
|
|
590
|
+
var object = {};
|
|
591
|
+
if (message.iteration != null && message.hasOwnProperty("iteration")) {
|
|
592
|
+
object.iteration = message.iteration;
|
|
593
|
+
if (options.oneofs) object._iteration = "iteration";
|
|
594
|
+
}
|
|
595
|
+
if (message.seed != null && message.hasOwnProperty("seed")) {
|
|
596
|
+
object.seed =
|
|
597
|
+
options.bytes === String
|
|
598
|
+
? $util.base64.encode(message.seed, 0, message.seed.length)
|
|
599
|
+
: options.bytes === Array
|
|
600
|
+
? Array.prototype.slice.call(message.seed)
|
|
601
|
+
: message.seed;
|
|
602
|
+
if (options.oneofs) object._seed = "seed";
|
|
603
|
+
}
|
|
604
|
+
return object;
|
|
605
|
+
};
|
|
606
|
+
SenderMessageKey.prototype.toJSON = function toJSON() {
|
|
607
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
608
|
+
};
|
|
609
|
+
SenderMessageKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
610
|
+
if (typeUrlPrefix === undefined) {
|
|
611
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
612
|
+
}
|
|
613
|
+
return (
|
|
614
|
+
typeUrlPrefix +
|
|
615
|
+
"/SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey"
|
|
616
|
+
);
|
|
617
|
+
};
|
|
618
|
+
return SenderMessageKey;
|
|
619
|
+
})();
|
|
620
|
+
SenderKeyStateStructure.SenderSigningKey = (function () {
|
|
621
|
+
function SenderSigningKey(properties) {
|
|
622
|
+
if (properties)
|
|
623
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
624
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
625
|
+
}
|
|
626
|
+
SenderSigningKey.prototype["public"] = null;
|
|
627
|
+
SenderSigningKey.prototype["private"] = null;
|
|
628
|
+
var $oneOfFields;
|
|
629
|
+
Object.defineProperty(SenderSigningKey.prototype, "_public", {
|
|
630
|
+
get: $util.oneOfGetter(($oneOfFields = ["public"])),
|
|
631
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
632
|
+
});
|
|
633
|
+
Object.defineProperty(SenderSigningKey.prototype, "_private", {
|
|
634
|
+
get: $util.oneOfGetter(($oneOfFields = ["private"])),
|
|
635
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
636
|
+
});
|
|
637
|
+
SenderSigningKey.create = function create(properties) {
|
|
638
|
+
return new SenderSigningKey(properties);
|
|
639
|
+
};
|
|
640
|
+
SenderSigningKey.encode = function encode(message, writer) {
|
|
641
|
+
if (!writer) writer = $Writer.create();
|
|
642
|
+
if (message["public"] != null && Object.hasOwnProperty.call(message, "public"))
|
|
643
|
+
writer.uint32(10).bytes(message["public"]);
|
|
644
|
+
if (message["private"] != null && Object.hasOwnProperty.call(message, "private"))
|
|
645
|
+
writer.uint32(18).bytes(message["private"]);
|
|
646
|
+
return writer;
|
|
647
|
+
};
|
|
648
|
+
SenderSigningKey.encodeDelimited = function encodeDelimited(message, writer) {
|
|
649
|
+
return this.encode(message, writer).ldelim();
|
|
650
|
+
};
|
|
651
|
+
SenderSigningKey.decode = function decode(reader, length, error) {
|
|
652
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
653
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
654
|
+
message =
|
|
655
|
+
new $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey();
|
|
656
|
+
while (reader.pos < end) {
|
|
657
|
+
var tag = reader.uint32();
|
|
658
|
+
if (tag === error) break;
|
|
659
|
+
switch (tag >>> 3) {
|
|
660
|
+
case 1: {
|
|
661
|
+
message["public"] = reader.bytes();
|
|
662
|
+
break;
|
|
663
|
+
}
|
|
664
|
+
case 2: {
|
|
665
|
+
message["private"] = reader.bytes();
|
|
666
|
+
break;
|
|
667
|
+
}
|
|
668
|
+
default:
|
|
669
|
+
reader.skipType(tag & 7);
|
|
670
|
+
break;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
return message;
|
|
674
|
+
};
|
|
675
|
+
SenderSigningKey.decodeDelimited = function decodeDelimited(reader) {
|
|
676
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
677
|
+
return this.decode(reader, reader.uint32());
|
|
678
|
+
};
|
|
679
|
+
SenderSigningKey.verify = function verify(message) {
|
|
680
|
+
if (typeof message !== "object" || message === null) return "object expected";
|
|
681
|
+
var properties = {};
|
|
682
|
+
if (message["public"] != null && message.hasOwnProperty("public")) {
|
|
683
|
+
properties._public = 1;
|
|
684
|
+
if (
|
|
685
|
+
!(
|
|
686
|
+
(message["public"] && typeof message["public"].length === "number") ||
|
|
687
|
+
$util.isString(message["public"])
|
|
688
|
+
)
|
|
689
|
+
)
|
|
690
|
+
return "public: buffer expected";
|
|
691
|
+
}
|
|
692
|
+
if (message["private"] != null && message.hasOwnProperty("private")) {
|
|
693
|
+
properties._private = 1;
|
|
694
|
+
if (
|
|
695
|
+
!(
|
|
696
|
+
(message["private"] && typeof message["private"].length === "number") ||
|
|
697
|
+
$util.isString(message["private"])
|
|
698
|
+
)
|
|
699
|
+
)
|
|
700
|
+
return "private: buffer expected";
|
|
701
|
+
}
|
|
702
|
+
return null;
|
|
703
|
+
};
|
|
704
|
+
SenderSigningKey.fromObject = function fromObject(object) {
|
|
705
|
+
if (
|
|
706
|
+
object instanceof
|
|
707
|
+
$root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey
|
|
708
|
+
)
|
|
709
|
+
return object;
|
|
710
|
+
var message =
|
|
711
|
+
new $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey();
|
|
712
|
+
if (object["public"] != null)
|
|
713
|
+
if (typeof object["public"] === "string")
|
|
714
|
+
$util.base64.decode(
|
|
715
|
+
object["public"],
|
|
716
|
+
(message["public"] = $util.newBuffer(
|
|
717
|
+
$util.base64.length(object["public"])
|
|
718
|
+
)),
|
|
719
|
+
0
|
|
720
|
+
);
|
|
721
|
+
else if (object["public"].length >= 0) message["public"] = object["public"];
|
|
722
|
+
if (object["private"] != null)
|
|
723
|
+
if (typeof object["private"] === "string")
|
|
724
|
+
$util.base64.decode(
|
|
725
|
+
object["private"],
|
|
726
|
+
(message["private"] = $util.newBuffer(
|
|
727
|
+
$util.base64.length(object["private"])
|
|
728
|
+
)),
|
|
729
|
+
0
|
|
730
|
+
);
|
|
731
|
+
else if (object["private"].length >= 0) message["private"] = object["private"];
|
|
732
|
+
return message;
|
|
733
|
+
};
|
|
734
|
+
SenderSigningKey.toObject = function toObject(message, options) {
|
|
735
|
+
if (!options) options = {};
|
|
736
|
+
var object = {};
|
|
737
|
+
if (message["public"] != null && message.hasOwnProperty("public")) {
|
|
738
|
+
object["public"] =
|
|
739
|
+
options.bytes === String
|
|
740
|
+
? $util.base64.encode(message["public"], 0, message["public"].length)
|
|
741
|
+
: options.bytes === Array
|
|
742
|
+
? Array.prototype.slice.call(message["public"])
|
|
743
|
+
: message["public"];
|
|
744
|
+
if (options.oneofs) object._public = "public";
|
|
745
|
+
}
|
|
746
|
+
if (message["private"] != null && message.hasOwnProperty("private")) {
|
|
747
|
+
object["private"] =
|
|
748
|
+
options.bytes === String
|
|
749
|
+
? $util.base64.encode(message["private"], 0, message["private"].length)
|
|
750
|
+
: options.bytes === Array
|
|
751
|
+
? Array.prototype.slice.call(message["private"])
|
|
752
|
+
: message["private"];
|
|
753
|
+
if (options.oneofs) object._private = "private";
|
|
754
|
+
}
|
|
755
|
+
return object;
|
|
756
|
+
};
|
|
757
|
+
SenderSigningKey.prototype.toJSON = function toJSON() {
|
|
758
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
759
|
+
};
|
|
760
|
+
SenderSigningKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
761
|
+
if (typeUrlPrefix === undefined) {
|
|
762
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
763
|
+
}
|
|
764
|
+
return (
|
|
765
|
+
typeUrlPrefix +
|
|
766
|
+
"/SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey"
|
|
767
|
+
);
|
|
768
|
+
};
|
|
769
|
+
return SenderSigningKey;
|
|
770
|
+
})();
|
|
771
|
+
return SenderKeyStateStructure;
|
|
772
|
+
})();
|
|
773
|
+
SignalLocalStorageProtocol.IdentityKeyPairStructure = (function () {
|
|
774
|
+
function IdentityKeyPairStructure(properties) {
|
|
775
|
+
if (properties)
|
|
776
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
777
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
778
|
+
}
|
|
779
|
+
IdentityKeyPairStructure.prototype.publicKey = null;
|
|
780
|
+
IdentityKeyPairStructure.prototype.privateKey = null;
|
|
781
|
+
var $oneOfFields;
|
|
782
|
+
Object.defineProperty(IdentityKeyPairStructure.prototype, "_publicKey", {
|
|
783
|
+
get: $util.oneOfGetter(($oneOfFields = ["publicKey"])),
|
|
784
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
785
|
+
});
|
|
786
|
+
Object.defineProperty(IdentityKeyPairStructure.prototype, "_privateKey", {
|
|
787
|
+
get: $util.oneOfGetter(($oneOfFields = ["privateKey"])),
|
|
788
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
789
|
+
});
|
|
790
|
+
IdentityKeyPairStructure.create = function create(properties) {
|
|
791
|
+
return new IdentityKeyPairStructure(properties);
|
|
792
|
+
};
|
|
793
|
+
IdentityKeyPairStructure.encode = function encode(message, writer) {
|
|
794
|
+
if (!writer) writer = $Writer.create();
|
|
795
|
+
if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey"))
|
|
796
|
+
writer.uint32(10).bytes(message.publicKey);
|
|
797
|
+
if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey"))
|
|
798
|
+
writer.uint32(18).bytes(message.privateKey);
|
|
799
|
+
return writer;
|
|
800
|
+
};
|
|
801
|
+
IdentityKeyPairStructure.encodeDelimited = function encodeDelimited(message, writer) {
|
|
802
|
+
return this.encode(message, writer).ldelim();
|
|
803
|
+
};
|
|
804
|
+
IdentityKeyPairStructure.decode = function decode(reader, length, error) {
|
|
805
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
806
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
807
|
+
message = new $root.SignalLocalStorageProtocol.IdentityKeyPairStructure();
|
|
808
|
+
while (reader.pos < end) {
|
|
809
|
+
var tag = reader.uint32();
|
|
810
|
+
if (tag === error) break;
|
|
811
|
+
switch (tag >>> 3) {
|
|
812
|
+
case 1: {
|
|
813
|
+
message.publicKey = reader.bytes();
|
|
814
|
+
break;
|
|
815
|
+
}
|
|
816
|
+
case 2: {
|
|
817
|
+
message.privateKey = reader.bytes();
|
|
818
|
+
break;
|
|
819
|
+
}
|
|
820
|
+
default:
|
|
821
|
+
reader.skipType(tag & 7);
|
|
822
|
+
break;
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
return message;
|
|
826
|
+
};
|
|
827
|
+
IdentityKeyPairStructure.decodeDelimited = function decodeDelimited(reader) {
|
|
828
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
829
|
+
return this.decode(reader, reader.uint32());
|
|
830
|
+
};
|
|
831
|
+
IdentityKeyPairStructure.verify = function verify(message) {
|
|
832
|
+
if (typeof message !== "object" || message === null) return "object expected";
|
|
833
|
+
var properties = {};
|
|
834
|
+
if (message.publicKey != null && message.hasOwnProperty("publicKey")) {
|
|
835
|
+
properties._publicKey = 1;
|
|
836
|
+
if (
|
|
837
|
+
!(
|
|
838
|
+
(message.publicKey && typeof message.publicKey.length === "number") ||
|
|
839
|
+
$util.isString(message.publicKey)
|
|
840
|
+
)
|
|
841
|
+
)
|
|
842
|
+
return "publicKey: buffer expected";
|
|
843
|
+
}
|
|
844
|
+
if (message.privateKey != null && message.hasOwnProperty("privateKey")) {
|
|
845
|
+
properties._privateKey = 1;
|
|
846
|
+
if (
|
|
847
|
+
!(
|
|
848
|
+
(message.privateKey && typeof message.privateKey.length === "number") ||
|
|
849
|
+
$util.isString(message.privateKey)
|
|
850
|
+
)
|
|
851
|
+
)
|
|
852
|
+
return "privateKey: buffer expected";
|
|
853
|
+
}
|
|
854
|
+
return null;
|
|
855
|
+
};
|
|
856
|
+
IdentityKeyPairStructure.fromObject = function fromObject(object) {
|
|
857
|
+
if (object instanceof $root.SignalLocalStorageProtocol.IdentityKeyPairStructure)
|
|
858
|
+
return object;
|
|
859
|
+
var message = new $root.SignalLocalStorageProtocol.IdentityKeyPairStructure();
|
|
860
|
+
if (object.publicKey != null)
|
|
861
|
+
if (typeof object.publicKey === "string")
|
|
862
|
+
$util.base64.decode(
|
|
863
|
+
object.publicKey,
|
|
864
|
+
(message.publicKey = $util.newBuffer(
|
|
865
|
+
$util.base64.length(object.publicKey)
|
|
866
|
+
)),
|
|
867
|
+
0
|
|
868
|
+
);
|
|
869
|
+
else if (object.publicKey.length >= 0) message.publicKey = object.publicKey;
|
|
870
|
+
if (object.privateKey != null)
|
|
871
|
+
if (typeof object.privateKey === "string")
|
|
872
|
+
$util.base64.decode(
|
|
873
|
+
object.privateKey,
|
|
874
|
+
(message.privateKey = $util.newBuffer(
|
|
875
|
+
$util.base64.length(object.privateKey)
|
|
876
|
+
)),
|
|
877
|
+
0
|
|
878
|
+
);
|
|
879
|
+
else if (object.privateKey.length >= 0) message.privateKey = object.privateKey;
|
|
880
|
+
return message;
|
|
881
|
+
};
|
|
882
|
+
IdentityKeyPairStructure.toObject = function toObject(message, options) {
|
|
883
|
+
if (!options) options = {};
|
|
884
|
+
var object = {};
|
|
885
|
+
if (message.publicKey != null && message.hasOwnProperty("publicKey")) {
|
|
886
|
+
object.publicKey =
|
|
887
|
+
options.bytes === String
|
|
888
|
+
? $util.base64.encode(message.publicKey, 0, message.publicKey.length)
|
|
889
|
+
: options.bytes === Array
|
|
890
|
+
? Array.prototype.slice.call(message.publicKey)
|
|
891
|
+
: message.publicKey;
|
|
892
|
+
if (options.oneofs) object._publicKey = "publicKey";
|
|
893
|
+
}
|
|
894
|
+
if (message.privateKey != null && message.hasOwnProperty("privateKey")) {
|
|
895
|
+
object.privateKey =
|
|
896
|
+
options.bytes === String
|
|
897
|
+
? $util.base64.encode(message.privateKey, 0, message.privateKey.length)
|
|
898
|
+
: options.bytes === Array
|
|
899
|
+
? Array.prototype.slice.call(message.privateKey)
|
|
900
|
+
: message.privateKey;
|
|
901
|
+
if (options.oneofs) object._privateKey = "privateKey";
|
|
902
|
+
}
|
|
903
|
+
return object;
|
|
904
|
+
};
|
|
905
|
+
IdentityKeyPairStructure.prototype.toJSON = function toJSON() {
|
|
906
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
907
|
+
};
|
|
908
|
+
IdentityKeyPairStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
909
|
+
if (typeUrlPrefix === undefined) {
|
|
910
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
911
|
+
}
|
|
912
|
+
return typeUrlPrefix + "/SignalLocalStorageProtocol.IdentityKeyPairStructure";
|
|
913
|
+
};
|
|
914
|
+
return IdentityKeyPairStructure;
|
|
915
|
+
})();
|
|
916
|
+
SignalLocalStorageProtocol.SignedPreKeyRecordStructure = (function () {
|
|
917
|
+
function SignedPreKeyRecordStructure(properties) {
|
|
918
|
+
if (properties)
|
|
919
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
920
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
921
|
+
}
|
|
922
|
+
SignedPreKeyRecordStructure.prototype.id = null;
|
|
923
|
+
SignedPreKeyRecordStructure.prototype.publicKey = null;
|
|
924
|
+
SignedPreKeyRecordStructure.prototype.privateKey = null;
|
|
925
|
+
SignedPreKeyRecordStructure.prototype.signature = null;
|
|
926
|
+
SignedPreKeyRecordStructure.prototype.timestamp = null;
|
|
927
|
+
var $oneOfFields;
|
|
928
|
+
Object.defineProperty(SignedPreKeyRecordStructure.prototype, "_id", {
|
|
929
|
+
get: $util.oneOfGetter(($oneOfFields = ["id"])),
|
|
930
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
931
|
+
});
|
|
932
|
+
Object.defineProperty(SignedPreKeyRecordStructure.prototype, "_publicKey", {
|
|
933
|
+
get: $util.oneOfGetter(($oneOfFields = ["publicKey"])),
|
|
934
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
935
|
+
});
|
|
936
|
+
Object.defineProperty(SignedPreKeyRecordStructure.prototype, "_privateKey", {
|
|
937
|
+
get: $util.oneOfGetter(($oneOfFields = ["privateKey"])),
|
|
938
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
939
|
+
});
|
|
940
|
+
Object.defineProperty(SignedPreKeyRecordStructure.prototype, "_signature", {
|
|
941
|
+
get: $util.oneOfGetter(($oneOfFields = ["signature"])),
|
|
942
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
943
|
+
});
|
|
944
|
+
Object.defineProperty(SignedPreKeyRecordStructure.prototype, "_timestamp", {
|
|
945
|
+
get: $util.oneOfGetter(($oneOfFields = ["timestamp"])),
|
|
946
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
947
|
+
});
|
|
948
|
+
SignedPreKeyRecordStructure.create = function create(properties) {
|
|
949
|
+
return new SignedPreKeyRecordStructure(properties);
|
|
950
|
+
};
|
|
951
|
+
SignedPreKeyRecordStructure.encode = function encode(message, writer) {
|
|
952
|
+
if (!writer) writer = $Writer.create();
|
|
953
|
+
if (message.id != null && Object.hasOwnProperty.call(message, "id"))
|
|
954
|
+
writer.uint32(8).uint32(message.id);
|
|
955
|
+
if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey"))
|
|
956
|
+
writer.uint32(18).bytes(message.publicKey);
|
|
957
|
+
if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey"))
|
|
958
|
+
writer.uint32(26).bytes(message.privateKey);
|
|
959
|
+
if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
|
|
960
|
+
writer.uint32(34).bytes(message.signature);
|
|
961
|
+
if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp"))
|
|
962
|
+
writer.uint32(41).fixed64(message.timestamp);
|
|
963
|
+
return writer;
|
|
964
|
+
};
|
|
965
|
+
SignedPreKeyRecordStructure.encodeDelimited = function encodeDelimited(message, writer) {
|
|
966
|
+
return this.encode(message, writer).ldelim();
|
|
967
|
+
};
|
|
968
|
+
SignedPreKeyRecordStructure.decode = function decode(reader, length, error) {
|
|
969
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
970
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
971
|
+
message = new $root.SignalLocalStorageProtocol.SignedPreKeyRecordStructure();
|
|
972
|
+
while (reader.pos < end) {
|
|
973
|
+
var tag = reader.uint32();
|
|
974
|
+
if (tag === error) break;
|
|
975
|
+
switch (tag >>> 3) {
|
|
976
|
+
case 1: {
|
|
977
|
+
message.id = reader.uint32();
|
|
978
|
+
break;
|
|
979
|
+
}
|
|
980
|
+
case 2: {
|
|
981
|
+
message.publicKey = reader.bytes();
|
|
982
|
+
break;
|
|
983
|
+
}
|
|
984
|
+
case 3: {
|
|
985
|
+
message.privateKey = reader.bytes();
|
|
986
|
+
break;
|
|
987
|
+
}
|
|
988
|
+
case 4: {
|
|
989
|
+
message.signature = reader.bytes();
|
|
990
|
+
break;
|
|
991
|
+
}
|
|
992
|
+
case 5: {
|
|
993
|
+
message.timestamp = reader.fixed64();
|
|
994
|
+
break;
|
|
995
|
+
}
|
|
996
|
+
default:
|
|
997
|
+
reader.skipType(tag & 7);
|
|
998
|
+
break;
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
return message;
|
|
1002
|
+
};
|
|
1003
|
+
SignedPreKeyRecordStructure.decodeDelimited = function decodeDelimited(reader) {
|
|
1004
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
1005
|
+
return this.decode(reader, reader.uint32());
|
|
1006
|
+
};
|
|
1007
|
+
SignedPreKeyRecordStructure.verify = function verify(message) {
|
|
1008
|
+
if (typeof message !== "object" || message === null) return "object expected";
|
|
1009
|
+
var properties = {};
|
|
1010
|
+
if (message.id != null && message.hasOwnProperty("id")) {
|
|
1011
|
+
properties._id = 1;
|
|
1012
|
+
if (!$util.isInteger(message.id)) return "id: integer expected";
|
|
1013
|
+
}
|
|
1014
|
+
if (message.publicKey != null && message.hasOwnProperty("publicKey")) {
|
|
1015
|
+
properties._publicKey = 1;
|
|
1016
|
+
if (
|
|
1017
|
+
!(
|
|
1018
|
+
(message.publicKey && typeof message.publicKey.length === "number") ||
|
|
1019
|
+
$util.isString(message.publicKey)
|
|
1020
|
+
)
|
|
1021
|
+
)
|
|
1022
|
+
return "publicKey: buffer expected";
|
|
1023
|
+
}
|
|
1024
|
+
if (message.privateKey != null && message.hasOwnProperty("privateKey")) {
|
|
1025
|
+
properties._privateKey = 1;
|
|
1026
|
+
if (
|
|
1027
|
+
!(
|
|
1028
|
+
(message.privateKey && typeof message.privateKey.length === "number") ||
|
|
1029
|
+
$util.isString(message.privateKey)
|
|
1030
|
+
)
|
|
1031
|
+
)
|
|
1032
|
+
return "privateKey: buffer expected";
|
|
1033
|
+
}
|
|
1034
|
+
if (message.signature != null && message.hasOwnProperty("signature")) {
|
|
1035
|
+
properties._signature = 1;
|
|
1036
|
+
if (
|
|
1037
|
+
!(
|
|
1038
|
+
(message.signature && typeof message.signature.length === "number") ||
|
|
1039
|
+
$util.isString(message.signature)
|
|
1040
|
+
)
|
|
1041
|
+
)
|
|
1042
|
+
return "signature: buffer expected";
|
|
1043
|
+
}
|
|
1044
|
+
if (message.timestamp != null && message.hasOwnProperty("timestamp")) {
|
|
1045
|
+
properties._timestamp = 1;
|
|
1046
|
+
if (
|
|
1047
|
+
!$util.isInteger(message.timestamp) &&
|
|
1048
|
+
!(
|
|
1049
|
+
message.timestamp &&
|
|
1050
|
+
$util.isInteger(message.timestamp.low) &&
|
|
1051
|
+
$util.isInteger(message.timestamp.high)
|
|
1052
|
+
)
|
|
1053
|
+
)
|
|
1054
|
+
return "timestamp: integer|Long expected";
|
|
1055
|
+
}
|
|
1056
|
+
return null;
|
|
1057
|
+
};
|
|
1058
|
+
SignedPreKeyRecordStructure.fromObject = function fromObject(object) {
|
|
1059
|
+
if (object instanceof $root.SignalLocalStorageProtocol.SignedPreKeyRecordStructure)
|
|
1060
|
+
return object;
|
|
1061
|
+
var message = new $root.SignalLocalStorageProtocol.SignedPreKeyRecordStructure();
|
|
1062
|
+
if (object.id != null) message.id = object.id >>> 0;
|
|
1063
|
+
if (object.publicKey != null)
|
|
1064
|
+
if (typeof object.publicKey === "string")
|
|
1065
|
+
$util.base64.decode(
|
|
1066
|
+
object.publicKey,
|
|
1067
|
+
(message.publicKey = $util.newBuffer(
|
|
1068
|
+
$util.base64.length(object.publicKey)
|
|
1069
|
+
)),
|
|
1070
|
+
0
|
|
1071
|
+
);
|
|
1072
|
+
else if (object.publicKey.length >= 0) message.publicKey = object.publicKey;
|
|
1073
|
+
if (object.privateKey != null)
|
|
1074
|
+
if (typeof object.privateKey === "string")
|
|
1075
|
+
$util.base64.decode(
|
|
1076
|
+
object.privateKey,
|
|
1077
|
+
(message.privateKey = $util.newBuffer(
|
|
1078
|
+
$util.base64.length(object.privateKey)
|
|
1079
|
+
)),
|
|
1080
|
+
0
|
|
1081
|
+
);
|
|
1082
|
+
else if (object.privateKey.length >= 0) message.privateKey = object.privateKey;
|
|
1083
|
+
if (object.signature != null)
|
|
1084
|
+
if (typeof object.signature === "string")
|
|
1085
|
+
$util.base64.decode(
|
|
1086
|
+
object.signature,
|
|
1087
|
+
(message.signature = $util.newBuffer(
|
|
1088
|
+
$util.base64.length(object.signature)
|
|
1089
|
+
)),
|
|
1090
|
+
0
|
|
1091
|
+
);
|
|
1092
|
+
else if (object.signature.length >= 0) message.signature = object.signature;
|
|
1093
|
+
if (object.timestamp != null)
|
|
1094
|
+
if ($util.Long)
|
|
1095
|
+
(message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false;
|
|
1096
|
+
else if (typeof object.timestamp === "string")
|
|
1097
|
+
message.timestamp = parseInt(object.timestamp, 10);
|
|
1098
|
+
else if (typeof object.timestamp === "number") message.timestamp = object.timestamp;
|
|
1099
|
+
else if (typeof object.timestamp === "object")
|
|
1100
|
+
message.timestamp = new $util.LongBits(
|
|
1101
|
+
object.timestamp.low >>> 0,
|
|
1102
|
+
object.timestamp.high >>> 0
|
|
1103
|
+
).toNumber();
|
|
1104
|
+
return message;
|
|
1105
|
+
};
|
|
1106
|
+
SignedPreKeyRecordStructure.toObject = function toObject(message, options) {
|
|
1107
|
+
if (!options) options = {};
|
|
1108
|
+
var object = {};
|
|
1109
|
+
if (message.id != null && message.hasOwnProperty("id")) {
|
|
1110
|
+
object.id = message.id;
|
|
1111
|
+
if (options.oneofs) object._id = "id";
|
|
1112
|
+
}
|
|
1113
|
+
if (message.publicKey != null && message.hasOwnProperty("publicKey")) {
|
|
1114
|
+
object.publicKey =
|
|
1115
|
+
options.bytes === String
|
|
1116
|
+
? $util.base64.encode(message.publicKey, 0, message.publicKey.length)
|
|
1117
|
+
: options.bytes === Array
|
|
1118
|
+
? Array.prototype.slice.call(message.publicKey)
|
|
1119
|
+
: message.publicKey;
|
|
1120
|
+
if (options.oneofs) object._publicKey = "publicKey";
|
|
1121
|
+
}
|
|
1122
|
+
if (message.privateKey != null && message.hasOwnProperty("privateKey")) {
|
|
1123
|
+
object.privateKey =
|
|
1124
|
+
options.bytes === String
|
|
1125
|
+
? $util.base64.encode(message.privateKey, 0, message.privateKey.length)
|
|
1126
|
+
: options.bytes === Array
|
|
1127
|
+
? Array.prototype.slice.call(message.privateKey)
|
|
1128
|
+
: message.privateKey;
|
|
1129
|
+
if (options.oneofs) object._privateKey = "privateKey";
|
|
1130
|
+
}
|
|
1131
|
+
if (message.signature != null && message.hasOwnProperty("signature")) {
|
|
1132
|
+
object.signature =
|
|
1133
|
+
options.bytes === String
|
|
1134
|
+
? $util.base64.encode(message.signature, 0, message.signature.length)
|
|
1135
|
+
: options.bytes === Array
|
|
1136
|
+
? Array.prototype.slice.call(message.signature)
|
|
1137
|
+
: message.signature;
|
|
1138
|
+
if (options.oneofs) object._signature = "signature";
|
|
1139
|
+
}
|
|
1140
|
+
if (message.timestamp != null && message.hasOwnProperty("timestamp")) {
|
|
1141
|
+
if (typeof message.timestamp === "number")
|
|
1142
|
+
object.timestamp =
|
|
1143
|
+
options.longs === String ? String(message.timestamp) : message.timestamp;
|
|
1144
|
+
else
|
|
1145
|
+
object.timestamp =
|
|
1146
|
+
options.longs === String
|
|
1147
|
+
? $util.Long.prototype.toString.call(message.timestamp)
|
|
1148
|
+
: options.longs === Number
|
|
1149
|
+
? new $util.LongBits(
|
|
1150
|
+
message.timestamp.low >>> 0,
|
|
1151
|
+
message.timestamp.high >>> 0
|
|
1152
|
+
).toNumber()
|
|
1153
|
+
: message.timestamp;
|
|
1154
|
+
if (options.oneofs) object._timestamp = "timestamp";
|
|
1155
|
+
}
|
|
1156
|
+
return object;
|
|
1157
|
+
};
|
|
1158
|
+
SignedPreKeyRecordStructure.prototype.toJSON = function toJSON() {
|
|
1159
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1160
|
+
};
|
|
1161
|
+
SignedPreKeyRecordStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1162
|
+
if (typeUrlPrefix === undefined) {
|
|
1163
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1164
|
+
}
|
|
1165
|
+
return typeUrlPrefix + "/SignalLocalStorageProtocol.SignedPreKeyRecordStructure";
|
|
1166
|
+
};
|
|
1167
|
+
return SignedPreKeyRecordStructure;
|
|
1168
|
+
})();
|
|
1169
|
+
SignalLocalStorageProtocol.PreKeyRecordStructure = (function () {
|
|
1170
|
+
function PreKeyRecordStructure(properties) {
|
|
1171
|
+
if (properties)
|
|
1172
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1173
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
1174
|
+
}
|
|
1175
|
+
PreKeyRecordStructure.prototype.id = null;
|
|
1176
|
+
PreKeyRecordStructure.prototype.publicKey = null;
|
|
1177
|
+
PreKeyRecordStructure.prototype.privateKey = null;
|
|
1178
|
+
var $oneOfFields;
|
|
1179
|
+
Object.defineProperty(PreKeyRecordStructure.prototype, "_id", {
|
|
1180
|
+
get: $util.oneOfGetter(($oneOfFields = ["id"])),
|
|
1181
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
1182
|
+
});
|
|
1183
|
+
Object.defineProperty(PreKeyRecordStructure.prototype, "_publicKey", {
|
|
1184
|
+
get: $util.oneOfGetter(($oneOfFields = ["publicKey"])),
|
|
1185
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
1186
|
+
});
|
|
1187
|
+
Object.defineProperty(PreKeyRecordStructure.prototype, "_privateKey", {
|
|
1188
|
+
get: $util.oneOfGetter(($oneOfFields = ["privateKey"])),
|
|
1189
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
1190
|
+
});
|
|
1191
|
+
PreKeyRecordStructure.create = function create(properties) {
|
|
1192
|
+
return new PreKeyRecordStructure(properties);
|
|
1193
|
+
};
|
|
1194
|
+
PreKeyRecordStructure.encode = function encode(message, writer) {
|
|
1195
|
+
if (!writer) writer = $Writer.create();
|
|
1196
|
+
if (message.id != null && Object.hasOwnProperty.call(message, "id"))
|
|
1197
|
+
writer.uint32(8).uint32(message.id);
|
|
1198
|
+
if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey"))
|
|
1199
|
+
writer.uint32(18).bytes(message.publicKey);
|
|
1200
|
+
if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey"))
|
|
1201
|
+
writer.uint32(26).bytes(message.privateKey);
|
|
1202
|
+
return writer;
|
|
1203
|
+
};
|
|
1204
|
+
PreKeyRecordStructure.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1205
|
+
return this.encode(message, writer).ldelim();
|
|
1206
|
+
};
|
|
1207
|
+
PreKeyRecordStructure.decode = function decode(reader, length, error) {
|
|
1208
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
1209
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
1210
|
+
message = new $root.SignalLocalStorageProtocol.PreKeyRecordStructure();
|
|
1211
|
+
while (reader.pos < end) {
|
|
1212
|
+
var tag = reader.uint32();
|
|
1213
|
+
if (tag === error) break;
|
|
1214
|
+
switch (tag >>> 3) {
|
|
1215
|
+
case 1: {
|
|
1216
|
+
message.id = reader.uint32();
|
|
1217
|
+
break;
|
|
1218
|
+
}
|
|
1219
|
+
case 2: {
|
|
1220
|
+
message.publicKey = reader.bytes();
|
|
1221
|
+
break;
|
|
1222
|
+
}
|
|
1223
|
+
case 3: {
|
|
1224
|
+
message.privateKey = reader.bytes();
|
|
1225
|
+
break;
|
|
1226
|
+
}
|
|
1227
|
+
default:
|
|
1228
|
+
reader.skipType(tag & 7);
|
|
1229
|
+
break;
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
return message;
|
|
1233
|
+
};
|
|
1234
|
+
PreKeyRecordStructure.decodeDelimited = function decodeDelimited(reader) {
|
|
1235
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
1236
|
+
return this.decode(reader, reader.uint32());
|
|
1237
|
+
};
|
|
1238
|
+
PreKeyRecordStructure.verify = function verify(message) {
|
|
1239
|
+
if (typeof message !== "object" || message === null) return "object expected";
|
|
1240
|
+
var properties = {};
|
|
1241
|
+
if (message.id != null && message.hasOwnProperty("id")) {
|
|
1242
|
+
properties._id = 1;
|
|
1243
|
+
if (!$util.isInteger(message.id)) return "id: integer expected";
|
|
1244
|
+
}
|
|
1245
|
+
if (message.publicKey != null && message.hasOwnProperty("publicKey")) {
|
|
1246
|
+
properties._publicKey = 1;
|
|
1247
|
+
if (
|
|
1248
|
+
!(
|
|
1249
|
+
(message.publicKey && typeof message.publicKey.length === "number") ||
|
|
1250
|
+
$util.isString(message.publicKey)
|
|
1251
|
+
)
|
|
1252
|
+
)
|
|
1253
|
+
return "publicKey: buffer expected";
|
|
1254
|
+
}
|
|
1255
|
+
if (message.privateKey != null && message.hasOwnProperty("privateKey")) {
|
|
1256
|
+
properties._privateKey = 1;
|
|
1257
|
+
if (
|
|
1258
|
+
!(
|
|
1259
|
+
(message.privateKey && typeof message.privateKey.length === "number") ||
|
|
1260
|
+
$util.isString(message.privateKey)
|
|
1261
|
+
)
|
|
1262
|
+
)
|
|
1263
|
+
return "privateKey: buffer expected";
|
|
1264
|
+
}
|
|
1265
|
+
return null;
|
|
1266
|
+
};
|
|
1267
|
+
PreKeyRecordStructure.fromObject = function fromObject(object) {
|
|
1268
|
+
if (object instanceof $root.SignalLocalStorageProtocol.PreKeyRecordStructure)
|
|
1269
|
+
return object;
|
|
1270
|
+
var message = new $root.SignalLocalStorageProtocol.PreKeyRecordStructure();
|
|
1271
|
+
if (object.id != null) message.id = object.id >>> 0;
|
|
1272
|
+
if (object.publicKey != null)
|
|
1273
|
+
if (typeof object.publicKey === "string")
|
|
1274
|
+
$util.base64.decode(
|
|
1275
|
+
object.publicKey,
|
|
1276
|
+
(message.publicKey = $util.newBuffer(
|
|
1277
|
+
$util.base64.length(object.publicKey)
|
|
1278
|
+
)),
|
|
1279
|
+
0
|
|
1280
|
+
);
|
|
1281
|
+
else if (object.publicKey.length >= 0) message.publicKey = object.publicKey;
|
|
1282
|
+
if (object.privateKey != null)
|
|
1283
|
+
if (typeof object.privateKey === "string")
|
|
1284
|
+
$util.base64.decode(
|
|
1285
|
+
object.privateKey,
|
|
1286
|
+
(message.privateKey = $util.newBuffer(
|
|
1287
|
+
$util.base64.length(object.privateKey)
|
|
1288
|
+
)),
|
|
1289
|
+
0
|
|
1290
|
+
);
|
|
1291
|
+
else if (object.privateKey.length >= 0) message.privateKey = object.privateKey;
|
|
1292
|
+
return message;
|
|
1293
|
+
};
|
|
1294
|
+
PreKeyRecordStructure.toObject = function toObject(message, options) {
|
|
1295
|
+
if (!options) options = {};
|
|
1296
|
+
var object = {};
|
|
1297
|
+
if (message.id != null && message.hasOwnProperty("id")) {
|
|
1298
|
+
object.id = message.id;
|
|
1299
|
+
if (options.oneofs) object._id = "id";
|
|
1300
|
+
}
|
|
1301
|
+
if (message.publicKey != null && message.hasOwnProperty("publicKey")) {
|
|
1302
|
+
object.publicKey =
|
|
1303
|
+
options.bytes === String
|
|
1304
|
+
? $util.base64.encode(message.publicKey, 0, message.publicKey.length)
|
|
1305
|
+
: options.bytes === Array
|
|
1306
|
+
? Array.prototype.slice.call(message.publicKey)
|
|
1307
|
+
: message.publicKey;
|
|
1308
|
+
if (options.oneofs) object._publicKey = "publicKey";
|
|
1309
|
+
}
|
|
1310
|
+
if (message.privateKey != null && message.hasOwnProperty("privateKey")) {
|
|
1311
|
+
object.privateKey =
|
|
1312
|
+
options.bytes === String
|
|
1313
|
+
? $util.base64.encode(message.privateKey, 0, message.privateKey.length)
|
|
1314
|
+
: options.bytes === Array
|
|
1315
|
+
? Array.prototype.slice.call(message.privateKey)
|
|
1316
|
+
: message.privateKey;
|
|
1317
|
+
if (options.oneofs) object._privateKey = "privateKey";
|
|
1318
|
+
}
|
|
1319
|
+
return object;
|
|
1320
|
+
};
|
|
1321
|
+
PreKeyRecordStructure.prototype.toJSON = function toJSON() {
|
|
1322
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1323
|
+
};
|
|
1324
|
+
PreKeyRecordStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1325
|
+
if (typeUrlPrefix === undefined) {
|
|
1326
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1327
|
+
}
|
|
1328
|
+
return typeUrlPrefix + "/SignalLocalStorageProtocol.PreKeyRecordStructure";
|
|
1329
|
+
};
|
|
1330
|
+
return PreKeyRecordStructure;
|
|
1331
|
+
})();
|
|
1332
|
+
SignalLocalStorageProtocol.RecordStructure = (function () {
|
|
1333
|
+
function RecordStructure(properties) {
|
|
1334
|
+
this.previousSessions = [];
|
|
1335
|
+
if (properties)
|
|
1336
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1337
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
1338
|
+
}
|
|
1339
|
+
RecordStructure.prototype.currentSession = null;
|
|
1340
|
+
RecordStructure.prototype.previousSessions = $util.emptyArray;
|
|
1341
|
+
var $oneOfFields;
|
|
1342
|
+
Object.defineProperty(RecordStructure.prototype, "_currentSession", {
|
|
1343
|
+
get: $util.oneOfGetter(($oneOfFields = ["currentSession"])),
|
|
1344
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
1345
|
+
});
|
|
1346
|
+
RecordStructure.create = function create(properties) {
|
|
1347
|
+
return new RecordStructure(properties);
|
|
1348
|
+
};
|
|
1349
|
+
RecordStructure.encode = function encode(message, writer) {
|
|
1350
|
+
if (!writer) writer = $Writer.create();
|
|
1351
|
+
if (
|
|
1352
|
+
message.currentSession != null &&
|
|
1353
|
+
Object.hasOwnProperty.call(message, "currentSession")
|
|
1354
|
+
)
|
|
1355
|
+
$root.SignalLocalStorageProtocol.SessionStructure.encode(
|
|
1356
|
+
message.currentSession,
|
|
1357
|
+
writer.uint32(10).fork()
|
|
1358
|
+
).ldelim();
|
|
1359
|
+
if (message.previousSessions != null && message.previousSessions.length)
|
|
1360
|
+
for (var i = 0; i < message.previousSessions.length; ++i)
|
|
1361
|
+
$root.SignalLocalStorageProtocol.SessionStructure.encode(
|
|
1362
|
+
message.previousSessions[i],
|
|
1363
|
+
writer.uint32(18).fork()
|
|
1364
|
+
).ldelim();
|
|
1365
|
+
return writer;
|
|
1366
|
+
};
|
|
1367
|
+
RecordStructure.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1368
|
+
return this.encode(message, writer).ldelim();
|
|
1369
|
+
};
|
|
1370
|
+
RecordStructure.decode = function decode(reader, length, error) {
|
|
1371
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
1372
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
1373
|
+
message = new $root.SignalLocalStorageProtocol.RecordStructure();
|
|
1374
|
+
while (reader.pos < end) {
|
|
1375
|
+
var tag = reader.uint32();
|
|
1376
|
+
if (tag === error) break;
|
|
1377
|
+
switch (tag >>> 3) {
|
|
1378
|
+
case 1: {
|
|
1379
|
+
message.currentSession =
|
|
1380
|
+
$root.SignalLocalStorageProtocol.SessionStructure.decode(
|
|
1381
|
+
reader,
|
|
1382
|
+
reader.uint32()
|
|
1383
|
+
);
|
|
1384
|
+
break;
|
|
1385
|
+
}
|
|
1386
|
+
case 2: {
|
|
1387
|
+
if (!(message.previousSessions && message.previousSessions.length))
|
|
1388
|
+
message.previousSessions = [];
|
|
1389
|
+
message.previousSessions.push(
|
|
1390
|
+
$root.SignalLocalStorageProtocol.SessionStructure.decode(
|
|
1391
|
+
reader,
|
|
1392
|
+
reader.uint32()
|
|
1393
|
+
)
|
|
1394
|
+
);
|
|
1395
|
+
break;
|
|
1396
|
+
}
|
|
1397
|
+
default:
|
|
1398
|
+
reader.skipType(tag & 7);
|
|
1399
|
+
break;
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
return message;
|
|
1403
|
+
};
|
|
1404
|
+
RecordStructure.decodeDelimited = function decodeDelimited(reader) {
|
|
1405
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
1406
|
+
return this.decode(reader, reader.uint32());
|
|
1407
|
+
};
|
|
1408
|
+
RecordStructure.verify = function verify(message) {
|
|
1409
|
+
if (typeof message !== "object" || message === null) return "object expected";
|
|
1410
|
+
var properties = {};
|
|
1411
|
+
if (message.currentSession != null && message.hasOwnProperty("currentSession")) {
|
|
1412
|
+
properties._currentSession = 1;
|
|
1413
|
+
{
|
|
1414
|
+
var error = $root.SignalLocalStorageProtocol.SessionStructure.verify(
|
|
1415
|
+
message.currentSession
|
|
1416
|
+
);
|
|
1417
|
+
if (error) return "currentSession." + error;
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
if (message.previousSessions != null && message.hasOwnProperty("previousSessions")) {
|
|
1421
|
+
if (!Array.isArray(message.previousSessions))
|
|
1422
|
+
return "previousSessions: array expected";
|
|
1423
|
+
for (var i = 0; i < message.previousSessions.length; ++i) {
|
|
1424
|
+
var error = $root.SignalLocalStorageProtocol.SessionStructure.verify(
|
|
1425
|
+
message.previousSessions[i]
|
|
1426
|
+
);
|
|
1427
|
+
if (error) return "previousSessions." + error;
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
return null;
|
|
1431
|
+
};
|
|
1432
|
+
RecordStructure.fromObject = function fromObject(object) {
|
|
1433
|
+
if (object instanceof $root.SignalLocalStorageProtocol.RecordStructure) return object;
|
|
1434
|
+
var message = new $root.SignalLocalStorageProtocol.RecordStructure();
|
|
1435
|
+
if (object.currentSession != null) {
|
|
1436
|
+
if (typeof object.currentSession !== "object")
|
|
1437
|
+
throw TypeError(
|
|
1438
|
+
".SignalLocalStorageProtocol.RecordStructure.currentSession: object expected"
|
|
1439
|
+
);
|
|
1440
|
+
message.currentSession =
|
|
1441
|
+
$root.SignalLocalStorageProtocol.SessionStructure.fromObject(
|
|
1442
|
+
object.currentSession
|
|
1443
|
+
);
|
|
1444
|
+
}
|
|
1445
|
+
if (object.previousSessions) {
|
|
1446
|
+
if (!Array.isArray(object.previousSessions))
|
|
1447
|
+
throw TypeError(
|
|
1448
|
+
".SignalLocalStorageProtocol.RecordStructure.previousSessions: array expected"
|
|
1449
|
+
);
|
|
1450
|
+
message.previousSessions = [];
|
|
1451
|
+
for (var i = 0; i < object.previousSessions.length; ++i) {
|
|
1452
|
+
if (typeof object.previousSessions[i] !== "object")
|
|
1453
|
+
throw TypeError(
|
|
1454
|
+
".SignalLocalStorageProtocol.RecordStructure.previousSessions: object expected"
|
|
1455
|
+
);
|
|
1456
|
+
message.previousSessions[i] =
|
|
1457
|
+
$root.SignalLocalStorageProtocol.SessionStructure.fromObject(
|
|
1458
|
+
object.previousSessions[i]
|
|
1459
|
+
);
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
return message;
|
|
1463
|
+
};
|
|
1464
|
+
RecordStructure.toObject = function toObject(message, options) {
|
|
1465
|
+
if (!options) options = {};
|
|
1466
|
+
var object = {};
|
|
1467
|
+
if (options.arrays || options.defaults) object.previousSessions = [];
|
|
1468
|
+
if (message.currentSession != null && message.hasOwnProperty("currentSession")) {
|
|
1469
|
+
object.currentSession = $root.SignalLocalStorageProtocol.SessionStructure.toObject(
|
|
1470
|
+
message.currentSession,
|
|
1471
|
+
options
|
|
1472
|
+
);
|
|
1473
|
+
if (options.oneofs) object._currentSession = "currentSession";
|
|
1474
|
+
}
|
|
1475
|
+
if (message.previousSessions && message.previousSessions.length) {
|
|
1476
|
+
object.previousSessions = [];
|
|
1477
|
+
for (var j = 0; j < message.previousSessions.length; ++j)
|
|
1478
|
+
object.previousSessions[j] =
|
|
1479
|
+
$root.SignalLocalStorageProtocol.SessionStructure.toObject(
|
|
1480
|
+
message.previousSessions[j],
|
|
1481
|
+
options
|
|
1482
|
+
);
|
|
1483
|
+
}
|
|
1484
|
+
return object;
|
|
1485
|
+
};
|
|
1486
|
+
RecordStructure.prototype.toJSON = function toJSON() {
|
|
1487
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1488
|
+
};
|
|
1489
|
+
RecordStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1490
|
+
if (typeUrlPrefix === undefined) {
|
|
1491
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1492
|
+
}
|
|
1493
|
+
return typeUrlPrefix + "/SignalLocalStorageProtocol.RecordStructure";
|
|
1494
|
+
};
|
|
1495
|
+
return RecordStructure;
|
|
1496
|
+
})();
|
|
1497
|
+
SignalLocalStorageProtocol.SessionStructure = (function () {
|
|
1498
|
+
function SessionStructure(properties) {
|
|
1499
|
+
this.receiverChains = [];
|
|
1500
|
+
if (properties)
|
|
1501
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1502
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
1503
|
+
}
|
|
1504
|
+
SessionStructure.prototype.sessionVersion = null;
|
|
1505
|
+
SessionStructure.prototype.localIdentityPublic = null;
|
|
1506
|
+
SessionStructure.prototype.remoteIdentityPublic = null;
|
|
1507
|
+
SessionStructure.prototype.rootKey = null;
|
|
1508
|
+
SessionStructure.prototype.previousCounter = null;
|
|
1509
|
+
SessionStructure.prototype.senderChain = null;
|
|
1510
|
+
SessionStructure.prototype.receiverChains = $util.emptyArray;
|
|
1511
|
+
SessionStructure.prototype.pendingKeyExchange = null;
|
|
1512
|
+
SessionStructure.prototype.pendingPreKey = null;
|
|
1513
|
+
SessionStructure.prototype.remoteRegistrationId = null;
|
|
1514
|
+
SessionStructure.prototype.localRegistrationId = null;
|
|
1515
|
+
SessionStructure.prototype.needsRefresh = null;
|
|
1516
|
+
SessionStructure.prototype.aliceBaseKey = null;
|
|
1517
|
+
var $oneOfFields;
|
|
1518
|
+
Object.defineProperty(SessionStructure.prototype, "_sessionVersion", {
|
|
1519
|
+
get: $util.oneOfGetter(($oneOfFields = ["sessionVersion"])),
|
|
1520
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
1521
|
+
});
|
|
1522
|
+
Object.defineProperty(SessionStructure.prototype, "_localIdentityPublic", {
|
|
1523
|
+
get: $util.oneOfGetter(($oneOfFields = ["localIdentityPublic"])),
|
|
1524
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
1525
|
+
});
|
|
1526
|
+
Object.defineProperty(SessionStructure.prototype, "_remoteIdentityPublic", {
|
|
1527
|
+
get: $util.oneOfGetter(($oneOfFields = ["remoteIdentityPublic"])),
|
|
1528
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
1529
|
+
});
|
|
1530
|
+
Object.defineProperty(SessionStructure.prototype, "_rootKey", {
|
|
1531
|
+
get: $util.oneOfGetter(($oneOfFields = ["rootKey"])),
|
|
1532
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
1533
|
+
});
|
|
1534
|
+
Object.defineProperty(SessionStructure.prototype, "_previousCounter", {
|
|
1535
|
+
get: $util.oneOfGetter(($oneOfFields = ["previousCounter"])),
|
|
1536
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
1537
|
+
});
|
|
1538
|
+
Object.defineProperty(SessionStructure.prototype, "_senderChain", {
|
|
1539
|
+
get: $util.oneOfGetter(($oneOfFields = ["senderChain"])),
|
|
1540
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
1541
|
+
});
|
|
1542
|
+
Object.defineProperty(SessionStructure.prototype, "_pendingKeyExchange", {
|
|
1543
|
+
get: $util.oneOfGetter(($oneOfFields = ["pendingKeyExchange"])),
|
|
1544
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
1545
|
+
});
|
|
1546
|
+
Object.defineProperty(SessionStructure.prototype, "_pendingPreKey", {
|
|
1547
|
+
get: $util.oneOfGetter(($oneOfFields = ["pendingPreKey"])),
|
|
1548
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
1549
|
+
});
|
|
1550
|
+
Object.defineProperty(SessionStructure.prototype, "_remoteRegistrationId", {
|
|
1551
|
+
get: $util.oneOfGetter(($oneOfFields = ["remoteRegistrationId"])),
|
|
1552
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
1553
|
+
});
|
|
1554
|
+
Object.defineProperty(SessionStructure.prototype, "_localRegistrationId", {
|
|
1555
|
+
get: $util.oneOfGetter(($oneOfFields = ["localRegistrationId"])),
|
|
1556
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
1557
|
+
});
|
|
1558
|
+
Object.defineProperty(SessionStructure.prototype, "_needsRefresh", {
|
|
1559
|
+
get: $util.oneOfGetter(($oneOfFields = ["needsRefresh"])),
|
|
1560
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
1561
|
+
});
|
|
1562
|
+
Object.defineProperty(SessionStructure.prototype, "_aliceBaseKey", {
|
|
1563
|
+
get: $util.oneOfGetter(($oneOfFields = ["aliceBaseKey"])),
|
|
1564
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
1565
|
+
});
|
|
1566
|
+
SessionStructure.create = function create(properties) {
|
|
1567
|
+
return new SessionStructure(properties);
|
|
1568
|
+
};
|
|
1569
|
+
SessionStructure.encode = function encode(message, writer) {
|
|
1570
|
+
if (!writer) writer = $Writer.create();
|
|
1571
|
+
if (
|
|
1572
|
+
message.sessionVersion != null &&
|
|
1573
|
+
Object.hasOwnProperty.call(message, "sessionVersion")
|
|
1574
|
+
)
|
|
1575
|
+
writer.uint32(8).uint32(message.sessionVersion);
|
|
1576
|
+
if (
|
|
1577
|
+
message.localIdentityPublic != null &&
|
|
1578
|
+
Object.hasOwnProperty.call(message, "localIdentityPublic")
|
|
1579
|
+
)
|
|
1580
|
+
writer.uint32(18).bytes(message.localIdentityPublic);
|
|
1581
|
+
if (
|
|
1582
|
+
message.remoteIdentityPublic != null &&
|
|
1583
|
+
Object.hasOwnProperty.call(message, "remoteIdentityPublic")
|
|
1584
|
+
)
|
|
1585
|
+
writer.uint32(26).bytes(message.remoteIdentityPublic);
|
|
1586
|
+
if (message.rootKey != null && Object.hasOwnProperty.call(message, "rootKey"))
|
|
1587
|
+
writer.uint32(34).bytes(message.rootKey);
|
|
1588
|
+
if (
|
|
1589
|
+
message.previousCounter != null &&
|
|
1590
|
+
Object.hasOwnProperty.call(message, "previousCounter")
|
|
1591
|
+
)
|
|
1592
|
+
writer.uint32(40).uint32(message.previousCounter);
|
|
1593
|
+
if (message.senderChain != null && Object.hasOwnProperty.call(message, "senderChain"))
|
|
1594
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.encode(
|
|
1595
|
+
message.senderChain,
|
|
1596
|
+
writer.uint32(50).fork()
|
|
1597
|
+
).ldelim();
|
|
1598
|
+
if (message.receiverChains != null && message.receiverChains.length)
|
|
1599
|
+
for (var i = 0; i < message.receiverChains.length; ++i)
|
|
1600
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.encode(
|
|
1601
|
+
message.receiverChains[i],
|
|
1602
|
+
writer.uint32(58).fork()
|
|
1603
|
+
).ldelim();
|
|
1604
|
+
if (
|
|
1605
|
+
message.pendingKeyExchange != null &&
|
|
1606
|
+
Object.hasOwnProperty.call(message, "pendingKeyExchange")
|
|
1607
|
+
)
|
|
1608
|
+
$root.SignalLocalStorageProtocol.SessionStructure.PendingKeyExchange.encode(
|
|
1609
|
+
message.pendingKeyExchange,
|
|
1610
|
+
writer.uint32(66).fork()
|
|
1611
|
+
).ldelim();
|
|
1612
|
+
if (
|
|
1613
|
+
message.pendingPreKey != null &&
|
|
1614
|
+
Object.hasOwnProperty.call(message, "pendingPreKey")
|
|
1615
|
+
)
|
|
1616
|
+
$root.SignalLocalStorageProtocol.SessionStructure.PendingPreKey.encode(
|
|
1617
|
+
message.pendingPreKey,
|
|
1618
|
+
writer.uint32(74).fork()
|
|
1619
|
+
).ldelim();
|
|
1620
|
+
if (
|
|
1621
|
+
message.remoteRegistrationId != null &&
|
|
1622
|
+
Object.hasOwnProperty.call(message, "remoteRegistrationId")
|
|
1623
|
+
)
|
|
1624
|
+
writer.uint32(80).uint32(message.remoteRegistrationId);
|
|
1625
|
+
if (
|
|
1626
|
+
message.localRegistrationId != null &&
|
|
1627
|
+
Object.hasOwnProperty.call(message, "localRegistrationId")
|
|
1628
|
+
)
|
|
1629
|
+
writer.uint32(88).uint32(message.localRegistrationId);
|
|
1630
|
+
if (message.needsRefresh != null && Object.hasOwnProperty.call(message, "needsRefresh"))
|
|
1631
|
+
writer.uint32(96).bool(message.needsRefresh);
|
|
1632
|
+
if (message.aliceBaseKey != null && Object.hasOwnProperty.call(message, "aliceBaseKey"))
|
|
1633
|
+
writer.uint32(106).bytes(message.aliceBaseKey);
|
|
1634
|
+
return writer;
|
|
1635
|
+
};
|
|
1636
|
+
SessionStructure.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1637
|
+
return this.encode(message, writer).ldelim();
|
|
1638
|
+
};
|
|
1639
|
+
SessionStructure.decode = function decode(reader, length, error) {
|
|
1640
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
1641
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
1642
|
+
message = new $root.SignalLocalStorageProtocol.SessionStructure();
|
|
1643
|
+
while (reader.pos < end) {
|
|
1644
|
+
var tag = reader.uint32();
|
|
1645
|
+
if (tag === error) break;
|
|
1646
|
+
switch (tag >>> 3) {
|
|
1647
|
+
case 1: {
|
|
1648
|
+
message.sessionVersion = reader.uint32();
|
|
1649
|
+
break;
|
|
1650
|
+
}
|
|
1651
|
+
case 2: {
|
|
1652
|
+
message.localIdentityPublic = reader.bytes();
|
|
1653
|
+
break;
|
|
1654
|
+
}
|
|
1655
|
+
case 3: {
|
|
1656
|
+
message.remoteIdentityPublic = reader.bytes();
|
|
1657
|
+
break;
|
|
1658
|
+
}
|
|
1659
|
+
case 4: {
|
|
1660
|
+
message.rootKey = reader.bytes();
|
|
1661
|
+
break;
|
|
1662
|
+
}
|
|
1663
|
+
case 5: {
|
|
1664
|
+
message.previousCounter = reader.uint32();
|
|
1665
|
+
break;
|
|
1666
|
+
}
|
|
1667
|
+
case 6: {
|
|
1668
|
+
message.senderChain =
|
|
1669
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.decode(
|
|
1670
|
+
reader,
|
|
1671
|
+
reader.uint32()
|
|
1672
|
+
);
|
|
1673
|
+
break;
|
|
1674
|
+
}
|
|
1675
|
+
case 7: {
|
|
1676
|
+
if (!(message.receiverChains && message.receiverChains.length))
|
|
1677
|
+
message.receiverChains = [];
|
|
1678
|
+
message.receiverChains.push(
|
|
1679
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.decode(
|
|
1680
|
+
reader,
|
|
1681
|
+
reader.uint32()
|
|
1682
|
+
)
|
|
1683
|
+
);
|
|
1684
|
+
break;
|
|
1685
|
+
}
|
|
1686
|
+
case 8: {
|
|
1687
|
+
message.pendingKeyExchange =
|
|
1688
|
+
$root.SignalLocalStorageProtocol.SessionStructure.PendingKeyExchange.decode(
|
|
1689
|
+
reader,
|
|
1690
|
+
reader.uint32()
|
|
1691
|
+
);
|
|
1692
|
+
break;
|
|
1693
|
+
}
|
|
1694
|
+
case 9: {
|
|
1695
|
+
message.pendingPreKey =
|
|
1696
|
+
$root.SignalLocalStorageProtocol.SessionStructure.PendingPreKey.decode(
|
|
1697
|
+
reader,
|
|
1698
|
+
reader.uint32()
|
|
1699
|
+
);
|
|
1700
|
+
break;
|
|
1701
|
+
}
|
|
1702
|
+
case 10: {
|
|
1703
|
+
message.remoteRegistrationId = reader.uint32();
|
|
1704
|
+
break;
|
|
1705
|
+
}
|
|
1706
|
+
case 11: {
|
|
1707
|
+
message.localRegistrationId = reader.uint32();
|
|
1708
|
+
break;
|
|
1709
|
+
}
|
|
1710
|
+
case 12: {
|
|
1711
|
+
message.needsRefresh = reader.bool();
|
|
1712
|
+
break;
|
|
1713
|
+
}
|
|
1714
|
+
case 13: {
|
|
1715
|
+
message.aliceBaseKey = reader.bytes();
|
|
1716
|
+
break;
|
|
1717
|
+
}
|
|
1718
|
+
default:
|
|
1719
|
+
reader.skipType(tag & 7);
|
|
1720
|
+
break;
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
return message;
|
|
1724
|
+
};
|
|
1725
|
+
SessionStructure.decodeDelimited = function decodeDelimited(reader) {
|
|
1726
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
1727
|
+
return this.decode(reader, reader.uint32());
|
|
1728
|
+
};
|
|
1729
|
+
SessionStructure.verify = function verify(message) {
|
|
1730
|
+
if (typeof message !== "object" || message === null) return "object expected";
|
|
1731
|
+
var properties = {};
|
|
1732
|
+
if (message.sessionVersion != null && message.hasOwnProperty("sessionVersion")) {
|
|
1733
|
+
properties._sessionVersion = 1;
|
|
1734
|
+
if (!$util.isInteger(message.sessionVersion))
|
|
1735
|
+
return "sessionVersion: integer expected";
|
|
1736
|
+
}
|
|
1737
|
+
if (
|
|
1738
|
+
message.localIdentityPublic != null &&
|
|
1739
|
+
message.hasOwnProperty("localIdentityPublic")
|
|
1740
|
+
) {
|
|
1741
|
+
properties._localIdentityPublic = 1;
|
|
1742
|
+
if (
|
|
1743
|
+
!(
|
|
1744
|
+
(message.localIdentityPublic &&
|
|
1745
|
+
typeof message.localIdentityPublic.length === "number") ||
|
|
1746
|
+
$util.isString(message.localIdentityPublic)
|
|
1747
|
+
)
|
|
1748
|
+
)
|
|
1749
|
+
return "localIdentityPublic: buffer expected";
|
|
1750
|
+
}
|
|
1751
|
+
if (
|
|
1752
|
+
message.remoteIdentityPublic != null &&
|
|
1753
|
+
message.hasOwnProperty("remoteIdentityPublic")
|
|
1754
|
+
) {
|
|
1755
|
+
properties._remoteIdentityPublic = 1;
|
|
1756
|
+
if (
|
|
1757
|
+
!(
|
|
1758
|
+
(message.remoteIdentityPublic &&
|
|
1759
|
+
typeof message.remoteIdentityPublic.length === "number") ||
|
|
1760
|
+
$util.isString(message.remoteIdentityPublic)
|
|
1761
|
+
)
|
|
1762
|
+
)
|
|
1763
|
+
return "remoteIdentityPublic: buffer expected";
|
|
1764
|
+
}
|
|
1765
|
+
if (message.rootKey != null && message.hasOwnProperty("rootKey")) {
|
|
1766
|
+
properties._rootKey = 1;
|
|
1767
|
+
if (
|
|
1768
|
+
!(
|
|
1769
|
+
(message.rootKey && typeof message.rootKey.length === "number") ||
|
|
1770
|
+
$util.isString(message.rootKey)
|
|
1771
|
+
)
|
|
1772
|
+
)
|
|
1773
|
+
return "rootKey: buffer expected";
|
|
1774
|
+
}
|
|
1775
|
+
if (message.previousCounter != null && message.hasOwnProperty("previousCounter")) {
|
|
1776
|
+
properties._previousCounter = 1;
|
|
1777
|
+
if (!$util.isInteger(message.previousCounter))
|
|
1778
|
+
return "previousCounter: integer expected";
|
|
1779
|
+
}
|
|
1780
|
+
if (message.senderChain != null && message.hasOwnProperty("senderChain")) {
|
|
1781
|
+
properties._senderChain = 1;
|
|
1782
|
+
{
|
|
1783
|
+
var error = $root.SignalLocalStorageProtocol.SessionStructure.Chain.verify(
|
|
1784
|
+
message.senderChain
|
|
1785
|
+
);
|
|
1786
|
+
if (error) return "senderChain." + error;
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
if (message.receiverChains != null && message.hasOwnProperty("receiverChains")) {
|
|
1790
|
+
if (!Array.isArray(message.receiverChains)) return "receiverChains: array expected";
|
|
1791
|
+
for (var i = 0; i < message.receiverChains.length; ++i) {
|
|
1792
|
+
var error = $root.SignalLocalStorageProtocol.SessionStructure.Chain.verify(
|
|
1793
|
+
message.receiverChains[i]
|
|
1794
|
+
);
|
|
1795
|
+
if (error) return "receiverChains." + error;
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
if (
|
|
1799
|
+
message.pendingKeyExchange != null &&
|
|
1800
|
+
message.hasOwnProperty("pendingKeyExchange")
|
|
1801
|
+
) {
|
|
1802
|
+
properties._pendingKeyExchange = 1;
|
|
1803
|
+
{
|
|
1804
|
+
var error =
|
|
1805
|
+
$root.SignalLocalStorageProtocol.SessionStructure.PendingKeyExchange.verify(
|
|
1806
|
+
message.pendingKeyExchange
|
|
1807
|
+
);
|
|
1808
|
+
if (error) return "pendingKeyExchange." + error;
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
if (message.pendingPreKey != null && message.hasOwnProperty("pendingPreKey")) {
|
|
1812
|
+
properties._pendingPreKey = 1;
|
|
1813
|
+
{
|
|
1814
|
+
var error =
|
|
1815
|
+
$root.SignalLocalStorageProtocol.SessionStructure.PendingPreKey.verify(
|
|
1816
|
+
message.pendingPreKey
|
|
1817
|
+
);
|
|
1818
|
+
if (error) return "pendingPreKey." + error;
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
if (
|
|
1822
|
+
message.remoteRegistrationId != null &&
|
|
1823
|
+
message.hasOwnProperty("remoteRegistrationId")
|
|
1824
|
+
) {
|
|
1825
|
+
properties._remoteRegistrationId = 1;
|
|
1826
|
+
if (!$util.isInteger(message.remoteRegistrationId))
|
|
1827
|
+
return "remoteRegistrationId: integer expected";
|
|
1828
|
+
}
|
|
1829
|
+
if (
|
|
1830
|
+
message.localRegistrationId != null &&
|
|
1831
|
+
message.hasOwnProperty("localRegistrationId")
|
|
1832
|
+
) {
|
|
1833
|
+
properties._localRegistrationId = 1;
|
|
1834
|
+
if (!$util.isInteger(message.localRegistrationId))
|
|
1835
|
+
return "localRegistrationId: integer expected";
|
|
1836
|
+
}
|
|
1837
|
+
if (message.needsRefresh != null && message.hasOwnProperty("needsRefresh")) {
|
|
1838
|
+
properties._needsRefresh = 1;
|
|
1839
|
+
if (typeof message.needsRefresh !== "boolean")
|
|
1840
|
+
return "needsRefresh: boolean expected";
|
|
1841
|
+
}
|
|
1842
|
+
if (message.aliceBaseKey != null && message.hasOwnProperty("aliceBaseKey")) {
|
|
1843
|
+
properties._aliceBaseKey = 1;
|
|
1844
|
+
if (
|
|
1845
|
+
!(
|
|
1846
|
+
(message.aliceBaseKey && typeof message.aliceBaseKey.length === "number") ||
|
|
1847
|
+
$util.isString(message.aliceBaseKey)
|
|
1848
|
+
)
|
|
1849
|
+
)
|
|
1850
|
+
return "aliceBaseKey: buffer expected";
|
|
1851
|
+
}
|
|
1852
|
+
return null;
|
|
1853
|
+
};
|
|
1854
|
+
SessionStructure.fromObject = function fromObject(object) {
|
|
1855
|
+
if (object instanceof $root.SignalLocalStorageProtocol.SessionStructure) return object;
|
|
1856
|
+
var message = new $root.SignalLocalStorageProtocol.SessionStructure();
|
|
1857
|
+
if (object.sessionVersion != null) message.sessionVersion = object.sessionVersion >>> 0;
|
|
1858
|
+
if (object.localIdentityPublic != null)
|
|
1859
|
+
if (typeof object.localIdentityPublic === "string")
|
|
1860
|
+
$util.base64.decode(
|
|
1861
|
+
object.localIdentityPublic,
|
|
1862
|
+
(message.localIdentityPublic = $util.newBuffer(
|
|
1863
|
+
$util.base64.length(object.localIdentityPublic)
|
|
1864
|
+
)),
|
|
1865
|
+
0
|
|
1866
|
+
);
|
|
1867
|
+
else if (object.localIdentityPublic.length >= 0)
|
|
1868
|
+
message.localIdentityPublic = object.localIdentityPublic;
|
|
1869
|
+
if (object.remoteIdentityPublic != null)
|
|
1870
|
+
if (typeof object.remoteIdentityPublic === "string")
|
|
1871
|
+
$util.base64.decode(
|
|
1872
|
+
object.remoteIdentityPublic,
|
|
1873
|
+
(message.remoteIdentityPublic = $util.newBuffer(
|
|
1874
|
+
$util.base64.length(object.remoteIdentityPublic)
|
|
1875
|
+
)),
|
|
1876
|
+
0
|
|
1877
|
+
);
|
|
1878
|
+
else if (object.remoteIdentityPublic.length >= 0)
|
|
1879
|
+
message.remoteIdentityPublic = object.remoteIdentityPublic;
|
|
1880
|
+
if (object.rootKey != null)
|
|
1881
|
+
if (typeof object.rootKey === "string")
|
|
1882
|
+
$util.base64.decode(
|
|
1883
|
+
object.rootKey,
|
|
1884
|
+
(message.rootKey = $util.newBuffer($util.base64.length(object.rootKey))),
|
|
1885
|
+
0
|
|
1886
|
+
);
|
|
1887
|
+
else if (object.rootKey.length >= 0) message.rootKey = object.rootKey;
|
|
1888
|
+
if (object.previousCounter != null)
|
|
1889
|
+
message.previousCounter = object.previousCounter >>> 0;
|
|
1890
|
+
if (object.senderChain != null) {
|
|
1891
|
+
if (typeof object.senderChain !== "object")
|
|
1892
|
+
throw TypeError(
|
|
1893
|
+
".SignalLocalStorageProtocol.SessionStructure.senderChain: object expected"
|
|
1894
|
+
);
|
|
1895
|
+
message.senderChain =
|
|
1896
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.fromObject(
|
|
1897
|
+
object.senderChain
|
|
1898
|
+
);
|
|
1899
|
+
}
|
|
1900
|
+
if (object.receiverChains) {
|
|
1901
|
+
if (!Array.isArray(object.receiverChains))
|
|
1902
|
+
throw TypeError(
|
|
1903
|
+
".SignalLocalStorageProtocol.SessionStructure.receiverChains: array expected"
|
|
1904
|
+
);
|
|
1905
|
+
message.receiverChains = [];
|
|
1906
|
+
for (var i = 0; i < object.receiverChains.length; ++i) {
|
|
1907
|
+
if (typeof object.receiverChains[i] !== "object")
|
|
1908
|
+
throw TypeError(
|
|
1909
|
+
".SignalLocalStorageProtocol.SessionStructure.receiverChains: object expected"
|
|
1910
|
+
);
|
|
1911
|
+
message.receiverChains[i] =
|
|
1912
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.fromObject(
|
|
1913
|
+
object.receiverChains[i]
|
|
1914
|
+
);
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
if (object.pendingKeyExchange != null) {
|
|
1918
|
+
if (typeof object.pendingKeyExchange !== "object")
|
|
1919
|
+
throw TypeError(
|
|
1920
|
+
".SignalLocalStorageProtocol.SessionStructure.pendingKeyExchange: object expected"
|
|
1921
|
+
);
|
|
1922
|
+
message.pendingKeyExchange =
|
|
1923
|
+
$root.SignalLocalStorageProtocol.SessionStructure.PendingKeyExchange.fromObject(
|
|
1924
|
+
object.pendingKeyExchange
|
|
1925
|
+
);
|
|
1926
|
+
}
|
|
1927
|
+
if (object.pendingPreKey != null) {
|
|
1928
|
+
if (typeof object.pendingPreKey !== "object")
|
|
1929
|
+
throw TypeError(
|
|
1930
|
+
".SignalLocalStorageProtocol.SessionStructure.pendingPreKey: object expected"
|
|
1931
|
+
);
|
|
1932
|
+
message.pendingPreKey =
|
|
1933
|
+
$root.SignalLocalStorageProtocol.SessionStructure.PendingPreKey.fromObject(
|
|
1934
|
+
object.pendingPreKey
|
|
1935
|
+
);
|
|
1936
|
+
}
|
|
1937
|
+
if (object.remoteRegistrationId != null)
|
|
1938
|
+
message.remoteRegistrationId = object.remoteRegistrationId >>> 0;
|
|
1939
|
+
if (object.localRegistrationId != null)
|
|
1940
|
+
message.localRegistrationId = object.localRegistrationId >>> 0;
|
|
1941
|
+
if (object.needsRefresh != null) message.needsRefresh = Boolean(object.needsRefresh);
|
|
1942
|
+
if (object.aliceBaseKey != null)
|
|
1943
|
+
if (typeof object.aliceBaseKey === "string")
|
|
1944
|
+
$util.base64.decode(
|
|
1945
|
+
object.aliceBaseKey,
|
|
1946
|
+
(message.aliceBaseKey = $util.newBuffer(
|
|
1947
|
+
$util.base64.length(object.aliceBaseKey)
|
|
1948
|
+
)),
|
|
1949
|
+
0
|
|
1950
|
+
);
|
|
1951
|
+
else if (object.aliceBaseKey.length >= 0)
|
|
1952
|
+
message.aliceBaseKey = object.aliceBaseKey;
|
|
1953
|
+
return message;
|
|
1954
|
+
};
|
|
1955
|
+
SessionStructure.toObject = function toObject(message, options) {
|
|
1956
|
+
if (!options) options = {};
|
|
1957
|
+
var object = {};
|
|
1958
|
+
if (options.arrays || options.defaults) object.receiverChains = [];
|
|
1959
|
+
if (message.sessionVersion != null && message.hasOwnProperty("sessionVersion")) {
|
|
1960
|
+
object.sessionVersion = message.sessionVersion;
|
|
1961
|
+
if (options.oneofs) object._sessionVersion = "sessionVersion";
|
|
1962
|
+
}
|
|
1963
|
+
if (
|
|
1964
|
+
message.localIdentityPublic != null &&
|
|
1965
|
+
message.hasOwnProperty("localIdentityPublic")
|
|
1966
|
+
) {
|
|
1967
|
+
object.localIdentityPublic =
|
|
1968
|
+
options.bytes === String
|
|
1969
|
+
? $util.base64.encode(
|
|
1970
|
+
message.localIdentityPublic,
|
|
1971
|
+
0,
|
|
1972
|
+
message.localIdentityPublic.length
|
|
1973
|
+
)
|
|
1974
|
+
: options.bytes === Array
|
|
1975
|
+
? Array.prototype.slice.call(message.localIdentityPublic)
|
|
1976
|
+
: message.localIdentityPublic;
|
|
1977
|
+
if (options.oneofs) object._localIdentityPublic = "localIdentityPublic";
|
|
1978
|
+
}
|
|
1979
|
+
if (
|
|
1980
|
+
message.remoteIdentityPublic != null &&
|
|
1981
|
+
message.hasOwnProperty("remoteIdentityPublic")
|
|
1982
|
+
) {
|
|
1983
|
+
object.remoteIdentityPublic =
|
|
1984
|
+
options.bytes === String
|
|
1985
|
+
? $util.base64.encode(
|
|
1986
|
+
message.remoteIdentityPublic,
|
|
1987
|
+
0,
|
|
1988
|
+
message.remoteIdentityPublic.length
|
|
1989
|
+
)
|
|
1990
|
+
: options.bytes === Array
|
|
1991
|
+
? Array.prototype.slice.call(message.remoteIdentityPublic)
|
|
1992
|
+
: message.remoteIdentityPublic;
|
|
1993
|
+
if (options.oneofs) object._remoteIdentityPublic = "remoteIdentityPublic";
|
|
1994
|
+
}
|
|
1995
|
+
if (message.rootKey != null && message.hasOwnProperty("rootKey")) {
|
|
1996
|
+
object.rootKey =
|
|
1997
|
+
options.bytes === String
|
|
1998
|
+
? $util.base64.encode(message.rootKey, 0, message.rootKey.length)
|
|
1999
|
+
: options.bytes === Array
|
|
2000
|
+
? Array.prototype.slice.call(message.rootKey)
|
|
2001
|
+
: message.rootKey;
|
|
2002
|
+
if (options.oneofs) object._rootKey = "rootKey";
|
|
2003
|
+
}
|
|
2004
|
+
if (message.previousCounter != null && message.hasOwnProperty("previousCounter")) {
|
|
2005
|
+
object.previousCounter = message.previousCounter;
|
|
2006
|
+
if (options.oneofs) object._previousCounter = "previousCounter";
|
|
2007
|
+
}
|
|
2008
|
+
if (message.senderChain != null && message.hasOwnProperty("senderChain")) {
|
|
2009
|
+
object.senderChain =
|
|
2010
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.toObject(
|
|
2011
|
+
message.senderChain,
|
|
2012
|
+
options
|
|
2013
|
+
);
|
|
2014
|
+
if (options.oneofs) object._senderChain = "senderChain";
|
|
2015
|
+
}
|
|
2016
|
+
if (message.receiverChains && message.receiverChains.length) {
|
|
2017
|
+
object.receiverChains = [];
|
|
2018
|
+
for (var j = 0; j < message.receiverChains.length; ++j)
|
|
2019
|
+
object.receiverChains[j] =
|
|
2020
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.toObject(
|
|
2021
|
+
message.receiverChains[j],
|
|
2022
|
+
options
|
|
2023
|
+
);
|
|
2024
|
+
}
|
|
2025
|
+
if (
|
|
2026
|
+
message.pendingKeyExchange != null &&
|
|
2027
|
+
message.hasOwnProperty("pendingKeyExchange")
|
|
2028
|
+
) {
|
|
2029
|
+
object.pendingKeyExchange =
|
|
2030
|
+
$root.SignalLocalStorageProtocol.SessionStructure.PendingKeyExchange.toObject(
|
|
2031
|
+
message.pendingKeyExchange,
|
|
2032
|
+
options
|
|
2033
|
+
);
|
|
2034
|
+
if (options.oneofs) object._pendingKeyExchange = "pendingKeyExchange";
|
|
2035
|
+
}
|
|
2036
|
+
if (message.pendingPreKey != null && message.hasOwnProperty("pendingPreKey")) {
|
|
2037
|
+
object.pendingPreKey =
|
|
2038
|
+
$root.SignalLocalStorageProtocol.SessionStructure.PendingPreKey.toObject(
|
|
2039
|
+
message.pendingPreKey,
|
|
2040
|
+
options
|
|
2041
|
+
);
|
|
2042
|
+
if (options.oneofs) object._pendingPreKey = "pendingPreKey";
|
|
2043
|
+
}
|
|
2044
|
+
if (
|
|
2045
|
+
message.remoteRegistrationId != null &&
|
|
2046
|
+
message.hasOwnProperty("remoteRegistrationId")
|
|
2047
|
+
) {
|
|
2048
|
+
object.remoteRegistrationId = message.remoteRegistrationId;
|
|
2049
|
+
if (options.oneofs) object._remoteRegistrationId = "remoteRegistrationId";
|
|
2050
|
+
}
|
|
2051
|
+
if (
|
|
2052
|
+
message.localRegistrationId != null &&
|
|
2053
|
+
message.hasOwnProperty("localRegistrationId")
|
|
2054
|
+
) {
|
|
2055
|
+
object.localRegistrationId = message.localRegistrationId;
|
|
2056
|
+
if (options.oneofs) object._localRegistrationId = "localRegistrationId";
|
|
2057
|
+
}
|
|
2058
|
+
if (message.needsRefresh != null && message.hasOwnProperty("needsRefresh")) {
|
|
2059
|
+
object.needsRefresh = message.needsRefresh;
|
|
2060
|
+
if (options.oneofs) object._needsRefresh = "needsRefresh";
|
|
2061
|
+
}
|
|
2062
|
+
if (message.aliceBaseKey != null && message.hasOwnProperty("aliceBaseKey")) {
|
|
2063
|
+
object.aliceBaseKey =
|
|
2064
|
+
options.bytes === String
|
|
2065
|
+
? $util.base64.encode(message.aliceBaseKey, 0, message.aliceBaseKey.length)
|
|
2066
|
+
: options.bytes === Array
|
|
2067
|
+
? Array.prototype.slice.call(message.aliceBaseKey)
|
|
2068
|
+
: message.aliceBaseKey;
|
|
2069
|
+
if (options.oneofs) object._aliceBaseKey = "aliceBaseKey";
|
|
2070
|
+
}
|
|
2071
|
+
return object;
|
|
2072
|
+
};
|
|
2073
|
+
SessionStructure.prototype.toJSON = function toJSON() {
|
|
2074
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
2075
|
+
};
|
|
2076
|
+
SessionStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
2077
|
+
if (typeUrlPrefix === undefined) {
|
|
2078
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
2079
|
+
}
|
|
2080
|
+
return typeUrlPrefix + "/SignalLocalStorageProtocol.SessionStructure";
|
|
2081
|
+
};
|
|
2082
|
+
SessionStructure.Chain = (function () {
|
|
2083
|
+
function Chain(properties) {
|
|
2084
|
+
this.messageKeys = [];
|
|
2085
|
+
if (properties)
|
|
2086
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2087
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
2088
|
+
}
|
|
2089
|
+
Chain.prototype.senderRatchetKey = null;
|
|
2090
|
+
Chain.prototype.senderRatchetKeyPrivate = null;
|
|
2091
|
+
Chain.prototype.chainKey = null;
|
|
2092
|
+
Chain.prototype.messageKeys = $util.emptyArray;
|
|
2093
|
+
var $oneOfFields;
|
|
2094
|
+
Object.defineProperty(Chain.prototype, "_senderRatchetKey", {
|
|
2095
|
+
get: $util.oneOfGetter(($oneOfFields = ["senderRatchetKey"])),
|
|
2096
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
2097
|
+
});
|
|
2098
|
+
Object.defineProperty(Chain.prototype, "_senderRatchetKeyPrivate", {
|
|
2099
|
+
get: $util.oneOfGetter(($oneOfFields = ["senderRatchetKeyPrivate"])),
|
|
2100
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
2101
|
+
});
|
|
2102
|
+
Object.defineProperty(Chain.prototype, "_chainKey", {
|
|
2103
|
+
get: $util.oneOfGetter(($oneOfFields = ["chainKey"])),
|
|
2104
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
2105
|
+
});
|
|
2106
|
+
Chain.create = function create(properties) {
|
|
2107
|
+
return new Chain(properties);
|
|
2108
|
+
};
|
|
2109
|
+
Chain.encode = function encode(message, writer) {
|
|
2110
|
+
if (!writer) writer = $Writer.create();
|
|
2111
|
+
if (
|
|
2112
|
+
message.senderRatchetKey != null &&
|
|
2113
|
+
Object.hasOwnProperty.call(message, "senderRatchetKey")
|
|
2114
|
+
)
|
|
2115
|
+
writer.uint32(10).bytes(message.senderRatchetKey);
|
|
2116
|
+
if (
|
|
2117
|
+
message.senderRatchetKeyPrivate != null &&
|
|
2118
|
+
Object.hasOwnProperty.call(message, "senderRatchetKeyPrivate")
|
|
2119
|
+
)
|
|
2120
|
+
writer.uint32(18).bytes(message.senderRatchetKeyPrivate);
|
|
2121
|
+
if (message.chainKey != null && Object.hasOwnProperty.call(message, "chainKey"))
|
|
2122
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.ChainKey.encode(
|
|
2123
|
+
message.chainKey,
|
|
2124
|
+
writer.uint32(26).fork()
|
|
2125
|
+
).ldelim();
|
|
2126
|
+
if (message.messageKeys != null && message.messageKeys.length)
|
|
2127
|
+
for (var i = 0; i < message.messageKeys.length; ++i)
|
|
2128
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.MessageKey.encode(
|
|
2129
|
+
message.messageKeys[i],
|
|
2130
|
+
writer.uint32(34).fork()
|
|
2131
|
+
).ldelim();
|
|
2132
|
+
return writer;
|
|
2133
|
+
};
|
|
2134
|
+
Chain.encodeDelimited = function encodeDelimited(message, writer) {
|
|
2135
|
+
return this.encode(message, writer).ldelim();
|
|
2136
|
+
};
|
|
2137
|
+
Chain.decode = function decode(reader, length, error) {
|
|
2138
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
2139
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
2140
|
+
message = new $root.SignalLocalStorageProtocol.SessionStructure.Chain();
|
|
2141
|
+
while (reader.pos < end) {
|
|
2142
|
+
var tag = reader.uint32();
|
|
2143
|
+
if (tag === error) break;
|
|
2144
|
+
switch (tag >>> 3) {
|
|
2145
|
+
case 1: {
|
|
2146
|
+
message.senderRatchetKey = reader.bytes();
|
|
2147
|
+
break;
|
|
2148
|
+
}
|
|
2149
|
+
case 2: {
|
|
2150
|
+
message.senderRatchetKeyPrivate = reader.bytes();
|
|
2151
|
+
break;
|
|
2152
|
+
}
|
|
2153
|
+
case 3: {
|
|
2154
|
+
message.chainKey =
|
|
2155
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.ChainKey.decode(
|
|
2156
|
+
reader,
|
|
2157
|
+
reader.uint32()
|
|
2158
|
+
);
|
|
2159
|
+
break;
|
|
2160
|
+
}
|
|
2161
|
+
case 4: {
|
|
2162
|
+
if (!(message.messageKeys && message.messageKeys.length))
|
|
2163
|
+
message.messageKeys = [];
|
|
2164
|
+
message.messageKeys.push(
|
|
2165
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.MessageKey.decode(
|
|
2166
|
+
reader,
|
|
2167
|
+
reader.uint32()
|
|
2168
|
+
)
|
|
2169
|
+
);
|
|
2170
|
+
break;
|
|
2171
|
+
}
|
|
2172
|
+
default:
|
|
2173
|
+
reader.skipType(tag & 7);
|
|
2174
|
+
break;
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
return message;
|
|
2178
|
+
};
|
|
2179
|
+
Chain.decodeDelimited = function decodeDelimited(reader) {
|
|
2180
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
2181
|
+
return this.decode(reader, reader.uint32());
|
|
2182
|
+
};
|
|
2183
|
+
Chain.verify = function verify(message) {
|
|
2184
|
+
if (typeof message !== "object" || message === null) return "object expected";
|
|
2185
|
+
var properties = {};
|
|
2186
|
+
if (
|
|
2187
|
+
message.senderRatchetKey != null &&
|
|
2188
|
+
message.hasOwnProperty("senderRatchetKey")
|
|
2189
|
+
) {
|
|
2190
|
+
properties._senderRatchetKey = 1;
|
|
2191
|
+
if (
|
|
2192
|
+
!(
|
|
2193
|
+
(message.senderRatchetKey &&
|
|
2194
|
+
typeof message.senderRatchetKey.length === "number") ||
|
|
2195
|
+
$util.isString(message.senderRatchetKey)
|
|
2196
|
+
)
|
|
2197
|
+
)
|
|
2198
|
+
return "senderRatchetKey: buffer expected";
|
|
2199
|
+
}
|
|
2200
|
+
if (
|
|
2201
|
+
message.senderRatchetKeyPrivate != null &&
|
|
2202
|
+
message.hasOwnProperty("senderRatchetKeyPrivate")
|
|
2203
|
+
) {
|
|
2204
|
+
properties._senderRatchetKeyPrivate = 1;
|
|
2205
|
+
if (
|
|
2206
|
+
!(
|
|
2207
|
+
(message.senderRatchetKeyPrivate &&
|
|
2208
|
+
typeof message.senderRatchetKeyPrivate.length === "number") ||
|
|
2209
|
+
$util.isString(message.senderRatchetKeyPrivate)
|
|
2210
|
+
)
|
|
2211
|
+
)
|
|
2212
|
+
return "senderRatchetKeyPrivate: buffer expected";
|
|
2213
|
+
}
|
|
2214
|
+
if (message.chainKey != null && message.hasOwnProperty("chainKey")) {
|
|
2215
|
+
properties._chainKey = 1;
|
|
2216
|
+
{
|
|
2217
|
+
var error =
|
|
2218
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.ChainKey.verify(
|
|
2219
|
+
message.chainKey
|
|
2220
|
+
);
|
|
2221
|
+
if (error) return "chainKey." + error;
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
if (message.messageKeys != null && message.hasOwnProperty("messageKeys")) {
|
|
2225
|
+
if (!Array.isArray(message.messageKeys)) return "messageKeys: array expected";
|
|
2226
|
+
for (var i = 0; i < message.messageKeys.length; ++i) {
|
|
2227
|
+
var error =
|
|
2228
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.MessageKey.verify(
|
|
2229
|
+
message.messageKeys[i]
|
|
2230
|
+
);
|
|
2231
|
+
if (error) return "messageKeys." + error;
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
return null;
|
|
2235
|
+
};
|
|
2236
|
+
Chain.fromObject = function fromObject(object) {
|
|
2237
|
+
if (object instanceof $root.SignalLocalStorageProtocol.SessionStructure.Chain)
|
|
2238
|
+
return object;
|
|
2239
|
+
var message = new $root.SignalLocalStorageProtocol.SessionStructure.Chain();
|
|
2240
|
+
if (object.senderRatchetKey != null)
|
|
2241
|
+
if (typeof object.senderRatchetKey === "string")
|
|
2242
|
+
$util.base64.decode(
|
|
2243
|
+
object.senderRatchetKey,
|
|
2244
|
+
(message.senderRatchetKey = $util.newBuffer(
|
|
2245
|
+
$util.base64.length(object.senderRatchetKey)
|
|
2246
|
+
)),
|
|
2247
|
+
0
|
|
2248
|
+
);
|
|
2249
|
+
else if (object.senderRatchetKey.length >= 0)
|
|
2250
|
+
message.senderRatchetKey = object.senderRatchetKey;
|
|
2251
|
+
if (object.senderRatchetKeyPrivate != null)
|
|
2252
|
+
if (typeof object.senderRatchetKeyPrivate === "string")
|
|
2253
|
+
$util.base64.decode(
|
|
2254
|
+
object.senderRatchetKeyPrivate,
|
|
2255
|
+
(message.senderRatchetKeyPrivate = $util.newBuffer(
|
|
2256
|
+
$util.base64.length(object.senderRatchetKeyPrivate)
|
|
2257
|
+
)),
|
|
2258
|
+
0
|
|
2259
|
+
);
|
|
2260
|
+
else if (object.senderRatchetKeyPrivate.length >= 0)
|
|
2261
|
+
message.senderRatchetKeyPrivate = object.senderRatchetKeyPrivate;
|
|
2262
|
+
if (object.chainKey != null) {
|
|
2263
|
+
if (typeof object.chainKey !== "object")
|
|
2264
|
+
throw TypeError(
|
|
2265
|
+
".SignalLocalStorageProtocol.SessionStructure.Chain.chainKey: object expected"
|
|
2266
|
+
);
|
|
2267
|
+
message.chainKey =
|
|
2268
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.ChainKey.fromObject(
|
|
2269
|
+
object.chainKey
|
|
2270
|
+
);
|
|
2271
|
+
}
|
|
2272
|
+
if (object.messageKeys) {
|
|
2273
|
+
if (!Array.isArray(object.messageKeys))
|
|
2274
|
+
throw TypeError(
|
|
2275
|
+
".SignalLocalStorageProtocol.SessionStructure.Chain.messageKeys: array expected"
|
|
2276
|
+
);
|
|
2277
|
+
message.messageKeys = [];
|
|
2278
|
+
for (var i = 0; i < object.messageKeys.length; ++i) {
|
|
2279
|
+
if (typeof object.messageKeys[i] !== "object")
|
|
2280
|
+
throw TypeError(
|
|
2281
|
+
".SignalLocalStorageProtocol.SessionStructure.Chain.messageKeys: object expected"
|
|
2282
|
+
);
|
|
2283
|
+
message.messageKeys[i] =
|
|
2284
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.MessageKey.fromObject(
|
|
2285
|
+
object.messageKeys[i]
|
|
2286
|
+
);
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
return message;
|
|
2290
|
+
};
|
|
2291
|
+
Chain.toObject = function toObject(message, options) {
|
|
2292
|
+
if (!options) options = {};
|
|
2293
|
+
var object = {};
|
|
2294
|
+
if (options.arrays || options.defaults) object.messageKeys = [];
|
|
2295
|
+
if (
|
|
2296
|
+
message.senderRatchetKey != null &&
|
|
2297
|
+
message.hasOwnProperty("senderRatchetKey")
|
|
2298
|
+
) {
|
|
2299
|
+
object.senderRatchetKey =
|
|
2300
|
+
options.bytes === String
|
|
2301
|
+
? $util.base64.encode(
|
|
2302
|
+
message.senderRatchetKey,
|
|
2303
|
+
0,
|
|
2304
|
+
message.senderRatchetKey.length
|
|
2305
|
+
)
|
|
2306
|
+
: options.bytes === Array
|
|
2307
|
+
? Array.prototype.slice.call(message.senderRatchetKey)
|
|
2308
|
+
: message.senderRatchetKey;
|
|
2309
|
+
if (options.oneofs) object._senderRatchetKey = "senderRatchetKey";
|
|
2310
|
+
}
|
|
2311
|
+
if (
|
|
2312
|
+
message.senderRatchetKeyPrivate != null &&
|
|
2313
|
+
message.hasOwnProperty("senderRatchetKeyPrivate")
|
|
2314
|
+
) {
|
|
2315
|
+
object.senderRatchetKeyPrivate =
|
|
2316
|
+
options.bytes === String
|
|
2317
|
+
? $util.base64.encode(
|
|
2318
|
+
message.senderRatchetKeyPrivate,
|
|
2319
|
+
0,
|
|
2320
|
+
message.senderRatchetKeyPrivate.length
|
|
2321
|
+
)
|
|
2322
|
+
: options.bytes === Array
|
|
2323
|
+
? Array.prototype.slice.call(message.senderRatchetKeyPrivate)
|
|
2324
|
+
: message.senderRatchetKeyPrivate;
|
|
2325
|
+
if (options.oneofs) object._senderRatchetKeyPrivate = "senderRatchetKeyPrivate";
|
|
2326
|
+
}
|
|
2327
|
+
if (message.chainKey != null && message.hasOwnProperty("chainKey")) {
|
|
2328
|
+
object.chainKey =
|
|
2329
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.ChainKey.toObject(
|
|
2330
|
+
message.chainKey,
|
|
2331
|
+
options
|
|
2332
|
+
);
|
|
2333
|
+
if (options.oneofs) object._chainKey = "chainKey";
|
|
2334
|
+
}
|
|
2335
|
+
if (message.messageKeys && message.messageKeys.length) {
|
|
2336
|
+
object.messageKeys = [];
|
|
2337
|
+
for (var j = 0; j < message.messageKeys.length; ++j)
|
|
2338
|
+
object.messageKeys[j] =
|
|
2339
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.MessageKey.toObject(
|
|
2340
|
+
message.messageKeys[j],
|
|
2341
|
+
options
|
|
2342
|
+
);
|
|
2343
|
+
}
|
|
2344
|
+
return object;
|
|
2345
|
+
};
|
|
2346
|
+
Chain.prototype.toJSON = function toJSON() {
|
|
2347
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
2348
|
+
};
|
|
2349
|
+
Chain.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
2350
|
+
if (typeUrlPrefix === undefined) {
|
|
2351
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
2352
|
+
}
|
|
2353
|
+
return typeUrlPrefix + "/SignalLocalStorageProtocol.SessionStructure.Chain";
|
|
2354
|
+
};
|
|
2355
|
+
Chain.ChainKey = (function () {
|
|
2356
|
+
function ChainKey(properties) {
|
|
2357
|
+
if (properties)
|
|
2358
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2359
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
2360
|
+
}
|
|
2361
|
+
ChainKey.prototype.index = null;
|
|
2362
|
+
ChainKey.prototype.key = null;
|
|
2363
|
+
var $oneOfFields;
|
|
2364
|
+
Object.defineProperty(ChainKey.prototype, "_index", {
|
|
2365
|
+
get: $util.oneOfGetter(($oneOfFields = ["index"])),
|
|
2366
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
2367
|
+
});
|
|
2368
|
+
Object.defineProperty(ChainKey.prototype, "_key", {
|
|
2369
|
+
get: $util.oneOfGetter(($oneOfFields = ["key"])),
|
|
2370
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
2371
|
+
});
|
|
2372
|
+
ChainKey.create = function create(properties) {
|
|
2373
|
+
return new ChainKey(properties);
|
|
2374
|
+
};
|
|
2375
|
+
ChainKey.encode = function encode(message, writer) {
|
|
2376
|
+
if (!writer) writer = $Writer.create();
|
|
2377
|
+
if (message.index != null && Object.hasOwnProperty.call(message, "index"))
|
|
2378
|
+
writer.uint32(8).uint32(message.index);
|
|
2379
|
+
if (message.key != null && Object.hasOwnProperty.call(message, "key"))
|
|
2380
|
+
writer.uint32(18).bytes(message.key);
|
|
2381
|
+
return writer;
|
|
2382
|
+
};
|
|
2383
|
+
ChainKey.encodeDelimited = function encodeDelimited(message, writer) {
|
|
2384
|
+
return this.encode(message, writer).ldelim();
|
|
2385
|
+
};
|
|
2386
|
+
ChainKey.decode = function decode(reader, length, error) {
|
|
2387
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
2388
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
2389
|
+
message =
|
|
2390
|
+
new $root.SignalLocalStorageProtocol.SessionStructure.Chain.ChainKey();
|
|
2391
|
+
while (reader.pos < end) {
|
|
2392
|
+
var tag = reader.uint32();
|
|
2393
|
+
if (tag === error) break;
|
|
2394
|
+
switch (tag >>> 3) {
|
|
2395
|
+
case 1: {
|
|
2396
|
+
message.index = reader.uint32();
|
|
2397
|
+
break;
|
|
2398
|
+
}
|
|
2399
|
+
case 2: {
|
|
2400
|
+
message.key = reader.bytes();
|
|
2401
|
+
break;
|
|
2402
|
+
}
|
|
2403
|
+
default:
|
|
2404
|
+
reader.skipType(tag & 7);
|
|
2405
|
+
break;
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
return message;
|
|
2409
|
+
};
|
|
2410
|
+
ChainKey.decodeDelimited = function decodeDelimited(reader) {
|
|
2411
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
2412
|
+
return this.decode(reader, reader.uint32());
|
|
2413
|
+
};
|
|
2414
|
+
ChainKey.verify = function verify(message) {
|
|
2415
|
+
if (typeof message !== "object" || message === null) return "object expected";
|
|
2416
|
+
var properties = {};
|
|
2417
|
+
if (message.index != null && message.hasOwnProperty("index")) {
|
|
2418
|
+
properties._index = 1;
|
|
2419
|
+
if (!$util.isInteger(message.index)) return "index: integer expected";
|
|
2420
|
+
}
|
|
2421
|
+
if (message.key != null && message.hasOwnProperty("key")) {
|
|
2422
|
+
properties._key = 1;
|
|
2423
|
+
if (
|
|
2424
|
+
!(
|
|
2425
|
+
(message.key && typeof message.key.length === "number") ||
|
|
2426
|
+
$util.isString(message.key)
|
|
2427
|
+
)
|
|
2428
|
+
)
|
|
2429
|
+
return "key: buffer expected";
|
|
2430
|
+
}
|
|
2431
|
+
return null;
|
|
2432
|
+
};
|
|
2433
|
+
ChainKey.fromObject = function fromObject(object) {
|
|
2434
|
+
if (
|
|
2435
|
+
object instanceof
|
|
2436
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.ChainKey
|
|
2437
|
+
)
|
|
2438
|
+
return object;
|
|
2439
|
+
var message =
|
|
2440
|
+
new $root.SignalLocalStorageProtocol.SessionStructure.Chain.ChainKey();
|
|
2441
|
+
if (object.index != null) message.index = object.index >>> 0;
|
|
2442
|
+
if (object.key != null)
|
|
2443
|
+
if (typeof object.key === "string")
|
|
2444
|
+
$util.base64.decode(
|
|
2445
|
+
object.key,
|
|
2446
|
+
(message.key = $util.newBuffer($util.base64.length(object.key))),
|
|
2447
|
+
0
|
|
2448
|
+
);
|
|
2449
|
+
else if (object.key.length >= 0) message.key = object.key;
|
|
2450
|
+
return message;
|
|
2451
|
+
};
|
|
2452
|
+
ChainKey.toObject = function toObject(message, options) {
|
|
2453
|
+
if (!options) options = {};
|
|
2454
|
+
var object = {};
|
|
2455
|
+
if (message.index != null && message.hasOwnProperty("index")) {
|
|
2456
|
+
object.index = message.index;
|
|
2457
|
+
if (options.oneofs) object._index = "index";
|
|
2458
|
+
}
|
|
2459
|
+
if (message.key != null && message.hasOwnProperty("key")) {
|
|
2460
|
+
object.key =
|
|
2461
|
+
options.bytes === String
|
|
2462
|
+
? $util.base64.encode(message.key, 0, message.key.length)
|
|
2463
|
+
: options.bytes === Array
|
|
2464
|
+
? Array.prototype.slice.call(message.key)
|
|
2465
|
+
: message.key;
|
|
2466
|
+
if (options.oneofs) object._key = "key";
|
|
2467
|
+
}
|
|
2468
|
+
return object;
|
|
2469
|
+
};
|
|
2470
|
+
ChainKey.prototype.toJSON = function toJSON() {
|
|
2471
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
2472
|
+
};
|
|
2473
|
+
ChainKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
2474
|
+
if (typeUrlPrefix === undefined) {
|
|
2475
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
2476
|
+
}
|
|
2477
|
+
return (
|
|
2478
|
+
typeUrlPrefix +
|
|
2479
|
+
"/SignalLocalStorageProtocol.SessionStructure.Chain.ChainKey"
|
|
2480
|
+
);
|
|
2481
|
+
};
|
|
2482
|
+
return ChainKey;
|
|
2483
|
+
})();
|
|
2484
|
+
Chain.MessageKey = (function () {
|
|
2485
|
+
function MessageKey(properties) {
|
|
2486
|
+
if (properties)
|
|
2487
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2488
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
2489
|
+
}
|
|
2490
|
+
MessageKey.prototype.index = null;
|
|
2491
|
+
MessageKey.prototype.cipherKey = null;
|
|
2492
|
+
MessageKey.prototype.macKey = null;
|
|
2493
|
+
MessageKey.prototype.iv = null;
|
|
2494
|
+
var $oneOfFields;
|
|
2495
|
+
Object.defineProperty(MessageKey.prototype, "_index", {
|
|
2496
|
+
get: $util.oneOfGetter(($oneOfFields = ["index"])),
|
|
2497
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
2498
|
+
});
|
|
2499
|
+
Object.defineProperty(MessageKey.prototype, "_cipherKey", {
|
|
2500
|
+
get: $util.oneOfGetter(($oneOfFields = ["cipherKey"])),
|
|
2501
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
2502
|
+
});
|
|
2503
|
+
Object.defineProperty(MessageKey.prototype, "_macKey", {
|
|
2504
|
+
get: $util.oneOfGetter(($oneOfFields = ["macKey"])),
|
|
2505
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
2506
|
+
});
|
|
2507
|
+
Object.defineProperty(MessageKey.prototype, "_iv", {
|
|
2508
|
+
get: $util.oneOfGetter(($oneOfFields = ["iv"])),
|
|
2509
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
2510
|
+
});
|
|
2511
|
+
MessageKey.create = function create(properties) {
|
|
2512
|
+
return new MessageKey(properties);
|
|
2513
|
+
};
|
|
2514
|
+
MessageKey.encode = function encode(message, writer) {
|
|
2515
|
+
if (!writer) writer = $Writer.create();
|
|
2516
|
+
if (message.index != null && Object.hasOwnProperty.call(message, "index"))
|
|
2517
|
+
writer.uint32(8).uint32(message.index);
|
|
2518
|
+
if (
|
|
2519
|
+
message.cipherKey != null &&
|
|
2520
|
+
Object.hasOwnProperty.call(message, "cipherKey")
|
|
2521
|
+
)
|
|
2522
|
+
writer.uint32(18).bytes(message.cipherKey);
|
|
2523
|
+
if (message.macKey != null && Object.hasOwnProperty.call(message, "macKey"))
|
|
2524
|
+
writer.uint32(26).bytes(message.macKey);
|
|
2525
|
+
if (message.iv != null && Object.hasOwnProperty.call(message, "iv"))
|
|
2526
|
+
writer.uint32(34).bytes(message.iv);
|
|
2527
|
+
return writer;
|
|
2528
|
+
};
|
|
2529
|
+
MessageKey.encodeDelimited = function encodeDelimited(message, writer) {
|
|
2530
|
+
return this.encode(message, writer).ldelim();
|
|
2531
|
+
};
|
|
2532
|
+
MessageKey.decode = function decode(reader, length, error) {
|
|
2533
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
2534
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
2535
|
+
message =
|
|
2536
|
+
new $root.SignalLocalStorageProtocol.SessionStructure.Chain.MessageKey();
|
|
2537
|
+
while (reader.pos < end) {
|
|
2538
|
+
var tag = reader.uint32();
|
|
2539
|
+
if (tag === error) break;
|
|
2540
|
+
switch (tag >>> 3) {
|
|
2541
|
+
case 1: {
|
|
2542
|
+
message.index = reader.uint32();
|
|
2543
|
+
break;
|
|
2544
|
+
}
|
|
2545
|
+
case 2: {
|
|
2546
|
+
message.cipherKey = reader.bytes();
|
|
2547
|
+
break;
|
|
2548
|
+
}
|
|
2549
|
+
case 3: {
|
|
2550
|
+
message.macKey = reader.bytes();
|
|
2551
|
+
break;
|
|
2552
|
+
}
|
|
2553
|
+
case 4: {
|
|
2554
|
+
message.iv = reader.bytes();
|
|
2555
|
+
break;
|
|
2556
|
+
}
|
|
2557
|
+
default:
|
|
2558
|
+
reader.skipType(tag & 7);
|
|
2559
|
+
break;
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
return message;
|
|
2563
|
+
};
|
|
2564
|
+
MessageKey.decodeDelimited = function decodeDelimited(reader) {
|
|
2565
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
2566
|
+
return this.decode(reader, reader.uint32());
|
|
2567
|
+
};
|
|
2568
|
+
MessageKey.verify = function verify(message) {
|
|
2569
|
+
if (typeof message !== "object" || message === null) return "object expected";
|
|
2570
|
+
var properties = {};
|
|
2571
|
+
if (message.index != null && message.hasOwnProperty("index")) {
|
|
2572
|
+
properties._index = 1;
|
|
2573
|
+
if (!$util.isInteger(message.index)) return "index: integer expected";
|
|
2574
|
+
}
|
|
2575
|
+
if (message.cipherKey != null && message.hasOwnProperty("cipherKey")) {
|
|
2576
|
+
properties._cipherKey = 1;
|
|
2577
|
+
if (
|
|
2578
|
+
!(
|
|
2579
|
+
(message.cipherKey &&
|
|
2580
|
+
typeof message.cipherKey.length === "number") ||
|
|
2581
|
+
$util.isString(message.cipherKey)
|
|
2582
|
+
)
|
|
2583
|
+
)
|
|
2584
|
+
return "cipherKey: buffer expected";
|
|
2585
|
+
}
|
|
2586
|
+
if (message.macKey != null && message.hasOwnProperty("macKey")) {
|
|
2587
|
+
properties._macKey = 1;
|
|
2588
|
+
if (
|
|
2589
|
+
!(
|
|
2590
|
+
(message.macKey && typeof message.macKey.length === "number") ||
|
|
2591
|
+
$util.isString(message.macKey)
|
|
2592
|
+
)
|
|
2593
|
+
)
|
|
2594
|
+
return "macKey: buffer expected";
|
|
2595
|
+
}
|
|
2596
|
+
if (message.iv != null && message.hasOwnProperty("iv")) {
|
|
2597
|
+
properties._iv = 1;
|
|
2598
|
+
if (
|
|
2599
|
+
!(
|
|
2600
|
+
(message.iv && typeof message.iv.length === "number") ||
|
|
2601
|
+
$util.isString(message.iv)
|
|
2602
|
+
)
|
|
2603
|
+
)
|
|
2604
|
+
return "iv: buffer expected";
|
|
2605
|
+
}
|
|
2606
|
+
return null;
|
|
2607
|
+
};
|
|
2608
|
+
MessageKey.fromObject = function fromObject(object) {
|
|
2609
|
+
if (
|
|
2610
|
+
object instanceof
|
|
2611
|
+
$root.SignalLocalStorageProtocol.SessionStructure.Chain.MessageKey
|
|
2612
|
+
)
|
|
2613
|
+
return object;
|
|
2614
|
+
var message =
|
|
2615
|
+
new $root.SignalLocalStorageProtocol.SessionStructure.Chain.MessageKey();
|
|
2616
|
+
if (object.index != null) message.index = object.index >>> 0;
|
|
2617
|
+
if (object.cipherKey != null)
|
|
2618
|
+
if (typeof object.cipherKey === "string")
|
|
2619
|
+
$util.base64.decode(
|
|
2620
|
+
object.cipherKey,
|
|
2621
|
+
(message.cipherKey = $util.newBuffer(
|
|
2622
|
+
$util.base64.length(object.cipherKey)
|
|
2623
|
+
)),
|
|
2624
|
+
0
|
|
2625
|
+
);
|
|
2626
|
+
else if (object.cipherKey.length >= 0) message.cipherKey = object.cipherKey;
|
|
2627
|
+
if (object.macKey != null)
|
|
2628
|
+
if (typeof object.macKey === "string")
|
|
2629
|
+
$util.base64.decode(
|
|
2630
|
+
object.macKey,
|
|
2631
|
+
(message.macKey = $util.newBuffer(
|
|
2632
|
+
$util.base64.length(object.macKey)
|
|
2633
|
+
)),
|
|
2634
|
+
0
|
|
2635
|
+
);
|
|
2636
|
+
else if (object.macKey.length >= 0) message.macKey = object.macKey;
|
|
2637
|
+
if (object.iv != null)
|
|
2638
|
+
if (typeof object.iv === "string")
|
|
2639
|
+
$util.base64.decode(
|
|
2640
|
+
object.iv,
|
|
2641
|
+
(message.iv = $util.newBuffer($util.base64.length(object.iv))),
|
|
2642
|
+
0
|
|
2643
|
+
);
|
|
2644
|
+
else if (object.iv.length >= 0) message.iv = object.iv;
|
|
2645
|
+
return message;
|
|
2646
|
+
};
|
|
2647
|
+
MessageKey.toObject = function toObject(message, options) {
|
|
2648
|
+
if (!options) options = {};
|
|
2649
|
+
var object = {};
|
|
2650
|
+
if (message.index != null && message.hasOwnProperty("index")) {
|
|
2651
|
+
object.index = message.index;
|
|
2652
|
+
if (options.oneofs) object._index = "index";
|
|
2653
|
+
}
|
|
2654
|
+
if (message.cipherKey != null && message.hasOwnProperty("cipherKey")) {
|
|
2655
|
+
object.cipherKey =
|
|
2656
|
+
options.bytes === String
|
|
2657
|
+
? $util.base64.encode(
|
|
2658
|
+
message.cipherKey,
|
|
2659
|
+
0,
|
|
2660
|
+
message.cipherKey.length
|
|
2661
|
+
)
|
|
2662
|
+
: options.bytes === Array
|
|
2663
|
+
? Array.prototype.slice.call(message.cipherKey)
|
|
2664
|
+
: message.cipherKey;
|
|
2665
|
+
if (options.oneofs) object._cipherKey = "cipherKey";
|
|
2666
|
+
}
|
|
2667
|
+
if (message.macKey != null && message.hasOwnProperty("macKey")) {
|
|
2668
|
+
object.macKey =
|
|
2669
|
+
options.bytes === String
|
|
2670
|
+
? $util.base64.encode(message.macKey, 0, message.macKey.length)
|
|
2671
|
+
: options.bytes === Array
|
|
2672
|
+
? Array.prototype.slice.call(message.macKey)
|
|
2673
|
+
: message.macKey;
|
|
2674
|
+
if (options.oneofs) object._macKey = "macKey";
|
|
2675
|
+
}
|
|
2676
|
+
if (message.iv != null && message.hasOwnProperty("iv")) {
|
|
2677
|
+
object.iv =
|
|
2678
|
+
options.bytes === String
|
|
2679
|
+
? $util.base64.encode(message.iv, 0, message.iv.length)
|
|
2680
|
+
: options.bytes === Array
|
|
2681
|
+
? Array.prototype.slice.call(message.iv)
|
|
2682
|
+
: message.iv;
|
|
2683
|
+
if (options.oneofs) object._iv = "iv";
|
|
2684
|
+
}
|
|
2685
|
+
return object;
|
|
2686
|
+
};
|
|
2687
|
+
MessageKey.prototype.toJSON = function toJSON() {
|
|
2688
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
2689
|
+
};
|
|
2690
|
+
MessageKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
2691
|
+
if (typeUrlPrefix === undefined) {
|
|
2692
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
2693
|
+
}
|
|
2694
|
+
return (
|
|
2695
|
+
typeUrlPrefix +
|
|
2696
|
+
"/SignalLocalStorageProtocol.SessionStructure.Chain.MessageKey"
|
|
2697
|
+
);
|
|
2698
|
+
};
|
|
2699
|
+
return MessageKey;
|
|
2700
|
+
})();
|
|
2701
|
+
return Chain;
|
|
2702
|
+
})();
|
|
2703
|
+
SessionStructure.PendingKeyExchange = (function () {
|
|
2704
|
+
function PendingKeyExchange(properties) {
|
|
2705
|
+
if (properties)
|
|
2706
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2707
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
2708
|
+
}
|
|
2709
|
+
PendingKeyExchange.prototype.sequence = null;
|
|
2710
|
+
PendingKeyExchange.prototype.localBaseKey = null;
|
|
2711
|
+
PendingKeyExchange.prototype.localBaseKeyPrivate = null;
|
|
2712
|
+
PendingKeyExchange.prototype.localRatchetKey = null;
|
|
2713
|
+
PendingKeyExchange.prototype.localRatchetKeyPrivate = null;
|
|
2714
|
+
PendingKeyExchange.prototype.localIdentityKey = null;
|
|
2715
|
+
PendingKeyExchange.prototype.localIdentityKeyPrivate = null;
|
|
2716
|
+
var $oneOfFields;
|
|
2717
|
+
Object.defineProperty(PendingKeyExchange.prototype, "_sequence", {
|
|
2718
|
+
get: $util.oneOfGetter(($oneOfFields = ["sequence"])),
|
|
2719
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
2720
|
+
});
|
|
2721
|
+
Object.defineProperty(PendingKeyExchange.prototype, "_localBaseKey", {
|
|
2722
|
+
get: $util.oneOfGetter(($oneOfFields = ["localBaseKey"])),
|
|
2723
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
2724
|
+
});
|
|
2725
|
+
Object.defineProperty(PendingKeyExchange.prototype, "_localBaseKeyPrivate", {
|
|
2726
|
+
get: $util.oneOfGetter(($oneOfFields = ["localBaseKeyPrivate"])),
|
|
2727
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
2728
|
+
});
|
|
2729
|
+
Object.defineProperty(PendingKeyExchange.prototype, "_localRatchetKey", {
|
|
2730
|
+
get: $util.oneOfGetter(($oneOfFields = ["localRatchetKey"])),
|
|
2731
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
2732
|
+
});
|
|
2733
|
+
Object.defineProperty(PendingKeyExchange.prototype, "_localRatchetKeyPrivate", {
|
|
2734
|
+
get: $util.oneOfGetter(($oneOfFields = ["localRatchetKeyPrivate"])),
|
|
2735
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
2736
|
+
});
|
|
2737
|
+
Object.defineProperty(PendingKeyExchange.prototype, "_localIdentityKey", {
|
|
2738
|
+
get: $util.oneOfGetter(($oneOfFields = ["localIdentityKey"])),
|
|
2739
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
2740
|
+
});
|
|
2741
|
+
Object.defineProperty(PendingKeyExchange.prototype, "_localIdentityKeyPrivate", {
|
|
2742
|
+
get: $util.oneOfGetter(($oneOfFields = ["localIdentityKeyPrivate"])),
|
|
2743
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
2744
|
+
});
|
|
2745
|
+
PendingKeyExchange.create = function create(properties) {
|
|
2746
|
+
return new PendingKeyExchange(properties);
|
|
2747
|
+
};
|
|
2748
|
+
PendingKeyExchange.encode = function encode(message, writer) {
|
|
2749
|
+
if (!writer) writer = $Writer.create();
|
|
2750
|
+
if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence"))
|
|
2751
|
+
writer.uint32(8).uint32(message.sequence);
|
|
2752
|
+
if (
|
|
2753
|
+
message.localBaseKey != null &&
|
|
2754
|
+
Object.hasOwnProperty.call(message, "localBaseKey")
|
|
2755
|
+
)
|
|
2756
|
+
writer.uint32(18).bytes(message.localBaseKey);
|
|
2757
|
+
if (
|
|
2758
|
+
message.localBaseKeyPrivate != null &&
|
|
2759
|
+
Object.hasOwnProperty.call(message, "localBaseKeyPrivate")
|
|
2760
|
+
)
|
|
2761
|
+
writer.uint32(26).bytes(message.localBaseKeyPrivate);
|
|
2762
|
+
if (
|
|
2763
|
+
message.localRatchetKey != null &&
|
|
2764
|
+
Object.hasOwnProperty.call(message, "localRatchetKey")
|
|
2765
|
+
)
|
|
2766
|
+
writer.uint32(34).bytes(message.localRatchetKey);
|
|
2767
|
+
if (
|
|
2768
|
+
message.localRatchetKeyPrivate != null &&
|
|
2769
|
+
Object.hasOwnProperty.call(message, "localRatchetKeyPrivate")
|
|
2770
|
+
)
|
|
2771
|
+
writer.uint32(42).bytes(message.localRatchetKeyPrivate);
|
|
2772
|
+
if (
|
|
2773
|
+
message.localIdentityKey != null &&
|
|
2774
|
+
Object.hasOwnProperty.call(message, "localIdentityKey")
|
|
2775
|
+
)
|
|
2776
|
+
writer.uint32(58).bytes(message.localIdentityKey);
|
|
2777
|
+
if (
|
|
2778
|
+
message.localIdentityKeyPrivate != null &&
|
|
2779
|
+
Object.hasOwnProperty.call(message, "localIdentityKeyPrivate")
|
|
2780
|
+
)
|
|
2781
|
+
writer.uint32(66).bytes(message.localIdentityKeyPrivate);
|
|
2782
|
+
return writer;
|
|
2783
|
+
};
|
|
2784
|
+
PendingKeyExchange.encodeDelimited = function encodeDelimited(message, writer) {
|
|
2785
|
+
return this.encode(message, writer).ldelim();
|
|
2786
|
+
};
|
|
2787
|
+
PendingKeyExchange.decode = function decode(reader, length, error) {
|
|
2788
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
2789
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
2790
|
+
message =
|
|
2791
|
+
new $root.SignalLocalStorageProtocol.SessionStructure.PendingKeyExchange();
|
|
2792
|
+
while (reader.pos < end) {
|
|
2793
|
+
var tag = reader.uint32();
|
|
2794
|
+
if (tag === error) break;
|
|
2795
|
+
switch (tag >>> 3) {
|
|
2796
|
+
case 1: {
|
|
2797
|
+
message.sequence = reader.uint32();
|
|
2798
|
+
break;
|
|
2799
|
+
}
|
|
2800
|
+
case 2: {
|
|
2801
|
+
message.localBaseKey = reader.bytes();
|
|
2802
|
+
break;
|
|
2803
|
+
}
|
|
2804
|
+
case 3: {
|
|
2805
|
+
message.localBaseKeyPrivate = reader.bytes();
|
|
2806
|
+
break;
|
|
2807
|
+
}
|
|
2808
|
+
case 4: {
|
|
2809
|
+
message.localRatchetKey = reader.bytes();
|
|
2810
|
+
break;
|
|
2811
|
+
}
|
|
2812
|
+
case 5: {
|
|
2813
|
+
message.localRatchetKeyPrivate = reader.bytes();
|
|
2814
|
+
break;
|
|
2815
|
+
}
|
|
2816
|
+
case 7: {
|
|
2817
|
+
message.localIdentityKey = reader.bytes();
|
|
2818
|
+
break;
|
|
2819
|
+
}
|
|
2820
|
+
case 8: {
|
|
2821
|
+
message.localIdentityKeyPrivate = reader.bytes();
|
|
2822
|
+
break;
|
|
2823
|
+
}
|
|
2824
|
+
default:
|
|
2825
|
+
reader.skipType(tag & 7);
|
|
2826
|
+
break;
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2829
|
+
return message;
|
|
2830
|
+
};
|
|
2831
|
+
PendingKeyExchange.decodeDelimited = function decodeDelimited(reader) {
|
|
2832
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
2833
|
+
return this.decode(reader, reader.uint32());
|
|
2834
|
+
};
|
|
2835
|
+
PendingKeyExchange.verify = function verify(message) {
|
|
2836
|
+
if (typeof message !== "object" || message === null) return "object expected";
|
|
2837
|
+
var properties = {};
|
|
2838
|
+
if (message.sequence != null && message.hasOwnProperty("sequence")) {
|
|
2839
|
+
properties._sequence = 1;
|
|
2840
|
+
if (!$util.isInteger(message.sequence)) return "sequence: integer expected";
|
|
2841
|
+
}
|
|
2842
|
+
if (message.localBaseKey != null && message.hasOwnProperty("localBaseKey")) {
|
|
2843
|
+
properties._localBaseKey = 1;
|
|
2844
|
+
if (
|
|
2845
|
+
!(
|
|
2846
|
+
(message.localBaseKey &&
|
|
2847
|
+
typeof message.localBaseKey.length === "number") ||
|
|
2848
|
+
$util.isString(message.localBaseKey)
|
|
2849
|
+
)
|
|
2850
|
+
)
|
|
2851
|
+
return "localBaseKey: buffer expected";
|
|
2852
|
+
}
|
|
2853
|
+
if (
|
|
2854
|
+
message.localBaseKeyPrivate != null &&
|
|
2855
|
+
message.hasOwnProperty("localBaseKeyPrivate")
|
|
2856
|
+
) {
|
|
2857
|
+
properties._localBaseKeyPrivate = 1;
|
|
2858
|
+
if (
|
|
2859
|
+
!(
|
|
2860
|
+
(message.localBaseKeyPrivate &&
|
|
2861
|
+
typeof message.localBaseKeyPrivate.length === "number") ||
|
|
2862
|
+
$util.isString(message.localBaseKeyPrivate)
|
|
2863
|
+
)
|
|
2864
|
+
)
|
|
2865
|
+
return "localBaseKeyPrivate: buffer expected";
|
|
2866
|
+
}
|
|
2867
|
+
if (message.localRatchetKey != null && message.hasOwnProperty("localRatchetKey")) {
|
|
2868
|
+
properties._localRatchetKey = 1;
|
|
2869
|
+
if (
|
|
2870
|
+
!(
|
|
2871
|
+
(message.localRatchetKey &&
|
|
2872
|
+
typeof message.localRatchetKey.length === "number") ||
|
|
2873
|
+
$util.isString(message.localRatchetKey)
|
|
2874
|
+
)
|
|
2875
|
+
)
|
|
2876
|
+
return "localRatchetKey: buffer expected";
|
|
2877
|
+
}
|
|
2878
|
+
if (
|
|
2879
|
+
message.localRatchetKeyPrivate != null &&
|
|
2880
|
+
message.hasOwnProperty("localRatchetKeyPrivate")
|
|
2881
|
+
) {
|
|
2882
|
+
properties._localRatchetKeyPrivate = 1;
|
|
2883
|
+
if (
|
|
2884
|
+
!(
|
|
2885
|
+
(message.localRatchetKeyPrivate &&
|
|
2886
|
+
typeof message.localRatchetKeyPrivate.length === "number") ||
|
|
2887
|
+
$util.isString(message.localRatchetKeyPrivate)
|
|
2888
|
+
)
|
|
2889
|
+
)
|
|
2890
|
+
return "localRatchetKeyPrivate: buffer expected";
|
|
2891
|
+
}
|
|
2892
|
+
if (
|
|
2893
|
+
message.localIdentityKey != null &&
|
|
2894
|
+
message.hasOwnProperty("localIdentityKey")
|
|
2895
|
+
) {
|
|
2896
|
+
properties._localIdentityKey = 1;
|
|
2897
|
+
if (
|
|
2898
|
+
!(
|
|
2899
|
+
(message.localIdentityKey &&
|
|
2900
|
+
typeof message.localIdentityKey.length === "number") ||
|
|
2901
|
+
$util.isString(message.localIdentityKey)
|
|
2902
|
+
)
|
|
2903
|
+
)
|
|
2904
|
+
return "localIdentityKey: buffer expected";
|
|
2905
|
+
}
|
|
2906
|
+
if (
|
|
2907
|
+
message.localIdentityKeyPrivate != null &&
|
|
2908
|
+
message.hasOwnProperty("localIdentityKeyPrivate")
|
|
2909
|
+
) {
|
|
2910
|
+
properties._localIdentityKeyPrivate = 1;
|
|
2911
|
+
if (
|
|
2912
|
+
!(
|
|
2913
|
+
(message.localIdentityKeyPrivate &&
|
|
2914
|
+
typeof message.localIdentityKeyPrivate.length === "number") ||
|
|
2915
|
+
$util.isString(message.localIdentityKeyPrivate)
|
|
2916
|
+
)
|
|
2917
|
+
)
|
|
2918
|
+
return "localIdentityKeyPrivate: buffer expected";
|
|
2919
|
+
}
|
|
2920
|
+
return null;
|
|
2921
|
+
};
|
|
2922
|
+
PendingKeyExchange.fromObject = function fromObject(object) {
|
|
2923
|
+
if (
|
|
2924
|
+
object instanceof
|
|
2925
|
+
$root.SignalLocalStorageProtocol.SessionStructure.PendingKeyExchange
|
|
2926
|
+
)
|
|
2927
|
+
return object;
|
|
2928
|
+
var message =
|
|
2929
|
+
new $root.SignalLocalStorageProtocol.SessionStructure.PendingKeyExchange();
|
|
2930
|
+
if (object.sequence != null) message.sequence = object.sequence >>> 0;
|
|
2931
|
+
if (object.localBaseKey != null)
|
|
2932
|
+
if (typeof object.localBaseKey === "string")
|
|
2933
|
+
$util.base64.decode(
|
|
2934
|
+
object.localBaseKey,
|
|
2935
|
+
(message.localBaseKey = $util.newBuffer(
|
|
2936
|
+
$util.base64.length(object.localBaseKey)
|
|
2937
|
+
)),
|
|
2938
|
+
0
|
|
2939
|
+
);
|
|
2940
|
+
else if (object.localBaseKey.length >= 0)
|
|
2941
|
+
message.localBaseKey = object.localBaseKey;
|
|
2942
|
+
if (object.localBaseKeyPrivate != null)
|
|
2943
|
+
if (typeof object.localBaseKeyPrivate === "string")
|
|
2944
|
+
$util.base64.decode(
|
|
2945
|
+
object.localBaseKeyPrivate,
|
|
2946
|
+
(message.localBaseKeyPrivate = $util.newBuffer(
|
|
2947
|
+
$util.base64.length(object.localBaseKeyPrivate)
|
|
2948
|
+
)),
|
|
2949
|
+
0
|
|
2950
|
+
);
|
|
2951
|
+
else if (object.localBaseKeyPrivate.length >= 0)
|
|
2952
|
+
message.localBaseKeyPrivate = object.localBaseKeyPrivate;
|
|
2953
|
+
if (object.localRatchetKey != null)
|
|
2954
|
+
if (typeof object.localRatchetKey === "string")
|
|
2955
|
+
$util.base64.decode(
|
|
2956
|
+
object.localRatchetKey,
|
|
2957
|
+
(message.localRatchetKey = $util.newBuffer(
|
|
2958
|
+
$util.base64.length(object.localRatchetKey)
|
|
2959
|
+
)),
|
|
2960
|
+
0
|
|
2961
|
+
);
|
|
2962
|
+
else if (object.localRatchetKey.length >= 0)
|
|
2963
|
+
message.localRatchetKey = object.localRatchetKey;
|
|
2964
|
+
if (object.localRatchetKeyPrivate != null)
|
|
2965
|
+
if (typeof object.localRatchetKeyPrivate === "string")
|
|
2966
|
+
$util.base64.decode(
|
|
2967
|
+
object.localRatchetKeyPrivate,
|
|
2968
|
+
(message.localRatchetKeyPrivate = $util.newBuffer(
|
|
2969
|
+
$util.base64.length(object.localRatchetKeyPrivate)
|
|
2970
|
+
)),
|
|
2971
|
+
0
|
|
2972
|
+
);
|
|
2973
|
+
else if (object.localRatchetKeyPrivate.length >= 0)
|
|
2974
|
+
message.localRatchetKeyPrivate = object.localRatchetKeyPrivate;
|
|
2975
|
+
if (object.localIdentityKey != null)
|
|
2976
|
+
if (typeof object.localIdentityKey === "string")
|
|
2977
|
+
$util.base64.decode(
|
|
2978
|
+
object.localIdentityKey,
|
|
2979
|
+
(message.localIdentityKey = $util.newBuffer(
|
|
2980
|
+
$util.base64.length(object.localIdentityKey)
|
|
2981
|
+
)),
|
|
2982
|
+
0
|
|
2983
|
+
);
|
|
2984
|
+
else if (object.localIdentityKey.length >= 0)
|
|
2985
|
+
message.localIdentityKey = object.localIdentityKey;
|
|
2986
|
+
if (object.localIdentityKeyPrivate != null)
|
|
2987
|
+
if (typeof object.localIdentityKeyPrivate === "string")
|
|
2988
|
+
$util.base64.decode(
|
|
2989
|
+
object.localIdentityKeyPrivate,
|
|
2990
|
+
(message.localIdentityKeyPrivate = $util.newBuffer(
|
|
2991
|
+
$util.base64.length(object.localIdentityKeyPrivate)
|
|
2992
|
+
)),
|
|
2993
|
+
0
|
|
2994
|
+
);
|
|
2995
|
+
else if (object.localIdentityKeyPrivate.length >= 0)
|
|
2996
|
+
message.localIdentityKeyPrivate = object.localIdentityKeyPrivate;
|
|
2997
|
+
return message;
|
|
2998
|
+
};
|
|
2999
|
+
PendingKeyExchange.toObject = function toObject(message, options) {
|
|
3000
|
+
if (!options) options = {};
|
|
3001
|
+
var object = {};
|
|
3002
|
+
if (message.sequence != null && message.hasOwnProperty("sequence")) {
|
|
3003
|
+
object.sequence = message.sequence;
|
|
3004
|
+
if (options.oneofs) object._sequence = "sequence";
|
|
3005
|
+
}
|
|
3006
|
+
if (message.localBaseKey != null && message.hasOwnProperty("localBaseKey")) {
|
|
3007
|
+
object.localBaseKey =
|
|
3008
|
+
options.bytes === String
|
|
3009
|
+
? $util.base64.encode(
|
|
3010
|
+
message.localBaseKey,
|
|
3011
|
+
0,
|
|
3012
|
+
message.localBaseKey.length
|
|
3013
|
+
)
|
|
3014
|
+
: options.bytes === Array
|
|
3015
|
+
? Array.prototype.slice.call(message.localBaseKey)
|
|
3016
|
+
: message.localBaseKey;
|
|
3017
|
+
if (options.oneofs) object._localBaseKey = "localBaseKey";
|
|
3018
|
+
}
|
|
3019
|
+
if (
|
|
3020
|
+
message.localBaseKeyPrivate != null &&
|
|
3021
|
+
message.hasOwnProperty("localBaseKeyPrivate")
|
|
3022
|
+
) {
|
|
3023
|
+
object.localBaseKeyPrivate =
|
|
3024
|
+
options.bytes === String
|
|
3025
|
+
? $util.base64.encode(
|
|
3026
|
+
message.localBaseKeyPrivate,
|
|
3027
|
+
0,
|
|
3028
|
+
message.localBaseKeyPrivate.length
|
|
3029
|
+
)
|
|
3030
|
+
: options.bytes === Array
|
|
3031
|
+
? Array.prototype.slice.call(message.localBaseKeyPrivate)
|
|
3032
|
+
: message.localBaseKeyPrivate;
|
|
3033
|
+
if (options.oneofs) object._localBaseKeyPrivate = "localBaseKeyPrivate";
|
|
3034
|
+
}
|
|
3035
|
+
if (message.localRatchetKey != null && message.hasOwnProperty("localRatchetKey")) {
|
|
3036
|
+
object.localRatchetKey =
|
|
3037
|
+
options.bytes === String
|
|
3038
|
+
? $util.base64.encode(
|
|
3039
|
+
message.localRatchetKey,
|
|
3040
|
+
0,
|
|
3041
|
+
message.localRatchetKey.length
|
|
3042
|
+
)
|
|
3043
|
+
: options.bytes === Array
|
|
3044
|
+
? Array.prototype.slice.call(message.localRatchetKey)
|
|
3045
|
+
: message.localRatchetKey;
|
|
3046
|
+
if (options.oneofs) object._localRatchetKey = "localRatchetKey";
|
|
3047
|
+
}
|
|
3048
|
+
if (
|
|
3049
|
+
message.localRatchetKeyPrivate != null &&
|
|
3050
|
+
message.hasOwnProperty("localRatchetKeyPrivate")
|
|
3051
|
+
) {
|
|
3052
|
+
object.localRatchetKeyPrivate =
|
|
3053
|
+
options.bytes === String
|
|
3054
|
+
? $util.base64.encode(
|
|
3055
|
+
message.localRatchetKeyPrivate,
|
|
3056
|
+
0,
|
|
3057
|
+
message.localRatchetKeyPrivate.length
|
|
3058
|
+
)
|
|
3059
|
+
: options.bytes === Array
|
|
3060
|
+
? Array.prototype.slice.call(message.localRatchetKeyPrivate)
|
|
3061
|
+
: message.localRatchetKeyPrivate;
|
|
3062
|
+
if (options.oneofs) object._localRatchetKeyPrivate = "localRatchetKeyPrivate";
|
|
3063
|
+
}
|
|
3064
|
+
if (
|
|
3065
|
+
message.localIdentityKey != null &&
|
|
3066
|
+
message.hasOwnProperty("localIdentityKey")
|
|
3067
|
+
) {
|
|
3068
|
+
object.localIdentityKey =
|
|
3069
|
+
options.bytes === String
|
|
3070
|
+
? $util.base64.encode(
|
|
3071
|
+
message.localIdentityKey,
|
|
3072
|
+
0,
|
|
3073
|
+
message.localIdentityKey.length
|
|
3074
|
+
)
|
|
3075
|
+
: options.bytes === Array
|
|
3076
|
+
? Array.prototype.slice.call(message.localIdentityKey)
|
|
3077
|
+
: message.localIdentityKey;
|
|
3078
|
+
if (options.oneofs) object._localIdentityKey = "localIdentityKey";
|
|
3079
|
+
}
|
|
3080
|
+
if (
|
|
3081
|
+
message.localIdentityKeyPrivate != null &&
|
|
3082
|
+
message.hasOwnProperty("localIdentityKeyPrivate")
|
|
3083
|
+
) {
|
|
3084
|
+
object.localIdentityKeyPrivate =
|
|
3085
|
+
options.bytes === String
|
|
3086
|
+
? $util.base64.encode(
|
|
3087
|
+
message.localIdentityKeyPrivate,
|
|
3088
|
+
0,
|
|
3089
|
+
message.localIdentityKeyPrivate.length
|
|
3090
|
+
)
|
|
3091
|
+
: options.bytes === Array
|
|
3092
|
+
? Array.prototype.slice.call(message.localIdentityKeyPrivate)
|
|
3093
|
+
: message.localIdentityKeyPrivate;
|
|
3094
|
+
if (options.oneofs) object._localIdentityKeyPrivate = "localIdentityKeyPrivate";
|
|
3095
|
+
}
|
|
3096
|
+
return object;
|
|
3097
|
+
};
|
|
3098
|
+
PendingKeyExchange.prototype.toJSON = function toJSON() {
|
|
3099
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
3100
|
+
};
|
|
3101
|
+
PendingKeyExchange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
3102
|
+
if (typeUrlPrefix === undefined) {
|
|
3103
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
3104
|
+
}
|
|
3105
|
+
return (
|
|
3106
|
+
typeUrlPrefix +
|
|
3107
|
+
"/SignalLocalStorageProtocol.SessionStructure.PendingKeyExchange"
|
|
3108
|
+
);
|
|
3109
|
+
};
|
|
3110
|
+
return PendingKeyExchange;
|
|
3111
|
+
})();
|
|
3112
|
+
SessionStructure.PendingPreKey = (function () {
|
|
3113
|
+
function PendingPreKey(properties) {
|
|
3114
|
+
if (properties)
|
|
3115
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
3116
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
3117
|
+
}
|
|
3118
|
+
PendingPreKey.prototype.preKeyId = null;
|
|
3119
|
+
PendingPreKey.prototype.signedPreKeyId = null;
|
|
3120
|
+
PendingPreKey.prototype.baseKey = null;
|
|
3121
|
+
var $oneOfFields;
|
|
3122
|
+
Object.defineProperty(PendingPreKey.prototype, "_preKeyId", {
|
|
3123
|
+
get: $util.oneOfGetter(($oneOfFields = ["preKeyId"])),
|
|
3124
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
3125
|
+
});
|
|
3126
|
+
Object.defineProperty(PendingPreKey.prototype, "_signedPreKeyId", {
|
|
3127
|
+
get: $util.oneOfGetter(($oneOfFields = ["signedPreKeyId"])),
|
|
3128
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
3129
|
+
});
|
|
3130
|
+
Object.defineProperty(PendingPreKey.prototype, "_baseKey", {
|
|
3131
|
+
get: $util.oneOfGetter(($oneOfFields = ["baseKey"])),
|
|
3132
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
3133
|
+
});
|
|
3134
|
+
PendingPreKey.create = function create(properties) {
|
|
3135
|
+
return new PendingPreKey(properties);
|
|
3136
|
+
};
|
|
3137
|
+
PendingPreKey.encode = function encode(message, writer) {
|
|
3138
|
+
if (!writer) writer = $Writer.create();
|
|
3139
|
+
if (message.preKeyId != null && Object.hasOwnProperty.call(message, "preKeyId"))
|
|
3140
|
+
writer.uint32(8).uint32(message.preKeyId);
|
|
3141
|
+
if (message.baseKey != null && Object.hasOwnProperty.call(message, "baseKey"))
|
|
3142
|
+
writer.uint32(18).bytes(message.baseKey);
|
|
3143
|
+
if (
|
|
3144
|
+
message.signedPreKeyId != null &&
|
|
3145
|
+
Object.hasOwnProperty.call(message, "signedPreKeyId")
|
|
3146
|
+
)
|
|
3147
|
+
writer.uint32(24).int32(message.signedPreKeyId);
|
|
3148
|
+
return writer;
|
|
3149
|
+
};
|
|
3150
|
+
PendingPreKey.encodeDelimited = function encodeDelimited(message, writer) {
|
|
3151
|
+
return this.encode(message, writer).ldelim();
|
|
3152
|
+
};
|
|
3153
|
+
PendingPreKey.decode = function decode(reader, length, error) {
|
|
3154
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
3155
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
3156
|
+
message = new $root.SignalLocalStorageProtocol.SessionStructure.PendingPreKey();
|
|
3157
|
+
while (reader.pos < end) {
|
|
3158
|
+
var tag = reader.uint32();
|
|
3159
|
+
if (tag === error) break;
|
|
3160
|
+
switch (tag >>> 3) {
|
|
3161
|
+
case 1: {
|
|
3162
|
+
message.preKeyId = reader.uint32();
|
|
3163
|
+
break;
|
|
3164
|
+
}
|
|
3165
|
+
case 3: {
|
|
3166
|
+
message.signedPreKeyId = reader.int32();
|
|
3167
|
+
break;
|
|
3168
|
+
}
|
|
3169
|
+
case 2: {
|
|
3170
|
+
message.baseKey = reader.bytes();
|
|
3171
|
+
break;
|
|
3172
|
+
}
|
|
3173
|
+
default:
|
|
3174
|
+
reader.skipType(tag & 7);
|
|
3175
|
+
break;
|
|
3176
|
+
}
|
|
3177
|
+
}
|
|
3178
|
+
return message;
|
|
3179
|
+
};
|
|
3180
|
+
PendingPreKey.decodeDelimited = function decodeDelimited(reader) {
|
|
3181
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
3182
|
+
return this.decode(reader, reader.uint32());
|
|
3183
|
+
};
|
|
3184
|
+
PendingPreKey.verify = function verify(message) {
|
|
3185
|
+
if (typeof message !== "object" || message === null) return "object expected";
|
|
3186
|
+
var properties = {};
|
|
3187
|
+
if (message.preKeyId != null && message.hasOwnProperty("preKeyId")) {
|
|
3188
|
+
properties._preKeyId = 1;
|
|
3189
|
+
if (!$util.isInteger(message.preKeyId)) return "preKeyId: integer expected";
|
|
3190
|
+
}
|
|
3191
|
+
if (message.signedPreKeyId != null && message.hasOwnProperty("signedPreKeyId")) {
|
|
3192
|
+
properties._signedPreKeyId = 1;
|
|
3193
|
+
if (!$util.isInteger(message.signedPreKeyId))
|
|
3194
|
+
return "signedPreKeyId: integer expected";
|
|
3195
|
+
}
|
|
3196
|
+
if (message.baseKey != null && message.hasOwnProperty("baseKey")) {
|
|
3197
|
+
properties._baseKey = 1;
|
|
3198
|
+
if (
|
|
3199
|
+
!(
|
|
3200
|
+
(message.baseKey && typeof message.baseKey.length === "number") ||
|
|
3201
|
+
$util.isString(message.baseKey)
|
|
3202
|
+
)
|
|
3203
|
+
)
|
|
3204
|
+
return "baseKey: buffer expected";
|
|
3205
|
+
}
|
|
3206
|
+
return null;
|
|
3207
|
+
};
|
|
3208
|
+
PendingPreKey.fromObject = function fromObject(object) {
|
|
3209
|
+
if (
|
|
3210
|
+
object instanceof
|
|
3211
|
+
$root.SignalLocalStorageProtocol.SessionStructure.PendingPreKey
|
|
3212
|
+
)
|
|
3213
|
+
return object;
|
|
3214
|
+
var message = new $root.SignalLocalStorageProtocol.SessionStructure.PendingPreKey();
|
|
3215
|
+
if (object.preKeyId != null) message.preKeyId = object.preKeyId >>> 0;
|
|
3216
|
+
if (object.signedPreKeyId != null)
|
|
3217
|
+
message.signedPreKeyId = object.signedPreKeyId | 0;
|
|
3218
|
+
if (object.baseKey != null)
|
|
3219
|
+
if (typeof object.baseKey === "string")
|
|
3220
|
+
$util.base64.decode(
|
|
3221
|
+
object.baseKey,
|
|
3222
|
+
(message.baseKey = $util.newBuffer(
|
|
3223
|
+
$util.base64.length(object.baseKey)
|
|
3224
|
+
)),
|
|
3225
|
+
0
|
|
3226
|
+
);
|
|
3227
|
+
else if (object.baseKey.length >= 0) message.baseKey = object.baseKey;
|
|
3228
|
+
return message;
|
|
3229
|
+
};
|
|
3230
|
+
PendingPreKey.toObject = function toObject(message, options) {
|
|
3231
|
+
if (!options) options = {};
|
|
3232
|
+
var object = {};
|
|
3233
|
+
if (message.preKeyId != null && message.hasOwnProperty("preKeyId")) {
|
|
3234
|
+
object.preKeyId = message.preKeyId;
|
|
3235
|
+
if (options.oneofs) object._preKeyId = "preKeyId";
|
|
3236
|
+
}
|
|
3237
|
+
if (message.baseKey != null && message.hasOwnProperty("baseKey")) {
|
|
3238
|
+
object.baseKey =
|
|
3239
|
+
options.bytes === String
|
|
3240
|
+
? $util.base64.encode(message.baseKey, 0, message.baseKey.length)
|
|
3241
|
+
: options.bytes === Array
|
|
3242
|
+
? Array.prototype.slice.call(message.baseKey)
|
|
3243
|
+
: message.baseKey;
|
|
3244
|
+
if (options.oneofs) object._baseKey = "baseKey";
|
|
3245
|
+
}
|
|
3246
|
+
if (message.signedPreKeyId != null && message.hasOwnProperty("signedPreKeyId")) {
|
|
3247
|
+
object.signedPreKeyId = message.signedPreKeyId;
|
|
3248
|
+
if (options.oneofs) object._signedPreKeyId = "signedPreKeyId";
|
|
3249
|
+
}
|
|
3250
|
+
return object;
|
|
3251
|
+
};
|
|
3252
|
+
PendingPreKey.prototype.toJSON = function toJSON() {
|
|
3253
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
3254
|
+
};
|
|
3255
|
+
PendingPreKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
3256
|
+
if (typeUrlPrefix === undefined) {
|
|
3257
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
3258
|
+
}
|
|
3259
|
+
return typeUrlPrefix + "/SignalLocalStorageProtocol.SessionStructure.PendingPreKey";
|
|
3260
|
+
};
|
|
3261
|
+
return PendingPreKey;
|
|
3262
|
+
})();
|
|
3263
|
+
return SessionStructure;
|
|
3264
|
+
})();
|
|
3265
|
+
return SignalLocalStorageProtocol;
|
|
3266
|
+
})();
|
|
3267
|
+
module.exports = $root;
|