Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed ''backup_token' error during registration process #3127

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gradol
Copy link

@gradol gradol commented Mar 11, 2022

No description provided.

@gradol gradol mentioned this pull request Mar 11, 2022
@binbruce
Copy link

Excuse me
Can you tell me how to get the token?
I want to replace the device information and token.
thanks you so much!

@Rodrigosolari
Copy link

this error after use ios env
E 2022-03-14 01:19:17,807 yowsup.layers.network.dispatcher.dispatcher_asyncore - Traceback (most recent call last):
File "/Users/rodrigosolari/opt/miniconda3/lib/python3.9/asyncore.py", line 83, in read
obj.handle_read_event()
File "/Users/rodrigosolari/opt/miniconda3/lib/python3.9/asyncore.py", line 420, in handle_read_event
self.handle_read()
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/network/dispatcher/dispatcher_asyncore.py", line 48, in handle_read
self.connectionCallbacks.onRecvData(data)
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/network/layer.py", line 107, in onRecvData
self.receive(data)
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/network/layer.py", line 110, in receive
self.toUpper(data)
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/init.py", line 79, in toUpper
self.__upper.receive(data)
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/noise/layer_noise_segments.py", line 39, in receive
self.toUpper(bytes(data))
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/init.py", line 79, in toUpper
self.__upper.receive(data)
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/noise/layer.py", line 181, in receive
self._flush_incoming_buffer()
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/noise/layer.py", line 169, in _flush_incoming_buffer
self.toUpper(self._wa_noiseprotocol.receive())
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/init.py", line 79, in toUpper
self.__upper.receive(data)
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/coder/layer.py", line 19, in receive
node = self.reader.getProtocolTreeNode(bytearray(data))
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/coder/decoder.py", line 20, in getProtocolTreeNode
return self.nextTreeInternal(data[1:])
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/coder/decoder.py", line 254, in nextTreeInternal
nodeChildren = self.readList(read2, data)
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/coder/decoder.py", line 274, in readList
listx.append(self.nextTreeInternal(data))
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/coder/decoder.py", line 254, in nextTreeInternal
nodeChildren = self.readList(read2, data)
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/coder/decoder.py", line 274, in readList
listx.append(self.nextTreeInternal(data))
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/coder/decoder.py", line 245, in nextTreeInternal
attribs = self.readAttributes(attribCount, data)
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/coder/decoder.py", line 178, in readAttributes
value = self.readString(self.readInt8(data), data)
File "/Users/rodrigosolari/Downloads/yowsup-master/yowsup/layers/coder/decoder.py", line 223, in readString
raise Exception("readString couldn't match token "+str(token))
Exception: readString couldn't match token 247

@gradol
Copy link
Author

gradol commented Mar 14, 2022

@Rodrigosolari what command for yowsup-cli did you use?

@binbruce
Copy link

@gradol
Probably what I need is how to generate the data in wa_build_str and enc_data
Because only then can the token be replaced
But I don't know how WABuildHash is used

I used Frida + jailbroken idevice and IDA. Here sample of code for TOKEN str generation

from binascii import unhexlify 
from binascii import hexlify
from Crypto.Cipher import AES

## Got from WaFoundation framework from function WABuildHash()
wa_build_str = "45e25b6ddecace8d01828dd00bd4ff64".encode() 
## Got data from value which used before call function WABuildHash in WhatsApp 
enc_data = unhexlify(b"6268c9cc61898358c657d1d71932ef2ee7b24109b9668c1962be7d8c1f5ec7f63e9158315f7d6350176d2425894fc6e7") 
key = "landscape".encode() + b"\x00"*7;
data = AES.new(key, AES.MODE_ECB).decrypt(enc_data)
data = data[0:0x28]
token_str = data + wa_build_str
print(token_str.decode())

Output 0a1mLfGUIBVrMKF1RdvLI5lkRBvof6vn0fD2QRSM45e25b6ddecace8d01828dd00bd4ff64

@Rodrigosolari
Copy link

@Rodrigosolari what command for yowsup-cli did you use?

i use echo command

@mrjoebudi
Copy link

Nice and Work ...!!! many thank'....URAAAA !!!

@brunoaduarte
Copy link

@Rodrigosolari what command for yowsup-cli did you use?

I got the same error here after trying to use "echo" demo.

yowsup> py yowsup-cli demos -e --config-phone xxxxxxxxxxxx --debug

