# abdelrahmanmshawki/pulse_facebook_android architecture

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

- Interactive diagram: https://gitdiagram.com/abdelrahmanmshawki/pulse_facebook_android
- Repository: https://github.com/abdelrahmanmshawki/pulse_facebook_android

## Overview

PULSE + Frida monitors Facebook Reels on an Android device: the user chooses a reel-count or time-based run, then the app is launched with the Frida hook, navigated to Reels, and swiped by the automator. Per-reel timing aligns player, network, and radio observations; the session assembles an Excel workbook and graphs. The graph preserves the documented throughput and playback-state capabilities. Some wiring is documented in the README rather than shown in the excerpts, so those edges cite the README.

Main entry points: [`main.py`](https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/main.py) (Session entry), [`reel_data.py`](https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/reel_data.py) (Reel session monitor), [`frida_runner.py`](https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/frida_runner.py) (Frida event runner), [`reel_automator.py`](https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/reel_automator.py) (Swipe automator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_run["Run control"]
  node_main["Session entry<br/>[main.py]"]
  node_navigation["Reels navigation"]
  node_automator["Swipe automator<br/>[reel_automator.py]"]
end

subgraph group_capture["Reel capture"]
  node_hook["ABR and CDN hook<br/>[fb_abr_hook.js]"]
  node_frida["Frida event runner<br/>[frida_runner.py]"]
  node_monitor["Reel session monitor<br/>[reel_data.py]"]
  node_gate["Playback gate<br/>[playback_gate.py]"]
end

subgraph group_metrics["Device metrics"]
  node_radio["Radio KPIs<br/>[radio_reader.py]"]
  node_throughput["Byte throughput<br/>[bytes_reader.py]"]
  node_ttfb["TCP latency capture<br/>[ttfb_measure.py]"]
end

subgraph group_output["Reporting"]
  node_workbook["Excel workbook<br/>[excel_export.py]"]
  node_graphs["Session graphs<br/>[graphs.py]"]
end

node_user(("Run operator"))
node_facebook["Facebook app"]
node_device["Android device"]

node_user -->|"configures run"| node_main
node_main -->|"starts hook"| node_frida
node_frida -->|"loads script"| node_hook
node_hook -->|"observes playback"| node_facebook
node_main -->|"navigates app"| node_navigation
node_navigation -->|"opens Reels"| node_facebook
node_main -->|"starts gate"| node_gate
node_frida -->|"feeds buffer"| node_gate
node_main -->|"creates monitor"| node_monitor
node_main -->|"starts sampling"| node_radio
node_main -->|"starts swipes"| node_automator
node_automator -->|"swipes reels"| node_facebook
node_automator -->|"marks boundaries"| node_monitor
node_monitor -->|"queries reel events"| node_frida
node_monitor -->|"buckets samples"| node_radio
node_monitor -->|"records throughput"| node_throughput
node_monitor -->|"measures latency"| node_ttfb
node_radio -->|"reads radio state"| node_device
node_ttfb -->|"captures TCP"| node_device
node_monitor -->|"writes inputs"| node_workbook
node_main -->|"generates plots"| node_graphs
node_workbook -->|"reads workbook"| node_graphs

click node_main "https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/main.py"
click node_navigation "https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/facebook_reels_navigation.py"
click node_automator "https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/reel_automator.py"
click node_hook "https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/fb_abr_hook.js"
click node_frida "https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/frida_runner.py"
click node_monitor "https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/reel_data.py"
click node_gate "https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/playback_gate.py"
click node_radio "https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/radio_reader.py"
click node_throughput "https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/bytes_reader.py"
click node_ttfb "https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/ttfb_measure.py"
click node_workbook "https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/excel_export.py"
click node_graphs "https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/graphs.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_main,node_navigation,node_automator toneBlue
class node_hook,node_frida,node_monitor,node_gate toneAmber
class node_radio,node_throughput,node_ttfb toneMint
class node_workbook,node_graphs toneRose
class node_user,node_facebook,node_device toneIndigo
```

## Components

### Run control

- [Session entry](https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/main.py): `main.py`
- [Reels navigation](https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/facebook_reels_navigation.py): `facebook_reels_navigation.py`
- [Swipe automator](https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/reel_automator.py): `reel_automator.py`

### Reel capture

- [ABR and CDN hook](https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/fb_abr_hook.js): `fb_abr_hook.js`
- [Frida event runner](https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/frida_runner.py): `frida_runner.py`
- [Reel session monitor](https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/reel_data.py): `reel_data.py`
- [Playback gate](https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/playback_gate.py): `playback_gate.py`

### Device metrics

- [Radio KPIs](https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/radio_reader.py): `radio_reader.py`
- [Byte throughput](https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/bytes_reader.py): `bytes_reader.py`
- [TCP latency capture](https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/ttfb_measure.py): `ttfb_measure.py`

### Reporting

- [Excel workbook](https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/excel_export.py): `excel_export.py`
- [Session graphs](https://github.com/abdelrahmanmshawki/pulse_facebook_android/blob/main/graphs.py): `graphs.py`

### Other components

- **Run operator**
- **Facebook app**
- **Android device**

## Connections

- Run operator → Session entry: configures run (evidence: `README.md`)
- Session entry → Frida event runner: starts hook (evidence: `main.py`)
- Frida event runner → ABR and CDN hook: loads script (evidence: `README.md`)
- ABR and CDN hook → Facebook app: observes playback (evidence: `README.md`)
- Session entry → Reels navigation: navigates app (evidence: `README.md`)
- Reels navigation → Facebook app: opens Reels (evidence: `README.md`)
- Session entry → Playback gate: starts gate (evidence: `main.py`)
- Frida event runner → Playback gate: feeds buffer (evidence: `main.py`)
- Session entry → Reel session monitor: creates monitor (evidence: `main.py`)
- Session entry → Radio KPIs: starts sampling (evidence: `main.py`)
- Session entry → Swipe automator: starts swipes (evidence: `README.md`)
- Swipe automator → Facebook app: swipes reels (evidence: `README.md`)
- Swipe automator → Reel session monitor: marks boundaries (evidence: `README.md`)
- Reel session monitor → Frida event runner: queries reel events (evidence: `reel_data.py`)
- Reel session monitor → Radio KPIs: buckets samples (evidence: `README.md`)
- Reel session monitor → Byte throughput: records throughput (evidence: `README.md`)
- Reel session monitor → TCP latency capture: measures latency (evidence: `reel_data.py`)
- Radio KPIs → Android device: reads radio state (evidence: `README.md`)
- TCP latency capture → Android device: captures TCP (evidence: `README.md`)
- Reel session monitor → Excel workbook: writes inputs (evidence: `reel_data.py`)
- Session entry → Session graphs: generates plots (evidence: `README.md`)
- Excel workbook → Session graphs: reads workbook (evidence: `README.md`)
