Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import os
- import configparser
- #menu buffer memory
- menu_actions = {}
- #Str var
- soft_lb = "\n"
- sof_lbs = "\n\n"
- soft_config_file = "config.cfg"
- soft_desc = "This little script makes it easy to recover photos on a device connect by adb android."
- soft_crea = "Coocke_hunt jonathan.gleyze{AT}gmail{DOT}com"
- soft_ver = "1.0"
- sof_last_up = "23 janv 2019"
- def main():
- os.system('cls')
- print("Welcome," + sof_lbs + soft_desc + soft_lb)
- print("Creator : " + soft_crea + soft_lb + "Version : " + soft_ver + soft_lb + "Last update : " + sof_last_up + soft_lb + "config : " + soft_config_file)
- print("_________________________________________________________________________" + soft_lb)
- print("1. Get pics")
- print("2. Get all the Pics from a file")
- print("0. EXIT")
- print("_________________________________________________________________________" + soft_lb)
- choice = input(soft_lb + " >> ")
- exec_menu(choice)
- def exec_menu(choice):
- os.system('cls')
- ch = choice.lower()
- if ch == '':
- menu_actions['main']()
- else:
- try:
- menu_actions[ch]()
- except KeyError:
- print("Invalid selection, please try again."+ soft_lb)
- menu_actions['main']()
- return
- def get_pics():
- print("Recover a photos on the remote device connect by adb" + soft_lb)
- print("_________________________________________________________________________" + soft_lb)
- print("3. Execute")
- print("9. Back")
- print("0. EXIT")
- print("_________________________________________________________________________" + soft_lb)
- choice = input(soft_lb + " >> ")
- exec_menu(choice)
- return
- def exec_on_pics():
- print ("remote directory : ")
- choice_re = input(soft_lb + " >> ")
- current_dir = os.path.dirname(os.path.realpath(__file__))
- os.system("adb pull " + choice_re + " " + current_dir)
- os.system("pause")
- return
- def get_pics_file():
- print("GPF")
- return
- def back():
- menu_actions['main_menu']()
- return
- def exit():
- sys.exit()
- return
- menu_actions = {
- 'main_menu': main,
- '1': get_pics,
- '2': get_pics_file,
- '3': exec_on_pics,
- '9': back,
- '0': exit,
- }
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement