-
Notifications
You must be signed in to change notification settings - Fork 347
/
culebra-navigate-firetv.py
executable file
·56 lines (41 loc) · 1.81 KB
/
culebra-navigate-firetv.py
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
51
52
53
54
55
56
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (C) 2013-2023 Diego Torres Milano
Created on 2023-09-05 by Culebra v22.6.1
__ __ __ __
/ \ / \ / \ / \
____________________/ __\/ __\/ __\/ __\_____________________________
___________________/ /__/ /__/ /__/ /________________________________
| / \ / \ / \ / \ \___
|/ \_/ \_/ \_/ \ o \
\_____/--<
@author: Diego Torres Milano
@author: Jennifer E. Swofford (ascii art snake)
"""
import os
import re
import sys
import time
from com.dtmilano.android.viewclient import ViewClient, KEY_EVENT
TAG = 'CULEBRA'
_s = 5
_v = '--verbose' in sys.argv
pid = os.getpid()
kwargs1 = {'verbose': False, 'ignoresecuredevice': False, 'ignoreversioncheck': False}
device, serialno = ViewClient.connectToDeviceOrExit(**kwargs1)
kwargs2 = {'forceviewserveruse': False, 'startviewserver': True, 'autodump': False, 'ignoreuiautomatorkilled': True, 'compresseddump': True, 'useuiautomatorhelper': True, 'debug': {}}
vc = ViewClient(device, serialno, **kwargs2)
helper = vc.uiAutomatorHelper
helper.ui_device.press_key_code(KEY_EVENT['KEYCODE_DPAD_RIGHT'])
helper.ui_device.wait_for_window_update()
helper.ui_device.press_key_code(KEY_EVENT['KEYCODE_DPAD_RIGHT'])
helper.ui_device.wait_for_window_update()
helper.ui_device.press_key_code(KEY_EVENT['KEYCODE_DPAD_RIGHT'])
helper.ui_device.wait_for_window_update()
helper.ui_device.press_key_code(KEY_EVENT['KEYCODE_DPAD_RIGHT'])
helper.ui_device.wait_for_window_update()
helper.ui_device.press_key_code(KEY_EVENT['KEYCODE_DPAD_CENTER'])
helper.ui_device.wait_for_window_update()
helper.ui_device.press_key_code(KEY_EVENT['KEYCODE_HOME'])
helper.ui_device.wait_for_window_update()