コード例 #1
0
 def wb_mode_Verification(self):
     support_file_name = '养号列表.txt'
     support_Data = file.read(support_file_name)
     error_file_name = '登录异常账号.txt'
     error_Data_List = file.read_all(error_file_name)
     wechat_file_name = '微信账号数据.txt'
     wechat_Data_List = file.read(wechat_file_name)
     num = []
     new_data_list = []
     for data in wechat_Data_List:
         if self.deviceid in data:
             new_data_list.append(data)
     for support in support_Data:
         if 'True' not in support.strip('\n'):
             if re.findall('(.*)\|', support)[0] not in error_Data_List:
                 try:
                     for self.wechat_Data in new_data_list:
                         if re.findall('(.*)\|', support)[0] in self.wechat_Data:
                             num.append('%s ID:%s' % (self.wechat_Data.strip('\n'), re.findall('\|(.*)', support)[0]))
                 except:
                     logging.info(self.deviceid+u'-正则没有匹配到该条数据:'+self.wechat_Data)
     if num.__len__() <> 0:
         logging.info(self.deviceid + u'设备找到%s个数据' % num.__len__())
         return num
     else:
         logging.info(self.deviceid + u'该设备在养号列表中没有数据')
         time.sleep(10000)
コード例 #2
0
 def start(self, m, t, filtering_mode):
     self.appPackage = re.findall('(.*?)\|',
                                  file.read('平台账号.txt')[25].strip('\n'))[0]
     self.appActivity = re.findall('\|(.*)',
                                   file.read('平台账号.txt')[25].strip('\n'))[0]
     self.d.app_stop('com.tencent.mm')
     while True:
         self.d(resourceId='org.wuji:id/exit_vpn').click()
         time.sleep(int(t))
         try:
             ip = re.findall(
                 '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}',
                 self.d(resourceId='org.wuji:id/ips').get_text())[0]
             logging.info(self.deviceid + u"-VPN已成功连接")
             logging.info(self.deviceid + u"-IP:%s" % ip)
             if m == '1':
                 if ip_fiter(self.deviceid, ip, filtering_mode) == True:
                     return ip
                 else:
                     pass
             if m == '2':
                 if ip_fiter(self.deviceid, ip, filtering_mode) == True:
                     return ip
                 else:
                     pass
         except:
             time.sleep(10)
コード例 #3
0
 def wb_mode_Verification(self):
     support_file_name = '养号列表.txt'
     support_Data = file.read(support_file_name)
     error_file_name = '登录异常账号.txt'
     error_Data_List = file.read_all(error_file_name)
     wechat_file_name = '微信账号数据.txt'
     wechat_Data_List = file.read(wechat_file_name)
     num = []
     new_data_list = []
     for data in wechat_Data_List:
         if self.deviceid in data:
             new_data_list.append(data)
     for support in support_Data:
         if 'True' not in support.strip('\n'):
             if re.findall('(.*)\|', support)[0] not in error_Data_List:
                 try:
                     for self.wechat_Data in new_data_list:
                         if re.findall('(.*)\|',
                                       support)[0] in self.wechat_Data:
                             num.append('%s ID:%s' %
                                        (self.wechat_Data.strip('\n'),
                                         re.findall('\|(.*)', support)[0]))
                 except:
                     logging.info(self.deviceid + u'-正则没有匹配到该条数据:' +
                                  self.wechat_Data)
     if num.__len__() <> 0:
         logging.info(self.deviceid + u'设备找到%s个数据' % num.__len__())
         return num
     else:
         logging.info(self.deviceid + u'该设备在养号列表中没有数据')
         time.sleep(10000)
コード例 #4
0
 def start(self,m,t,filtering_mode):
     self.appPackage = re.findall('(.*?)\|', file.read('平台账号.txt')[25].strip('\n'))[0]
     self.appActivity = re.findall('\|(.*)', file.read('平台账号.txt')[25].strip('\n'))[0]
     os.system('adb -s ' + self.deviceid + ' shell am force-stop com.tencent.mm')
     driver = Open().Phone(self.appPackage, self.appActivity, self.deviceid, self.port)
     driver.implicitly_wait(60)
     while True:
         driver.find_element_by_id('org.wuji:id/exit_vpn').click()  # 切换VPN
         time.sleep(int(t))
         try:
             ip = re.findall('[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}',
                             driver.find_element_by_id('org.wuji:id/ips').get_attribute(("text")))[0]
             logging.info(self.deviceid + u"-VPN已成功连接")
             logging.info(self.deviceid + u"-IP:%s" % ip)
             if m == '1':
                 if ip_fiter(self.deviceid, ip, filtering_mode) == True:
                     return ip
                 else:
                     pass
             if m == '2':
                 if ip_fiter(self.deviceid, ip, filtering_mode) == True:
                     return ip
                 else:
                     pass
         except:
             time.sleep(10)
コード例 #5
0
 def start(self, m, t, filtering_mode):
     self.appPackage = re.findall('(.*?)\|',
                                  file.read('平台账号.txt')[25].strip('\n'))[0]
     self.appActivity = re.findall('\|(.*)',
                                   file.read('平台账号.txt')[25].strip('\n'))[0]
     os.system('adb -s ' + self.deviceid +
               ' shell am force-stop com.tencent.mm')
     driver = Open().Phone(self.appPackage, self.appActivity, self.deviceid,
                           self.port)
     driver.implicitly_wait(60)
     while True:
         driver.find_element_by_id('org.wuji:id/exit_vpn').click()  # 切换VPN
         time.sleep(int(t))
         try:
             ip = re.findall(
                 '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}',
                 driver.find_element_by_id('org.wuji:id/ips').get_attribute(
                     ("text")))[0]
             logging.info(self.deviceid + u"-VPN已成功连接")
             logging.info(self.deviceid + u"-IP:%s" % ip)
             if m == '1':
                 if ip_fiter(self.deviceid, ip, filtering_mode) == True:
                     return ip
                 else:
                     pass
             if m == '2':
                 if ip_fiter(self.deviceid, ip, filtering_mode) == True:
                     return ip
                 else:
                     pass
         except:
             time.sleep(10)
コード例 #6
0
 def gnsr2_get_ph(self):
     file_name = '国内私人2数据.txt'
     data = file.read(file_name)
     data_new = []
     for i in range(1, data.__len__()):
         data_new.append(data[i])
     file().delete(file_name)
     file().write(data_new, file_name)
     logging.info(self.deviceid + u'-获取到手机号码:' + re.findall('[0-9]{11}', data[0])[0])
     return re.findall('[0-9]{11}', data[0])[0],'test'
コード例 #7
0
def ip_fiter(deviceid,ip,filtering_mode):
    if ip in file().readIpFile():
        logging.info(deviceid + u'-IP已存在,重新切换IP')
        return False
    else:
        if filtering_mode ==  '2.设定过滤IP段'.decode('utf-8'):
            filer_all=file.read('IP段设定过滤.txt')
            test=[]
            for filer_ip in filer_all:
                if filer_ip.strip('\n') in ip:
                    logging.info(deviceid + u'-被设定的IP段过滤,重新切换网络')
                    test.append(filer_ip.strip('\n'))
            if test==[]:
                file().writeIpFile(ip)
                return True
            else:
                return False
        else:
            file().writeIpFile(ip)
            return True
コード例 #8
0
def ip_fiter(deviceid, ip, filtering_mode):
    if ip in file().readIpFile():
        logging.info(deviceid + u'-IP已存在,重新切换IP')
        return False
    else:
        if filtering_mode == '2.设定过滤IP段'.decode('utf-8'):
            filer_all = file.read('IP段设定过滤.txt')
            test = []
            for filer_ip in filer_all:
                if filer_ip.strip('\n') in ip:
                    logging.info(deviceid + u'-被设定的IP段过滤,重新切换网络')
                    test.append(filer_ip.strip('\n'))
            if test == []:
                file().writeIpFile(ip)
                return True
            else:
                return False
        else:
            file().writeIpFile(ip)
            return True