Notileak is implemented based on LibPecker and Flowdroid. LibPecker is used to detect third party notification libraries and Flowdroid is used to detect whether these libraries leak personal information. The analysis results are stored in mongodb.
This project mainly constains three useful scripts, including library-scraper.py, main.py and FD_Analysis.py.
library-scraper.pyis used to download all notification libraries from maven and other repositories.- The downloaded libraries are mostly
aarorjarformat, which need to be convert to dex format that is required by Libpecker. Uselib2dex(True,sys_type)function to convert all these libraries todexformat. - (!!Edit the
settings.pybefore use)main.pycan then be used to iterate over a folder that contains apk files. Firstly it use libpecker to detect whether these apk files used notification libraries, if yes, it will then use Flowdroid to analyze its information leakage behaviours. The Flowdroid analysis reuslt will be writen to./flow_result/xxx.xml. FD_Analysis.pycan be used to analyze all the flowdroid result files to obtain statistics.
# Install Mongodb
apt-get install gnupg
curl -fsSL https://pgp.mongodb.com/server-6.0.asc | \
sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg \
--dearmor
touch /etc/apt/sources.list.d/mongodb-org-6.0.list
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
# Install python requirement
pip install -r requirements.txt
# Scrape latest notification libraries from Maven and other repositories.
python library-scraper.py config/notification-libraries.jsonBefore run the following command, you need to change the hardcoded paths in the settings.py
python main.py