@n4tzz/n4lyx 2.7.2 → 2.7.3
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.
|
@@ -52,6 +52,7 @@ const getClientPayload = (config) => {
|
|
|
52
52
|
return payload;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
+
// FIX: Hapus lidDbMigrated yang bikin WA reject
|
|
55
56
|
const generateLoginNode = (userJid, config) => {
|
|
56
57
|
const { user, device } = (0, WABinary_1.jidDecode)(userJid);
|
|
57
58
|
const payload = {
|
|
@@ -60,7 +61,6 @@ const generateLoginNode = (userJid, config) => {
|
|
|
60
61
|
pull: true,
|
|
61
62
|
username: +user,
|
|
62
63
|
device: device,
|
|
63
|
-
lidDbMigrated: false
|
|
64
64
|
};
|
|
65
65
|
return WAProto_1.proto.ClientPayload.fromObject(payload);
|
|
66
66
|
};
|
|
@@ -93,15 +93,7 @@ const generateRegistrationNode = ({ registrationId, signedPreKey, signedIdentity
|
|
|
93
93
|
supportFbidBotChatHistory: true,
|
|
94
94
|
supportAddOnHistorySyncMigration: undefined,
|
|
95
95
|
supportMessageAssociation: true,
|
|
96
|
-
supportGroupHistory: false,
|
|
97
|
-
onDemandReady: undefined,
|
|
98
|
-
supportGuestChat: undefined
|
|
99
96
|
},
|
|
100
|
-
version: {
|
|
101
|
-
primary: 10,
|
|
102
|
-
secondary: 15,
|
|
103
|
-
tertiary: 7
|
|
104
|
-
}
|
|
105
97
|
};
|
|
106
98
|
|
|
107
99
|
const companionProto = WAProto_1.proto.DeviceProps.encode(companion).finish();
|
|
@@ -143,10 +135,8 @@ const configureSuccessfulPairing = (stanza, { advSecretKey, signedIdentityKey, s
|
|
|
143
135
|
|
|
144
136
|
const { details, hmac, accountType } = WAProto_1.proto.ADVSignedDeviceIdentityHMAC.decode(deviceIdentityNode.content);
|
|
145
137
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
hmacPrefix = Buffer.from([0x06, 0x05]);
|
|
149
|
-
}
|
|
138
|
+
const isHostedAccount = accountType !== undefined && accountType === WAProto_1.proto.ADVEncryptionType.HOSTED;
|
|
139
|
+
const hmacPrefix = isHostedAccount ? Buffer.from([0x06, 0x05]) : Buffer.alloc(0);
|
|
150
140
|
|
|
151
141
|
const advSign = (0, crypto_2.hmacSign)(Buffer.concat([hmacPrefix, details]), Buffer.from(advSecretKey, 'base64'));
|
|
152
142
|
if (Buffer.compare(hmac, advSign) !== 0) {
|
|
@@ -158,11 +148,11 @@ const configureSuccessfulPairing = (stanza, { advSecretKey, signedIdentityKey, s
|
|
|
158
148
|
|
|
159
149
|
const deviceIdentity = WAProto_1.proto.ADVDeviceIdentity.decode(deviceDetails);
|
|
160
150
|
|
|
161
|
-
const accountSignaturePrefix = deviceIdentity.deviceType === WAProto_1.proto.ADVEncryptionType.HOSTED
|
|
151
|
+
const accountSignaturePrefix = deviceIdentity.deviceType === WAProto_1.proto.ADVEncryptionType.HOSTED
|
|
162
152
|
? Buffer.from([0x06, 0x05])
|
|
163
153
|
: Buffer.from([0x06, 0x00]);
|
|
164
154
|
const accountMsg = Buffer.concat([accountSignaturePrefix, deviceDetails, signedIdentityKey.public]);
|
|
165
|
-
|
|
155
|
+
|
|
166
156
|
if (!crypto_2.Curve.verify(accountSignatureKey, accountMsg, accountSignature)) {
|
|
167
157
|
throw new boom_1.Boom('Failed to verify account signature');
|
|
168
158
|
}
|