From 875717bf9a791649a3d25f4b88e36a9554e5d718 Mon Sep 17 00:00:00 2001 From: moyamo Date: Sat, 9 Apr 2016 23:05:16 +0200 Subject: [PATCH] Revert "Patch YowAxoltolLayer to fix padding problems" This reverts commit 4643bb433d6201bcaf89e2c9a113a757a1e88efa. --- yowsupwrapper.py | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/yowsupwrapper.py b/yowsupwrapper.py index ee9d19c..dfbb4e6 100644 --- a/yowsupwrapper.py +++ b/yowsupwrapper.py @@ -55,38 +55,9 @@ from functools import partial #from session import MsgIDs -# Temporarily work around yowsup padding bugs with new protocol -class UpdatedYowAxolotlLayer(YowAxolotlLayer): - def decodeInt7bit(self, string): - idx = 0 - while ord(string[idx]) >= 128: - idx += 1 - consumedBytes = idx + 1 - value = 0 - while idx >= 0: - value <<= 7 - value += ord(string[idx]) % 128 - idx -= 1 - return value, consumedBytes - - def unpadV2Plaintext(self, v2plaintext): - end = -ord(v2plaintext[-1]) # length of the left padding - length,consumed = self.decodeInt7bit(v2plaintext[1:]) - return v2plaintext[1+consumed:end] - -# Temporary env until yowsup updates -class UpdatedS40YowsupEnv(env.S40YowsupEnv): - _VERSION = "2.13.39" - _OS_NAME= "S40" - _OS_VERSION = "14.26" - _DEVICE_NAME = "302" - _MANUFACTURER = "Nokia" - _TOKEN_STRING = "PdA2DJyKoUrwLw1Bg6EIhzh502dF9noR9uFCllGk{phone}" - _AXOLOTL = True - class YowsupApp(object): def __init__(self): - env.CURRENT_ENV = UpdatedS40YowsupEnv() + env.CURRENT_ENV = env.S40YowsupEnv() layers = (YowsupAppLayer, YowParallelLayer((YowAuthenticationProtocolLayer, @@ -104,7 +75,7 @@ class YowsupApp(object): YowProfilesProtocolLayer, YowGroupsProtocolLayer, YowPresenceProtocolLayer)), - UpdatedYowAxolotlLayer, + YowAxolotlLayer, YowCoderLayer, YowCryptLayer, YowStanzaRegulator,