From f3e03099cff314277f8986e89ad4e6b8f4dbbfca Mon Sep 17 00:00:00 2001 From: Azeem Idrisi Date: Sat, 7 Oct 2023 15:45:47 +0530 Subject: [PATCH] v1.61 Detect Android Version before Stream/Record --- modules/banner.py | 2 +- phonesploitpro.py | 31 +++++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/modules/banner.py b/modules/banner.py index 4b259fb..b7a07bb 100644 --- a/modules/banner.py +++ b/modules/banner.py @@ -5,7 +5,7 @@ from modules import color -version = "v1.6" +version = "v1.61" menu1 = f""" diff --git a/phonesploitpro.py b/phonesploitpro.py index 2c19805..2afbd5a 100755 --- a/phonesploitpro.py +++ b/phonesploitpro.py @@ -1440,8 +1440,21 @@ def scan_network(): def record_audio(mode): print( - f"\n{color.RED}[Warning] {color.CYAN}This feature is currently available for devices running on Android 11 or higher only.{color.WHITE}" + f"\n{color.RED}[Notice] {color.CYAN}This feature is currently available for devices running on Android 11 or higher only.{color.WHITE}" ) + try: + androidVersion = os.popen("adb shell getprop ro.build.version.release").read() + android_os = int(androidVersion.split(".")[0]) + print(f"\n{color.GREEN}Detected Android Version : {androidVersion}") + except ValueError: + print( + f"\n{color.RED} No connected device found\n{color.GREEN} Going back to Main Menu{color.WHITE}" + ) + return + + if android_os<11: + print(f"{color.RED}Going back to Main Menu{color.WHITE}") + return global pull_location if pull_location == "": @@ -1549,8 +1562,22 @@ def record_audio(mode): def stream_audio(mode): print( - f"\n{color.RED}[Warning] {color.CYAN}This feature is currently available for devices running on Android 11 or higher only.{color.WHITE}" + f"\n{color.RED}[Notice] {color.CYAN}This feature is currently available for devices running on Android 11 or higher only.{color.WHITE}" ) + try: + androidVersion = os.popen("adb shell getprop ro.build.version.release").read() + android_os = int(androidVersion.split(".")[0]) + print(f"\n{color.GREEN}Detected Android Version : {androidVersion}") + except ValueError: + print( + f"\n{color.RED} No connected device found\n{color.GREEN} Going back to Main Menu{color.WHITE}" + ) + return + + if android_os<11: + print(f"{color.RED}Going back to Main Menu{color.WHITE}") + return + match mode: case "mic": print(