Skip to content

Commit 3c3ef25

Browse files
Ch0pinCh0pin
Ch0pin
authored and
Ch0pin
committed
improve regex module
1 parent 0e3d23d commit 3c3ef25

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

mango.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,35 @@
66
import sys
77

88
# Local application/library specific imports
9+
from colorama import Fore, Style, init
910
from libraries.libmango import *
1011
from libraries.Questions import *
1112
from libraries.libguava import *
1213
from libraries.libadb import *
1314
from libraries.logging_config import setup_logging
14-
15+
from shutil import which
1516

1617
logging.getLogger().handlers = []
1718
setup_logging()
1819
logger = logging.getLogger(__name__)
20+
init(autoreset=True)
21+
22+
def check_cli_tools():
23+
tools = ["adb", "jdb", "zipalign", "apksigner", "trufflehog"]
24+
all_installed = True
25+
26+
logger.info("Checking required tools:")
27+
for tool in tools:
28+
if shutil.which(tool):
29+
print(f"{Fore.GREEN}[✔] {tool}")
30+
else:
31+
print(f"{Fore.RED}[x] {tool}")
32+
all_installed = False
33+
34+
if not all_installed:
35+
logger.warning("Some tools are missing. Certain features may not work correctly.")
36+
else:
37+
logger.info("All tools are installed. You are good to go!")
1938

2039
def print_logo():
2140
print(Style.BRIGHT + BLUE + """
@@ -80,6 +99,7 @@ def interactive_menu():
8099
sys.exit(0)
81100
else:
82101
print_logo()
102+
check_cli_tools()
83103
session = sys.argv[1]
84104
if os.path.exists(session):
85105
start_session(session, existing=True)

modules/helpers/regexes.med

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@
66
{
77
console.log('\\n--------Kotlin.text.regex hook module--------------');
88

9+
let hook_1735325965 = Java.use('java.util.regex.Pattern');
10+
let overloadCount_1735325965 = hook_1735325965['matches'].overloads.length;
11+
colorLog('\nTracing ' +'matches' + ' [' + overloadCount_1735325965 + ' overload(s)]',{ c: Color.Green });
12+
13+
for (let i = 0; i < overloadCount_1735325965; i++) {
14+
hook_1735325965['matches'].overloads[i].implementation = function() {
15+
colorLog('*** entered ' +'matches',{ c: Color.Green });
16+
17+
if (arguments.length) console.log();
18+
for (let j = 0; j < arguments.length; j++) {
19+
console.log('arg[' + j + ']: ' + arguments[j]);
20+
}
21+
let retval = this['matches'].apply(this, arguments);
22+
console.log('retval: ' + retval);
23+
colorLog('*** exiting ' + 'matches',{ c: Color.Green });
24+
return retval;
25+
}
26+
}
27+
28+
29+
930
let Regex = Java.use('kotlin.text.Regex');
1031
var constructors = Regex.$init;
1132

0 commit comments

Comments
 (0)