D 2022-03-22 17:08:34,090 yowsup.config.manager - load(path_or_profile_name=xxxxxxxxxxxx, profile_only=False)
D 2022-03-22 17:08:34,090 yowsup.config.manager - _load_path(path=xxxxxxxxxxxx)
D 2022-03-22 17:08:34,092 yowsup.config.manager - _load_path couldn't find the path: xxxxxxxxxxxx
D 2022-03-22 17:08:34,092 yowsup.config.manager - path_or_profile_name is not a path, using it as profile name
D 2022-03-22 17:08:34,096 yowsup.config.manager - Detecting config for profile=xxxxxxxxxxxx, dir=C:\Users\Myself\AppData\Local\yowsup\yowsup\xxxxxxxxxxxx
D 2022-03-22 17:08:34,096 yowsup.config.manager - Trying C:\Users\Myself\AppData\Local\yowsup\yowsup\xxxxxxxxxxxx\config.yo
D 2022-03-22 17:08:34,096 yowsup.config.manager - Trying C:\Users\Myself\AppData\Local\yowsup\yowsup\xxxxxxxxxxxx\config.json
D 2022-03-22 17:08:34,096 yowsup.config.manager - _load_path(path=C:\Users\Myself\AppData\Local\yowsup\yowsup\xxxxxxxxxxxx\config.json)
D 2022-03-22 17:08:34,096 yowsup.config.manager - Detected config type: json
D 2022-03-22 17:08:34,096 yowsup.config.manager - Opening config for reading
D 2022-03-22 17:08:34,097 yowsup.config.manager - Loading config
D 2022-03-22 17:08:34,097 yowsup.profile.profile - Constructed Profile(profile_name=xxxxxxxxxxxx)
yowsup-cli     v3.2.1
yowsup         v3.3.0
consonance     v0.1.5
dissononce     v0.34.3
python-axolotl v0.2.2
cryptography   v36.0.2
protobuf       v4.0.0rc2


Copyright (c) 2012-2019 Tarek Galal
http://www.openwhatsapp.org

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://openwhatsapp.org/yowsup/donate


D 2022-03-22 17:08:34,268 yowsup.stacks.yowstack - Initializing stack
D 2022-03-22 17:08:34,268 yowsup.stacks.yowstack - Constructed Network Layer
D 2022-03-22 17:08:34,268 yowsup.stacks.yowstack - Constructed Noise Segments Layer
D 2022-03-22 17:08:34,268 yowsup.stacks.yowstack - Constructed Noise Layer
D 2022-03-22 17:08:34,269 yowsup.stacks.yowstack - Constructed Coder Layer
D 2022-03-22 17:08:34,269 yowsup.stacks.yowstack - Constructed Logger Layer
D 2022-03-22 17:08:34,269 yowsup.stacks.yowstack - Constructed <yowsup.layers.axolotl.layer_control.AxolotlControlLayer object at 0x000001B3008F4A90>
D 2022-03-22 17:08:34,269 yowsup.stacks.yowstack - Constructed Axolotl Layer - <yowsup.layers.axolotl.layer_receive.AxolotlReceivelayer object at 0x000001B37FC1DE10>
D 2022-03-22 17:08:34,269 yowsup.stacks.yowstack - Constructed Authentication Layer - Messages Layer - Receipt Layer - Ack Layer - Presence Layer - Ib Layer - Iq Layer - notification Ib Layer - Contact Iq Layer - Chatstate Layer - call Layer - Groups Iq Layer - Media Layer - Privacy Layer - Profiles Layer
D 2022-03-22 17:08:34,269 yowsup.stacks.yowstack - Constructed Interface Layer
D 2022-03-22 17:08:34,270 yowsup.stacks.yowstack - setProfile(YowProfile(profile_name=xxxxxxxxxxxx))
D 2022-03-22 17:08:34,270 yowsup.layers.network.layer - Created asyncore dispatcher
I 2022-03-22 17:08:34,270 yowsup.layers.network.layer - Connecting to e6.whatsapp.net:443
D 2022-03-22 17:08:34,270 yowsup.layers.network.dispatcher.dispatcher_asyncore - connect(('e6.whatsapp.net', 443))
D 2022-03-22 17:08:34,442 yowsup.layers.network.dispatcher.dispatcher_asyncore - handle_connect
D 2022-03-22 17:08:34,442 yowsup.layers.network.layer - Connected
D 2022-03-22 17:08:34,442 yowsup.axolotl.factory - get_manager(profile_name=xxxxxxxxxxxx, username=xxxxxxxxxxxx)
D 2022-03-22 17:08:34,444 yowsup.axolotl.manager - Initialized AxolotlManager [username=xxxxxxxxxxxx, db=C:\Users\Myself\AppData\Local\yowsup\yowsup\xxxxxxxxxxxx\axolotl.db]
D 2022-03-22 17:08:34,444 yowsup.axolotl.manager - level_prekeys(force=False)
D 2022-03-22 17:08:34,451 yowsup.axolotl.manager - len(pending_prekeys) = 812
D 2022-03-22 17:08:34,452 yowsup.axolotl.manager - load_unsent_prekeys
D 2022-03-22 17:08:34,452 yowsup.layers.noise.layer - Received auth event
D 2022-03-22 17:08:34,452 yowsup.env.env - Env not set, setting it to android
D 2022-03-22 17:08:34,452 yowsup.env.env - Current env changed to android
D 2022-03-22 17:08:34,452 yowsup.layers.noise.layer - Performing handshake [username= xxxxxxxxxxxx, passive=False]
D 2022-03-22 17:08:34,453 yowsup.layers.noise.layer - Starting handshake worker
D 2022-03-22 17:08:34,828 yowsup.layers.logger.layer - rx:
<success t="1647979714" props="26" location="rva" abprops="0" creation="1647979048" />
D 2022-03-22 17:08:34,829 yowsup.layers.protocol_iq.layer - starting ping thread.
D 2022-03-22 17:08:35,029 yowsup.layers.logger.layer - rx:
<ib from="s.whatsapp.net">
  <edge_routing>
    <routing_info>
      0x08080805
    </routing_info>
  </edge_routing>
