Exemple #1
0
    def __init__(self, credentials, encryptionEnabled=False):
        stackBuilder = YowStackBuilder()

        if not encryptionEnabled:
            env.CURRENT_ENV = S40YowsupEnv()

        self.stack = stackBuilder\
            .pushDefaultLayers(encryptionEnabled)\
            .push(BridgeMPPCliLayer)\
            .build()

        self.stack.setCredentials(credentials)
Exemple #2
0
 def test_tokengen(self):
     phone = "1234567"
     S40YowsupEnv._TOKEN_STRING  = "PdA2DJyKoUrwLw1Bg6EIhzh502dF9noR9uFCllGk1425519315543{phone}"
     env = S40YowsupEnv()
     token = env.getToken(phone)
     self.assertEqual(token, 'e84e1f1477704159efd46f6f0781dbde')
Exemple #3
0
 def test_tokengen(self):
     phone = "1234567"
     S40YowsupEnv._TOKEN_STRING = "PdA2DJyKoUrwLw1Bg6EIhzh502dF9noR9uFCllGk1418865329241{phone}"
     env = S40YowsupEnv()
     token = env.getToken(phone)
     self.assertEqual(token, '71780696500214e7c14433dc6e0eefdb')
Exemple #4
0
from yowsup.common.http.warequest import WARequest
from yowsup.common.http.waresponseparser import JSONResponseParser
# from yowsup.env import CURRENT_ENV
from yowsup.common.tools import StorageTools, WATools
from yowsup.registration.existsrequest import WAExistsRequest
from yowsup.env import S40YowsupEnv
CURRENT_ENV = S40YowsupEnv()


class WACodeRequest(WARequest):
    def __init__(self,
                 cc,
                 p_in,
                 mcc="000",
                 mnc="000",
                 sim_mcc="000",
                 sim_mnc="000",
                 method="sms"):
        super(WACodeRequest, self).__init__()
        idx = StorageTools.getIdentity(cc + p_in)

        self.p_in = p_in
        self.__id = idx
        self.cc = cc

        self.addParam("cc", cc)
        self.addParam("in", p_in)
        self.addParam("lc", "GB")
        self.addParam("lg", "en")
        self.addParam("sim_mcc", sim_mcc.zfill(3))
        self.addParam("sim_mnc", sim_mnc.zfill(3))