tgalal / yowsup

The WhatsApp lib
GNU General Public License v3.0
7.08k stars 2.23k forks source link

Disconnected on develop #2655

Closed luisaugustos closed 5 years ago

luisaugustos commented 5 years ago

Hi,

I'm testing the develop branch with yowsup-cli. The register proccess was ok, but when i try sent a sample test the lib return disconnected.


D 2019-04-11 10:16:40,685 yowsup.config.manager - load(path=teste)
D 2019-04-11 10:16:40,686 yowsup.config.manager - Detected config type: keyval
D 2019-04-11 10:16:40,686 yowsup.config.manager - Opening config for reading
D 2019-04-11 10:16:40,687 yowsup.config.manager - Loading config
D 2019-04-11 10:16:40,687 yowsup.env.env - Current env changed to android 
yowsup-cli  v2.0.15
yowsup      v2.5.7

Copyright (c) 2012-2016 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 2019-04-11 10:16:41,404 yowsup.stacks.yowstack - Initializing stack
D 2019-04-11 10:16:41,404 yowsup.stacks.yowstack - Constructed Network Layer
D 2019-04-11 10:16:41,405 yowsup.stacks.yowstack - Constructed Stanza Regulator Layer
D 2019-04-11 10:16:41,405 yowsup.stacks.yowstack - Constructed Crypt Layer
D 2019-04-11 10:16:41,405 yowsup.stacks.yowstack - Constructed Coder Layer
D 2019-04-11 10:16:41,405 yowsup.stacks.yowstack - Constructed Logger Layer
D 2019-04-11 10:16:41,406 yowsup.stacks.yowstack - Constructed Authentication Layer - Messages Layer - Receipt Layer - Ack Layer - Presence Layer - Ib Layer - Iq Layer - notification Ib Layer - Iq Layer - Chatstate Layer - call Layer - Groups Iq Layer - Media Layer - Privacy Layer - Profiles Layer
D 2019-04-11 10:16:41,406 yowsup.stacks.yowstack - Constructed Interface Layer
D 2019-04-11 10:16:41,573 yowsup.layers.network.layer - CONNECTED!!
D 2019-04-11 10:16:41,574 yowsup.layers.logger.layer - tx:
<stream:features>
</stream:features>

D 2019-04-11 10:16:41,575 yowsup.layers.logger.layer - tx:
<auth user="554788392043" mechanism="WAUTH-2" passive="true">
</auth>

D 2019-04-11 10:16:41,960 yowsup.layers.network.layer - Disconnected```
lisabrauns commented 5 years ago

See the issues: 2635

You have two options:

  1. Waiting for tgalal to update yowsup
  2. Modify the yowsup code to convert the RC4 protocol to the NOSIE protocol
victorgt26 commented 5 years ago

someone already modified the RC4 protocol to NOISE?

lisabrauns commented 5 years ago

Yes, I have switched from the RC4 protocol to the NOSIE protocol, and now it is working.

victorgt26 commented 5 years ago

Do you can share? Can i Contact you?

x-frst commented 5 years ago

Me too please share changes!

redrux commented 5 years ago

@lisabrauns Why don't you share?

langioletto commented 5 years ago

this is a fake, it's still the same fool

lisabrauns commented 5 years ago

This is not a lie, it can be converted, but I will not share the code, because I hope to get some help in the conversion process, but I am not willing to help me, which makes me very disappointed.

But I can provide some help with the conversion process.

redrux commented 5 years ago

@lisabrauns how we can talk with you? :) You don't have an email adress on your public profile.

luisaugustos commented 5 years ago

This is not a lie, it can be converted, but I will not share the code, because I hope to get some help in the conversion process, but I am not willing to help me, which makes me very disappointed.

But I can provide some help with the conversion process.

Thanks for your reply @lisabrauns I believe we should work harder on the project and not depend only of the owners. I posted this comment because the fact that I can already register a new number for the platform is a great advance.

lisabrauns commented 5 years ago

@redrux If you have problems with the conversion, you can submit an issuse, if I know how to solve it, I will reply.. :)

lisabrauns commented 5 years ago

@luisaugustos My research is just that I am interested in the reverse. I want to find an app to reverse learning. I don't have any plans for specific projects. Anyway, thanks to the contributions of @tgalal and @mgp25

dazzzl commented 5 years ago

@lisabrauns Nice, that you make it to work! Congrats! Maybe you can open the issue tracker on your yowsup fork?

I have also two specific questions. It would be nice, If you or someone else could give me a hint.

a) In WA2.0, the authorization secret is the private (static) client key. How can this key be calculated form the pw received from registration?

b) What changes are done on the authblob? E.g., the nonce does not exist anymore.

Thanks!

cmeerw commented 5 years ago

@dazzzl for the initial connection you generate your private/public key pair, connect and then authenticate using the password from the registration. For subsequent connections you just re-use the same keys (those are now associated with your account).

dazzzl commented 5 years ago

@cmeerw Thanks! You are talking about the static keys, not the ephemeral ones, or? This means, that the authblob looks different from the first authentication to the other logins. Where can I find some information about the authblob? Do the format differ from Android and IPhone devices?

cmeerw commented 5 years ago

@dazzzl get the apk and look for protobuf descriptors in there - it's pretty self explanatory from there

redrux commented 5 years ago

@cmeerw @lisabrauns Can you tell us what should we to do?

lisabrauns commented 5 years ago

@dazzzl a) You won't receive the key pair from whatsapp. You need to generate a key pair when you register, and then send it to whatsapp. This key pair is equivalent to the password and is used for login.

b) I think authblob is no longer used.

lisabrauns commented 5 years ago

@redrux You can find a file in whatsapp, which details the connection in detail.

dazzzl commented 5 years ago

@cmeerw I have only the protobuf.meta which seem to have no symbols in it. I decompiled the apk, but also a grep on it will not find, e.g., DeviceManufacturer, which might be used in the authblob. Maybe one hint more? :-) @lisabrauns So, the pw field is not used anymore? Do I have to register the number again from changing WA16 to WA2X? Do you mean with register the first login or the registration process? To generate the private key, can I use any arbitrary 32 bytes for it?

cmeerw commented 5 years ago

@dazzzl maybe things have changed in 2.19.x. In 2.18.x (when I looked at it in detail) they had com/whatsapp/proto/Wa20 with the protobuf descriptors.

lisabrauns commented 5 years ago

@dazzzl I haven't started researching yet, I will tell you if I have results.

generate the key code like this:

randm32 = os.urandom(32) randm64 = os.urandom(64)

private_key = curve.generatePrivateKey(randm32) public_key = curve.generatePublicKey(private_key)

tgalal commented 5 years ago

fixed