-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDuoRunner.py
More file actions
50 lines (46 loc) · 2.29 KB
/
Copy pathDuoRunner.py
File metadata and controls
50 lines (46 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import subprocess
import os
import time
def main(triggerQueue, returnQueue, speedMultiple=1):
#
# p1 = subprocess.run(['dir','dne'], shell=True, stderr=subprocess.DEVNULL)
# print(p1.stderr)
# subprocess.call("notepad.exe")
# subprocess.run('cd C:\\Users\\camcd\\.android\\avd\\Duo_Slave.avd', shell=True)
subprocess.Popen("emulator -avd Duo_Slave_2 -no-snapshot-save", shell=True)
os.chdir("C:\\Users\\Christopher McDonnel\\AppData\\Local\\Android\\Sdk\\platform-tools")
# print('got past cd')
status = subprocess.run("adb devices", capture_output=True, text=True)
thirdStatus = subprocess.run('adb shell getprop init.svc.bootanim', capture_output=True, text=True, shell=True)
while status.stdout.split()[-1] != 'device' or 'stopped' not in thirdStatus.stdout:
time.sleep(0.25)
status = subprocess.run("adb devices", capture_output=True, text=True)
# print(status.stdout.split())
# print('stopped' not in thirdStatus.stdout)
otherStatus = subprocess.run("adb shell service call power 12", capture_output=True, text=True)
otherStatus = subprocess.run('adb shell dumpsys power | find "mWakefulness="', capture_output=True, text=True, shell=True)
thirdStatus = subprocess.run('adb shell getprop init.svc.bootanim', capture_output=True, shell=True, text=True)
# print(type(otherStatus.stdout))
# print(thirdStatus.stdout)
# print('finished checking')
# print(thirdStatus.stdout)
# time.sleep(1)
while triggerQueue.empty():
continue
time.sleep(1)
subprocess.call('adb shell am start com.duosecurity.duomobile/.account_list.AccountListActivity"', shell=True)
time.sleep(8*speedMultiple)
subprocess.call("adb shell input touchscreen tap 550 430", shell=True)
time.sleep(1*speedMultiple^2)
subprocess.call("adb shell input touchscreen tap 250 1960", shell=True)
time.sleep(0.5*(speedMultiple^2))
# subprocess.run("adb shell kill-server", shell=True)
subprocess.run("Taskkill /IM qemu-system-x86_64.exe /F /T", shell=True)
returnQueue.put("We done")
return
# return duoCodeRaw
if __name__ == '__main__':
from multiprocessing import SimpleQueue
triggerQueue = SimpleQueue()
triggerQueue.put('Go get em chief')
main(triggerQueue, SimpleQueue())