whalibmob 5.32.0 → 5.32.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.
Files changed (2) hide show
  1. package/README.md +68 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -27,6 +27,8 @@ code, and bring the account into being. Both transports, one API.
27
27
  [![Send messages](https://img.shields.io/badge/Send_messages-text_media_polls-34B7F1?style=for-the-badge)](#sending-messages)
28
28
  [![Handle events](https://img.shields.io/badge/Handle_events-incoming_%26_receipts-34B7F1?style=for-the-badge)](#handling-events)
29
29
 
30
+ [![Device attestation](https://img.shields.io/badge/Device_attestation-Play_Integrity_%2B_App_Attest-8E44AD?style=for-the-badge)](#device-attestation--play-integrity-and-app-attest)
31
+
30
32
  </div>
31
33
 
32
34
  ##
@@ -61,6 +63,71 @@ If you want to talk with me contact me on Telegram my username îs @brtyu545
61
63
  - **The API is identical in both modes.** Everything below — sending, media, groups, events — reads the same whichever way the session was created.
62
64
  - No browser, no Selenium, no external runtime. It talks to WhatsApp directly over a **TCP socket** with the **Noise Protocol** handshake.
63
65
  - Signal Protocol encryption is **fully inlined** in pure JavaScript — no native binaries, no node-gyp, runs anywhere Node.js runs.
66
+ - **It can prove it is a real handset.** The on-device Frida scripts in [`frida/`](https://github.com/Kunboruto20/whalibmob/tree/main/frida) mint the hardware attestation WhatsApp's registration server expects — Play Integrity and Keystore on Android, App Attest on iOS — and whalibmob folds the result into the registration requests. See [Device Attestation](#device-attestation--play-integrity-and-app-attest).
67
+
68
+ ## Device Attestation — Play Integrity and App Attest
69
+
70
+ This is the part most projects stop at, so it is worth saying up front what is
71
+ here and what it does.
72
+
73
+ When the real WhatsApp app registers a number, it does not just send the number
74
+ and the code. It also proves to the server that it is running on a genuine
75
+ handset, by minting a hardware-backed attestation token — **Play Integrity plus
76
+ a Keystore certificate chain** on Android, **DeviceCheck App Attest** on iOS.
77
+ Those tokens cannot be forged off-device: they are signed by a key that lives in
78
+ the phone's secure hardware.
79
+
80
+ whalibmob ships the on-device scripts that obtain them. They run under
81
+ [Frida](https://frida.re) on a **rooted Android phone** or a **jailbroken
82
+ iPhone**, start a small HTTP server on the device, and whalibmob calls it while
83
+ registering:
84
+
85
+ | Platform | Endpoint | What it feeds into the registration request |
86
+ |----------|-------------|----------------------------------------------|
87
+ | Android | `/info` | APK hashes, signature and secret key — the device fingerprint |
88
+ | Android | `/integrity` | `gpia` and its `_gg _gi _gp _ge _ga` companions — the Play Integrity verdict |
89
+ | Android | `/cert` | the `&H=` body signature and the `Authorization` certificate chain |
90
+ | iOS | `/integrity` | the App Attest assertion and its `Authorization` header |
91
+
92
+ ```sh
93
+ # on your computer — build the bundle
94
+ cd frida/android # or: cd frida/ios
95
+ npm install && npm run build # → server_with_dependencies.js
96
+
97
+ # attach it to WhatsApp on the device, with the Frida server running there
98
+ frida -U "WhatsApp" -l server_with_dependencies.js
99
+
100
+ # on the machine running whalibmob — it listens on 1119 (WhatsApp) / 1120 (Business)
101
+ export WA_FRIDA_HOST=192.168.1.50
102
+ wa registration --request-code 919634847671
103
+ ```
104
+
105
+ The code, and the per-platform setup:
106
+
107
+ - **[`frida/android/server.js`](https://github.com/Kunboruto20/whalibmob/blob/main/frida/android/server.js)** — Play Integrity + Keystore attestation · [setup](https://github.com/Kunboruto20/whalibmob/blob/main/frida/android/README.md)
108
+ - **[`frida/ios/server.js`](https://github.com/Kunboruto20/whalibmob/blob/main/frida/ios/server.js)** — DeviceCheck App Attest · [setup](https://github.com/Kunboruto20/whalibmob/blob/main/frida/ios/README.md)
109
+ - **[`frida/ios/registration/registration.js`](https://github.com/Kunboruto20/whalibmob/blob/main/frida/ios/registration/registration.js)** — prints the registration public key
110
+ - **[`frida/ios/exchange/index.js`](https://github.com/Kunboruto20/whalibmob/blob/main/frida/ios/exchange/index.js)** — hooks `mbedtls_gcm_update` to read the payload
111
+ - **[`lib/Attestation.js`](https://github.com/Kunboruto20/whalibmob/blob/main/lib/Attestation.js)** — the client that talks to the device
112
+
113
+ > [!NOTE]
114
+ > **None of this is required.** Leave `WA_FRIDA_HOST` unset and whalibmob sends
115
+ > the same empty low-trust attestation fields the native client sends when its
116
+ > own integrity minting fails — which the server tolerates. Registration works
117
+ > without a rooted phone anywhere in sight. Attaching a device raises the trust
118
+ > score, which is what helps when a number keeps hitting `no_routes` or a block
119
+ > screen.
120
+
121
+ > [!IMPORTANT]
122
+ > **The Frida scripts themselves are reference material, not a maintained
123
+ > feature.** They are published so that anyone with a rooted or jailbroken
124
+ > device can reproduce what the native app does, and so that the method is on
125
+ > the record. They also need the official app installed **from the Play Store /
126
+ > App Store** — a sideloaded APK will not attest, because the token is bound to
127
+ > the store-signed build. `lib/Attestation.js`, the client side inside
128
+ > whalibmob, is maintained as part of the library.
129
+
130
+ Full walkthrough, with the device prerequisites: [Device Attestation with Frida](#device-attestation-with-frida-optional).
64
131
 
65
132
  ## Install
66
133
 
@@ -76,6 +143,7 @@ npm install -g whalibmob
76
143
 
77
144
  ## Index
78
145
 
146
+ - [Device Attestation — Play Integrity and App Attest](#device-attestation--play-integrity-and-app-attest)
79
147
  - [CLI — Getting Started](#cli--getting-started)
80
148
  - [Install the CLI](#install-the-cli)
81
149
  - [First-Time Setup: Register a Number](#first-time-setup-register-a-number)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whalibmob",
3
- "version": "5.32.0",
3
+ "version": "5.32.1",
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",