# sjshb57/pairip-patches architecture

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

- Interactive diagram: https://gitdiagram.com/sjshb57/pairip-patches
- Repository: https://github.com/sjshb57/pairip-patches

## Overview

Pairip Patches is a Morphe patch source for restoring Android apps protected by Pairip. The user adds the source in Morphe Manager, selects an APK and patches it, then builds the patched app. The core restoration branches remove Pairip protection, restore extracted methods, inline call wrappers, and repair the manifest; debug stripping is optional. The wrapper patch explicitly depends on restored methods. README documents manifest repair as part of protection removal, but the sampled excerpts do not show its wiring, so that relationship is left unconnected.

Main entry points: [`patches/src/main/kotlin/app/patches/pairip/sjshb57/InlineCallWrappersPatch.kt`](https://github.com/sjshb57/pairip-patches/blob/main/patches/src/main/kotlin/app/patches/pairip/sjshb57/InlineCallWrappersPatch.kt) (Inline wrappers), [`patches/src/main/kotlin/app/patches/pairip/sjshb57/RestoreExtractedMethodsPatch.kt`](https://github.com/sjshb57/pairip-patches/blob/main/patches/src/main/kotlin/app/patches/pairip/sjshb57/RestoreExtractedMethodsPatch.kt) (Restore methods), [`patches/src/main/kotlin/app/patches/pairip/sjshb57/RemovePairipPatch.kt`](https://github.com/sjshb57/pairip-patches/blob/main/patches/src/main/kotlin/app/patches/pairip/sjshb57/RemovePairipPatch.kt) (Remove protection), [`patches/src/main/kotlin/app/patches/pairip/sjshb57/StripDebugInfoPatch.kt`](https://github.com/sjshb57/pairip-patches/blob/main/patches/src/main/kotlin/app/patches/pairip/sjshb57/StripDebugInfoPatch.kt) (Strip debug info)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Patch workflow"]
  node_manager["Morphe Manager"]
  node_apk["Input APK"]
  node_engine["Morphe Patcher"]
end

subgraph group_bytecode["Bytecode restoration"]
  node_remove["Remove protection"]
  node_restore["Restore methods"]
  node_inline["Inline wrappers"]
  node_strip["Strip debug info"]
end

subgraph group_resources["Resource repair"]
  node_manifest["Repair manifest"]
end

node_user(("User"))

node_user -->|"adds source"| node_manager
node_user -->|"selects APK"| node_apk
node_manager -->|"starts patching"| node_engine
node_engine -.->|"runs patch"| node_remove
node_engine -.->|"runs patch"| node_restore
node_engine -.->|"runs patch"| node_inline
node_engine -.->|"runs optional patch"| node_strip
node_inline -->|"depends on"| node_restore

click node_remove "https://github.com/sjshb57/pairip-patches/blob/main/patches/src/main/kotlin/app/patches/pairip/sjshb57/RemovePairipPatch.kt"
click node_restore "https://github.com/sjshb57/pairip-patches/blob/main/patches/src/main/kotlin/app/patches/pairip/sjshb57/RestoreExtractedMethodsPatch.kt"
click node_inline "https://github.com/sjshb57/pairip-patches/blob/main/patches/src/main/kotlin/app/patches/pairip/sjshb57/InlineCallWrappersPatch.kt"
click node_strip "https://github.com/sjshb57/pairip-patches/blob/main/patches/src/main/kotlin/app/patches/pairip/sjshb57/StripDebugInfoPatch.kt"
click node_manifest "https://github.com/sjshb57/pairip-patches/blob/main/patches/src/main/kotlin/app/patches/pairip/sjshb57/FixPairipManifestPatch.kt"

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_manager,node_apk,node_engine,node_user toneBlue
class node_remove,node_restore,node_inline,node_strip toneAmber
class node_manifest toneMint
```

## Components

### Patch workflow

- **Morphe Manager**
- **Input APK**
- **Morphe Patcher**

### Bytecode restoration

- [Remove protection](https://github.com/sjshb57/pairip-patches/blob/main/patches/src/main/kotlin/app/patches/pairip/sjshb57/RemovePairipPatch.kt): `patches/src/main/kotlin/app/patches/pairip/sjshb57/RemovePairipPatch.kt`
- [Restore methods](https://github.com/sjshb57/pairip-patches/blob/main/patches/src/main/kotlin/app/patches/pairip/sjshb57/RestoreExtractedMethodsPatch.kt): `patches/src/main/kotlin/app/patches/pairip/sjshb57/RestoreExtractedMethodsPatch.kt`
- [Inline wrappers](https://github.com/sjshb57/pairip-patches/blob/main/patches/src/main/kotlin/app/patches/pairip/sjshb57/InlineCallWrappersPatch.kt): `patches/src/main/kotlin/app/patches/pairip/sjshb57/InlineCallWrappersPatch.kt`
- [Strip debug info](https://github.com/sjshb57/pairip-patches/blob/main/patches/src/main/kotlin/app/patches/pairip/sjshb57/StripDebugInfoPatch.kt): `patches/src/main/kotlin/app/patches/pairip/sjshb57/StripDebugInfoPatch.kt`

### Resource repair

- [Repair manifest](https://github.com/sjshb57/pairip-patches/blob/main/patches/src/main/kotlin/app/patches/pairip/sjshb57/FixPairipManifestPatch.kt): `patches/src/main/kotlin/app/patches/pairip/sjshb57/FixPairipManifestPatch.kt`

### Other components

- **User**

## Connections

- User → Morphe Manager: adds source (evidence: `README.md`)
- User → Input APK: selects APK (evidence: `README.md`)
- Morphe Manager → Morphe Patcher: starts patching (evidence: `README.md`)
- Morphe Patcher → Remove protection: runs patch
- Morphe Patcher → Restore methods: runs patch
- Morphe Patcher → Inline wrappers: runs patch
- Morphe Patcher → Strip debug info: runs optional patch
- Inline wrappers → Restore methods: depends on (evidence: `patches/src/main/kotlin/app/patches/pairip/sjshb57/InlineCallWrappersPatch.kt`)
