This repository has been archived on 2023-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
Android-Mobile-Toolkit/amt.py

67 lines
2.0 KiB
Python
Raw Permalink Normal View History

2019-09-29 19:20:36 +00:00
# amt.py
2019-09-28 04:10:53 +00:00
"""
Code to interact with an android device using ADB
Written by Kevin Rode
2019-09-29 00:19:25 +00:00
Last Updated Sep 28 2019
2019-09-28 04:10:53 +00:00
"""
2019-09-29 00:19:25 +00:00
import sys
2019-09-29 19:38:41 +00:00
from helpers import root
2019-10-02 05:11:09 +00:00
from helpers import extract
2019-09-29 19:20:36 +00:00
2019-09-29 00:19:25 +00:00
def menu():
while True:
2019-10-02 05:11:09 +00:00
print("[1] Root Device\n[2] Check root\n[3] Extract Data (WIP)\n[99] Quit")
2019-09-29 00:19:25 +00:00
choice = input("Please select a number: ")
if int(choice) == 1:
2019-09-29 19:38:41 +00:00
root.root_device()
2019-09-29 00:19:25 +00:00
elif int(choice) == 2:
2019-10-02 05:11:09 +00:00
root.root_check()
elif int(choice) == 3:
extract.extract_menu()
2019-09-29 00:19:25 +00:00
elif int(choice) == 99:
print("Goodbye!")
sys.exit()
2019-10-02 05:11:09 +00:00
else:
print("Unknown input")
2019-09-29 19:20:36 +00:00
2019-09-29 01:38:22 +00:00
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")
2019-10-02 05:11:09 +00:00
print(" --check-root : checks if the device is rooted")
print(" -Ae : Extract data in app extract mode. Add -o to specify an output directory")
2019-09-29 01:38:22 +00:00
print(" --help : print this message")
print(" -h : alias for --help")
2019-09-28 03:56:01 +00:00
def main():
2019-09-29 01:38:22 +00:00
if "--interactive" in sys.argv[1:] or "-i" in sys.argv[1:]:
2019-09-29 19:38:41 +00:00
root.adb_start()
2019-09-29 01:38:22 +00:00
menu()
elif "--root" in sys.argv[1:] or "-r" in sys.argv[1:]:
2019-09-29 19:38:41 +00:00
root.root_device()
2019-09-29 01:38:22 +00:00
elif "--help" in sys.argv[1:] or "-h" in sys.argv[1:]:
show_help()
2019-10-02 05:11:09 +00:00
elif "--check-root" in sys.argv[1:]:
root.root_check()
elif "-Ae" in sys.argv[1:]:
if "-o" in sys.argv[1:]:
output_index = sys.argv.index("-o")
output = sys.argv[output_index+1]
extract.app_extract(output)
else:
extract.app_extract()
2019-09-29 01:38:22 +00:00
else:
show_help()
2019-09-28 03:56:01 +00:00
main()