# elohim-etz/morphe-builder architecture

> Architecture diagram of the GitHub repository elohim-etz/morphe-builder, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/elohim-etz/morphe-builder
- Repository: https://github.com/elohim-etz/morphe-builder

## Overview

Morphe Builder turns a user-configured patch selection into patched APKs and installable root modules. The README documents configuration, building, and obtaining releases; it also documents module support for Magisk and KernelSU and capabilities including stock-app version handling and module updates. Source excerpts were unavailable, so internal calls and packaging details are not inferred; the module scripts are shown as lifecycle components without speculative wiring.

Main entry points: [`build.sh`](https://github.com/elohim-etz/morphe-builder/blob/main/build.sh) (Build entrypoint), [`module`](https://github.com/elohim-etz/morphe-builder/tree/main/module) (Installable module), [`config.toml`](https://github.com/elohim-etz/morphe-builder/blob/main/config.toml) (Build config), [`module/utils.sh`](https://github.com/elohim-etz/morphe-builder/blob/main/module/utils.sh) (Module utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_build["Build configuration"]
  node_buildscript["Build entrypoint<br/>[build.sh]"]
  node_termux["Termux entrypoint<br/>[build-termux.sh]"]
  node_config["Build config<br/>[config.toml]"]
  node_tools["Bundled tools"]
end

subgraph group_artifacts["Build outputs"]
  node_apks["Patched APKs"]
  node_modulepkg["Installable module"]
end

subgraph group_module["Module lifecycle"]
  node_installer["Android installer"]
  node_customize["Module setup<br/>[customize.sh]"]
  node_action["Module action<br/>[action.sh]"]
  node_service["Module service<br/>[service.sh]"]
  node_uninstall["Module removal<br/>[uninstall.sh]"]
  node_utils["Module utilities<br/>[utils.sh]"]
  node_profiles["Architecture profiles"]
end

node_user(("Builder user"))
node_patches["Morphe patches"]
node_manager["Magisk / KernelSU"]
node_stock["Stock app"]
node_releases["Build releases"]

node_user -->|"customizes"| node_config
node_user -->|"runs locally"| node_buildscript
node_user -->|"runs on Termux"| node_termux
node_user -->|"selects patches"| node_patches
node_buildscript -->|"reads settings"| node_config
node_termux -->|"builds with"| node_config
node_buildscript -->|"uses tools"| node_tools
node_buildscript -->|"builds"| node_apks
node_buildscript -->|"builds"| node_modulepkg
node_patches -->|"patches"| node_apks
node_patches -->|"patches"| node_modulepkg
node_user -->|"obtains outputs"| node_releases
node_manager -->|"installs"| node_installer
node_installer -->|"runs setup"| node_customize
node_customize -->|"handles version"| node_stock
node_manager -->|"provides updates"| node_modulepkg
node_action --> node_utils
node_service --> node_utils
node_uninstall --> node_utils
node_modulepkg -->|"includes"| node_profiles

click node_buildscript "https://github.com/elohim-etz/morphe-builder/blob/main/build.sh"
click node_termux "https://github.com/elohim-etz/morphe-builder/blob/main/build-termux.sh"
click node_config "https://github.com/elohim-etz/morphe-builder/blob/main/config.toml"
click node_tools "https://github.com/elohim-etz/morphe-builder/tree/main/bin"
click node_modulepkg "https://github.com/elohim-etz/morphe-builder/tree/main/module"
click node_installer "https://github.com/elohim-etz/morphe-builder/blob/main/module/META-INF/com/google/android/update-binary"
click node_customize "https://github.com/elohim-etz/morphe-builder/blob/main/module/customize.sh"
click node_action "https://github.com/elohim-etz/morphe-builder/blob/main/module/action.sh"
click node_service "https://github.com/elohim-etz/morphe-builder/blob/main/module/service.sh"
click node_uninstall "https://github.com/elohim-etz/morphe-builder/blob/main/module/uninstall.sh"
click node_utils "https://github.com/elohim-etz/morphe-builder/blob/main/module/utils.sh"
click node_profiles "https://github.com/elohim-etz/morphe-builder/tree/main/module/bin"

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_buildscript,node_termux,node_config,node_tools,node_user toneBlue
class node_apks,node_modulepkg toneAmber
class node_installer,node_customize,node_action,node_service,node_uninstall,node_utils,node_profiles toneMint
class node_patches,node_manager,node_stock,node_releases toneIndigo
```

## Components

### Build configuration

- [Build entrypoint](https://github.com/elohim-etz/morphe-builder/blob/main/build.sh): `build.sh`
- [Termux entrypoint](https://github.com/elohim-etz/morphe-builder/blob/main/build-termux.sh): `build-termux.sh`
- [Build config](https://github.com/elohim-etz/morphe-builder/blob/main/config.toml): `config.toml`
- [Bundled tools](https://github.com/elohim-etz/morphe-builder/tree/main/bin): `bin`

### Build outputs

- **Patched APKs**
- [Installable module](https://github.com/elohim-etz/morphe-builder/tree/main/module): `module`

### Module lifecycle

- [Android installer](https://github.com/elohim-etz/morphe-builder/blob/main/module/META-INF/com/google/android/update-binary): `module/META-INF/com/google/android/update-binary`
- [Module setup](https://github.com/elohim-etz/morphe-builder/blob/main/module/customize.sh): `module/customize.sh`
- [Module action](https://github.com/elohim-etz/morphe-builder/blob/main/module/action.sh): `module/action.sh`
- [Module service](https://github.com/elohim-etz/morphe-builder/blob/main/module/service.sh): `module/service.sh`
- [Module removal](https://github.com/elohim-etz/morphe-builder/blob/main/module/uninstall.sh): `module/uninstall.sh`
- [Module utilities](https://github.com/elohim-etz/morphe-builder/blob/main/module/utils.sh): `module/utils.sh`
- [Architecture profiles](https://github.com/elohim-etz/morphe-builder/tree/main/module/bin): `module/bin`

### Other components

- **Builder user**
- **Morphe patches**
- **Magisk / KernelSU**
- **Stock app**
- **Build releases**

## Connections

- Builder user → Build config: customizes
- Builder user → Build entrypoint: runs locally
- Builder user → Termux entrypoint: runs on Termux
- Builder user → Morphe patches: selects patches
- Build entrypoint → Build config: reads settings
- Termux entrypoint → Build config: builds with
- Build entrypoint → Bundled tools: uses tools
- Build entrypoint → Patched APKs: builds
- Build entrypoint → Installable module: builds
- Morphe patches → Patched APKs: patches
- Morphe patches → Installable module: patches
- Builder user → Build releases: obtains outputs
- Magisk / KernelSU → Android installer: installs
- Android installer → Module setup: runs setup
- Module setup → Stock app: handles version
- Magisk / KernelSU → Installable module: provides updates
- Module action → Module utilities
- Module service → Module utilities
- Module removal → Module utilities
- Installable module → Architecture profiles: includes
