# roothide/dopamine-roothide architecture

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

- Interactive diagram: https://gitdiagram.com/roothide/dopamine-roothide
- Repository: https://github.com/roothide/dopamine-roothide

## Overview

##### Project’s Main Purpose and Type
- This project is a jailbreak “toolkit” aimed at bypassing jailbreak detections – it supplies not only exploit modules and daemons for system-level operations (like fork fixing, system hooks, and launching hijacks) but also a user-facing management application (Dopamine/RootHide Manager App) allowing users to toggle jailbreak and hide its presence.
- The README clearly states that it is a “completely hidden rootless jailbreak solution” and highlights functionalities like switching between tweaks and cleaning up artifacts.

##### Break Down the File Tree into Main Architectural Components
a. Core Binaries and Daemons (Located in BaseBin):
– Multiple subdirectories such as boomerang, forkfix, idownloadd, jailbreakd, jbctl, jbinit, launchdhook, systemhook, watchdoghook, etc.
– These components are low-level executables and daemons that perform tasks such as hooking system calls, managing privileges, addressing exploit payloads, and handling IPC.
b. User-Space Management Application (Under Dopamine):
– An Xcode project written in Swift (with DopamineApp.swift, UI folders, Assets, and bridging headers).
– This is likely the RootHide Manager App, which provides the GUI for managing jailbreak state and toggling app blacklists.
c. Exploit Modules (Exploit and Packages Directories):
– “Exploits” directory contains low-level kernel exploit scripts and configurations (e.g., fastPath, oobPCI).
– Under “Packages,” there are individual Swift packages for Fugu15KernelExploit, KernelPatchfinder, PatchfinderUtils, and ProcessCommunication. These packages offer the underlying functionalities for kernel patching, process communication, and other jailbreaking services.
d. Utility and Tooling Components (Under Tools):
– Contains tools (Exe2Driver, fastPathSign, installHaxx, etc.), build scripts, and Makefiles that assist in signing, building, and installing components.

##### Relationships and Interactions
- The user-space management app (Dopamine) likely interfaces with the various daemons and binaries in BaseBin via IPC mechanisms (e.g., XPC—note the numerous xpc related headers and modules).
- The core exploit functionalities provided by Packages (Fugu15KernelExploit, KernelPatchfinder, etc.) are used by the low-level binaries in BaseBin for kernel interactions.
- Utility tools under Tools help developers or build processes streamline tertiary tasks like driver conversion, signing, or installation automation.

##### Architectural Patterns and Design Principles
- Modularity: The overall project is split into well-defined subcomponents (UI, kernel exploits, daemons, and tools) that can be understood and developed independently.
- Separation of Concerns: Distinct boundaries are evident between the frontend (Dopamine app), the system-level backends (daemons and hooks), and the kernel interaction libraries/packages.
- Low-level and high-level integration: The design bridges low-level C/assembly work (e.g., in forkfix or system hooks) with high-level Swift for the user interface, using bridging headers and well-structured IPC.

## Diagram (Mermaid)

```mermaid
flowchart TD

    %% User-Space Management Application (Dopamine)
    subgraph "User-Space Management (Dopamine)"
        dm["Dopamine Manager App"]:::frontend
        da["DopamineApp.swift"]:::frontend
        ui["UI"]:::frontend
    end

    %% System Level Daemons (BaseBin)
    subgraph "System Level Daemons (BaseBin)"
        base1["boomerang"]:::daemon
        base2["forkfix"]:::daemon
        base3["idownloadd"]:::daemon
        base4["jailbreakd"]:::daemon
        base5["jbctl"]:::daemon
        base6["jbinit"]:::daemon
        base7["launchdhook"]:::daemon
        base8["systemhook"]:::daemon
        base9["watchdoghook"]:::daemon
    end

    %% Kernel Exploit Modules (Exploits & Packages)
    subgraph "Kernel Exploit Modules"
        ex1["fastPath"]:::kernel
        ex2["oobPCI"]:::kernel
        pkg1["Fugu15KernelExploit"]:::kernel
        pkg2["KernelPatchfinder"]:::kernel
        pkg3["PatchfinderUtils"]:::kernel
        pkg4["ProcessCommunication"]:::kernel
    end

    %% Utility and Tooling Components (Tools)
    subgraph "Utility Tools"
        tool1["Exe2Driver"]:::tools
        tool2["fastPathSign"]:::tools
        tool3["installHaxx"]:::tools
    end

    %% Interactions and Data Flow
    dm -->|"IPC"| base4
    base4 -->|"KernelCalls"| pkg2
    tool1 -->|"Build"| base2
    tool2 -->|"Sign"| pkg1

    %% Click Events for BaseBin components
    click base1 "https://github.com/roothide/dopamine-roothide/tree/1.x/BaseBin/boomerang"
    click base2 "https://github.com/roothide/dopamine-roothide/tree/1.x/BaseBin/forkfix"
    click base3 "https://github.com/roothide/dopamine-roothide/tree/1.x/BaseBin/idownloadd"
    click base4 "https://github.com/roothide/dopamine-roothide/tree/1.x/BaseBin/jailbreakd"
    click base5 "https://github.com/roothide/dopamine-roothide/tree/1.x/BaseBin/jbctl"
    click base6 "https://github.com/roothide/dopamine-roothide/tree/1.x/BaseBin/jbinit"
    click base7 "https://github.com/roothide/dopamine-roothide/tree/1.x/BaseBin/launchdhook"
    click base8 "https://github.com/roothide/dopamine-roothide/tree/1.x/BaseBin/systemhook"
    click base9 "https://github.com/roothide/dopamine-roothide/tree/1.x/BaseBin/watchdoghook"

    %% Click Events for Dopamine components
    click dm "https://github.com/roothide/dopamine-roothide/tree/1.x/Dopamine"
    click da "https://github.com/roothide/dopamine-roothide/blob/1.x/Dopamine/DopamineApp.swift"
    click ui "https://github.com/roothide/dopamine-roothide/tree/1.x/Dopamine/UI"

    %% Click Events for Kernel Exploit Modules
    click ex1 "https://github.com/roothide/dopamine-roothide/tree/1.x/Exploits/fastPath"
    click ex2 "https://github.com/roothide/dopamine-roothide/tree/1.x/Exploits/oobPCI"
    click pkg1 "https://github.com/roothide/dopamine-roothide/tree/1.x/Packages/Fugu15KernelExploit"
    click pkg2 "https://github.com/roothide/dopamine-roothide/tree/1.x/Packages/KernelPatchfinder"
    click pkg3 "https://github.com/roothide/dopamine-roothide/tree/1.x/Packages/PatchfinderUtils"
    click pkg4 "https://github.com/roothide/dopamine-roothide/tree/1.x/Packages/ProcessCommunication"

    %% Click Events for Utility Tools
    click tool1 "https://github.com/roothide/dopamine-roothide/tree/1.x/Tools/Exe2Driver"
    click tool2 "https://github.com/roothide/dopamine-roothide/tree/1.x/Tools/fastPathSign"
    click tool3 "https://github.com/roothide/dopamine-roothide/tree/1.x/Tools/installHaxx"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef daemon fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef kernel fill:#FFCCCB,stroke:#000,stroke-width:1px;
    classDef tools fill:#FFD580,stroke:#000,stroke-width:1px;
```
