Comments (5)
Okay, item 2 and 3 are quite obvious: 2 is the clientToken
sent to you in the initial "Conn" response and 3 is the serverToken
in the same message. Not sure how to derive item 4 yet...
I also looked at the two cookies ".web.whatsapp.com" stores: "ref" and "tok", but I can't spot any similarities between the known ones and their values...
from whatsapp-web-reveng.
Thanks, it seems item 4 is the clientId
(you can take a look at the "init" command and notice that the same base64-encoded value is used there). I get back when confirm it. We could update the protocol description then.
from whatsapp-web-reveng.
I'm not so sure about that being the actual clientId
.
When you look at the original app***.js
source file and set a breakpoint at requestSync
, it's hit after a page reload:
As you can see, item 2 and 3 really are client and server tokens.
Item 4 though is derived differently, as the id
function is called:
This function looks at the local storage of WhatsApp Web (check it out by clicking at the "Application" tab and then "Local Storage" on the left pane), for the value of the key "WABrowserId". I can confirm that this is the actual value of item 4.
As also observable in the source code, if the browser ID does not yet exist, just 16 random bytes are generated, base64-encoded and set as the new browser ID. Of course, this ID obviously just exists for tracking purposes (or does it?). Thus it would be nice to know wheather it's a problem when the browser ID is regenerated for every session takeover...
By the way, I just discovered the local storage contents myself. They seem really interesting and should be examined further...
from whatsapp-web-reveng.
Sorry for the delay.
clientId
and WABrowserId
are different names of the same thing, I just used a term from your description: Generate your own clientId, which needs to be 16 base64-encoded bytes (i.e. 25 characters). This application just uses 16 random bytes, i.e. base64.b64encode(os.urandom(16)) in Python.
I can confirm that a reconnection
process works correctly by using the following approach:
1522232358,["admin","init",{WAClientVersion},["Description1","Description2"],"{WABrowserId}",true]
1522232359,["admin","login","{clientToken}","{serverToken}","{WABrowserId}","takeover"]
Yep, there are a lot of interesting things in the local storage to investigate.
btw, is there a way to communicate with you directly?
Thanks,
from whatsapp-web-reveng.
Ah, alright, that's good to know. I'm happy that you got it to work.
And yes, I added an email address to my GitHub account: [email protected]
from whatsapp-web-reveng.
Related Issues (20)
- Error installing dependencies HOT 7
- Multi-Device beta WebSocket is only binary with encryption
- Get a group of users HOT 1
- Is it possible that answering audio call and video call? HOT 2
- It is possible create new chat? HOT 2
- Error QR Generate via docker HOT 1
- How can ı get user presence with no contact HOT 1
- Whatapp monitoring
- some question about HISTORY_SYNC_NOTIFICATION
- hi,some one known how to use this kind data?repay for it!
- wa.web
- Invalid QR code
- update for python3 and run with 0.0.0.0
- lo que ha hecho y hace
- 'cmd': {version: '2.2126.11', type: 'upgrade_md_prod'} HOT 1
- error when requesting to generate qr code HOT 2
- Cod
- I also have a new version,And update in real-time HOT 2
- Is this repo alive? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from whatsapp-web-reveng.