CLI support added

This commit is contained in:
Kevin Rode 2019-09-28 21:38:22 -04:00
parent 300d688368
commit cd3a832a18

28
amt.py
View File

@ -113,11 +113,35 @@ def menu():
elif int(choice) == 99:
print("Goodbye!")
sys.exit()
def show_help():
print("Android Mobile Toolkit v1.1")
print("Written by Kevin Rode (kevroded)")
print()
print("Run with amt.exe [options]")
print()
print("OPTIONS:")
print(" --interactive : start the utility in a mode with a menu for the user to select options on")
print(" -i : alias for --interactive")
print(" --root : root a connected Android device")
print(" -r : alias for --root")
print(" --help : print this message")
print(" -h : alias for --help")
def main():
adb_start()
menu()
if "--interactive" in sys.argv[1:] or "-i" in sys.argv[1:]:
adb_start()
menu()
elif "--root" in sys.argv[1:] or "-r" in sys.argv[1:]:
device = adb_connect()
twrp_download(device)
push_files(device)
reboot_bootloader()
root_device()
elif "--help" in sys.argv[1:] or "-h" in sys.argv[1:]:
show_help()
else:
show_help()
main()