Merge branch 'master' into feature/listen_to_sms
This commit is contained in:
+14
-7
@@ -1,7 +1,10 @@
|
|||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
from pojo.contact_pojo import ContactPojo
|
||||||
|
|
||||||
PACKAGE_NAME = "com.lpa.appointement"
|
PACKAGE_NAME = "com.lpa.appointement"
|
||||||
ACTIVITY_NAME = "MainActivity"
|
ACTIVITY_NAME = "MainActivity"
|
||||||
|
BROADCAST_ACTION = "com.lpa.appointement.broadcast"
|
||||||
|
|
||||||
|
|
||||||
class Commandor:
|
class Commandor:
|
||||||
@@ -9,22 +12,26 @@ class Commandor:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def reload_page(self):
|
def start_page(self, contact: ContactPojo):
|
||||||
# specifying an explicit component name
|
# specifying an explicit component name
|
||||||
self.clear_app_data()
|
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
|
pass
|
||||||
|
|
||||||
def clear_app_data(self):
|
def clear_app_data(self):
|
||||||
subprocess.call("adb shell pm clear {}".format(PACKAGE_NAME), shell=True)
|
subprocess.call("adb shell pm clear {}".format(PACKAGE_NAME), shell=True)
|
||||||
|
|
||||||
def send_telephone_number(self):
|
def send_otp(self, otp: str):
|
||||||
pass
|
subprocess.call(
|
||||||
|
"adb shell am broadcast -a {} --es otp \"{}\"".format(BROADCAST_ACTION, otp), shell=True)
|
||||||
def send_otp(self):
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
commandor = Commandor()
|
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