# hxreborn/morphe-patches architecture

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

- Interactive diagram: https://gitdiagram.com/hxreborn/morphe-patches
- Repository: https://github.com/hxreborn/morphe-patches

## Overview

hxreborn’s patches is a collection of Android-app modifications for Morphe. The principal workflow is to select a compatible patch for a target app and have Morphe apply its bytecode or resource changes to produce a modified app. Patch definitions cover app-specific features such as themes, premium access, ads and tracking; shared code supports compatibility and specialized protected-app handling. The tree also includes injected runtime extensions for behaviors that cannot be expressed solely as patch-time edits. Source excerpts are limited, so links between individual patch declarations and runtime extensions are not inferred.

Main entry points: [`patches/src/main/kotlin/app/morphe/patches`](https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches) (App-specific patches), [`patches/src/main/kotlin/app/morphe/patches/protonmail`](https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/protonmail) (Proton patches), [`patches/src/main/kotlin/app/morphe/patches/shared/misc`](https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/shared/misc) (Protection handling), [`patches/src/main/kotlin/app/morphe/patches/protonvpn`](https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/protonvpn) (VPN patches)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patches["App patches"]
  node_app_patches["App-specific patches"]
  node_proton_patches["Proton patches"]
  node_vpn_patches["VPN patches"]
  node_photo_patches["Photo editor patches"]
  node_media_patches["Media app patches"]
end

subgraph group_shared["Shared patch support"]
  node_shared_compat["Compatibility support"]
  node_shared_proton["Proton UI support"]
  node_shared_protection["Protection handling"]
end

subgraph group_runtime["Runtime extensions"]
  node_extension["Injected extensions"]
  node_proton_extension["Proton runtime UI"]
  node_mail_extension["Mail behavior"]
  node_photo_extension["Photo diagnostics"]
  node_web_scripts["WebView styling"]
end

subgraph group_special["Specialized handling"]
  node_ijiami["Ijiami handler"]
  node_jiagu["Jiagu handler"]
  node_moviebox_client["Playback client"]
  node_terabox_login["Login handling"]
end

node_user(("Morphe user"))
node_target["Target Android app"]
node_morphe["Morphe patcher"]
node_patched_app["Patched Android app"]

node_user -->|"selects patches"| node_morphe
node_target -->|"provides app"| node_morphe
node_morphe -->|"loads patches"| node_app_patches
node_app_patches -->|"checks compatibility"| node_shared_compat
node_app_patches -->|"defines modifications"| node_patched_app
node_proton_patches -->|"uses UI support"| node_shared_proton
node_proton_patches -->|"defines modifications"| node_patched_app
node_vpn_patches -->|"defines modifications"| node_patched_app
node_photo_patches -->|"defines modifications"| node_patched_app
node_media_patches -->|"defines modifications"| node_patched_app
node_shared_protection -->|"supports unpacking"| node_ijiami
node_shared_protection -->|"supports unpacking"| node_jiagu
node_patched_app -.->|"runs injected code"| node_extension
node_proton_extension -.->|"uses scripts"| node_web_scripts

