Skip to content

Commit 81090e7

Browse files
authored
Update phonesploit.py
1 parent 145e2ff commit 81090e7

File tree

1 file changed

+155
-155
lines changed

1 file changed

+155
-155
lines changed

phonesploit.py

Lines changed: 155 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -694,68 +694,67 @@ def use_keycode():
694694
keycode_option = input(
695695
f"{color.RED}\n[KEYCODE] {color.WHITE}Enter selection > ").lower()
696696

697-
match keycode_option:
698-
case '0':
699-
keycodes = False
700-
display_menu()
701-
case '99':
702-
os.system(clear)
703-
print(banner.keycode_menu)
704-
case '1':
705-
text = input(f'\n{color.CYAN}Enter text > {color.WHITE}')
706-
os.system(f'adb shell input text "{text}"')
707-
print(f'{color.YELLOW}\nEntered {color.WHITE}"{text}"')
708-
case '2':
709-
os.system('adb shell input keyevent 3')
710-
print(f'{color.YELLOW}\nPressed Home Button{color.WHITE}')
711-
case '3':
712-
os.system('adb shell input keyevent 4')
713-
print(f'{color.YELLOW}\nPressed Back Button{color.WHITE}')
714-
case '4':
715-
os.system('adb shell input keyevent 187')
716-
print(f'{color.YELLOW}\nPressed Recent Apps Button{color.WHITE}')
717-
case '5':
718-
os.system('adb shell input keyevent 26')
719-
print(f'{color.YELLOW}\nPressed Power Key{color.WHITE}')
720-
case '6':
721-
os.system('adb shell input keyevent 19')
722-
print(f'{color.YELLOW}\nPressed DPAD Up{color.WHITE}')
723-
case '7':
724-
os.system('adb shell input keyevent 20')
725-
print(f'{color.YELLOW}\nPressed DPAD Down{color.WHITE}')
726-
case '8':
727-
os.system('adb shell input keyevent 21')
728-
print(f'{color.YELLOW}\nPressed DPAD Left{color.WHITE}')
729-
case '9':
730-
os.system('adb shell input keyevent 22')
731-
print(f'{color.YELLOW}\nPressed DPAD Right{color.WHITE}')
732-
case '10':
733-
os.system('adb shell input keyevent 67')
734-
print(f'{color.YELLOW}\nPressed Delete/Backspace{color.WHITE}')
735-
case '11':
736-
os.system('adb shell input keyevent 66')
737-
print(f'{color.YELLOW}\nPressed Enter{color.WHITE}')
738-
case '12':
739-
os.system('adb shell input keyevent 24')
740-
print(f'{color.YELLOW}\nPressed Volume Up{color.WHITE}')
741-
case '13':
742-
os.system('adb shell input keyevent 25')
743-
print(f'{color.YELLOW}\nPressed Volume Down{color.WHITE}')
744-
case '14':
745-
os.system('adb shell input keyevent 126')
746-
print(f'{color.YELLOW}\nPressed Media Play{color.WHITE}')
747-
case '15':
748-
os.system('adb shell input keyevent 127')
749-
print(f'{color.YELLOW}\nPressed Media Pause{color.WHITE}')
750-
case '16':
751-
os.system('adb shell input keyevent 61')
752-
print(f'{color.YELLOW}\nPressed Tab Key{color.WHITE}')
753-
case '17':
754-
os.system('adb shell input keyevent 111')
755-
print(f'{color.YELLOW}\nPressed Esc Key{color.WHITE}')
756-
757-
case other:
758-
print("\nInvalid selection!\n")
697+
# Replace match statement with if-elif
698+
if keycode_option == '0':
699+
keycodes = False
700+
display_menu()
701+
elif keycode_option == '99':
702+
os.system(clear)
703+
print(banner.keycode_menu)
704+
elif keycode_option == '1':
705+
text = input(f'\n{color.CYAN}Enter text > {color.WHITE}')
706+
os.system(f'adb shell input text "{text}"')
707+
print(f'{color.YELLOW}\nEntered {color.WHITE}"{text}"')
708+
elif keycode_option == '2':
709+
os.system('adb shell input keyevent 3')
710+
print(f'{color.YELLOW}\nPressed Home Button{color.WHITE}')
711+
elif keycode_option == '3':
712+
os.system('adb shell input keyevent 4')
713+
print(f'{color.YELLOW}\nPressed Back Button{color.WHITE}')
714+
elif keycode_option == '4':
715+
os.system('adb shell input keyevent 187')
716+
print(f'{color.YELLOW}\nPressed Recent Apps Button{color.WHITE}')
717+
elif keycode_option == '5':
718+
os.system('adb shell input keyevent 26')
719+
print(f'{color.YELLOW}\nPressed Power Key{color.WHITE}')
720+
elif keycode_option == '6':
721+
os.system('adb shell input keyevent 19')
722+
print(f'{color.YELLOW}\nPressed DPAD Up{color.WHITE}')
723+
elif keycode_option == '7':
724+
os.system('adb shell input keyevent 20')
725+
print(f'{color.YELLOW}\nPressed DPAD Down{color.WHITE}')
726+
elif keycode_option == '8':
727+
os.system('adb shell input keyevent 21')
728+
print(f'{color.YELLOW}\nPressed DPAD Left{color.WHITE}')
729+
elif keycode_option == '9':
730+
os.system('adb shell input keyevent 22')
731+
print(f'{color.YELLOW}\nPressed DPAD Right{color.WHITE}')
732+
elif keycode_option == '10':
733+
os.system('adb shell input keyevent 67')
734+
print(f'{color.YELLOW}\nPressed Delete/Backspace{color.WHITE}')
735+
elif keycode_option == '11':
736+
os.system('adb shell input keyevent 66')
737+
print(f'{color.YELLOW}\nPressed Enter{color.WHITE}')
738+
elif keycode_option == '12':
739+
os.system('adb shell input keyevent 24')
740+
print(f'{color.YELLOW}\nPressed Volume Up{color.WHITE}')
741+
elif keycode_option == '13':
742+
os.system('adb shell input keyevent 25')
743+
print(f'{color.YELLOW}\nPressed Volume Down{color.WHITE}')
744+
elif keycode_option == '14':
745+
os.system('adb shell input keyevent 126')
746+
print(f'{color.YELLOW}\nPressed Media Play{color.WHITE}')
747+
elif keycode_option == '15':
748+
os.system('adb shell input keyevent 127')
749+
print(f'{color.YELLOW}\nPressed Media Pause{color.WHITE}')
750+
elif keycode_option == '16':
751+
os.system('adb shell input keyevent 61')
752+
print(f'{color.YELLOW}\nPressed Tab Key{color.WHITE}')
753+
elif keycode_option == '17':
754+
os.system('adb shell input keyevent 111')
755+
print(f'{color.YELLOW}\nPressed Esc Key{color.WHITE}')
756+
else:
757+
print("\nInvalid selection!\n")
759758

