Python API Monitor for Android apps
PAPIMonitor (Python API Monitor for Android apps) is a python tool based on Frida for monitoring user-select APIs during the app execution. The app should be installed within an emulator already connected through ADB to the pc host. The user can choose to monitor a predefined list of APIs divided into several categories (e.g., Device Data, Device Info, SMS) or a custom list of APIs passed through the command line to the script. The tool stores the invoked API, the parameters, the return value, and the line and file from where it was called.
Below is an example of output:
{
"category": "Custom",
"class": "com.dave.popupre.MainActivity",
"method": "getText",
"args": [],
"calledFrom": "com.dave.popupre.MainActivity$1.onClick(MainActivity.java:26)",
"returnValue": "Hello Toast!",
"time": "03/09/2021, 14:43:06"
}
:warning: Warning with Google Emulator
Google Emulator | Ubuntu | Windows | MacOS |
---|---|---|---|
7.x x86 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
8.x x86 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
9.0 x86 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
10.0 x86 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
11.0 x86 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
12.0 x86 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
:warning: Frida seems broken on Android 11-12 (x86_64) (Google Emulatore).
General requirements:
sudo apt-get install libjpeg-dev zlib1g-dev
pyenv install 3.8.0
pyenv virtualenv 3.8.0 papi-monitor
pyenv activate 3.8.0/envs/papi-monitor
pip3 install -r requirements
sudo apt-get install python3-virtualenv
virtualenv env
source env/bin/activate
pip install -r requirements
resources/frida-server/
A lot of Frida Script for Android can be found here.