Skip to content

Commit

Permalink
record the device screen while medusa is running in non-interactive mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Ch0pin committed Feb 27, 2024
1 parent f738c1c commit 466d7f9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions medusa.py
Original file line number Diff line number Diff line change
Expand Up @@ -1633,6 +1633,8 @@ def run_frida_n_interactive(self, force, detached, package_name, device, pid=-1,
device = frida.get_device_manager() \
.add_remote_device(f'{host}:{port}')
print(f'Using device:{device}')
recording = self.package_name+'-'+str(int(time.time()))+'.mp4'
os.popen(f"adb -s {self.device.id} shell screenrecord /sdcard/{recording} --time-limit {self.time_to_run}")

self.detached = False
session = self.frida_session_handler(device, force, package_name, pid)
Expand Down Expand Up @@ -1665,6 +1667,8 @@ def run_frida_n_interactive(self, force, detached, package_name, device, pid=-1,
self.script.unload()
open(os.path.join(self.base_directory, 'agent.js'), 'w').close()
self.edit_scratchpad('')
os.popen(f"adb -s {self.device.id} pull /sdcard/{recording} {os.path.join(os.path.dirname(self.save_to_file), recording)}")
os.popen(f"adb -s {self.device.id} shell rm /sdcard/{recording}")
sys.exit(0)

except Exception as e:
Expand Down

0 comments on commit 466d7f9

Please sign in to comment.