760759

761760
def open_link():
@@ -1175,99 +1174,99 @@ def main():
11751174
option = input(
11761175
f"\n{color.RED}[Main Menu] {color.WHITE}Enter selection > ").lower()
11771176

1178-
match option:
1179-
case 'p':
1180-
change_page('p')
1181-
case 'n':
1182-
change_page('n')
1183-
case '0':
1184-
exit_phonesploit_pro()
1185-
case '99':
1186-
clear_screen()
1187-
case '1':
1188-
connect()
1189-
case '2':
1190-
list_devices()
1191-
case '3':
1192-
disconnect()
1193-
case '4':
1194-
scan_network()
1195-
case '5':
1196-
mirror()
1197-
case '6':
1198-
get_screenshot()
1199-
case '7':
1200-
screenrecord()
1201-
case '8':
1202-
pull_file()
1203-
case '9':
1204-
push_file()
1205-
case '10':
1206-
launch_app()
1207-
case '11':
1208-
install_app()
1209-
case '12':
1210-
uninstall_app()
1211-
case '13':
1212-
list_apps()
1213-
case '14':
1214-
get_shell()
1215-
case '15':
1216-
hack()
1217-
case '16':
1218-
list_files()
1219-
case '17':
1220-
send_sms()
1221-
case '18':
1222-
copy_whatsapp()
1223-
case '19':
1224-
copy_screenshots()
1225-
case '20':
1226-
copy_camera()
1227-
case '21':
1228-
anonymous_screenshot()
1229-
case '22':
1230-
anonymous_screenrecord()
1231-
case '23':
1232-
open_link()
1233-
case '24':
1234-
open_photo()
1235-
case '25':
1236-
open_audio()
1237-
case '26':
1238-
open_video()
1239-
case '27':
1240-
get_device_info()
1241-
case '28':
1242-
battery_info()
1243-
case '29':
1244-
reboot('system')
1245-
case '30':
1246-
reboot('advanced')
1247-
case '31':
1248-
unlock_device()
1249-
case '32':
1250-
lock_device()
1251-
case '33':
1252-
dump_sms()
1253-
case '34':
1254-
dump_contacts()
1255-
case '35':
1256-
dump_call_logs()
1257-
case '36':
1258-
extract_apk()
1259-
case '37':
1260-
stop_adb()
1261-
case '38':
1262-
power_off()
1263-
case '39':
1264-
use_keycode()
1265-
case '40':
1266-
update_me()
1267-
case '41':
1268-
visit_me()
1269-
case other:
1270-
print("\nInvalid selection!\n")
1177+
# Replace match statement with if-elif
1178+
if option == 'p':
1179+
change_page('p')
1180+
elif option == 'n':
1181+
change_page('n')
1182+
elif option == '0':
1183+
exit_phonesploit_pro()
1184+
elif option == '99':
1185+
clear_screen()
1186+
elif option == '1':
1187+
connect()
1188+
elif option == '2':
1189+
list_devices()
1190+
elif option == '3':
1191+
disconnect()
1192+
elif option == '4':
1193+
scan_network()
1194+
elif option == '5':
1195+
mirror()
1196+
elif option == '6':
1197+
get_screenshot()
1198+
elif option == '7':
1199+
screenrecord()
1200+
elif option == '8':
1201+
pull_file()
1202+
elif option == '9':
1203+
push_file()
1204+
elif option == '10':
1205+
launch_app()
1206+
elif option == '11':
1207+
install_app()
1208+
elif option == '12':
1209+
uninstall_app()
1210+
elif option == '13':
1211+
list_apps()
1212+
elif option == '14':
1213+
get_shell()
1214+
elif option == '15':
1215+
hack()
1216+
elif option == '16':
1217+
list_files()
1218+
elif option == '17':
1219+
send_sms()
1220+
elif option == '18':
1221+
copy_whatsapp()
1222+
elif option == '19':
1223+
copy_screenshots()
1224+
elif option == '20':
1225+
copy_camera()
1226+
elif option == '21':
1227+
anonymous_screenshot()
1228+
elif option == '22':
1229+
anonymous_screenrecord()
1230+
elif option == '23':
1231+
open_link()
1232+
elif option == '24':
1233+
open_photo()
1234+
elif option == '25':
1235+
open_audio()
1236+
elif option == '26':
1237+
open_video()
1238+
elif option == '27':
1239+
get_device_info()
1240+
elif option == '28':
1241+
battery_info()
1242+
elif option == '29':
1243+
reboot('system')
1244+
elif option == '30':
1245+
reboot('advanced')
1246+
elif option == '31':
1247+
unlock_device()
1248+
elif option == '32':
1249+
lock_device()
1250+
elif option == '33':
1251+
dump_sms()
1252+
elif option == '34':
1253+
dump_contacts()
1254+
elif option == '35':
1255+
dump_call_logs()
1256+
elif option == '36':
1257+
extract_apk()
1258+
elif option == '37':
1259+
stop_adb()
1260+
elif option == '38':
1261+
power_off()
1262+
elif option == '39':
1263+
use_keycode()
1264+
elif option == '40':
1265+
update_me()
1266+
elif option == '41':
1267+
visit_me()
1268+
else:
1269+
print("\nInvalid selection!\n")
12711270

12721271

12731272
# Starting point of the program
@@ -1299,3 +1298,4 @@ def main():
12991298
main()
13001299
except KeyboardInterrupt:
13011300
exit_phonesploit_pro()
1301+

0 commit comments

Comments
 (0)