click node_app_patches "https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches"
click node_proton_patches "https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/protonmail"
click node_vpn_patches "https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/protonvpn"
click node_photo_patches "https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/photoeditorpro"
click node_media_patches "https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/moviebox"
click node_shared_compat "https://github.com/hxreborn/morphe-patches/blob/main/patches/src/main/kotlin/app/morphe/patches/shared/compat/AppCompatibilities.kt"
click node_shared_proton "https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/shared/misc/proton"
click node_shared_protection "https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/shared/misc"
click node_extension "https://github.com/hxreborn/morphe-patches/tree/main/extensions/extension/src/main/java/app/hxreborn/extension"
click node_proton_extension "https://github.com/hxreborn/morphe-patches/tree/main/extensions/extension/src/main/java/app/hxreborn/extension/proton"
click node_mail_extension "https://github.com/hxreborn/morphe-patches/tree/main/extensions/extension/src/main/java/app/hxreborn/extension/protonmail"
click node_photo_extension "https://github.com/hxreborn/morphe-patches/tree/main/extensions/extension/src/main/java/app/hxreborn/extension/photoeditorpro"
click node_web_scripts "https://github.com/hxreborn/morphe-patches/tree/main/extensions/extension/src/main/js"
click node_ijiami "https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/shared/misc/ijiami"
click node_jiagu "https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/shared/misc/jiagu"
click node_moviebox_client "https://github.com/hxreborn/morphe-patches/blob/main/extensions/moviebox/src/hx/CloudFrontPlayInfoClient.java"
click node_terabox_login "https://github.com/hxreborn/morphe-patches/blob/main/extensions/extension/src/main/java/app/hxreborn/extension/terabox/GoogleLoginChromeClient.java"

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_app_patches,node_proton_patches,node_vpn_patches,node_photo_patches,node_media_patches,node_user toneBlue
class node_shared_compat,node_shared_proton,node_shared_protection toneAmber
class node_extension,node_proton_extension,node_mail_extension,node_photo_extension,node_web_scripts toneMint
class node_ijiami,node_jiagu,node_moviebox_client,node_terabox_login toneRose
class node_target,node_morphe,node_patched_app toneIndigo
```

## Components

### App patches

- [App-specific patches](https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches): `patches/src/main/kotlin/app/morphe/patches`
- [Proton patches](https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/protonmail): `patches/src/main/kotlin/app/morphe/patches/protonmail`
- [VPN patches](https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/protonvpn): `patches/src/main/kotlin/app/morphe/patches/protonvpn`
- [Photo editor patches](https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/photoeditorpro): `patches/src/main/kotlin/app/morphe/patches/photoeditorpro`
- [Media app patches](https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/moviebox): `patches/src/main/kotlin/app/morphe/patches/moviebox`

### Shared patch support

- [Compatibility support](https://github.com/hxreborn/morphe-patches/blob/main/patches/src/main/kotlin/app/morphe/patches/shared/compat/AppCompatibilities.kt): `patches/src/main/kotlin/app/morphe/patches/shared/compat/AppCompatibilities.kt`
- [Proton UI support](https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/shared/misc/proton): `patches/src/main/kotlin/app/morphe/patches/shared/misc/proton`
- [Protection handling](https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/shared/misc): `patches/src/main/kotlin/app/morphe/patches/shared/misc`

### Runtime extensions

- [Injected extensions](https://github.com/hxreborn/morphe-patches/tree/main/extensions/extension/src/main/java/app/hxreborn/extension): `extensions/extension/src/main/java/app/hxreborn/extension`
- [Proton runtime UI](https://github.com/hxreborn/morphe-patches/tree/main/extensions/extension/src/main/java/app/hxreborn/extension/proton): `extensions/extension/src/main/java/app/hxreborn/extension/proton`
- [Mail behavior](https://github.com/hxreborn/morphe-patches/tree/main/extensions/extension/src/main/java/app/hxreborn/extension/protonmail): `extensions/extension/src/main/java/app/hxreborn/extension/protonmail`
- [Photo diagnostics](https://github.com/hxreborn/morphe-patches/tree/main/extensions/extension/src/main/java/app/hxreborn/extension/photoeditorpro): `extensions/extension/src/main/java/app/hxreborn/extension/photoeditorpro`
- [WebView styling](https://github.com/hxreborn/morphe-patches/tree/main/extensions/extension/src/main/js): `extensions/extension/src/main/js`

### Specialized handling

- [Ijiami handler](https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/shared/misc/ijiami): `patches/src/main/kotlin/app/morphe/patches/shared/misc/ijiami`
- [Jiagu handler](https://github.com/hxreborn/morphe-patches/tree/main/patches/src/main/kotlin/app/morphe/patches/shared/misc/jiagu): `patches/src/main/kotlin/app/morphe/patches/shared/misc/jiagu`
- [Playback client](https://github.com/hxreborn/morphe-patches/blob/main/extensions/moviebox/src/hx/CloudFrontPlayInfoClient.java): `extensions/moviebox/src/hx/CloudFrontPlayInfoClient.java`
- [Login handling](https://github.com/hxreborn/morphe-patches/blob/main/extensions/extension/src/main/java/app/hxreborn/extension/terabox/GoogleLoginChromeClient.java): `extensions/extension/src/main/java/app/hxreborn/extension/terabox/GoogleLoginChromeClient.java`

### Other components

- **Morphe user**
- **Target Android app**
- **Morphe patcher**
- **Patched Android app**

## Connections

- Morphe user → Morphe patcher: selects patches
- Target Android app → Morphe patcher: provides app
- Morphe patcher → App-specific patches: loads patches
- App-specific patches → Compatibility support: checks compatibility
- App-specific patches → Patched Android app: defines modifications
- Proton patches → Proton UI support: uses UI support
- Proton patches → Patched Android app: defines modifications
- VPN patches → Patched Android app: defines modifications
- Photo editor patches → Patched Android app: defines modifications
- Media app patches → Patched Android app: defines modifications
- Protection handling → Ijiami handler: supports unpacking
- Protection handling → Jiagu handler: supports unpacking
- Patched Android app → Injected extensions: runs injected code
- Proton runtime UI → WebView styling: uses scripts