</ib>
D 2022-03-22 17:08:35,029 yowsup.layers.protocol_ib.layer - ignoring edge_routing ib node for now
D 2022-03-22 17:08:35,032 yowsup.layers.logger.layer - rx:
<ib from="s.whatsapp.net">
  <dirty type="groups" timestamp="1647979714" />
</ib>
D 2022-03-22 17:08:35,032 yowsup.layers.logger.layer - rx:
<ib from="s.whatsapp.net">
  <dirty type="account_sync" timestamp="1647979714" />
</ib>
D 2022-03-22 17:08:35,032 yowsup.layers.logger.layer - rx:
<ib from="s.whatsapp.net">
  <offline count="0" />
</ib>
D 2022-03-22 17:09:25,039 yowsup.layers.protocol_iq.layer - ping queue size: 1
D 2022-03-22 17:09:25,039 yowsup.layers.logger.layer - tx:
<iq id="1" type="get" xmlns="w:p" />
D 2022-03-22 17:09:25,400 yowsup.layers.logger.layer - rx:
<iq from="[email protected]" type="result" id="1" t="1647979765" />
D 2022-03-22 17:10:14,129 yowsup.layers.logger.layer - rx:
<notification from="[email protected]" type="privacy_token" id="3345116943" t="1647979813">
  <tokens>
    <token t="1647979813" jid="[email protected]" type="trusted_contact">
      0x0101416c0821ce8d76350b37b91aa280e15432d003c0bffeb7a083ed27xxxxxxxxxxxx
    </token>
  </tokens>
</notification>
W 2022-03-22 17:10:14,130 yowsup.layers.protocol_notifications.layer - Unsupported notification type: privacy_token
D 2022-03-22 17:10:14,133 yowsup.layers.protocol_notifications.layer - Unsupported notification node: <notification from="[email protected]" type="privacy_token" id="3345116943" t="1647979813">
  <tokens>
    <token t="1647979813" jid="[email protected]" type="trusted_contact">
      0x0101416c0821ce8d76350b37b91aa280e15432d003c0bffeb7a083ed27xxxxxxxxxxxx
    </token>
  </tokens>
</notification>
D 2022-03-22 17:10:14,133 yowsup.layers.logger.layer - tx:
<ack id="3345116943" class="notification" type="privacy_token" to="[email protected]" />
E 2022-03-22 17:10:14,162 yowsup.layers.network.dispatcher.dispatcher_asyncore - Traceback (most recent call last):
  File "C:\Users\Myself\AppData\Local\Programs\Python\Python310\lib\asyncore.py", line 90, in read
    obj.handle_read_event()
  File "C:\Users\Myself\AppData\Local\Programs\Python\Python310\lib\asyncore.py", line 427, in handle_read_event
    self.handle_read()
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\network\dispatcher\dispatcher_asyncore.py", line 48, in handle_read
    self.connectionCallbacks.onRecvData(data)
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\network\layer.py", line 107, in onRecvData
    self.receive(data)
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\network\layer.py", line 110, in receive
    self.toUpper(data)
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\noise\layer_noise_segments.py", line 39, in receive
    self.toUpper(bytes(data))
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\noise\layer.py", line 188, in receive
    self._flush_incoming_buffer()
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\noise\layer.py", line 176, in _flush_incoming_buffer
    self.toUpper(self._wa_noiseprotocol.receive())
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\coder\layer.py", line 19, in receive
    node = self.reader.getProtocolTreeNode(bytearray(data))
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\coder\decoder.py", line 20, in getProtocolTreeNode
    return self.nextTreeInternal(data[1:])
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\coder\decoder.py", line 245, in nextTreeInternal
    attribs = self.readAttributes(attribCount, data)
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\coder\decoder.py", line 178, in readAttributes
    value = self.readString(self.readInt8(data), data)
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\coder\decoder.py", line 223, in readString
    raise Exception("readString couldn't match token "+str(token))
Exception: readString couldn't match token 247

D 2022-03-22 17:10:14,162 yowsup.layers.network.dispatcher.dispatcher_asyncore - handle_close
D 2022-03-22 17:10:14,162 yowsup.layers.network.layer - Disconnected
D 2022-03-22 17:10:14,163 yowsup.layers.axolotl.layer_control - Disconnected, reboot_connect? = False
D 2022-03-22 17:10:14,163 yowsup.layers.protocol_iq.layer - stopping ping thread
D 2022-03-22 17:10:14,427 yowsup.layers.protocol_iq.layer - YowPingThread-2 - ping thread stopped

Yowsdown

@Rodrigosolari
Copy link

@Rodrigosolari what command for yowsup-cli did you use?

I got the same error here after trying to use "echo" demo.

yowsup> py yowsup-cli demos -e --config-phone xxxxxxxxxxxx --debug

