whalibmob 5.40.39 → 5.40.41
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/docs/registration.md +7 -4
- package/lib/PlayStore.js +35 -8
- package/lib/noise.js +4 -0
- package/lib/proto.js +7 -1
- package/package.json +1 -1
package/docs/registration.md
CHANGED
|
@@ -236,7 +236,7 @@ signed it, and carries on to the code request — one command, no APK to find:
|
|
|
236
236
|
```
|
|
237
237
|
no Android token material yet — fetching the WhatsApp APK from Google Play
|
|
238
238
|
version 2.26.30.3 (code 263000302)
|
|
239
|
-
downloading base.apk and
|
|
239
|
+
downloading base.apk and 2 splits (of 24 the server offered): config.xxxhdpi, config.arm64_v8a
|
|
240
240
|
token material written to /home/you/.waSession/android-apk-material.json
|
|
241
241
|
requesting sms code for +919634847671...
|
|
242
242
|
status sent
|
|
@@ -357,13 +357,16 @@ adb pull /data/app/~~xyz==/com.whatsapp-abc==/split_config.xxhdpi.apk
|
|
|
357
357
|
```
|
|
358
358
|
|
|
359
359
|
Recent releases ship as an App Bundle, so `about_logo.png` often lives in a
|
|
360
|
-
density split rather than in `base.apk
|
|
361
|
-
|
|
360
|
+
density split rather than in `base.apk`, and `libwhatsapp.so` — the file the
|
|
361
|
+
login `integrity_payload`'s `_lh` hashes — lives in the architecture split. Pull
|
|
362
|
+
the `split_config.*dpi.apk` density file and the `split_config.arm64_v8a.apk`
|
|
363
|
+
architecture file too, and pass them along. Without the architecture split `_lh`
|
|
364
|
+
falls back to a pinned value; `--download` fetches it for you.
|
|
362
365
|
|
|
363
366
|
**Read the material out of it:**
|
|
364
367
|
|
|
365
368
|
```sh
|
|
366
|
-
wa apk-material base.apk split_config.xxhdpi.apk
|
|
369
|
+
wa apk-material base.apk split_config.xxhdpi.apk split_config.arm64_v8a.apk
|
|
367
370
|
```
|
|
368
371
|
|
|
369
372
|
```
|
package/lib/PlayStore.js
CHANGED
|
@@ -366,15 +366,34 @@ async function _download(url, cookies) {
|
|
|
366
366
|
return res.body;
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
+
// The ABI splits, in the order the material prefers them. libwhatsapp.so — the
|
|
370
|
+
// file _lh is the SHA-256 of — ships in one of these, named `config.<abi>` by
|
|
371
|
+
// Play (underscores, e.g. config.arm64_v8a). extractMaterial reads the library
|
|
372
|
+
// out of whichever split carries it, so the download only needs the one, picked
|
|
373
|
+
// by preference. Nothing else here reads an ABI split.
|
|
374
|
+
const ABI_SPLIT_PREFERENCE = ['arm64_v8a', 'armeabi_v7a', 'x86_64', 'x86'];
|
|
375
|
+
|
|
376
|
+
// The single ABI split to fetch for _lh, or null when Play offered none (the
|
|
377
|
+
// library then lives in the base APK, on an extractNativeLibs build).
|
|
378
|
+
function pickAbiSplit(splits) {
|
|
379
|
+
const bare = s => String(s.name).replace(/\.apk$/i, '').toLowerCase();
|
|
380
|
+
for (const abi of ABI_SPLIT_PREFERENCE) {
|
|
381
|
+
const hit = (splits || []).find(s => bare(s).endsWith(abi));
|
|
382
|
+
if (hit) return hit;
|
|
383
|
+
}
|
|
384
|
+
return null;
|
|
385
|
+
}
|
|
386
|
+
|
|
369
387
|
/**
|
|
370
388
|
* Download what the Android token material needs from Play.
|
|
371
389
|
*
|
|
372
390
|
* Returns { packageName, versionCode, versionName, base, splits: [{name,data}] }
|
|
373
391
|
* with the APK bytes in hand.
|
|
374
392
|
*
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
*
|
|
393
|
+
* The density splits are fetched for the token's key (about_logo.png lives in
|
|
394
|
+
* one of those), plus the one ABI split that carries libwhatsapp.so so the
|
|
395
|
+
* login integrity_payload's _lh is the real library hash rather than a pinned
|
|
396
|
+
* fallback. The language splits are left behind — nothing here reads them. Pass
|
|
378
397
|
* { allSplits: true } to take everything anyway.
|
|
379
398
|
*/
|
|
380
399
|
async function downloadApk(opts) {
|
|
@@ -394,16 +413,23 @@ async function downloadApk(opts) {
|
|
|
394
413
|
_whaDbg('[DBG] PLAY → delivery ' + packageName + ' vc=' + version.versionCode);
|
|
395
414
|
const delivery = await fetchDelivery(packageName, version.versionCode, headers);
|
|
396
415
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
416
|
+
let wanted;
|
|
417
|
+
if (opts.allSplits) {
|
|
418
|
+
wanted = delivery.splits;
|
|
419
|
+
} else {
|
|
420
|
+
const density = delivery.splits.filter(s => /dpi$/i.test(String(s.name).replace(/\.apk$/i, '')));
|
|
421
|
+
const abi = pickAbiSplit(delivery.splits);
|
|
422
|
+
// The ABI split goes alongside the density ones. It is not already among
|
|
423
|
+
// them (an ABI name never ends in `dpi`), so no de-duplication is needed.
|
|
424
|
+
wanted = abi ? density.concat(abi) : density;
|
|
425
|
+
}
|
|
400
426
|
|
|
401
|
-
// Which
|
|
427
|
+
// Which splits came back is worth saying out loud. Play serves the splits
|
|
402
428
|
// that suit the device profile it was asked as, not the full set a bundle
|
|
403
429
|
// holds, so the about_logo.png this yields can be a different density from
|
|
404
430
|
// the one in a complete bundle — and a different density is a different key.
|
|
405
431
|
if (opts.onProgress) {
|
|
406
|
-
opts.onProgress('downloading base.apk and ' + wanted.length + '
|
|
432
|
+
opts.onProgress('downloading base.apk and ' + wanted.length + ' split' +
|
|
407
433
|
(wanted.length === 1 ? '' : 's') +
|
|
408
434
|
' (of ' + delivery.splits.length + ' the server offered): ' +
|
|
409
435
|
(wanted.map(s => s.name).join(', ') || 'none'));
|
|
@@ -432,6 +458,7 @@ module.exports = {
|
|
|
432
458
|
fetchVersion,
|
|
433
459
|
fetchDelivery,
|
|
434
460
|
decodeFields,
|
|
461
|
+
pickAbiSplit,
|
|
435
462
|
AURORA_DISPENSER_URL,
|
|
436
463
|
PERSONAL_PACKAGE
|
|
437
464
|
};
|
package/lib/noise.js
CHANGED
|
@@ -646,6 +646,10 @@ class NoiseSocket extends EventEmitter {
|
|
|
646
646
|
dnsSource: { dnsMethod: require('./socks').socksProxyUrl() ? 7 : 0, appCached: false },
|
|
647
647
|
trafficAnonymization: 0,
|
|
648
648
|
connectionSequenceInfo: 5,
|
|
649
|
+
// paaLink (field 44) — the real 2.26.44.90 client writes this bool on
|
|
650
|
+
// every fresh phone login as false; matching it keeps the payload's
|
|
651
|
+
// field-set indistinguishable from the native client's.
|
|
652
|
+
paaLink: false,
|
|
649
653
|
userAgent: {
|
|
650
654
|
// Which client this says it is. The server checks the announced
|
|
651
655
|
// version against *this* platform, so a wrong number here comes back
|
package/lib/proto.js
CHANGED
|
@@ -69,7 +69,7 @@ function encodeDnsSource({ dnsMethod, appCached }) {
|
|
|
69
69
|
return Buffer.concat(parts);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
function encodeClientPayload({ username, passive, userAgent, pushName, sessionId, shortConnect, connectType, connectReason, dnsSource, connectAttemptCount, device, oc, lc, yearClass, memClass, trafficAnonymization, connectionSequenceInfo }) {
|
|
72
|
+
function encodeClientPayload({ username, passive, userAgent, pushName, sessionId, shortConnect, connectType, connectReason, dnsSource, connectAttemptCount, device, oc, lc, yearClass, memClass, trafficAnonymization, connectionSequenceInfo, paaLink }) {
|
|
73
73
|
const uaBuf = encodeUserAgent(userAgent);
|
|
74
74
|
const parts = [
|
|
75
75
|
field(1, VARINT, varint(username)),
|
|
@@ -90,6 +90,12 @@ function encodeClientPayload({ username, passive, userAgent, pushName, sessionId
|
|
|
90
90
|
if (memClass !== undefined) parts.push(field(37, VARINT, varint(memClass)));
|
|
91
91
|
if (trafficAnonymization !== undefined) parts.push(field(40, VARINT, varint(trafficAnonymization)));
|
|
92
92
|
if (connectionSequenceInfo !== undefined) parts.push(field(43, VARINT, varint(connectionSequenceInfo)));
|
|
93
|
+
// paaLink (field 44, bool). The live 2.26.44.90 registration capture carries
|
|
94
|
+
// it on every fresh phone login as `paaLink = 0` — the field is written by the
|
|
95
|
+
// X.1JB filler and is present (as false) even when no link exists. Omitting it
|
|
96
|
+
// left whalibmob's payload field-set distinguishable from the real client, so
|
|
97
|
+
// it now rides along, defaulting to false and overridable through the call site.
|
|
98
|
+
if (paaLink !== undefined) parts.push(field(44, VARINT, bool(paaLink)));
|
|
93
99
|
return Buffer.concat(parts);
|
|
94
100
|
}
|
|
95
101
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "whalibmob",
|
|
3
|
-
"version": "5.40.
|
|
3
|
+
"version": "5.40.41",
|
|
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",
|