cuckoo-droid
cuckoo-droid copied to clipboard
process.popen() shell parameter fixed
Issue was with support of depricated function and the parameter , path the android shell .
I have Fixed the bug related to process.popen() in #53
I have reproduced the issue on my local system.
Setup: - Ubuntu 18.04 Python 3.8 Android API 18 Android Linux kernel version 4.4
We need to make below chages to analyzer/android/lib/api/adb.py file :-
search for function execute_sample(package,activity)
#proc = subprocess.Popen("["/system/bin/am", "start","-n ", package + "/" + activity], stdout=subprocess.PIPE, shell=True, stderr=subprocess.PIPE) to subprocess.Popen("/system/bin/am start -n "+ package + "/" + activity, stdout=subprocess.PIPE, shell=True, stderr=subprocess.PIPE, executable='/system/bin/sh')
The issue is with subprocess.Popen() functions parameter. Reference:- https://docs.python.org/3/library/subprocess.html
Changed in version 3.6: args parameter accepts a path-like object if shell is False and a sequence containing path-like objects on POSIX.
I have throughly tested the fixed. After fixing the issue, I didn't get bug.