D 2022-03-22 17:08:34,090 yowsup.config.manager - load(path_or_profile_name=xxxxxxxxxxxx, profile_only=False)
D 2022-03-22 17:08:34,090 yowsup.config.manager - _load_path(path=xxxxxxxxxxxx)
D 2022-03-22 17:08:34,092 yowsup.config.manager - _load_path couldn't find the path: xxxxxxxxxxxx
D 2022-03-22 17:08:34,092 yowsup.config.manager - path_or_profile_name is not a path, using it as profile name
D 2022-03-22 17:08:34,096 yowsup.config.manager - Detecting config for profile=xxxxxxxxxxxx, dir=C:\Users\Myself\AppData\Local\yowsup\yowsup\xxxxxxxxxxxx
D 2022-03-22 17:08:34,096 yowsup.config.manager - Trying C:\Users\Myself\AppData\Local\yowsup\yowsup\xxxxxxxxxxxx\config.yo
D 2022-03-22 17:08:34,096 yowsup.config.manager - Trying C:\Users\Myself\AppData\Local\yowsup\yowsup\xxxxxxxxxxxx\config.json
D 2022-03-22 17:08:34,096 yowsup.config.manager - _load_path(path=C:\Users\Myself\AppData\Local\yowsup\yowsup\xxxxxxxxxxxx\config.json)
D 2022-03-22 17:08:34,096 yowsup.config.manager - Detected config type: json
D 2022-03-22 17:08:34,096 yowsup.config.manager - Opening config for reading
D 2022-03-22 17:08:34,097 yowsup.config.manager - Loading config
D 2022-03-22 17:08:34,097 yowsup.profile.profile - Constructed Profile(profile_name=xxxxxxxxxxxx)
yowsup-cli     v3.2.1
yowsup         v3.3.0
consonance     v0.1.5
dissononce     v0.34.3
python-axolotl v0.2.2
cryptography   v36.0.2
protobuf       v4.0.0rc2


Copyright (c) 2012-2019 Tarek Galal
http://www.openwhatsapp.org

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://openwhatsapp.org/yowsup/donate


D 2022-03-22 17:08:34,268 yowsup.stacks.yowstack - Initializing stack
D 2022-03-22 17:08:34,268 yowsup.stacks.yowstack - Constructed Network Layer
D 2022-03-22 17:08:34,268 yowsup.stacks.yowstack - Constructed Noise Segments Layer
D 2022-03-22 17:08:34,268 yowsup.stacks.yowstack - Constructed Noise Layer
D 2022-03-22 17:08:34,269 yowsup.stacks.yowstack - Constructed Coder Layer
D 2022-03-22 17:08:34,269 yowsup.stacks.yowstack - Constructed Logger Layer
D 2022-03-22 17:08:34,269 yowsup.stacks.yowstack - Constructed <yowsup.layers.axolotl.layer_control.AxolotlControlLayer object at 0x000001B3008F4A90>
D 2022-03-22 17:08:34,269 yowsup.stacks.yowstack - Constructed Axolotl Layer - <yowsup.layers.axolotl.layer_receive.AxolotlReceivelayer object at 0x000001B37FC1DE10>
D 2022-03-22 17:08:34,269 yowsup.stacks.yowstack - Constructed Authentication Layer - Messages Layer - Receipt Layer - Ack Layer - Presence Layer - Ib Layer - Iq Layer - notification Ib Layer - Contact Iq Layer - Chatstate Layer - call Layer - Groups Iq Layer - Media Layer - Privacy Layer - Profiles Layer
D 2022-03-22 17:08:34,269 yowsup.stacks.yowstack - Constructed Interface Layer
D 2022-03-22 17:08:34,270 yowsup.stacks.yowstack - setProfile(YowProfile(profile_name=xxxxxxxxxxxx))
D 2022-03-22 17:08:34,270 yowsup.layers.network.layer - Created asyncore dispatcher
I 2022-03-22 17:08:34,270 yowsup.layers.network.layer - Connecting to e6.whatsapp.net:443
D 2022-03-22 17:08:34,270 yowsup.layers.network.dispatcher.dispatcher_asyncore - connect(('e6.whatsapp.net', 443))
D 2022-03-22 17:08:34,442 yowsup.layers.network.dispatcher.dispatcher_asyncore - handle_connect
D 2022-03-22 17:08:34,442 yowsup.layers.network.layer - Connected
D 2022-03-22 17:08:34,442 yowsup.axolotl.factory - get_manager(profile_name=xxxxxxxxxxxx, username=xxxxxxxxxxxx)
D 2022-03-22 17:08:34,444 yowsup.axolotl.manager - Initialized AxolotlManager [username=xxxxxxxxxxxx, db=C:\Users\Myself\AppData\Local\yowsup\yowsup\xxxxxxxxxxxx\axolotl.db]
D 2022-03-22 17:08:34,444 yowsup.axolotl.manager - level_prekeys(force=False)
D 2022-03-22 17:08:34,451 yowsup.axolotl.manager - len(pending_prekeys) = 812
D 2022-03-22 17:08:34,452 yowsup.axolotl.manager - load_unsent_prekeys
D 2022-03-22 17:08:34,452 yowsup.layers.noise.layer - Received auth event
D 2022-03-22 17:08:34,452 yowsup.env.env - Env not set, setting it to android
D 2022-03-22 17:08:34,452 yowsup.env.env - Current env changed to android
D 2022-03-22 17:08:34,452 yowsup.layers.noise.layer - Performing handshake [username= xxxxxxxxxxxx, passive=False]
D 2022-03-22 17:08:34,453 yowsup.layers.noise.layer - Starting handshake worker
D 2022-03-22 17:08:34,828 yowsup.layers.logger.layer - rx:
<success t="1647979714" props="26" location="rva" abprops="0" creation="1647979048" />
D 2022-03-22 17:08:34,829 yowsup.layers.protocol_iq.layer - starting ping thread.
D 2022-03-22 17:08:35,029 yowsup.layers.logger.layer - rx:
<ib from="s.whatsapp.net">
  <edge_routing>
    <routing_info>
      0x08080805
    </routing_info>
  </edge_routing>
