whalibmob 5.21.0 → 5.21.1
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/README.md +17 -1
- package/lib/Client.js +11 -1
- package/lib/constants.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -132,6 +132,8 @@ npm install -g whalibmob
|
|
|
132
132
|
- [Client Options](#client-options)
|
|
133
133
|
- [Linking to an Existing Account (Pairing Code or QR)](#linking-to-an-existing-account-pairing-code-or-qr)
|
|
134
134
|
- [Requesting a Pairing Code](#requesting-a-pairing-code)
|
|
135
|
+
- [Linking by QR Code](#linking-by-qr-code)
|
|
136
|
+
- [After the Link — Same for Both Paths](#after-the-link--same-for-both-paths)
|
|
135
137
|
- [Reconnecting a Linked Session](#reconnecting-a-linked-session)
|
|
136
138
|
- [Choosing Your Own Code](#choosing-your-own-code)
|
|
137
139
|
- [Options](#options)
|
|
@@ -153,13 +155,20 @@ npm install -g whalibmob
|
|
|
153
155
|
- [The Number WhatsApp Files Your Account Under](#the-number-whatsapp-files-your-account-under)
|
|
154
156
|
- [When Registration Is Refused for Consent](#when-registration-is-refused-for-consent)
|
|
155
157
|
- [The Push Token](#the-push-token)
|
|
158
|
+
- [Receiving the Code over Push](#receiving-the-code-over-push-without-typing-it)
|
|
156
159
|
- [Routing Traffic Through a Proxy](#routing-traffic-through-a-proxy)
|
|
160
|
+
- [What Goes Through It](#what-goes-through-it)
|
|
157
161
|
- [Saving & Restoring Sessions](#saving--restoring-sessions)
|
|
162
|
+
- [Keeping the Announced Version Current](#keeping-the-announced-version-current)
|
|
163
|
+
- [One-time Pre-keys](#one-time-pre-keys)
|
|
164
|
+
- [Where the Folder Comes From](#where-the-folder-comes-from)
|
|
165
|
+
- [Working Out the Paths Yourself](#working-out-the-paths-yourself)
|
|
158
166
|
- [Signal Store Utilities](#signal-store-utilities)
|
|
159
167
|
- [makeCacheableSignalKeyStore](#makecacheablesignalkeystore)
|
|
160
168
|
- [addTransactionCapability](#addtransactioncapability)
|
|
161
169
|
- [assertMeId](#assertmeid)
|
|
162
170
|
- [initAuthCreds](#initauthcreds)
|
|
171
|
+
- [Recommended Stacking Pattern](#recommended-stacking-pattern)
|
|
163
172
|
- [Handling Events](#handling-events)
|
|
164
173
|
- [Example to Start](#example-to-start)
|
|
165
174
|
- [All Events](#all-events)
|
|
@@ -248,11 +257,13 @@ npm install -g whalibmob
|
|
|
248
257
|
- [Query Metadata](#query-metadata)
|
|
249
258
|
- [Get Request Join List](#get-request-join-list)
|
|
250
259
|
- [Approve / Reject Request Join](#approve--reject-request-join)
|
|
251
|
-
- [Personal Invitations](#personal-invitations)
|
|
260
|
+
- [Personal Invitations](#personal-invitations-1)
|
|
252
261
|
- [Toggle Ephemeral in Group](#toggle-ephemeral-in-group)
|
|
253
262
|
- [WhatsApp IDs](#whatsapp-ids)
|
|
254
263
|
- [Transport](#transport)
|
|
255
264
|
- [Media Encryption](#media-encryption)
|
|
265
|
+
- [Sending (Upload Flow)](#sending-upload-flow)
|
|
266
|
+
- [Receiving (Download + Decrypt Flow)](#receiving-download--decrypt-flow)
|
|
256
267
|
- [Device Emulation](#device-emulation)
|
|
257
268
|
- [Quick Start](#device-quick-start)
|
|
258
269
|
- [iOS Profiles](#ios-profiles)
|
|
@@ -261,6 +272,7 @@ npm install -g whalibmob
|
|
|
261
272
|
- [Version & Token Overrides](#version--token-overrides)
|
|
262
273
|
- [When the server answers 405 on connect](#when-the-server-answers-405-on-connect)
|
|
263
274
|
- [Finding out what a 405 objects to](#finding-out-what-a-405-objects-to)
|
|
275
|
+
- [License](#license)
|
|
264
276
|
|
|
265
277
|
---
|
|
266
278
|
|
|
@@ -1616,6 +1628,10 @@ wa> /quit
|
|
|
1616
1628
|
|
|
1617
1629
|
## Library API
|
|
1618
1630
|
|
|
1631
|
+
Everything the CLI does is available as a Node.js library. The sections below
|
|
1632
|
+
cover connecting an account, sending and receiving every message type, groups,
|
|
1633
|
+
communities, channels, presence, privacy, history sync, and device emulation.
|
|
1634
|
+
|
|
1619
1635
|
## Connecting Account
|
|
1620
1636
|
|
|
1621
1637
|
### Register a New Number
|
package/lib/Client.js
CHANGED
|
@@ -576,8 +576,18 @@ class WhalibmobClient extends EventEmitter {
|
|
|
576
576
|
try {
|
|
577
577
|
const { compareVersions } = require('./Registration');
|
|
578
578
|
const before = this._store.version;
|
|
579
|
+
// On Android, ask the way registration does — fetchWaVersion(), which
|
|
580
|
+
// reads the version straight off the APK material when there is any. That
|
|
581
|
+
// material is the exact build the token was computed from and the only
|
|
582
|
+
// Android source that is actually reliable: the Play Store listing no
|
|
583
|
+
// longer exposes a version to scrape, so fetchAndroidVersion() on its own
|
|
584
|
+
// usually just hands back the pinned fallback and a session can never
|
|
585
|
+
// climb past it. With the material preferred, refreshing it (e.g.
|
|
586
|
+
// `wa apk-material --download`) is picked up on the next connect and
|
|
587
|
+
// written through to <number>.json. fetchWaVersion falls through to the
|
|
588
|
+
// Play Store lookup, and then the fallback, only when no material exists.
|
|
579
589
|
const live = android
|
|
580
|
-
? await
|
|
590
|
+
? await fetchWaVersion(device)
|
|
581
591
|
: await fetchIosVersion(business);
|
|
582
592
|
if (!live) return;
|
|
583
593
|
|
package/lib/constants.js
CHANGED
|
@@ -48,7 +48,7 @@ const IOS_BUSINESS_STATIC_TOKEN = 'USUDuDYDeQhY4RF2fCSp5m3F6kJ1M2J8wS7bbNA2';
|
|
|
48
48
|
// reason nothing in the error names. Keep them within a few releases of what
|
|
49
49
|
// the stores are actually serving; the live lookup is what normally decides.
|
|
50
50
|
const IOS_VERSION_FALLBACK = '2.26.9.75';
|
|
51
|
-
const ANDROID_VERSION_FALLBACK = '2.26.
|
|
51
|
+
const ANDROID_VERSION_FALLBACK = '2.26.30.84';
|
|
52
52
|
|
|
53
53
|
// Safari UA for the iTunes lookup only.
|
|
54
54
|
const IOS_USER_AGENT = 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4.1 Mobile/15E148 Safari/604.1';
|