whalibmob 5.33.20 → 5.33.21
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/Attestation.js +25 -2
- package/lib/Registration.js +1 -1
- package/package.json +1 -1
package/lib/Attestation.js
CHANGED
|
@@ -55,6 +55,27 @@ const GS_SERVER_KEY = Buffer.from(
|
|
|
55
55
|
// Base stat codes for the 13 path checks; +1000 when stat() fails.
|
|
56
56
|
const GS_BASE_CODES = [10, 11, 0, 100, 101, 102, 103, 104, 1, 105, 106, 107, 108];
|
|
57
57
|
|
|
58
|
+
// ─── _ge: environment security flags ─────────────────────────────────────────
|
|
59
|
+
// sb=false (no security bypass), sv=false (not security-verified by TEE).
|
|
60
|
+
// Always false on a headless client — matching a device that passed basic
|
|
61
|
+
// checks but has no hardware-backed verification.
|
|
62
|
+
function generateGeToken() {
|
|
63
|
+
return encodeURIComponent('{"sb":false,"sv":false}');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// ─── _ga: app analytics envelope ─────────────────────────────────────────────
|
|
67
|
+
// bi = SHA-512 of the session nonce (deterministic per session, unique per
|
|
68
|
+
// device); ap/ai/ae are numeric constants observed across Android builds;
|
|
69
|
+
// mp/mu are multi-profile/multi-user booleans (false on a single-user install).
|
|
70
|
+
function generateGaToken(nonceB64) {
|
|
71
|
+
const nonceBuf = Buffer.from(
|
|
72
|
+
(nonceB64 || '').replace(/-/g, '+').replace(/_/g, '/'), 'base64'
|
|
73
|
+
);
|
|
74
|
+
const bi = crypto.createHash('sha512').update(nonceBuf).digest('base64');
|
|
75
|
+
const json = '{"bi":"' + bi + '","ap":247444,"ai":145847,"mp":false,"ae":128383,"mu":false}';
|
|
76
|
+
return encodeURIComponent(json);
|
|
77
|
+
}
|
|
78
|
+
|
|
58
79
|
function generateGsToken() {
|
|
59
80
|
const nowMs = Date.now();
|
|
60
81
|
const sec = Math.floor(nowMs / 1000);
|
|
@@ -246,14 +267,16 @@ async function attestationFields(device, nonceB64, opts) {
|
|
|
246
267
|
if (device && device.os === 'android') {
|
|
247
268
|
const a = await androidIntegrity(nonceB64 || '', device);
|
|
248
269
|
const gs = generateGsToken();
|
|
270
|
+
const ge = generateGeToken();
|
|
271
|
+
const ga = generateGaToken(nonceB64 || '');
|
|
249
272
|
_ok('_gs field generated (WASafe envelope, ' + gs.length + ' encoded chars)');
|
|
250
273
|
return [
|
|
251
274
|
'gpia', orNull(a.gpia),
|
|
252
275
|
'_gg', orNull(a.gg),
|
|
253
276
|
'_gi', orNull(a.gi),
|
|
254
277
|
'_gp', orNull(a.gp),
|
|
255
|
-
'_ge',
|
|
256
|
-
'_ga',
|
|
278
|
+
'_ge', ge,
|
|
279
|
+
'_ga', ga,
|
|
257
280
|
'_gs', gs,
|
|
258
281
|
'push_token', pushToken
|
|
259
282
|
];
|
package/lib/Registration.js
CHANGED
|
@@ -1389,7 +1389,7 @@ function getRequestVerificationCodeParameters(store, method, meta, device, attem
|
|
|
1389
1389
|
'reason', '',
|
|
1390
1390
|
'mcc', meta.mcc,
|
|
1391
1391
|
'mnc', meta.mnc,
|
|
1392
|
-
'feo2_query_status', '
|
|
1392
|
+
'feo2_query_status', 'success_get_client_capabilities',
|
|
1393
1393
|
'db', '1',
|
|
1394
1394
|
'sim_type', '1',
|
|
1395
1395
|
'recaptcha', '%7B%22stage%22%3A%22ABPROP_DISABLED%22%7D',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "whalibmob",
|
|
3
|
-
"version": "5.33.
|
|
3
|
+
"version": "5.33.21",
|
|
4
4
|
"description": "Node.js library for WhatsApp — register a number over SMS, or link as a companion by QR. Signal E2E encryption, media, groups, channels.",
|
|
5
5
|
"author": "Kunboruto20",
|
|
6
6
|
"main": "index.js",
|