</ib>
D 2022-03-22 17:08:35,029 yowsup.layers.protocol_ib.layer - ignoring edge_routing ib node for now
D 2022-03-22 17:08:35,032 yowsup.layers.logger.layer - rx:
<ib from="s.whatsapp.net">
  <dirty type="groups" timestamp="1647979714" />
</ib>
D 2022-03-22 17:08:35,032 yowsup.layers.logger.layer - rx:
<ib from="s.whatsapp.net">
  <dirty type="account_sync" timestamp="1647979714" />
</ib>
D 2022-03-22 17:08:35,032 yowsup.layers.logger.layer - rx:
<ib from="s.whatsapp.net">
  <offline count="0" />
</ib>
D 2022-03-22 17:09:25,039 yowsup.layers.protocol_iq.layer - ping queue size: 1
D 2022-03-22 17:09:25,039 yowsup.layers.logger.layer - tx:
<iq id="1" type="get" xmlns="w:p" />
D 2022-03-22 17:09:25,400 yowsup.layers.logger.layer - rx:
<iq from="[email protected]" type="result" id="1" t="1647979765" />
D 2022-03-22 17:10:14,129 yowsup.layers.logger.layer - rx:
<notification from="[email protected]" type="privacy_token" id="3345116943" t="1647979813">
  <tokens>
    <token t="1647979813" jid="[email protected]" type="trusted_contact">
      0x0101416c0821ce8d76350b37b91aa280e15432d003c0bffeb7a083ed27xxxxxxxxxxxx
    </token>
  </tokens>
</notification>
W 2022-03-22 17:10:14,130 yowsup.layers.protocol_notifications.layer - Unsupported notification type: privacy_token
D 2022-03-22 17:10:14,133 yowsup.layers.protocol_notifications.layer - Unsupported notification node: <notification from="[email protected]" type="privacy_token" id="3345116943" t="1647979813">
  <tokens>
    <token t="1647979813" jid="[email protected]" type="trusted_contact">
      0x0101416c0821ce8d76350b37b91aa280e15432d003c0bffeb7a083ed27xxxxxxxxxxxx
    </token>
  </tokens>
</notification>
D 2022-03-22 17:10:14,133 yowsup.layers.logger.layer - tx:
<ack id="3345116943" class="notification" type="privacy_token" to="[email protected]" />
E 2022-03-22 17:10:14,162 yowsup.layers.network.dispatcher.dispatcher_asyncore - Traceback (most recent call last):
  File "C:\Users\Myself\AppData\Local\Programs\Python\Python310\lib\asyncore.py", line 90, in read
    obj.handle_read_event()
  File "C:\Users\Myself\AppData\Local\Programs\Python\Python310\lib\asyncore.py", line 427, in handle_read_event
    self.handle_read()
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\network\dispatcher\dispatcher_asyncore.py", line 48, in handle_read
    self.connectionCallbacks.onRecvData(data)
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\network\layer.py", line 107, in onRecvData
    self.receive(data)
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\network\layer.py", line 110, in receive
    self.toUpper(data)
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\noise\layer_noise_segments.py", line 39, in receive
    self.toUpper(bytes(data))
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\noise\layer.py", line 188, in receive
    self._flush_incoming_buffer()
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\noise\layer.py", line 176, in _flush_incoming_buffer
    self.toUpper(self._wa_noiseprotocol.receive())
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\__init__.py", line 79, in toUpper
    self.__upper.receive(data)
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\coder\layer.py", line 19, in receive
    node = self.reader.getProtocolTreeNode(bytearray(data))
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\coder\decoder.py", line 20, in getProtocolTreeNode
    return self.nextTreeInternal(data[1:])
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\coder\decoder.py", line 245, in nextTreeInternal
    attribs = self.readAttributes(attribCount, data)
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\coder\decoder.py", line 178, in readAttributes
    value = self.readString(self.readInt8(data), data)
  File "E:\whatsappinvestigation\yowsup\yowsup\layers\coder\decoder.py", line 223, in readString
    raise Exception("readString couldn't match token "+str(token))
Exception: readString couldn't match token 247

D 2022-03-22 17:10:14,162 yowsup.layers.network.dispatcher.dispatcher_asyncore - handle_close
D 2022-03-22 17:10:14,162 yowsup.layers.network.layer - Disconnected
D 2022-03-22 17:10:14,163 yowsup.layers.axolotl.layer_control - Disconnected, reboot_connect? = False
D 2022-03-22 17:10:14,163 yowsup.layers.protocol_iq.layer - stopping ping thread
D 2022-03-22 17:10:14,427 yowsup.layers.protocol_iq.layer - YowPingThread-2 - ping thread stopped

