Merge branch 'master' into feature/listen_to_sms
This commit is contained in:
+14
-7
@@ -1,7 +1,10 @@
|
||||
import subprocess
|
||||
|
||||
from pojo.contact_pojo import ContactPojo
|
||||
|
||||
PACKAGE_NAME = "com.lpa.appointement"
|
||||
ACTIVITY_NAME = "MainActivity"
|
||||
BROADCAST_ACTION = "com.lpa.appointement.broadcast"
|
||||
|
||||
|
||||
class Commandor:
|
||||
@@ -9,22 +12,26 @@ class Commandor:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def reload_page(self):
|
||||
def start_page(self, contact: ContactPojo):
|
||||
# specifying an explicit component name
|
||||
self.clear_app_data()
|
||||
subprocess.call("adb shell am start -n {}/.{}".format(PACKAGE_NAME, ACTIVITY_NAME), shell=True)
|
||||
|
||||
subprocess.call(
|
||||
"adb shell am start -n {}/.{} --es \"first_name\" \"{}\" --es \"last_name\" \"{}\" --es \"phone\" \"{}\" --es \"email\" \"{}\" --es \"passport\" \"{}\"".format(
|
||||
PACKAGE_NAME, ACTIVITY_NAME, contact.first_name, contact.last_name, contact.phone, contact.mail, contact.passport), shell=True)
|
||||
pass
|
||||
|
||||
def clear_app_data(self):
|
||||
subprocess.call("adb shell pm clear {}".format(PACKAGE_NAME), shell=True)
|
||||
|
||||
def send_telephone_number(self):
|
||||
pass
|
||||
|
||||
def send_otp(self):
|
||||
def send_otp(self, otp: str):
|
||||
subprocess.call(
|
||||
"adb shell am broadcast -a {} --es otp \"{}\"".format(BROADCAST_ACTION, otp), shell=True)
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
commandor = Commandor()
|
||||
commandor.reload_page()
|
||||
contact = ContactPojo("0608090706", "1234567890", "Willy", "Arnold", "AZEER", "test@test.fr")
|
||||
commandor.start_page(contact)
|
||||
# commandor.send_otp("12345")
|
||||
|
||||
Reference in New Issue
Block a user