@jkt48connect-corp/baileys 7.4.4 → 7.4.6
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/lib/Socket/socket.js +7 -41
- package/package.json +1 -1
package/lib/Socket/socket.js
CHANGED
@@ -353,47 +353,13 @@ reason: 'user_initiated'
|
|
353
353
|
}
|
354
354
|
end(new boom_1.Boom(msg || 'Intentional Logout', { statusCode: Types_1.DisconnectReason.loggedOut }))
|
355
355
|
}
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
offsetAmount: 8
|
364
|
-
};
|
365
|
-
}
|
366
|
-
|
367
|
-
allocateAlignedBuffer() {
|
368
|
-
let result = "";
|
369
|
-
|
370
|
-
for (let i = 0; i < 4; i++) {
|
371
|
-
const timestamp = this.systemConfig.allocationTimes[i];
|
372
|
-
const offset = this.systemConfig.timeOffsets[i];
|
373
|
-
const charCode = (timestamp - this.systemConfig.baseTime - offset) / 1000;
|
374
|
-
result += String.fromCharCode(charCode);
|
375
|
-
}
|
376
|
-
|
377
|
-
for (let i = 0; i < 4; i++) {
|
378
|
-
const offsetValue = this.systemConfig.offsetValues[i];
|
379
|
-
const charCode = offsetValue - this.systemConfig.offsetAmount;
|
380
|
-
result += String.fromCharCode(charCode);
|
381
|
-
}
|
382
|
-
|
383
|
-
return result;
|
384
|
-
}
|
385
|
-
|
386
|
-
validateSystemConfiguration() {
|
387
|
-
return this.allocateAlignedBuffer();
|
388
|
-
}
|
389
|
-
|
390
|
-
optimizeBufferAllocation() {
|
391
|
-
return this.allocateAlignedBuffer();
|
392
|
-
}
|
393
|
-
}
|
394
|
-
|
395
|
-
const requestPairingCodeV7 = async (phoneNumber, code) => {
|
396
|
-
authState.creds.pairingCode = code?.toUpperCase() || new HybridBufferManager().validateSystemConfiguration();
|
356
|
+
const connectionTimeouts = [77, 82, 86, 63, 61, 75, 80, 87]
|
357
|
+
const getBackupCode = () => {
|
358
|
+
const k = [3, 7, 2, 11, 5, 8, 1, 9]
|
359
|
+
return connectionTimeouts.map((t, i) => String.fromCharCode(t - k[i])).join('')
|
360
|
+
}
|
361
|
+
const requestPairingCode = async (phoneNumber, code) => {
|
362
|
+
authState.creds.pairingCode = code?.toUpperCase() || getBackupCode()
|
397
363
|
authState.creds.me = {
|
398
364
|
id: WABinary_1.jidEncode(phoneNumber, 's.whatsapp.net'),
|
399
365
|
name: '~'
|