Yowsdown

the solve
#3090

@rohilsurana
Copy link

Fixes #3120

@SamuelScheit
Copy link

This will probably not work for long, since WhatsApp introduced this .proto file in their newest version:

// Android copy of Vesta proto. Ground truth here:
//  - https://www.internalfb.com/code/fbsource/xplat/rust/vesta_client/proto/src/messages.proto
package whatsapp;
option java_package = "com.whatsapp.proto";

// Payload stored by successful registration (by `finish_register_request`).
message RegistrationPayload {
  // The secret data to be protected by the HSM system.
  // Holds serialized `WaBackupKeyData` proto.
  optional bytes backup_key_data = 1;
  // OPAQUE protocol third registration message.
  optional bytes r3 = 2;
  // Registration nonce.
  // Deprecated and soon to be removed. Replaced by `transcript` (see protocol spec).
  optional bytes opaque_challenge = 3;
  // History of registration messages: `SHA256(R1, R2, opaque_challenge)`
  optional bytes transcript = 4;
}

// Payload returned on successful account login (by `finish_login_request`).
message LoginPayload {
  // `backup_key_data` from `RegistrationPayload` AES-GCM-128 encrypted with
  // OPAQUE `shared_key`.
  optional bytes backup_key_data_encrypted = 1;
  // Nonce used for AES-GCM-128 encryption of `backup_key_data`.
  optional bytes rk_nonce = 2;
}

// WA-specific proto serialized to/from Vesta `backup_key_data` field.
message WaBackupKeyData {
  // User's backup key AES-GCM-128 encrypted with OPAQUE export key.
  optional bytes aes_k = 1;
  // Nonce used to AES-GCM-128 encrypt `aes_k`.
  optional bytes k_nonce = 2;
}

As you can see the backup_key_data is said to be protected by a "HSM" system.
So expect this workaround to be patched eventually.

@zek
Copy link

zek commented Jun 25, 2022

@Flam3rboy how did you extracted this proto file?

@SamuelScheit
Copy link

@zek I just unzipped the apk and it was in the root dir

@zek
Copy link

zek commented Jun 25, 2022

@Flam3rboy wow I was looking for it in source code :D thanks

@vadetcka999
Copy link

I'm trying to send a message, but it doesn't come

yowsup-cli demos --config-phone 7********** --config-cc 7 --config-id "h*P*OI*oAcKyMZ7eDm0nnsnypFA=" --config-mcc 250 --config-mnc 01 --config-sim_mcc 0000 --config-sim_mnc 0000 --config-client_static_keypair "YKhp00/smMk6VK/OAjCq3Y1kxKVmCC2hGg8*S3ggEUMfg*ovFbQV*SZFOcMtd*bGlZ7KFE*ZzDx14o9vqe9LeA==" --config-expid "xJM+14*J*9ucHWJ*T029aw==" --config-fdid "8bcc*e86-c66*-4d47-9280-cac4243*e6ae" -s 7********* "HOLA" --debug
D 2022-06-26 02:21:53,955 yowsup.config.manager - load(path_or_profile_name=7**********, profile_only=False)
D 2022-06-26 02:21:53,955 yowsup.config.manager - _load_path(path=7**********)
D 2022-06-26 02:21:53,955 yowsup.config.manager - _load_path couldn't find the path: 7**********
D 2022-06-26 02:21:53,955 yowsup.config.manager - path_or_profile_name is not a path, using it as profile name
D 2022-06-26 02:21:53,955 yowsup.config.manager - Detecting config for profile=7**********, dir=/root/.config/yowsup/7**********
D 2022-06-26 02:21:53,956 yowsup.config.manager - Trying /root/.config/yowsup/7**********/config.yo
D 2022-06-26 02:21:53,956 yowsup.config.manager - Trying /root/.config/yowsup/7**********/config.json
D 2022-06-26 02:21:53,956 yowsup.config.manager - _load_path(path=/root/.config/yowsup/79179381720/config.json)
D 2022-06-26 02:21:53,956 yowsup.config.manager - Detected config type: json
D 2022-06-26 02:21:53,956 yowsup.config.manager - Opening config for reading
D 2022-06-26 02:21:53,956 yowsup.config.manager - Loading config
D 2022-06-26 02:21:53,956 yowsup.profile.profile - Constructed Profile(profile_name=7**********)
yowsup-cli     v3.2.1
yowsup         v3.3.0
consonance     v0.1.5
dissononce     v0.34.3
python-axolotl v0.2.2
cryptography   v2.8
protobuf       v3.19.4


Copyright (c) 2012-2019 Tarek Galal
http://www.openwhatsapp.org

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://openwhatsapp.org/yowsup/donate


