Python wrapper to use FlowDroid APK analyzer.
Project description
PyFlowDroid
Python wrappers for FlowDroid Apk analyzer. This project was built with two goals in mind:
- Automate the creation of a FlowDroid environment out-of-the-box
- Allow the usage of FlowDroid from Python code
Installation
Prerequisites
Make sure you have:
- A working version of java in the PATH of your environment.
- A working version of python in the PATH of your environment.
- A working version of git in the PATH of your environment.
Installing pyFlowDroid dependencies
You can install it with pip by:
$ pip install pyflowdroid
Download FlowDroid and its dependencies
This step will download and install FlowDroid and the required resources to use it:
$ python -m pyflowdroid install
Usage
There are two ways in which you can use pyflowdroid: As a command line tool or as a Python library.
Using pyflowdroid from the command line
The main advantage of using pyflowdroid as a command line tool over using FlowDroid directly is the automatic gathering of resources required to execute the flow analysis. pyflowdroid comes bundled with all the required resources to allow a quick analysis of apk files.
To analyze an .apk file with the default pyflowdroid setup, just run:
$ python -m pyflowdroid analyze path/to/file.apk
Similarly, you can perform a flow analysis on all the apks inside a folder:
$ python -m pyflowdroid analyze path/to/folder/
This should store raw FlowDroid logs for each analyzed apk and then show a general report like the following:
################################################################################
# PYFLOWDROID REPORT #
################################################################################
Analized: 5
Leaks found: 2
Leaky apps:
- 'path/to/folder/app1.apk'
- 'path/to/folder/app3.apk'
If you want to get some test apks, pyflowdroid includes a download function to fetch apks from a given supplier. Current available supplier are:
To fetch apks from a supplier, just run:
$ python -m pyflowdroid download supplier_name
Using pyflowdroid as a Python library
[Comming Soon]
Contributing to pyflowdroid
If you want to add any features to pyflowdroid you will need to get a development enviroment.
Fetching the project source code
You can clone the github repository by executing:
$ git clone https://github.com/gvieralopez/pyFlowDroid
$ cd pyFlowDroid
Installing pyFlowDroid dependencies
You can install them with poetry by executing:
$ poetry shell
$ poetry install
$ poetry build
Download FlowDroid and its dependencies
This step will download and install FlowDroid. After doing this you can use FlowDroid with or without pyFlowDroid wrappers. Simply run:
$ python -m pyflowdroid install
Making your changes appear in the project
Just make a Pull Request.
Run tests:
$ pytest
Type checking:
$ mypy
Code style:
$ flake8
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pyflowdroid-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f6dbc10cd52b3ab449a370cddbd207524c6bceafddfe82c5e3324e1292dd1e9 |
|
MD5 | f1270809121e142f67ec3f3ce887e6a8 |
|
BLAKE2b-256 | 72992da10333f545d632dcd7e0838d5f377abf1b9656e64f83860647e415611a |