AndroidFridaManager


NameAndroidFridaManager JSON
Version 1.8.3 PyPI version JSON
download
home_pagehttps://github.com/fkie-cad/AndroidFridaManager
SummaryA python API in order to install and run the frida-server on an Android device.
upload_time2025-07-29 14:37:00
maintainerNone
docs_urlNone
authorDaniel Baier
requires_python>=3.6
licenseGPL v3
keywords mobile instrumentation frida hook android
VCS
bugtrack_url
requirements frida colorlog requests
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![version](https://img.shields.io/badge/version-1.8.3-blue) [![PyPI version](https://badge.fury.io/py/AndroidFridaManager.svg)](https://badge.fury.io/py/AndroidFridaManager) [![Publish status](https://github.com/fkie-cad/friTap/actions/workflows/publish.yml/badge.svg?branch=main)](https://github.com/fkie-cad/AndroidFridaManager/actions/workflows/publish-to-pypi.yml)

# AndroidFridaManager

AndroidFridaManager is a Python API designed to simplify the installation and management of Frida on Android devices. It provides an easy-to-use interface for installing and running the latest Frida server, as well as the flexibility to install specific versions as needed.

Key features:

- Frida Server Management:  Seamlessly install and run the latest Frida server on your Android device, or choose to install a specific version as required.
- Job Management: Execute Frida scripts as independent jobs, managed by the `JobManager()`. This feature allows for concurrent execution of multiple Frida scripts, with each job running in its own thread.
- `afrim` Tool Integration: Utilize the `afrim` tool to check for existing Frida server installations on your device and ensure you are always running the latest version.


The project was inspired by [Frida-Python-Binding](https://github.com/Mind0xP/Frida-Python-Binding/tree/master).

## Install

Just install it via pip:
```bash
python3 -m pip install AndroidFridaManager
```

This will install the `afrim`-command to your system.

## Usage

In order to easily install the latest frida-server version to your Android device just run the following command:

```bash
$ afrim 
```

In order to check only if frida-server is running invoke it with the `-r`-parameter:

```bash
$ afrim -r
```


## API Usage

In order to install and run Frida on your Android device use the `FridaManager`-API:
```python
from AndroidFridaManager import FridaManager
...
afm_obj = FridaManager(is_remote=False, socket="ip:port", verbose=False, frida_install_dst="/data/local/tmp/")
afm_obj.install_frida_server()
afm_obj.run_frida_server()
```

For running Frida scripts as jobs use the `JobManager`-API:
```python
from AndroidFridaManager import JobManager
...
app_package = "net.classwindexampleyear.bookseapiececountry"
frida_script_path = "./frida_script1.js"
job_manager = JobManager()
job_manager.setup_frida_session(app_package, myAwesomeHookingHandler)
job_manager.start_job(frida_script_path, myAwesomeHookingHandler)
print("Running jobs:", job_manager.running_jobs())
job_manager.stop_app_with_closing_frida(app_package)
``` 

The `setup_frida_session()` function accepts a callback function as its second parameter, typically provided by `script.on('message', on_message)`. This initializes the first job and, by default, is the only job where you can activate [child_gating and spawn_gating](https://frida.re/news/#child-gating). To execute the job, you must invoke the `start_job()` function.

## API

```python
install_frida_server(dst_dir="/data/local/tmp/", version="latest")
run_frida_server()
is_frida_server_running()
stop_frida_server()
remove_frida_server()

# JobManager
JobManager(host="", enable_spawn_gating=False)
running_jobs() # list running jobs
start_android_app(package_name, main_activity = None, extras = None) # returns the PID of the start app
setup_frida_session(target_process, frida_callback_function, should_spawn=True,foreground=False)
start_job(frida_script_name, frida_callback_function)
stop_jobs() # stops all running jobs
stop_job_with_id(job_id) # stop only job with job_id
detach_from_app() # will also be invoked when running stop_app_with_closing_frida()
stop_app_with_closing_frida(app_package)
stop_app(app_package)
kill_app(pid)
setup_frida_handler(host="", enable_spawn_gating=False) # returns the device object and is used by setup_frida_session()

# setup_frida_handler,setup_frida_session will raise the FridaBasedException(Exception). Ensure to handle it
```

### JobManager

The JobManager expect a running `frida-server`on the target device. 

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fkie-cad/AndroidFridaManager",
    "name": "AndroidFridaManager",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "mobile, instrumentation, frida, hook, android",
    "author": "Daniel Baier",
    "author_email": "daniel.baier@fkie.fraunhofer.de",
    "download_url": "https://files.pythonhosted.org/packages/32/06/61b94b6edc392c8605beea5cdb3bd4e97ee5ee320eb01c00b9e06175b4d3/androidfridamanager-1.8.3.tar.gz",
    "platform": null,
    "description": "![version](https://img.shields.io/badge/version-1.8.3-blue) [![PyPI version](https://badge.fury.io/py/AndroidFridaManager.svg)](https://badge.fury.io/py/AndroidFridaManager) [![Publish status](https://github.com/fkie-cad/friTap/actions/workflows/publish.yml/badge.svg?branch=main)](https://github.com/fkie-cad/AndroidFridaManager/actions/workflows/publish-to-pypi.yml)\n\n# AndroidFridaManager\n\nAndroidFridaManager is a Python API designed to simplify the installation and management of Frida on Android devices. It provides an easy-to-use interface for installing and running the latest Frida server, as well as the flexibility to install specific versions as needed.\n\nKey features:\n\n- Frida Server Management:  Seamlessly install and run the latest Frida server on your Android device, or choose to install a specific version as required.\n- Job Management: Execute Frida scripts as independent jobs, managed by the `JobManager()`. This feature allows for concurrent execution of multiple Frida scripts, with each job running in its own thread.\n- `afrim` Tool Integration: Utilize the `afrim` tool to check for existing Frida server installations on your device and ensure you are always running the latest version.\n\n\nThe project was inspired by [Frida-Python-Binding](https://github.com/Mind0xP/Frida-Python-Binding/tree/master).\n\n## Install\n\nJust install it via pip:\n```bash\npython3 -m pip install AndroidFridaManager\n```\n\nThis will install the `afrim`-command to your system.\n\n## Usage\n\nIn order to easily install the latest frida-server version to your Android device just run the following command:\n\n```bash\n$ afrim \n```\n\nIn order to check only if frida-server is running invoke it with the `-r`-parameter:\n\n```bash\n$ afrim -r\n```\n\n\n## API Usage\n\nIn order to install and run Frida on your Android device use the `FridaManager`-API:\n```python\nfrom AndroidFridaManager import FridaManager\n...\nafm_obj = FridaManager(is_remote=False, socket=\"ip:port\", verbose=False, frida_install_dst=\"/data/local/tmp/\")\nafm_obj.install_frida_server()\nafm_obj.run_frida_server()\n```\n\nFor running Frida scripts as jobs use the `JobManager`-API:\n```python\nfrom AndroidFridaManager import JobManager\n...\napp_package = \"net.classwindexampleyear.bookseapiececountry\"\nfrida_script_path = \"./frida_script1.js\"\njob_manager = JobManager()\njob_manager.setup_frida_session(app_package, myAwesomeHookingHandler)\njob_manager.start_job(frida_script_path, myAwesomeHookingHandler)\nprint(\"Running jobs:\", job_manager.running_jobs())\njob_manager.stop_app_with_closing_frida(app_package)\n``` \n\nThe `setup_frida_session()` function accepts a callback function as its second parameter, typically provided by `script.on('message', on_message)`. This initializes the first job and, by default, is the only job where you can activate [child_gating and spawn_gating](https://frida.re/news/#child-gating). To execute the job, you must invoke the `start_job()` function.\n\n## API\n\n```python\ninstall_frida_server(dst_dir=\"/data/local/tmp/\", version=\"latest\")\nrun_frida_server()\nis_frida_server_running()\nstop_frida_server()\nremove_frida_server()\n\n# JobManager\nJobManager(host=\"\", enable_spawn_gating=False)\nrunning_jobs() # list running jobs\nstart_android_app(package_name, main_activity = None, extras = None) # returns the PID of the start app\nsetup_frida_session(target_process, frida_callback_function, should_spawn=True,foreground=False)\nstart_job(frida_script_name, frida_callback_function)\nstop_jobs() # stops all running jobs\nstop_job_with_id(job_id) # stop only job with job_id\ndetach_from_app() # will also be invoked when running stop_app_with_closing_frida()\nstop_app_with_closing_frida(app_package)\nstop_app(app_package)\nkill_app(pid)\nsetup_frida_handler(host=\"\", enable_spawn_gating=False) # returns the device object and is used by setup_frida_session()\n\n# setup_frida_handler,setup_frida_session will raise the FridaBasedException(Exception). Ensure to handle it\n```\n\n### JobManager\n\nThe JobManager expect a running `frida-server`on the target device. \n",
    "bugtrack_url": null,
    "license": "GPL v3",
    "summary": "A python API in order to install and run the frida-server on an Android device.",
    "version": "1.8.3",
    "project_urls": {
        "Homepage": "https://github.com/fkie-cad/AndroidFridaManager"
    },
    "split_keywords": [
        "mobile",
        " instrumentation",
        " frida",
        " hook",
        " android"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a2c243c0e175442bfc36c072d55f2784a4beae4370b123af49eee8f6b582d3e9",
                "md5": "7c8e7851869e7fc4a980236a752cfa30",
                "sha256": "3ee0eba1d9301959982a28fdaeab2051ca2809ef51ea2e075a60a508558b7571"
            },
            "downloads": -1,
            "filename": "androidfridamanager-1.8.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7c8e7851869e7fc4a980236a752cfa30",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 25024,
            "upload_time": "2025-07-29T14:36:59",
            "upload_time_iso_8601": "2025-07-29T14:36:59.557541Z",
            "url": "https://files.pythonhosted.org/packages/a2/c2/43c0e175442bfc36c072d55f2784a4beae4370b123af49eee8f6b582d3e9/androidfridamanager-1.8.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "320661b94b6edc392c8605beea5cdb3bd4e97ee5ee320eb01c00b9e06175b4d3",
                "md5": "85c3160ddc2e96982ac2de464efe38be",
                "sha256": "9081316502086c62d76806fa3ca98e3be4b9ca0e5ce1bb408a6e774c63ba9673"
            },
            "downloads": -1,
            "filename": "androidfridamanager-1.8.3.tar.gz",
            "has_sig": false,
            "md5_digest": "85c3160ddc2e96982ac2de464efe38be",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 25777,
            "upload_time": "2025-07-29T14:37:00",
            "upload_time_iso_8601": "2025-07-29T14:37:00.660137Z",
            "url": "https://files.pythonhosted.org/packages/32/06/61b94b6edc392c8605beea5cdb3bd4e97ee5ee320eb01c00b9e06175b4d3/androidfridamanager-1.8.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-29 14:37:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fkie-cad",
    "github_project": "AndroidFridaManager",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "frida",
            "specs": [
                [
                    ">=",
                    "15.0.0"
                ]
            ]
        },
        {
            "name": "colorlog",
            "specs": []
        },
        {
            "name": "requests",
            "specs": []
        }
    ],
    "lcname": "androidfridamanager"
}
        
Elapsed time: 0.67018s