Skip to content

Commit 466d7f9

Browse files
author
Ch0pin
committed
record the device screen while medusa is running in non-interactive mode
1 parent f738c1c commit 466d7f9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

medusa.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,6 +1633,8 @@ def run_frida_n_interactive(self, force, detached, package_name, device, pid=-1,
16331633
device = frida.get_device_manager() \
16341634
.add_remote_device(f'{host}:{port}')
16351635
print(f'Using device:{device}')
1636+
recording = self.package_name+'-'+str(int(time.time()))+'.mp4'
1637+
os.popen(f"adb -s {self.device.id} shell screenrecord /sdcard/{recording} --time-limit {self.time_to_run}")
16361638

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

16701674
except Exception as e:

0 commit comments

Comments
 (0)