# firerpa/lamda architecture

> Architecture diagram of the GitHub repository firerpa/lamda, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/firerpa/lamda
- Repository: https://github.com/firerpa/lamda

## Overview

FIRERPA is an Android device-control platform; this repository contains its Python client and RPC protocol definitions, not the on-device service. The principal workflow is a Python caller connecting to a device service, invoking device operations, and receiving results. The client exposes distinct UI automation, application management, virtual displays, image/OCR, proxy/MITM, and Frida capabilities. The README documents broader remote-desktop, networking, and capture features; those branches are shown at the RPC boundary where implementation detail is unavailable. Relationships beyond the sampled client excerpts are cited to the README, not presented as inspected implementation.

Main entry points: [`lamda/client.py`](https://github.com/firerpa/lamda/blob/10/lamda/client.py) (Device Client), [`tools/startmitm.py`](https://github.com/firerpa/lamda/blob/10/tools/startmitm.py) (Proxy And Capture), [`lamda/rpc`](https://github.com/firerpa/lamda/tree/10/lamda/rpc) (RPC Protocols), [`lamda/exceptions.py`](https://github.com/firerpa/lamda/blob/10/lamda/exceptions.py) (Client Exceptions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client API"]
  node_device_client["Device Client<br/>[client.py]"]
  node_rpc_protocols["RPC Protocols"]
  node_exceptions["Client Exceptions<br/>[exceptions.py]"]
end

subgraph group_automation["UI Automation"]
  node_ui_automation["UI Automation<br/>[client.py]"]
  node_virtual_displays["Virtual Displays<br/>[client.py]"]
  node_ocr_image["OCR And Images<br/>[client.py]"]
end

subgraph group_device_ops["Device Operations"]
  node_app_management["App Management<br/>[client.py]"]
  node_shell_ops["Shell And Device Ops<br/>[client.py]"]
  node_remote_desktop["Remote Desktop"]
end

subgraph group_networking["Network And Inspection"]
  node_proxy_capture["Proxy And Capture<br/>[startmitm.py]"]
  node_frida_hooks["Frida Hooks<br/>[client.py]"]
  node_network_services["Network Services"]
end

node_caller(("Python Caller"))
node_android_service["Android Service"]

node_caller -->|"connects through"| node_device_client
node_device_client -->|"sends RPCs"| node_android_service
node_device_client -->|"uses definitions"| node_rpc_protocols
node_device_client -->|"raises client errors"| node_exceptions
node_device_client -->|"exposes"| node_ui_automation
node_ui_automation -->|"invokes UI RPCs"| node_android_service
node_device_client -->|"exposes"| node_virtual_displays
node_virtual_displays -->|"requests displays"| node_android_service
node_device_client -->|"exposes"| node_ocr_image
node_device_client -->|"exposes"| node_app_management
node_app_management -->|"sends app requests"| node_android_service
node_device_client -.->|"exposes"| node_shell_ops
node_device_client -.->|"supports"| node_remote_desktop
node_device_client -->|"supports"| node_proxy_capture
node_proxy_capture -->|"configures proxy"| node_android_service
node_device_client -.->|"exposes"| node_frida_hooks
node_device_client -.->|"supports"| node_network_services

click node_device_client "https://github.com/firerpa/lamda/blob/10/lamda/client.py"
click node_rpc_protocols "https://github.com/firerpa/lamda/tree/10/lamda/rpc"
click node_ui_automation "https://github.com/firerpa/lamda/blob/10/lamda/client.py"
click node_virtual_displays "https://github.com/firerpa/lamda/blob/10/lamda/client.py"
click node_ocr_image "https://github.com/firerpa/lamda/blob/10/lamda/client.py"
click node_app_management "https://github.com/firerpa/lamda/blob/10/lamda/client.py"
click node_shell_ops "https://github.com/firerpa/lamda/blob/10/lamda/client.py"
click node_remote_desktop "https://github.com/firerpa/lamda/tree/10/lamda/rpc"
click node_proxy_capture "https://github.com/firerpa/lamda/blob/10/tools/startmitm.py"
click node_frida_hooks "https://github.com/firerpa/lamda/blob/10/lamda/client.py"
click node_network_services "https://github.com/firerpa/lamda/tree/10/lamda/rpc"
click node_exceptions "https://github.com/firerpa/lamda/blob/10/lamda/exceptions.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_device_client,node_rpc_protocols,node_exceptions toneBlue
class node_ui_automation,node_virtual_displays,node_ocr_image toneAmber
class node_app_management,node_shell_ops,node_remote_desktop toneMint
class node_proxy_capture,node_frida_hooks,node_network_services toneRose
class node_caller,node_android_service toneIndigo
```

## Components

### Client API

- [Device Client](https://github.com/firerpa/lamda/blob/10/lamda/client.py): `lamda/client.py`
- [RPC Protocols](https://github.com/firerpa/lamda/tree/10/lamda/rpc): `lamda/rpc`
- [Client Exceptions](https://github.com/firerpa/lamda/blob/10/lamda/exceptions.py): `lamda/exceptions.py`

### UI Automation

- [UI Automation](https://github.com/firerpa/lamda/blob/10/lamda/client.py): `lamda/client.py`
- [Virtual Displays](https://github.com/firerpa/lamda/blob/10/lamda/client.py): `lamda/client.py`
- [OCR And Images](https://github.com/firerpa/lamda/blob/10/lamda/client.py): `lamda/client.py`

### Device Operations

- [App Management](https://github.com/firerpa/lamda/blob/10/lamda/client.py): `lamda/client.py`
- [Shell And Device Ops](https://github.com/firerpa/lamda/blob/10/lamda/client.py): `lamda/client.py`
- [Remote Desktop](https://github.com/firerpa/lamda/tree/10/lamda/rpc): `lamda/rpc`

### Network And Inspection

- [Proxy And Capture](https://github.com/firerpa/lamda/blob/10/tools/startmitm.py): `tools/startmitm.py`
- [Frida Hooks](https://github.com/firerpa/lamda/blob/10/lamda/client.py): `lamda/client.py`
- [Network Services](https://github.com/firerpa/lamda/tree/10/lamda/rpc): `lamda/rpc`

### Other components

- **Python Caller**
- **Android Service**

## Connections

- Python Caller → Device Client: connects through (evidence: `lamda/client.py`)
- Device Client → Android Service: sends RPCs (evidence: `lamda/client.py`)
- Device Client → RPC Protocols: uses definitions (evidence: `lamda/client.py`)
- Device Client → Client Exceptions: raises client errors (evidence: `lamda/client.py`)
- Device Client → UI Automation: exposes (evidence: `lamda/client.py`)
- UI Automation → Android Service: invokes UI RPCs (evidence: `lamda/client.py`)
- Device Client → Virtual Displays: exposes (evidence: `lamda/client.py`)
- Virtual Displays → Android Service: requests displays (evidence: `lamda/client.py`)
- Device Client → OCR And Images: exposes (evidence: `lamda/client.py`)
- Device Client → App Management: exposes (evidence: `lamda/client.py`)
- App Management → Android Service: sends app requests (evidence: `lamda/client.py`)
- Device Client → Shell And Device Ops: exposes (evidence: `lamda/client.py`)
- Device Client → Remote Desktop: supports
- Device Client → Proxy And Capture: supports (evidence: `tools/startmitm.py`)
- Proxy And Capture → Android Service: configures proxy (evidence: `tools/startmitm.py`)
- Device Client → Frida Hooks: exposes (evidence: `lamda/client.py`)
- Device Client → Network Services: supports
