def main():

    for action_code in SOFT_KEYBOARD_ACTIONS.keys():
        SOFT_KEYBOARD_ACTIONS_LIST.append(action_code)
    print("Record tap gestures:", SOFT_KEYBOARD_ACTIONS_LIST, "\n")

    lf.kill_app(lf.LOGGING_APP)
    lf.adb("am start -n " + SOFT_KEYBOARD_ACTIVITY)
    time.sleep(1.0)

    lf.start_logging_app(clean_start=False)

    # First round without adb event trigger to enable automated detection of candidate side channels
    for gesture in SOFT_KEYBOARD_ACTIONS_LIST:
        do_tap_gesture(gesture, trigger_event=False)
        time.sleep(0.5)

    randomized_record.acquire_data_randomized(SOFT_KEYBOARD_ACTIONS_LIST,
                                              RECORDS_PER_GESTURE,
                                              do_tap_gesture)

    lf.stop_logging_app()
Пример #2
0
def main():

    for app in config.TARGET_APPS:
        for permission in PROTECTED_PERMISSIONS:
            lf.adb("pm grant " + app + " android.permission." + permission)
def start_website(url, trigger_event=True):
    if trigger_event:
        lf.trigger_new_event(url)
    lf.adb("am start -a \"android.intent.action.VIEW\" -d \"" + url + "\"")
def long_press_event(pos):
    duration = 550  # milliseconds
    lf.adb("input swipe " + str(pos.x) + " " + str(pos.y) + " " + str(pos.x) +
           " " + str(pos.y) + " " + str(duration))
def short_swipe_event():
    lf.adb("input swipe 100 1450 450 1450 75")
def long_swipe_event():
    lf.adb("input swipe 100 1450 850 1450 300")
def tap_event(pos):
    for cnt in range(0, REPEAT_TAPS):
        lf.adb("input tap " + str(pos.x) + " " + str(pos.y))
Пример #8
0
def start_google_maps_poi_search(search_query, trigger_event=True):
    if trigger_event:
        lf.trigger_new_event(search_query)
    lf.adb("am start -a \"android.intent.action.VIEW\" -d \"geo:0,0?q=" +
           search_query + "\"")
def launch_activity(activity_target):
    return lf.adb("am start -n " + activity_target, get_output=True)