|
15 | 15 |
|
16 | 16 | from mpt import functions
|
17 | 17 |
|
18 |
| -__version__ = '0.7.34' |
| 18 | +__version__ = '0.7.35' |
19 | 19 |
|
20 | 20 | from mpt import settings, logger
|
21 | 21 | from mpt.config import Config
|
@@ -500,6 +500,35 @@ def print_run_tool_usage():
|
500 | 500 | print(" if you pass the argument to file location please use absolute path !!!")
|
501 | 501 |
|
502 | 502 |
|
| 503 | +def run_tool_objection(): |
| 504 | + log.info("Execute the followings steps") |
| 505 | + log.info(f"1) Please run 'frida-ps -U' to find the app name") |
| 506 | + log.info(f"2) start objection with the following command: 'objection --gadget \"<APP-NAME>\" explore'") |
| 507 | + |
| 508 | + conf = Config() |
| 509 | + package = conf.load_config('package-name') |
| 510 | + application_label = conf.load_config('application-label') |
| 511 | + |
| 512 | + app = f"\"{application_label}\" ({package})" |
| 513 | + options = [f"run objection for app {app}", "run objection"] |
| 514 | + terminal_menu = TerminalMenu(options, title="Please select an option:") |
| 515 | + menu_entry_index = terminal_menu.show() |
| 516 | + |
| 517 | + command = settings.ANDROID_TOOLS['objection']['bin'] |
| 518 | + if menu_entry_index == 0: |
| 519 | + objection_command = f"objection --gadget \\\"{application_label}\\\" explore" |
| 520 | + command = command.rsplit(";", 1)[0] + f"; {objection_command}; exec $SHELL" |
| 521 | + log_info = f"Running command in {Style.BRIGHT + Fore.CYAN}kitty terminal{Style.RESET_ALL} {objection_command}" |
| 522 | + if menu_entry_index == 1: |
| 523 | + # replace last objection mit exec $SHELL |
| 524 | + command = command.rsplit(";", 1)[0] + "; objection --help; exec $SHELL" |
| 525 | + log_info = f"Running command in {Style.BRIGHT + Fore.CYAN}kitty terminal{Style.RESET_ALL} ..." |
| 526 | + |
| 527 | + terminal_with_command = f"{settings.ANDROID_TOOLS['kitty']['bin']} -- bash -c \"{command}\"" |
| 528 | + log.info(log_info) |
| 529 | + functions.run_command(terminal_with_command, return_output=False) |
| 530 | + |
| 531 | + |
503 | 532 | def run_tool(tool_with_args):
|
504 | 533 | """
|
505 | 534 | Accepts only two parameters tool + <arg>
|
@@ -549,18 +578,7 @@ def run_tool(tool_with_args):
|
549 | 578 | command = command + " " + tool_args
|
550 | 579 |
|
551 | 580 | if tool == 'objection':
|
552 |
| - |
553 |
| - log.info("Execute the followings steps") |
554 |
| - log.info(f"1) Please run 'frida-ps -U' to find the app name") |
555 |
| - log.info(f"2) start objection with the following command: 'objection --gadget \"<APP-NAME>\" explore'") |
556 |
| - |
557 |
| - command = settings.ANDROID_TOOLS[tool]['bin'] |
558 |
| - # replace last objection mit exec $SHELL |
559 |
| - command = command.rsplit(";", 1)[0] + "; exec $SHELL" |
560 |
| - |
561 |
| - terminal_with_command = f"{settings.ANDROID_TOOLS['kitty']['bin']} -- bash -c \"{command}\"" |
562 |
| - log.info(f"Running command in {Style.BRIGHT + Fore.CYAN}kitty terminal{Style.RESET_ALL} ...") |
563 |
| - functions.run_command(terminal_with_command, return_output=False) |
| 581 | + run_tool_objection() |
564 | 582 |
|
565 | 583 | # default case
|
566 | 584 | else:
|
|
0 commit comments