def reset_vpn(): app = Application().start(r"C:/Program Files/AVG/Secure VPN/Vpn.exe") time.sleep(3) for w_handle in Desktop(backend='uia').windows(): if "AVG Secure VPN" in w_handle.texts(): avg_handle = w_handle.handle break app = Desktop(backend='uia').window(handle=avg_handle) try: window = app.window(handle=avg_handle) turn_vpn_off_button = window.child_window(title="Turn VPN Off", control_type="Button").click() time.sleep(3) window = app.window(handle=avg_handle) turn_vpn_on_button = window.child_window(title="Turn VPN On", control_type="Button").click() except: ... try : window = app.window(handle=avg_handle) turn_vpn_on_button = window.child_window(title="Turn VPN On", control_type="Button").click() except: ... time.sleep(10) def findObject(obj,idx, acc: float = 0.7, quarter: bool = False): # Read the input image img_path = f"screenshot{idx}.png" image = cv.imread(img_path) if image is None: print(f"Error: Unable to load image {img_path}") return [] if quarter: image = image[0:1080, 960:1920] # Convert the input image to grayscale screen = cv.cvtColor(image, cv.COLOR_BGR2GRAY) # Read the needle (template) image needle_img = cv.imread(obj, cv.IMREAD_GRAYSCALE) if needle_img is None: print(f"Error: Unable to load image {obj}") return [] # Template matching result = cv.matchTemplate(screen, needle_img, cv.TM_CCOEFF_NORMED) locations = np.where(result >= acc) locations = list(zip(*locations[::-1])) # Extract rectangles from found locations ndl_h, ndl_w = needle_img.shape[:2] rectangles = [] for loc in locations: rect = [loc[0], loc[1], ndl_w, ndl_h] rectangles.append(rect) rectangles.append(rect) # For grouping purposes rectangles, weights = cv.groupRectangles(rectangles, groupThreshold=1, eps=0.5) # Calculate center points of the rectangles centers = [] for (x, y, w, h) in rectangles: center = (x + w // 2, y + h // 2) centers.append(center) return centers # Function to run an ADB command def run_adb_command(command, em_name): result = subprocess.run(["adb", "-s", em_name] + command, capture_output=True, text=True) if result.returncode != 0: print(f"Error: {result.stderr}") else: print(result.stdout) def em_ss(em_name, idx): run_adb_command(['exec-out', 'screencap', '-p', f"/sdcard/screenshot{idx}.png"], em_name) run_adb_command(['pull', f"/sdcard/screenshot{idx}.png", '.'], em_name) def em_click(pos,em_name,clicks = 1, delay = 0.2): x,y = pos for _ in range(clicks) : run_adb_command(['shell' ,'input', 'tap', str(x), str(y)], em_name); time.sleep(delay) def em_press(key,em_name,clicks = 1, delay = 0.2): if key == "TAB" : key = 61 if key == "ENTER" : key = 66 if key == "SPACE" : key = 62 if key == "UP" : key = 19 for _ in range(clicks) : run_adb_command(['shell' ,'input', 'keyevent', str(key)], em_name); time.sleep(delay) def em_write(text,em_name): run_adb_command(['shell' ,'input', 'text', text], em_name) def delet_line(file_name, line_number): with open(file_name) as file : lines = file.readlines() del lines[line_number] with open(file_name, 'w') as file: for line in lines: file.write(line) def addToNote(file_name, type1): file111 = open(file_name, "a") file111.writelines(type1) file111.writelines('\n') file111.close() queue = [] def main(emulator, idx): global smsQue, oldOTP, phoneName,phoneNum def setUp(): while 1: em_ss(emulator, idx) point = findObject(f"./obj/app.png", idx) if point : point = point[0]; break time.sleep(0.5) run_adb_command(["shell","input keyevent KEYCODE_HOME"], emulator) print(point) em_click(point,emulator) ####################################################### while 1: em_ss(emulator, idx) point = findObject(f"./obj/Agree.png", idx) if point : Apoint = point[0]; break time.sleep(0.3) print(point) time.sleep(1) for _ in range(3): run_adb_command(["shell", "input swipe 270 800 270 300 70"], emulator); time.sleep(0.2) time.sleep(0.5) em_click((Apoint[0]*2-20, Apoint[1]),emulator) while 1: em_ss(emulator, idx) point = findObject(f"./obj/continue.png", idx) if point : point = point[0]; break time.sleep(1) print(point) em_click(point,emulator) ####################################################### while 1: for _ in range(6): em_ss(emulator, idx) em_click((500,70),emulator); time.sleep(0.3) pointID = findObject(f"./obj/createID.png", idx) if pointID: break if pointID : pointID = pointID[0];em_click(pointID,emulator); break for _ in range(6): em_ss(emulator, idx) em_click((40,70),emulator); time.sleep(0.3) pointDot = findObject(f"./obj/dots.png", idx) if pointDot : break if pointDot : pointDot = pointDot[0]; em_click(pointDot,emulator,clicks=2); time.sleep(0.5) em_ss(emulator, idx) pointSI = findObject(f"./obj/signIn.png", idx) if pointSI : pointSI = pointSI[0]; em_click(pointSI,emulator) time.sleep(0.7) # while 1: # em_ss(emulator, idx) # point = findObject(f"./obj/createID.png", idx) # if point : point = point[0]; break # time.sleep(0.3) # # em_click((470,70),emulator) # print(point) # em_click(point,emulator) def signUp(acc): def generate_random_password(): characters = "abcdefghijklmnopqrstuvwxyz" password = ''.join(random.choice(characters).lower() for i in range(8)) password=random.choice(characters).upper() + password +random.choice(["#","@"]) + str(random.randint(10,99)) return password pw = generate_random_password() mail = acc while 1: em_ss(emulator, idx) point = findObject(f"./obj/email.png", idx) if point : point = point[0]; break time.sleep(1) print(point) em_click(point, emulator) em_write(mail, emulator) em_press("TAB", emulator, delay=0.3) em_write(pw, emulator) em_press("TAB", emulator) em_write(pw, emulator) em_press("TAB", emulator, delay=0) em_write("f", emulator) while 1: em_ss(emulator, idx) if findObject(f"./obj/email_window.png", idx) : break time.sleep(0.2) time.sleep(0.1) em_press("TAB", emulator) em_press("UP", emulator) em_press("ENTER", emulator) em_press("UP", emulator, clicks=4) em_press("ENTER", emulator) while 1: em_ss(emulator, idx) if findObject(f"./obj/email_window.png", idx) : break time.sleep(0.2) em_press("TAB", emulator) em_press("SPACE", emulator) em_press("TAB", emulator, clicks=2, delay=0.1) em_press("SPACE", emulator) return pw def info(acc): def generate_random_questions(): names = [ "Alice", "Bob", "Charlie", "Diana", "Eve", "Frank", "Grace", "Hank", "Ivy", "Jack", "Kara", "Leo", "Mona", "Nina", "Oscar", "Paul", "Quinn", "Rita", "Steve", "Tina", "Uma", "Victor", "Wendy", "Xander", "Yara", "Zane", "Amy", "Brian", "Clara", "David", "Elena", "Felix", "Gina", "Harry", "Isla", "James", "Kira", "Liam", "Mila", "Nora", "Owen", "Pia", "Quentin", "Rachel", "Sam", "Tara", "Uri", "Vera", "Walter", "Xena", "Yuri", "Zara", "Aiden", "Bella", "Caleb", "Daisy", "Ethan", "Fiona", "George", "Holly", "Ian", "Jill", "Kyle", "Lola", "Mason", "Nina", "Oliver", "Penny", "Quinn", "Rose", "Sean", "Tina", "Ursula", "Vincent", "Willow", "Xavier", "Yvonne", "Zach", "Ava", "Ben", "Chloe", "Dan", "Emma", "Finn", "Gabby", "Hugo", "Ivy", "Jack", "Kate", "Liam", "Mia" ] works = [ "Engineer", "Doctor", "Teacher", "Artist", "Writer", "Musician", "Architect", "Chef", "Lawyer", "Nurse", "Accountant", "Scientist", "Pharmacist", "Designer", "Pilot", "Electrician", "Plumber", "Mechanic", "Farmer", "Carpenter", "Veterinarian", "Journalist", "Photographer", "Chef", "Firefighter", "Police Officer", "Dentist", "Surgeon", "Developer", "Analyst", "Consultant", "Therapist", "Coach", "Athlete", "Actor", "Director", "Producer", "Editor", "Translator", "Librarian", "Researcher", "Scientist", "Entrepreneur", "Manager", "Salesperson", "Marketer", "Realt", "Worker", "Counselor", "Pilot", "Florist", "Decorator", "Barista", "Bartender", "Chef", "Stylist", "Trainer", "Instructor", "Dancer", "Choreographer", "Fitness Instructor", "Coach", "Athlete", "Artist", "Painter", "Sculptor", "Musician", "Singer", "Composer", "Conductor", "Producer", "Director", "Writer", "Author", "Poet", "Blogger", "Vlogger", "Influencer", "Content Creator", "Photographer", "Videographer", "Cinematographer", "Actor", "Comedian", "Magician", "Clown", "Entertainer", "Model", "Fashion", "Designer" ] places = [ "NewYork", "LosAngeles", "Chicago", "Houston", "Phoenix", "Philadelphia", "SanAntonio", "SanDiego", "Dallas", "SanJose", "Austin", "Jacksonville", "FortWorth", "Columbus", "Charlotte", "SanFrancisco", "Indianapolis", "Seattle", "Denver", "Washington", "Boston", "El Paso", "Nashville", "Detroit", "Oklahoma", "Portland", "LasVegas", "Memphis", "Louisville", "Baltimore", "Milwaukee", "Albuquerque", "Tucson", "Fresno", "Sacramento", "Mesa", "Kansas", "Atlanta", "Omaha", "Colorado", "Raleigh", "Miami", "Virginia", "Oakland", "Minneapolis", "Tulsa", "Arlington", "Tampa", "NewOrleans", "Wichita", "Cleveland", "Bakersfield", "Aurora", "Anaheim", "Honolulu", "Santa Ana", "Riverside", "Corpus Christi", "Lexington", "Stockton", "Henderson", "Louis", "Pittsburgh", "Cincinnati", "Anchorage", "Greensboro", "Plano", "Newark", "Lincoln", "Toledo", "Orlando", "Vista", "Irvine", "Wayne", "Jersey", "Durham", "Petersburg", "Laredo", "Buffalo", "Madison", "Lubbock", "Chandler", "Scottsdale", "Glendale", "Reno", "Norfolk", "Winston", "Vegas", "Irving", "Chesapeake" ] date = f"0{random.randint(1,9)}/0{random.randint(1,9)}/{random.randint(1980,2000)}" return [random.choice(names).replace(" ","") , random.choice(works).replace(" ","") , random.choice(places).replace(" ","") , date] # if open("o.txt").readline().rstrip() == "RND": q1,q2,q3,date = generate_random_questions() q1,q2,q3,date = generate_random_questions() while 1: em_ss(emulator, idx) point = findObject(f"./obj/info.png", idx) if point : point = point[0]; break time.sleep(1) print(point) em_click(point, emulator) name = acc.split("@")[0] em_write(f"{name[:name.__len__()//2]}", emulator) em_press("TAB", emulator, delay=0) em_write(f"{name[name.__len__()//2:]}", emulator) em_press("TAB", emulator, delay=0) em_write(date.split("/")[0], emulator); em_write(date.split("/")[1], emulator); em_write(date.split("/")[2], emulator) while 1: em_ss(emulator, idx) point = findObject(f"./obj/ques.png", idx) if point : point = point[0]; break time.sleep(1) em_click(point, emulator); time.sleep(0.1) em_press("SPACE", emulator); time.sleep(0.1) em_press("ENTER", emulator); time.sleep(0.1) em_press("TAB", emulator, delay=0.1) em_write(q1, emulator) em_press("TAB", emulator); time.sleep(0.1) # em_press("SPACE", emulator); time.sleep(0.1) # em_press("ENTER", emulator); time.sleep(0.1) em_write("w", emulator) em_press("TAB", emulator, delay=0.1) em_write(q2, emulator) em_press("TAB", emulator) # em_press("SPACE", emulator); time.sleep(0.1) # em_press("ENTER", emulator); time.sleep(0.1) em_write("i", emulator) em_press("TAB", emulator, delay=0.1) em_write(q3, emulator) em_press("TAB", emulator, clicks=2, delay=0) em_press("SPACE", emulator) return q1,q2,q3,date def phone(): global smsQue, oldOTP, phoneName,phoneNum while 1: em_ss(emulator, idx) point = findObject(f"./obj/phoneR.png", idx) if point : point = point[0]; break time.sleep(1) point = (point[0] ,point[1]-20) print(point) em_click(point, emulator) while 1: em_ss(emulator, idx) point = findObject(f"./obj/phoneN.png", idx) if point : point = point[0]; break time.sleep(1) print(point) em_click(point, emulator) em_write(phoneNum, emulator) em_press("TAB", emulator, clicks=3) smsQue.append(idx) while smsQue[0] != idx: time.sleep(1) em_press("SPACE", emulator) otp = Phone_getOTP() oldOTP = otp smsQue.pop(0) print(otp) while 1: em_ss(emulator, idx) point = findObject(f"./obj/OTP.png", idx) if point : point = point[0]; break time.sleep(1) print(point) em_click(point, emulator) em_write(otp, emulator) em_press("ENTER", emulator) while 1: em_ss(emulator, idx) point = findObject(f"./obj/next.png", idx) if point : point = point[0]; break time.sleep(1) print(point) em_click(point, emulator) def address(): egypt_governorates = [ "Cairo", "Alexandria", "Giza", "Luxor", "Aswan", "Suez", "Ismailia", "Dakahlia", "Sharkia","Beheira", "Minya", "Fayoum", "Qena", "Sohag", "Matruh", "Gharbia", "Menoufia", "Qalyubia", "Damietta","Assiut" ] egypt_postal_codes = [ "11511", "21519", "11767", "11632", "82611", "43711", "41611", "35615", "35511", "44629", "43111", "82633", "11698", "33511", "61711", "63511", "22711", "32951", "42711", "12611", "31711", "33511", "18611", "11671", "46611", "11011", "31821" ] while 1: em_ss(emulator, idx) point = findObject(f"./obj/verified.png", idx) if point : point = point[0]; break time.sleep(1) print(point) em_click(point, emulator) em_press("TAB", emulator, clicks=4, delay=0) em_write(random.choice(egypt_governorates), emulator) em_press("TAB", emulator, clicks=2, delay=0.1) em_write(random.choice(egypt_governorates), emulator) em_press("TAB", emulator, delay=0.1) # em_press("SPACE", emulator, delay=0.4) em_write("c", emulator) # em_press("ENTER", emulator, delay=0.3) em_press("TAB", emulator, delay=0.1) em_write(random.choice(egypt_postal_codes), emulator) em_press("TAB", emulator, clicks=2, delay=0) em_write("023", emulator); em_write(f"02{random.randint(2,5)}{random.randint(200,250)}{random.randint(1111,8888)}", emulator) em_press("TAB", emulator, clicks=3, delay=0) em_press("SPACE", emulator, delay=0.1) def Gmail_aceOTP(link): while 1: time.sleep(0.7) try: print(2.5) r = requests.get(link+"&short=1") print(r.json()) if r.json()["message"] == "No latest emails": continue otp = r.json()["message"]["email_code"] if otp in tstOTP:continue break except:pass return otp def Phone_getOTP(): global smsQue, oldOTP, phoneName,phoneNum while 1: adb_command = ['adb', '-s', phoneName,'shell', 'content', 'query','--uri', "content://sms"] with open("sms.txt", 'w') as file: subprocess.run(adb_command, stdout=file, check=True) ssm = io.open("sms.txt",encoding='utf-8').readline() txxt = "Enter this code to confirm mobile phone billing as an Apple services payment method: " pos = ssm.find(txxt) + len(txxt) otp = ssm[pos:pos+4] try: if otp == oldOTP: continue except:pass print(smsQue) return otp def getGmails(): gmails = gmailsFb.get('', None) accs = [] x = random.choice(list(gmails)); gmailsFb.delete("",x); accs.append(gmails[x]) addToNote(accsFile,accs[0]) def resetAll(): run_adb_command(["shell","pm","clear com.apple.android.music"], emulator); time.sleep(0.5) run_adb_command(["shell","am start -n com.device.emulator.pro/com.device.emulator.pro.MainActivity"], emulator); time.sleep(0.5) while 1: em_ss(emulator, idx) point = findObject(f"./obj/reset.png", idx) if point : point = point[0]; break time.sleep(0.3) print(point) p1 = (point[0]-40, point[1]); p2 = (point[0]+40, point[1]) em_click(p1,emulator); time.sleep(0.2); em_click(p2,emulator) while 1: em_ss(emulator, idx) point = findObject(f"./obj/reset2.png", idx) if point : point = point[0]; break # time.sleep(0.3) print(point) em_click(point,emulator); time.sleep(0.2) em_press("TAB", emulator, delay=0) em_press("ENTER", emulator); time.sleep(0.7) run_adb_command(["shell","input keyevent KEYCODE_HOME"], emulator) count =0 accsFile = f"accs{idx}.txt" while 1: if count %5 == 0 and idx != 1: queue.append(idx) while len(queue)>0: ... if count %5 == 0 and idx ==1: queue.append(idx) while 0