diff --git a/mobsf/MobSF/utils.py b/mobsf/MobSF/utils.py index b6a4f5320..d24e4367a 100755 --- a/mobsf/MobSF/utils.py +++ b/mobsf/MobSF/utils.py @@ -98,6 +98,17 @@ def upstream_proxy(flaw_type): return proxies, verify +def get_system_resources(): + """Get CPU and Memory Available.""" + # Get number of physical cores + physical_cores = psutil.cpu_count(logical=False) + # Get number of logical processors (threads) + logical_processors = psutil.cpu_count(logical=True) + # Get total RAM + total_ram = psutil.virtual_memory().total / (1024 ** 3) # Convert bytes to GB + return physical_cores, logical_processors, total_ram + + def print_version(): """Print MobSF Version.""" logger.info(settings.BANNER) @@ -122,6 +133,8 @@ def print_version(): dst_str = f' ({dist}) ' env_str = f'OS Environment: {os}{dst_str}{pltfm}' logger.info(env_str) + cores, threads, ram = get_system_resources() + logger.info('CPU Cores: %s, Threads: %s, RAM: %.2f GB', cores, threads, ram) find_java_binary() check_basic_env() thread = threading.Thread(target=check_update, name='check_update') diff --git a/mobsf/StaticAnalyzer/views/android/xapk.py b/mobsf/StaticAnalyzer/views/android/xapk.py index 1d60a7490..67e130eaa 100644 --- a/mobsf/StaticAnalyzer/views/android/xapk.py +++ b/mobsf/StaticAnalyzer/views/android/xapk.py @@ -107,8 +107,6 @@ def handle_aab(app_dic): if not apks.exists() and aab_path.exists(): # Convert AAB to APKS subprocess.run(args, timeout=300) - # Remove AAB - aab_path.unlink() # Extract APK from APKS for apk_file in unzip(checksum, apks.as_posix(), app_dic['app_dir']): full_path = app_dic['app_dir'] / apk_file diff --git a/mobsf/templates/static_analysis/android_binary_analysis.html b/mobsf/templates/static_analysis/android_binary_analysis.html index abd716d62..cc1aced3d 100755 --- a/mobsf/templates/static_analysis/android_binary_analysis.html +++ b/mobsf/templates/static_analysis/android_binary_analysis.html @@ -1827,6 +1827,7 @@