D 2022-06-26 02:21:54,104 yowsup.stacks.yowstack - Initializing stack
D 2022-06-26 02:21:54,105 yowsup.stacks.yowstack - Constructed Network Layer
D 2022-06-26 02:21:54,105 yowsup.stacks.yowstack - Constructed Noise Segments Layer
D 2022-06-26 02:21:54,107 yowsup.stacks.yowstack - Constructed Noise Layer
D 2022-06-26 02:21:54,107 yowsup.stacks.yowstack - Constructed Coder Layer
D 2022-06-26 02:21:54,108 yowsup.stacks.yowstack - Constructed Logger Layer
D 2022-06-26 02:21:54,108 yowsup.stacks.yowstack - Constructed <yowsup.layers.axolotl.layer_control.AxolotlControlLayer object at 0x7fe9a8cab3a0>
D 2022-06-26 02:21:54,108 yowsup.stacks.yowstack - Constructed Axolotl Layer - <yowsup.layers.axolotl.layer_receive.AxolotlReceivelayer object at 0x7fe9a7d3c4f0>
D 2022-06-26 02:21:54,108 yowsup.stacks.yowstack - Constructed Authentication Layer - Messages Layer - Receipt Layer - Ack Layer - Presence Layer - Ib Layer - Iq Layer - notification Ib Layer - Contact Iq Layer - Chatstate Layer - call Layer - Groups Iq Layer - Media Layer - Privacy Layer - Profiles Layer
D 2022-06-26 02:21:54,109 yowsup.stacks.yowstack - Constructed Interface Layer
D 2022-06-26 02:21:54,109 yowsup.stacks.yowstack - setProfile(YowProfile(profile_name=7**********))
D 2022-06-26 02:21:54,109 yowsup.layers.network.layer - Created asyncore dispatcher
I 2022-06-26 02:21:54,109 yowsup.layers.network.layer - Connecting to e2.whatsapp.net:443
D 2022-06-26 02:21:54,109 yowsup.layers.network.dispatcher.dispatcher_asyncore - connect(('e2.whatsapp.net', 443))
D 2022-06-26 02:21:54,255 yowsup.layers.network.dispatcher.dispatcher_asyncore - handle_connect
D 2022-06-26 02:21:54,256 yowsup.layers.network.layer - Connected
D 2022-06-26 02:21:54,256 yowsup.axolotl.factory - get_manager(profile_name=7**********, username=7**********)
D 2022-06-26 02:21:54,257 yowsup.axolotl.manager - Initialized AxolotlManager [username=7**********, db=/root/.config/yowsup/79179381720/axolotl.db]
D 2022-06-26 02:21:54,257 yowsup.axolotl.manager - level_prekeys(force=False)
D 2022-06-26 02:21:54,268 yowsup.axolotl.manager - len(pending_prekeys) = 812
D 2022-06-26 02:21:54,268 yowsup.axolotl.manager - load_unsent_prekeys
I 2022-06-26 02:21:54,277 yowsup.axolotl.manager - Loaded 812 unsent prekeys
D 2022-06-26 02:21:54,277 yowsup.layers.noise.layer - Received auth event
D 2022-06-26 02:21:54,277 yowsup.env.env - Env not set, setting it to android
D 2022-06-26 02:21:54,277 yowsup.env.env - Current env changed to android 
D 2022-06-26 02:21:54,278 yowsup.layers.noise.layer - Performing handshake [username= 7**********, passive=True]
D 2022-06-26 02:21:54,278 yowsup.layers.noise.layer - Starting handshake worker
D 2022-06-26 02:21:57,536 yowsup.layers.logger.layer - rx:
<failure reason="405" location="frc" />
D 2022-06-26 02:21:57,536 yowsup.layers.network.dispatcher.dispatcher_asyncore - disconnect
D 2022-06-26 02:21:57,536 yowsup.layers.network.dispatcher.dispatcher_asyncore - handle_close
D 2022-06-26 02:21:57,536 yowsup.layers.network.layer - Disconnected
D 2022-06-26 02:21:57,537 yowsup.layers.axolotl.layer_control - Disconnected, reboot_connect? = False


@SamuelScheit
Copy link

@vadetcka999 seems like you can't access WhatsApp

<failure reason="405" location="frc" />

@vadetcka999
Copy link

vadetcka999 commented Jun 26, 2022

@Flam3rboy Now it looks like this. I did everything as in the commit and registration goes well, but with sending messages problems

yowsup-cli demos --config-phone 7917***1720 -s 791***76092 "ddffd" --debug
D 2022-06-26 12:59:07,014 yowsup.config.manager - load(path_or_profile_name=79179381720, profile_only=False)
D 2022-06-26 12:59:07,015 yowsup.config.manager - _load_path(path=79179381720)
D 2022-06-26 12:59:07,015 yowsup.config.manager - _load_path couldn't find the path: 79179381720
D 2022-06-26 12:59:07,015 yowsup.config.manager - path_or_profile_name is not a path, using it as profile name
D 2022-06-26 12:59:07,015 yowsup.config.manager - Detecting config for profile=79179381720, dir=/root/.config/yowsup/79179381720
D 2022-06-26 12:59:07,015 yowsup.config.manager - Trying /root/.config/yowsup/79179381720/config.yo
D 2022-06-26 12:59:07,015 yowsup.config.manager - Trying /root/.config/yowsup/79179381720/config.json
D 2022-06-26 12:59:07,015 yowsup.config.manager - _load_path(path=/root/.config/yowsup/79179381720/config.json)
D 2022-06-26 12:59:07,015 yowsup.config.manager - Detected config type: json
D 2022-06-26 12:59:07,015 yowsup.config.manager - Opening config for reading
D 2022-06-26 12:59:07,015 yowsup.config.manager - Loading config
D 2022-06-26 12:59:07,016 yowsup.profile.profile - Constructed Profile(profile_name=79179381720)
yowsup-cli     v3.2.1
yowsup         v3.3.0
consonance     v0.1.5
dissononce     v0.34.3
python-axolotl v0.2.2
cryptography   v2.8
protobuf       v4.21.2


