# adminzachary/enablemacosai architecture

> Architecture diagram of the GitHub repository adminzachary/enablemacosai, 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/adminzachary/enablemacosai
- Repository: https://github.com/adminzachary/enablemacosai

## Overview

RegionSpoof is a macOS kernel extension and setup tool that changes the platform’s reported region to enable Apple Intelligence eligibility. The main workflow is: the user installs the extension, its boot-time loader loads it, and the extension changes IORegistry properties that system services use to determine region and eligibility. Installation also locks the country-code cache to US; status and diagnosis are separate script modes. Runtime wiring for the scripts is summarized from the README; their source was not sampled.

Main entry points: [`install.sh`](https://github.com/adminzachary/enablemacosai/blob/main/install.sh) (Install script), [`RegionSpoof.kext/Contents/MacOS/RegionSpoof`](https://github.com/adminzachary/enablemacosai/blob/main/RegionSpoof.kext/Contents/MacOS/RegionSpoof) (Installed kext), [`region-kext-load.sh`](https://github.com/adminzachary/enablemacosai/blob/main/region-kext-load.sh) (Load script), [`src/RegionSpoof.cpp`](https://github.com/adminzachary/enablemacosai/blob/main/src/RegionSpoof.cpp) (RegionSpoof service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Setup and maintenance"]
  node_installer["Install script<br/>[install.sh]"]
  node_cache[("Country-code cache")]
  node_systemconfig["System configuration"]
end

subgraph group_boot["Boot-time loading"]
  node_daemon["LaunchDaemon config"]
  node_loader["Load script"]
end

subgraph group_region["Region override"]
  node_kext["Installed kext<br/>[RegionSpoof]"]
  node_driver["RegionSpoof service<br/>[RegionSpoof.cpp]"]
  node_personality["IOKit personality<br/>[Info.plist]"]
  node_kmod["Kernel module entry<br/>[kmod_info.c]"]
  node_ioregistry[("Platform IORegistry")]
end

subgraph group_eligibility["Apple Intelligence"]
  node_gestalt["MobileGestalt"]
  node_eligibilityd["Eligibility service"]
  node_ai["Apple Intelligence"]
  node_accountlanguage["Account and language settings"]
end

node_user(("Mac administrator"))

node_user -->|"runs"| node_installer
node_installer -->|"installs"| node_kext
node_installer -->|"configures startup"| node_daemon
node_installer -->|"sets country US"| node_cache
node_installer -->|"checks status"| node_systemconfig
node_installer -->|"diagnoses"| node_eligibilityd
node_daemon -->|"dispatches"| node_loader
node_loader -->|"loads"| node_kext
node_loader -->|"refreshes"| node_eligibilityd
node_personality -->|"matches device"| node_driver
node_kmod -->|"provides entry"| node_kext
node_kext -->|"runs service"| node_driver
node_driver -->|"sets properties"| node_ioregistry
node_gestalt -->|"reads region"| node_ioregistry
node_eligibilityd -->|"checks region"| node_gestalt
node_eligibilityd -->|"checks inputs"| node_accountlanguage
node_eligibilityd -->|"determines eligibility"| node_ai

click node_installer "https://github.com/adminzachary/enablemacosai/blob/main/install.sh"
click node_daemon "https://github.com/adminzachary/enablemacosai/blob/main/com.local.regionkext.plist"
click node_loader "https://github.com/adminzachary/enablemacosai/blob/main/region-kext-load.sh"
click node_kext "https://github.com/adminzachary/enablemacosai/blob/main/RegionSpoof.kext/Contents/MacOS/RegionSpoof"
click node_driver "https://github.com/adminzachary/enablemacosai/blob/main/src/RegionSpoof.cpp"
click node_personality "https://github.com/adminzachary/enablemacosai/blob/main/src/Info.plist"
click node_kmod "https://github.com/adminzachary/enablemacosai/blob/main/src/kmod_info.c"

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_installer,node_cache,node_systemconfig toneBlue
class node_daemon,node_loader toneAmber
class node_kext,node_driver,node_personality,node_kmod,node_ioregistry toneMint
class node_gestalt,node_eligibilityd,node_ai,node_accountlanguage toneRose
class node_user toneIndigo
```

## Components

### Setup and maintenance

- [Install script](https://github.com/adminzachary/enablemacosai/blob/main/install.sh): `install.sh`
- **Country-code cache**
- **System configuration**

### Boot-time loading

- [LaunchDaemon config](https://github.com/adminzachary/enablemacosai/blob/main/com.local.regionkext.plist): `com.local.regionkext.plist`
- [Load script](https://github.com/adminzachary/enablemacosai/blob/main/region-kext-load.sh): `region-kext-load.sh`

### Region override

- [Installed kext](https://github.com/adminzachary/enablemacosai/blob/main/RegionSpoof.kext/Contents/MacOS/RegionSpoof): `RegionSpoof.kext/Contents/MacOS/RegionSpoof`
- [RegionSpoof service](https://github.com/adminzachary/enablemacosai/blob/main/src/RegionSpoof.cpp): `src/RegionSpoof.cpp`
- [IOKit personality](https://github.com/adminzachary/enablemacosai/blob/main/src/Info.plist): `src/Info.plist`
- [Kernel module entry](https://github.com/adminzachary/enablemacosai/blob/main/src/kmod_info.c): `src/kmod_info.c`
- **Platform IORegistry**

### Apple Intelligence

- **MobileGestalt**
- **Eligibility service**
- **Apple Intelligence**
- **Account and language settings**

### Other components

- **Mac administrator**

## Connections

- Mac administrator → Install script: runs
- Install script → Installed kext: installs
- Install script → LaunchDaemon config: configures startup
- Install script → Country-code cache: sets country US
- Install script → System configuration: checks status
- Install script → Eligibility service: diagnoses
- LaunchDaemon config → Load script: dispatches
- Load script → Installed kext: loads
- Load script → Eligibility service: refreshes
- IOKit personality → RegionSpoof service: matches device
- Kernel module entry → Installed kext: provides entry
- Installed kext → RegionSpoof service: runs service
- RegionSpoof service → Platform IORegistry: sets properties
- MobileGestalt → Platform IORegistry: reads region
- Eligibility service → MobileGestalt: checks region
- Eligibility service → Account and language settings: checks inputs
- Eligibility service → Apple Intelligence: determines eligibility
