Skip to content

Commit

Permalink
Merge branch 'eldereng-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
tgalal committed Dec 14, 2021
2 parents 4930acf + fa41bd4 commit dd47d57
Show file tree
Hide file tree
Showing 14 changed files with 1,311 additions and 571 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,15 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project (kinda) adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.3.0] 2021-12-14

### Changed

- Updated to whatsapp protocol 4.0
- Updated consonance to 0.1.5
- Fixed registration error due to obsolete keys in returned data
- Updated android env app version to 2.21.21.18

## [3.2.3] 2019-05-07

### Changed
Expand Down
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -12,12 +12,12 @@ The project started as the protocol engine behind [Wazapp for Meego](https://wik
library it can be used to power any custom WhatsApp client.

```
updated: 2019-05-07
yowsup version: 3.2.3
yowsup-cli version: 3.2.0
updated: 2021-12-14
yowsup version: 3.3.0
yowsup-cli version: 3.2.1
requires:
- python>=2.7,<=3.7
- consonance==0.1.3-1
- consonance==0.1.5
- python-axolotl==0.2.2
- protobuf>=3.6.0
- six==1.10
Expand Down
11 changes: 11 additions & 0 deletions requirements.txt
@@ -0,0 +1,11 @@
appdirs==1.4.4
cffi==1.15.0
consonance==0.1.5
cryptography==36.0.0
dissononce==0.34.3
protobuf==4.0.0rc2
pycparser==2.21
python-axolotl==0.2.2
python-axolotl-curve25519==0.4.1.post2
six==1.10.0
transitions==0.8.10
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -5,7 +5,7 @@
import platform
import sys

deps = ['consonance==0.1.3-1', 'argparse', 'python-axolotl==0.2.2', 'six==1.10', 'appdirs', 'protobuf>=3.6.0']
deps = ['consonance==0.1.5', 'argparse', 'python-axolotl==0.2.2', 'six==1.10', 'appdirs', 'protobuf>=3.6.0']

if sys.version_info < (2, 7):
deps.append('importlib')
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -16,4 +16,4 @@ deps =
appdirs
python-axolotl==0.2.2
protobuf>=3.6.0
consonance==0.1.3-1
consonance==0.1.5
10 changes: 5 additions & 5 deletions yowsup-cli
@@ -1,5 +1,5 @@
#!/usr/bin/env python
__version__ = "3.2.0"
__version__ = "3.2.1"
__author__ = "Tarek Galal"

from yowsup.env import YowsupEnv
Expand Down Expand Up @@ -402,9 +402,9 @@ class RegistrationArgParser(YowArgParser):
if result["status"] in ("sent", "ok"):
if "login" in result:
config.login = result["login"]
if "edge_routing_info" in result:
if "edge_routing_info" in result and result["edge_routing_info"]:
config.edge_routing_info = base64.b64decode(result["edge_routing_info"])
if "chat_dns_domain" in result:
if "chat_dns_domain" in result and result["chat_dns_domain"]:
config.chat_dns_domain = result["chat_dns_domain"]
self._profile.write_config(config)
print(self.resultToString(result))
Expand All @@ -422,9 +422,9 @@ class RegistrationArgParser(YowArgParser):
if not self._preview:
if result["status"] == "ok":
config.login = result["login"]
if "edge_routing_info" in result:
if "edge_routing_info" in result and result["edge_routing_info"]:
config.edge_routing_info = base64.b64decode(result["edge_routing_info"])
if "chat_dns_domain" in result:
if "chat_dns_domain" in result and result["chat_dns_domain"]:
config.chat_dns_domain = result["chat_dns_domain"]
self._profile.write_config(self._profile.config)

Expand Down
2 changes: 1 addition & 1 deletion yowsup/__init__.py
@@ -1,6 +1,6 @@
import logging

__version__ = "3.2.3"
__version__ = "3.3.0"
__author__ = "Tarek Galal"

logger = logging.getLogger(__name__)
Expand Down
4 changes: 2 additions & 2 deletions yowsup/env/env_android.py
Expand Up @@ -17,10 +17,10 @@ class AndroidYowsupEnv(YowsupEnv):
"YHNtYoIvt5R3X6YZylbPftF/8ayWTALBgcqhkjOOAQDBQADLwAwLAIUAKYCp0d6z4QQdyN74JDfQ2WCyi8CFDUM4CaNB+ceVXd" \
"KtOrNTQcc0e+t"

_MD5_CLASSES = "/QhoCBMppKpKQumhTC8kcQ=="
_MD5_CLASSES = "WuFH18yXKRVezywQm+S24A=="
_KEY = "eQV5aq/Cg63Gsq1sshN9T3gh+UUp0wIw0xgHYT1bnCjEqOJQKCRrWxdAe2yvsDeCJL+Y4G3PRD2HUF7oUgiGo8vGlNJOaux26k+A2F3hj8A="

_VERSION = "2.19.244"
_VERSION = "2.21.21.18" # 2.20.206.24
_OS_NAME = "Android"
_OS_VERSION = "8.0.0"
_DEVICE_NAME = "star2lte"
Expand Down
6 changes: 3 additions & 3 deletions yowsup/layers/coder/test_decoder.py
Expand Up @@ -8,8 +8,8 @@ def setUp(self):
self.decoder.streamStarted = True

def test_decode(self):
data = bytearray([0, 248, 6, 95, 179, 252, 3, 120, 121, 122, 252, 4, 102, 111, 114, 109, 252, 3, 97, 98, 99, 248, 1, 248, 4, 93,
236, 104, 255, 130, 18, 63, 252, 6, 49, 50, 51, 52, 53, 54])
data = bytearray([0, 248, 6, 9, 11, 252, 3, 120, 121, 122, 5, 252, 3, 97, 98, 99, 248, 1, 248, 4, 50, 238, 86, 255, 130, 18, 63,
252, 6, 49, 50, 51, 52, 53, 54])
node = self.decoder.getProtocolTreeNode(data)
targetNode = ProtocolTreeNode("message", {"form": "abc", "to":"xyz"}, [ProtocolTreeNode("media", {"width" : "123"}, data=b"123456")])
targetNode = ProtocolTreeNode("message", {"from": "abc", "to":"xyz"}, [ProtocolTreeNode("media", {"width" : "123"}, data=b"123456")])
self.assertEqual(node, targetNode)
10 changes: 5 additions & 5 deletions yowsup/layers/coder/test_encoder.py
Expand Up @@ -9,14 +9,14 @@ def setUp(self):
self.encoder = WriteEncoder(TokenDictionary())

def test_encode(self):
node = ProtocolTreeNode("message", {"form": "abc", "to":"xyz"}, [ProtocolTreeNode("media", {"width" : "123"}, data=b"123456")])
node = ProtocolTreeNode("message", {"from": "abc", "to":"xyz"}, [ProtocolTreeNode("media", {"width" : "123"}, data=b"123456")])
result = self.encoder.protocolTreeNodeToBytes(node)

self.assertTrue(result in (
[0, 248, 6, 95, 179, 252, 3, 120, 121, 122, 252, 4, 102, 111, 114, 109, 252, 3, 97, 98, 99, 248, 1, 248, 4, 93,
236, 104, 255, 130, 18, 63, 252, 6, 49, 50, 51, 52, 53, 54],
[0, 248, 6, 95, 252, 4, 102, 111, 114, 109, 252, 3, 97, 98, 99, 179, 252, 3, 120, 121, 122, 248, 1, 248, 4, 93,
236, 104, 255, 130, 18, 63, 252, 6, 49, 50, 51, 52, 53, 54]
[0, 248, 6, 9, 11, 252, 3, 120, 121, 122, 5, 252, 3, 97, 98, 99, 248, 1, 248, 4, 50, 238, 86, 255, 130, 18, 63,
252, 6, 49, 50, 51, 52, 53, 54],
[0, 248, 6, 9, 5, 252, 3, 97, 98, 99, 11, 252, 3, 120, 121, 122, 248, 1, 248, 4, 50, 238, 86, 255, 130, 18, 63,
252, 6, 49, 50, 51, 52, 53, 54]
)
)

10 changes: 5 additions & 5 deletions yowsup/layers/coder/test_tokendictionary.py
Expand Up @@ -5,16 +5,16 @@ def setUp(self):
self.tokenDictionary = TokenDictionary()

def test_getToken(self):
self.assertEqual(self.tokenDictionary.getToken(80), "iq")
self.assertEqual(self.tokenDictionary.getToken(10), "iq")

def test_getIndex(self):
self.assertEqual(self.tokenDictionary.getIndex("iq"), (80, False))
self.assertEqual(self.tokenDictionary.getIndex("iq"), (10, False))

def test_getSecondaryToken(self):
self.assertEqual(self.tokenDictionary.getToken(238), "amrnb")
self.assertEqual(self.tokenDictionary.getToken(238), "lc")

def test_getSecondaryTokenExplicit(self):
self.assertEqual(self.tokenDictionary.getToken(11, True), "wmv")
self.assertEqual(self.tokenDictionary.getToken(11, True), "reject")

def test_getSecondaryIndex(self):
self.assertEqual(self.tokenDictionary.getIndex("wmv"), (11, True))
self.assertEqual(self.tokenDictionary.getIndex("reject"), (11, True))

0 comments on commit dd47d57

Please sign in to comment.