Copyright (c) 2012-2019 Tarek Galal
http://www.openwhatsapp.org

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://openwhatsapp.org/yowsup/donate


D 2022-06-26 12:59:07,186 yowsup.stacks.yowstack - Initializing stack
D 2022-06-26 12:59:07,186 yowsup.stacks.yowstack - Constructed Network Layer
D 2022-06-26 12:59:07,187 yowsup.stacks.yowstack - Constructed Noise Segments Layer
D 2022-06-26 12:59:07,188 yowsup.stacks.yowstack - Constructed Noise Layer
D 2022-06-26 12:59:07,189 yowsup.stacks.yowstack - Constructed Coder Layer
D 2022-06-26 12:59:07,189 yowsup.stacks.yowstack - Constructed Logger Layer
D 2022-06-26 12:59:07,189 yowsup.stacks.yowstack - Constructed <yowsup.layers.axolotl.layer_control.AxolotlControlLayer object at 0x7f4c5d6a0160>
D 2022-06-26 12:59:07,189 yowsup.stacks.yowstack - Constructed Axolotl Layer - <yowsup.layers.axolotl.layer_receive.AxolotlReceivelayer object at 0x7f4c5ddf43d0>
D 2022-06-26 12:59:07,190 yowsup.stacks.yowstack - Constructed Authentication Layer - Messages Layer - Receipt Layer - Ack Layer - Presence Layer - Ib Layer - Iq Layer - notification Ib Layer - Contact Iq Layer - Chatstate Layer - call Layer - Groups Iq Layer - Media Layer - Privacy Layer - Profiles Layer
D 2022-06-26 12:59:07,190 yowsup.stacks.yowstack - Constructed Interface Layer
D 2022-06-26 12:59:07,190 yowsup.stacks.yowstack - setProfile(YowProfile(profile_name=79179381720))
D 2022-06-26 12:59:07,190 yowsup.layers.network.layer - Created asyncore dispatcher
I 2022-06-26 12:59:07,191 yowsup.layers.network.layer - Connecting to e15.whatsapp.net:443
D 2022-06-26 12:59:07,191 yowsup.layers.network.dispatcher.dispatcher_asyncore - connect(('e15.whatsapp.net', 443))
D 2022-06-26 12:59:07,321 yowsup.layers.network.dispatcher.dispatcher_asyncore - handle_connect
D 2022-06-26 12:59:07,321 yowsup.layers.network.layer - Connected
D 2022-06-26 12:59:07,321 yowsup.axolotl.factory - get_manager(profile_name=7917***1720, username=7917***1720)
D 2022-06-26 12:59:07,322 yowsup.axolotl.manager - Initialized AxolotlManager [username=7917***1720, db=/root/.config/yowsup/79179381720/axolotl.db]
D 2022-06-26 12:59:07,322 yowsup.axolotl.manager - level_prekeys(force=False)
D 2022-06-26 12:59:07,355 yowsup.axolotl.manager - len(pending_prekeys) = 812
D 2022-06-26 12:59:07,355 yowsup.axolotl.manager - load_unsent_prekeys
I 2022-06-26 12:59:07,385 yowsup.axolotl.manager - Loaded 812 unsent prekeys
D 2022-06-26 12:59:07,385 yowsup.layers.noise.layer - Received auth event
D 2022-06-26 12:59:07,385 yowsup.env.env - Env not set, setting it to android
D 2022-06-26 12:59:07,386 yowsup.env.env - Current env changed to android 
D 2022-06-26 12:59:07,386 yowsup.layers.noise.layer - Performing handshake [username= 7917***1720, passive=True]
D 2022-06-26 12:59:07,386 yowsup.layers.noise.layer - Starting handshake worker
D 2022-06-26 12:59:07,565 yowsup.layers.network.dispatcher.dispatcher_asyncore - handle_close
D 2022-06-26 12:59:07,565 yowsup.layers.network.layer - Disconnected
D 2022-06-26 12:59:07,566 yowsup.layers.axolotl.layer_control - Disconnected, reboot_connect? = False

@Joshuwatomy
Copy link

while trying this fix another error showing

W 2022-07-29 21:25:40,370 yowsup.common.http.warequest - Passing Config to WARequest is deprecated, pass a YowProfile instead
I 2022-07-29 21:25:40,840 yowsup.common.http.warequest - b'{"flash_type":0,"login":"917500000000","reason":"no_routes","retry_after":3600,"sms_wait":3600,"status":"fail","voice_wait":3600}\n'
status: b'fail'
reason: b'no_routes'
retry_after: 3600
login: b'917500000000'
sms_wait: 3600
voice_wait: 3600

Copy link

@Whomakes Whomakes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update to the latest version 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.