Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteSnipers committed Jan 11, 2025
1 parent 7bf540f commit 62763e8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# ChangeLog

### 0.7.36
- CHANGE: Minor fix

### 0.7.35
- CHANGE: tool objection

Expand Down
29 changes: 17 additions & 12 deletions mpt/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from mpt import functions

__version__ = '0.7.35'
__version__ = '0.7.36'

from mpt import settings, logger
from mpt.config import Config
Expand Down Expand Up @@ -508,19 +508,24 @@ def run_tool_objection():
conf = Config()
package = conf.load_config('package-name')
application_label = conf.load_config('application-label')
command = settings.ANDROID_TOOLS['objection']['bin']

app = f"\"{application_label}\" ({package})"
options = [f"run objection for app {app}", "run objection"]
terminal_menu = TerminalMenu(options, title="Please select an option:")
menu_entry_index = terminal_menu.show()
if len(application_label) > 0:

command = settings.ANDROID_TOOLS['objection']['bin']
if menu_entry_index == 0:
objection_command = f"objection --gadget \\\"{application_label}\\\" explore"
command = command.rsplit(";", 1)[0] + f"; {objection_command}; exec $SHELL"
log_info = f"Running command in {Style.BRIGHT + Fore.CYAN}kitty terminal{Style.RESET_ALL} {objection_command}"
if menu_entry_index == 1:
# replace last objection mit exec $SHELL
app = f"\"{application_label}\" ({package})"
options = [f"run objection for app {app}", "run objection"]
terminal_menu = TerminalMenu(options, title="Please select an option:")
menu_entry_index = terminal_menu.show()

if menu_entry_index == 0:
objection_command = f"objection --gadget \\\"{application_label}\\\" explore"
command = command.rsplit(";", 1)[0] + f"; {objection_command}; exec $SHELL"
log_info = f"Running command in {Style.BRIGHT + Fore.CYAN}kitty terminal{Style.RESET_ALL} {objection_command}"
if menu_entry_index == 1:
# replace last objection mit exec $SHELL
command = command.rsplit(";", 1)[0] + "; objection --help; exec $SHELL"
log_info = f"Running command in {Style.BRIGHT + Fore.CYAN}kitty terminal{Style.RESET_ALL} ..."
else:
command = command.rsplit(";", 1)[0] + "; objection --help; exec $SHELL"
log_info = f"Running command in {Style.BRIGHT + Fore.CYAN}kitty terminal{Style.RESET_ALL} ..."

Expand Down

0 comments on commit 62763e8

Please sign in to comment.