Esempio n. 1
0
File: action.py Progetto: fmca/ctxpy
 def do_email(self, action, variables):
     d.screen.on()
     d.press.home()
     Adb.start("com.google.android.gm/com.google.android.gm.ComposeActivityGmail")
     d(resourceId="com.google.android.gm:id/to").click()
     Adb.write(action['value'])
     d.press.enter()
     d(resourceId="com.google.android.gm:id/subject").click()
     Adb.write(self.get_var("$titulo", variables))
     d(resourceId="com.google.android.gm:id/body").click()
     Adb.write(self.get_var("$mensagem", variables))
     d(resourceId="com.google.android.gm:id/send").click()
Esempio n. 2
0
File: action.py Progetto: fmca/ctxpy
 def do_email(self, action, variables):
     d.screen.on()
     d.press.home()
     Adb.start(
         "com.google.android.gm/com.google.android.gm.ComposeActivityGmail")
     d(resourceId="com.google.android.gm:id/to").click()
     Adb.write(action['value'])
     d.press.enter()
     d(resourceId="com.google.android.gm:id/subject").click()
     Adb.write(self.get_var("$titulo", variables))
     d(resourceId="com.google.android.gm:id/body").click()
     Adb.write(self.get_var("$mensagem", variables))
     d(resourceId="com.google.android.gm:id/send").click()
Esempio n. 3
0
    def generate(self):
        result = Adb.shell("dumpsys", "location").replace("\n", "").replace("\r", "")
        m = re.match(".*Last Known Locations:.*gps: Location\[gps (.*?) acc=(.*?) et.*Last Known.*", result)
        coordinates = None
        accuracy = 0
        try:
            coordinates_tuple_str = tuple(StrUtils.split(m.group(1), ",", 2))
            print(coordinates_tuple_str)
            coordinates = tuple(map(lambda x: float(x.replace(",", ".")), coordinates_tuple_str))
            accuracy = 1 - (int(m.group(2)) / self.acceptable_distance)
        except AttributeError:
            traceback.print_exc()  # m can be None

        return {"value": coordinates, "accuracy": accuracy}
Esempio n. 4
0
File: action.py Progetto: fmca/ctxpy
 def do_facebook(self, action, variables):
     contact = action["value"]
     d.screen.on()
     d.press.home()
     Adb.start("com.facebook.orca/.auth.StartScreenActivity")
     d(resourceId="com.facebook.orca:id/action_search").click()
     Adb.write(contact)
     d(className="android.widget.ListView").child(index=1).click()
     d(resourceId="com.facebook.orca:id/edit_text").click()
     Adb.write(self.get_var("$mensagem", variables))
     d(description="Enviar").click()
Esempio n. 5
0
File: action.py Progetto: fmca/ctxpy
 def do_facebook(self, action, variables):
     contact = action["value"]
     d.screen.on()
     d.press.home()
     Adb.start("com.facebook.orca/.auth.StartScreenActivity")
     d(resourceId="com.facebook.orca:id/action_search").click()
     Adb.write(contact)
     d(className="android.widget.ListView").child(index=1).click()
     d(resourceId="com.facebook.orca:id/edit_text").click()
     Adb.write(self.get_var("$mensagem", variables))
     d(description="Enviar").click()
Esempio n. 6
0
    def generate(self):
        result = Adb.shell("dumpsys",
                           "location").replace("\n", "").replace("\r", "")
        m = re.match(
            ".*Last Known Locations:.*gps: Location\[gps (.*?) acc=(.*?) et.*Last Known.*",
            result)
        coordinates = None
        accuracy = 0
        try:
            coordinates_tuple_str = tuple(StrUtils.split(m.group(1), ",", 2))
            print(coordinates_tuple_str)
            coordinates = tuple(
                map(lambda x: float(x.replace(",", ".")),
                    coordinates_tuple_str))
            accuracy = 1 - (int(m.group(2)) / self.acceptable_distance)
        except AttributeError:
            traceback.print_exc()  # m can be None

        return {"value": coordinates, "accuracy": accuracy}