def findAccount(): imsi = Utilities.getImsi() print "Looking for %s " % (imsi) m = Manager() accountIds = m.accountList() for aId in accountIds: a = m.account(aId) services = a.services() for s in services: if s.name() == "waxmpp": print "found waxmpp account with imsi: %s" % ( a.valueAsString("imsi")) if a.valueAsString("imsi") == imsi: account = a waaccount = WAAccount( account.valueAsString("cc"), account.valueAsString("phoneNumber"), account.valueAsString("username"), account.valueAsString("status"), account.valueAsString("pushName"), account.valueAsString("imsi"), account.valueAsString("password")) waaccount.setAccountInstance(a) return waaccount return None
def getAccountById(accountId): account = AccountsManager.manager.account(accountId) waaccount = WAAccount(account.valueAsString("cc"), account.valueAsString("phoneNumber"), account.valueAsString("username"), account.valueAsString("status"), account.valueAsString("pushName"), account.valueAsString("imsi"), account.valueAsString("password")) waaccount.setAccountInstance(account) return waaccount
def findAccount(): d = AccountsDebug() _d = d.d imsi = Utilities.getImsi() _d("Looking for %s " % (imsi)) accountIds = AccountsManager.manager.accountList() for aId in accountIds: a = AccountsManager.manager.account(aId) services = a.services() for s in services: if s.name() in ("waxmpp"): _d("found waxmpp account with imsi: %s" % (a.valueAsString("imsi"))) if a.valueAsString("imsi") == imsi: account = a waaccount = WAAccount( account.valueAsString("cc"), account.valueAsString("phoneNumber"), account.valueAsString("username"), account.valueAsString("status"), account.valueAsString("pushName"), account.valueAsString("imsi"), base64.b64decode(account.valueAsString("password")) if account.valueAsString("penc") == "b64" else str( account.valueAsString("password"))) #to ensure backwards compatibility for non-blocked accounts if account.valueAsString( "wazapp_version"): #rest of data exist waaccount.setExtraData( account.valueAsString("kind"), account.valueAsString("expiration"), account.valueAsString("cost"), account.valueAsString("currency"), account.valueAsString("price"), account.valueAsString("price_expiration")) waaccount.setAccountInstance(a) return waaccount return None
def findAccount(): imsi = Utilities.getImsi() print "Looking for %s "%(imsi) m = Manager() accountIds = m.accountList() for aId in accountIds: a = m.account(aId) services = a.services() for s in services: if s.name() == "waxmpp": print "found waxmpp account with imsi: %s"%(a.valueAsString("imsi")) if a.valueAsString("imsi") == imsi: account = a waaccount = WAAccount(account.valueAsString("cc"),account.valueAsString("phoneNumber"),account.valueAsString("username"),account.valueAsString("status"),account.valueAsString("pushName"),account.valueAsString("imsi"),account.valueAsString("password")); waaccount.setAccountInstance(a) return waaccount return None
def findAccount(): d = AccountsDebug() _d = d.d; imsi = Utilities.getImsi() _d("Looking for %s "%(imsi)) accountIds = AccountsManager.manager.accountList() for aId in accountIds: a = AccountsManager.manager.account(aId) services = a.services() for s in services: if s.name() in ("waxmpp"): _d("found waxmpp account with imsi: %s"%(a.valueAsString("imsi"))) if a.valueAsString("imsi") == imsi: account = a waaccount = WAAccount(account.valueAsString("cc"), account.valueAsString("phoneNumber"), account.valueAsString("username"), account.valueAsString("status"), account.valueAsString("pushName"), account.valueAsString("imsi"), base64.b64decode(account.valueAsString("password")) if account.valueAsString("penc") == "b64" else account.valueAsString("password")); #to ensure backwards compatibility for non-blocked accounts if account.valueAsString("wazapp_version"): #rest of data exist waaccount.setExtraData(account.valueAsString("kind"), account.valueAsString("expiration"), account.valueAsString("cost"), account.valueAsString("currency"), account.valueAsString("price"), account.valueAsString("price_expiration")) waaccount.setAccountInstance(a) return waaccount return None
def getAccountById(accountId): account = AccountsManager.manager.account(accountId) waaccount = WAAccount(account.valueAsString("cc"),account.valueAsString("phoneNumber"),account.valueAsString("username"),account.valueAsString("status"),account.valueAsString("pushName"),account.valueAsString("imsi"),account.valueAsString("password")); waaccount.setAccountInstance(account) return waaccount