# bunnyciaa/mg-unlooker-server-code architecture

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

- Interactive diagram: https://gitdiagram.com/bunnyciaa/mg-unlooker-server-code
- Repository: https://github.com/bunnyciaa/mg-unlooker-server-code

## Overview

This repository provides a no-serial-change iOS activation server in two forms: PHP web endpoints and a local C# server. The main workflow fetches a live Apple activation seed, then uses that seed and device details to build a signed activation record for reactivation. In PHP, the endpoints delegate shared validation, rate limiting, Apple communication, and record-building logic to common.php. The README documents the equivalent local-server workflow; sampled C# excerpts show its listener, request handling, seed fetch, and record construction. Some C# routing details are not shown.

Main entry points: [`sn.php`](https://github.com/bunnyciaa/mg-unlooker-server-code/blob/main/sn.php) (Seed endpoint), [`nosn-nochange.php`](https://github.com/bunnyciaa/mg-unlooker-server-code/blob/main/nosn-nochange.php) (Record endpoint), [`common.php`](https://github.com/bunnyciaa/mg-unlooker-server-code/blob/main/common.php) (Apple seed fetch), [`NoSnServer.cs`](https://github.com/bunnyciaa/mg-unlooker-server-code/blob/main/NoSnServer.cs) (Local HTTP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_php_api["PHP web API"]
  node_seed_endpoint["Seed endpoint<br/>[sn.php]"]
  node_record_endpoint["Record endpoint<br/>[nosn-nochange.php]"]
end

subgraph group_shared["Shared PHP logic"]
  node_shared_helpers["Validation and helpers<br/>[common.php]"]
  node_apple_seed["Apple seed fetch<br/>[common.php]"]
  node_record_builder["Signed record builder<br/>[common.php]"]
end

subgraph group_local["Local C&#35; server"]
  node_local_server["Local HTTP server<br/>[NoSnServer.cs]"]
end

subgraph group_activation["Activation services"]
  node_apple["Apple activation"]
  node_seed_record["Seed activation record"]
  node_final_record["Final activation record"]
end

node_device(("Device client"))

node_device -->|"requests seed"| node_seed_endpoint
node_seed_endpoint -->|"validates and limits"| node_shared_helpers
node_seed_endpoint -->|"fetches seed"| node_apple_seed
node_apple_seed -->|"requests activation seed"| node_apple
node_apple_seed -->|"returns seed"| node_seed_record
node_seed_endpoint -->|"returns seed"| node_device
node_device -->|"submits seed and details"| node_record_endpoint
node_record_endpoint -->|"validates and limits"| node_shared_helpers
node_record_endpoint -->|"builds final record"| node_record_builder
node_record_builder -->|"produces signed record"| node_final_record
node_record_endpoint -->|"returns final record"| node_device
node_device -->|"requests activation"| node_local_server
node_local_server -->|"fetches seed"| node_apple
node_local_server -->|"returns activation record"| node_final_record

click node_seed_endpoint "https://github.com/bunnyciaa/mg-unlooker-server-code/blob/main/sn.php"
click node_record_endpoint "https://github.com/bunnyciaa/mg-unlooker-server-code/blob/main/nosn-nochange.php"
click node_shared_helpers "https://github.com/bunnyciaa/mg-unlooker-server-code/blob/main/common.php"
click node_apple_seed "https://github.com/bunnyciaa/mg-unlooker-server-code/blob/main/common.php"
click node_record_builder "https://github.com/bunnyciaa/mg-unlooker-server-code/blob/main/common.php"
click node_local_server "https://github.com/bunnyciaa/mg-unlooker-server-code/blob/main/NoSnServer.cs"

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_seed_endpoint,node_record_endpoint,node_device toneBlue
class node_shared_helpers,node_apple_seed,node_record_builder toneAmber
class node_local_server toneMint
class node_apple,node_seed_record,node_final_record toneRose
```

## Components

### PHP web API

- [Seed endpoint](https://github.com/bunnyciaa/mg-unlooker-server-code/blob/main/sn.php): `sn.php`
- [Record endpoint](https://github.com/bunnyciaa/mg-unlooker-server-code/blob/main/nosn-nochange.php): `nosn-nochange.php`

### Shared PHP logic

- [Validation and helpers](https://github.com/bunnyciaa/mg-unlooker-server-code/blob/main/common.php): `common.php`
- [Apple seed fetch](https://github.com/bunnyciaa/mg-unlooker-server-code/blob/main/common.php): `common.php`
- [Signed record builder](https://github.com/bunnyciaa/mg-unlooker-server-code/blob/main/common.php): `common.php`

### Local C# server

- [Local HTTP server](https://github.com/bunnyciaa/mg-unlooker-server-code/blob/main/NoSnServer.cs): `NoSnServer.cs`

### Activation services

- **Apple activation**
- **Seed activation record**
- **Final activation record**

### Other components

- **Device client**

## Connections

- Device client → Seed endpoint: requests seed (evidence: `README.md`)
- Seed endpoint → Validation and helpers: validates and limits (evidence: `sn.php`)
- Seed endpoint → Apple seed fetch: fetches seed (evidence: `sn.php`)
- Apple seed fetch → Apple activation: requests activation seed (evidence: `common.php`)
- Apple seed fetch → Seed activation record: returns seed (evidence: `common.php`)
- Seed endpoint → Device client: returns seed (evidence: `README.md`)
- Device client → Record endpoint: submits seed and details (evidence: `README.md`)
- Record endpoint → Validation and helpers: validates and limits (evidence: `nosn-nochange.php`)
- Record endpoint → Signed record builder: builds final record (evidence: `nosn-nochange.php`)
- Signed record builder → Final activation record: produces signed record (evidence: `common.php`)
- Record endpoint → Device client: returns final record (evidence: `README.md`)
- Device client → Local HTTP server: requests activation (evidence: `README.md`)
- Local HTTP server → Apple activation: fetches seed (evidence: `README.md`)
- Local HTTP server → Final activation record: returns activation record (evidence: `NoSnServer.cs`)
