# theiphoneos1project/preferenceloader-iphoneos1 architecture

> Architecture diagram of the GitHub repository theiphoneos1project/preferenceloader-iphoneos1, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/theiphoneos1project/preferenceloader-iphoneos1
- Repository: https://github.com/theiphoneos1project/preferenceloader-iphoneos1

## Overview

#### Purpose and Deployment
This repository reimplements PreferenceLoader for iPhone OS 1: an injected Settings extension framework that discovers third-party preference bundles and exposes their plist-defined panes in the native Settings app. It is packaged as a PXL for installation alongside MicroInjector.

Key deployment metadata:
- `PreferenceLoader.plist`
- `PxlPkg.plist`
- `Makefile`

#### Injection Entry Point
The runtime hook is centered in `Tweak.m`, loaded through MicroInjector into the Settings process. It extends legacy Preferences framework behavior so external preference definitions can be discovered and instantiated without native platform support.

- `Tweak.m`
- `PreferenceLoader.plist`

#### Preference Controller Integration
The project augments Apple’s `PSListController` to load PreferenceLoader-managed specifiers and route navigation into custom preference panes. This is the primary boundary between injected code and the private legacy Preferences APIs.

- `libprefs/PSListController+PreferenceLoader.m`
- `libprefs/PSListController+PreferenceLoader.h`
- `libprefs/PSSpecifier+PreferenceLoader.m`

#### Specifier Loading and Compatibility
Preference panes are represented by `PSSpecifier` objects sourced from plist data. The compatibility layer adapts plist-to-specifier construction to the iPhone OS 1 Preferences framework, which lacks later PreferenceLoader conveniences.

- `libprefs/SpecifiersFromPlist+Compatibility.m`
- `libprefs/SpecifiersFromPlist+Compatibility.h`
- `libprefs/PSSpecifier+PreferenceLoader.h`

#### Custom Pane Controllers
External preference bundles can name custom controller classes. `PLCustomListController` provides the base list-controller behavior for those panes, including loading their declared specifiers and participating in Settings navigation.

- `libprefs/PLCustomListController.m`
- `libprefs/PLCustomListController.h`
- `Firmware/Firmware.m`

#### Localization-Aware Controllers
`PLLocalizedListController` specializes the custom controller path for localized preference resources, separating locale-aware plist/string resolution from generic pane loading.

- `libprefs/PLLocalizedListController.m`
- `libprefs/PLLocalizedListController.h`
- `libprefs/Constants.h`

#### Runtime and Build Boundaries
The code is Objective-C for the fragile Objective-C runtime in the unofficial iPhone OS 1 SDK. It depends on MicroInjector’s dynamic library for process injection and links against legacy system/private Preferences APIs. The Makefile builds the injected binary and packages a distributable PXL via Python 3.

- `Makefile`
- `Firmware/Firmware.h`
- `PxlPkg.plist`

Main entry points: [`libprefs/PSListController+PreferenceLoader.m`](https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/libprefs/PSListController%2BPreferenceLoader.m) (PSListController integration), [`Tweak.m`](https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/Tweak.m) (Injection hook), [`libprefs/PLCustomListController.m`](https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/libprefs/PLCustomListController.m) (Custom list controller), [`libprefs/SpecifiersFromPlist+Compatibility.m`](https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/libprefs/SpecifiersFromPlist%2BCompatibility.m) (Plist specifier compatibility)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deployment["Build &amp; Deployment"]
  node_makefile["Build &amp; package<br/>Make"]
  node_pxl["PXL package metadata<br/>package manifest<br/>[PxlPkg.plist]"]
  node_injector{{"MicroInjector<br/>injection runtime"}}
  node_tweak_manifest["Injection manifest<br/>plist"]
end

subgraph group_injected["Injected Integration"]
  node_settings["Settings process<br/>host app"]
  node_tweak["Injection hook<br/>Objective-C tweak<br/>[Tweak.m]"]
  node_pslist["PSListController integration<br/>Preferences category"]
  node_specifier_extension["PSSpecifier extensions<br/>Preferences category"]
  node_compatibility["Plist specifier compatibility<br/>compatibility layer"]
  node_legacy_preferences{{"Legacy Preferences APIs<br/>private framework"}}
end

subgraph group_panes["Preference Pane Runtime"]
  node_preference_bundles["Third-party preference bundles<br/>external bundles"]
  node_custom_controller["Custom list controller<br/>pane controller base"]
  node_localized_controller["Localized list controller<br/>pane controller"]
  node_firmware["Firmware integration<br/>Objective-C runtime support<br/>[Firmware.m]"]
end

node_makefile -->|"packages"| node_pxl
node_makefile -->|"builds"| node_tweak
node_pxl -->|"includes"| node_tweak_manifest
node_tweak_manifest -->|"declares load target"| node_injector
node_injector -->|"injects into"| node_settings
node_settings -->|"hosts"| node_tweak
node_tweak -->|"activates"| node_pslist
node_tweak -->|"discovers"| node_preference_bundles
node_pslist -->|"loads specifiers through"| node_compatibility
node_compatibility -->|"constructs"| node_specifier_extension
node_preference_bundles -->|"supplies plist definitions"| node_compatibility
node_pslist -->|"routes navigation to"| node_custom_controller
node_preference_bundles -->|"names controller classes"| node_custom_controller
node_custom_controller -->|"specialized by"| node_localized_controller
node_custom_controller -->|"uses"| node_firmware
node_pslist -->|"augments"| node_legacy_preferences

click node_makefile "https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/Makefile"
click node_pxl "https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/PxlPkg.plist"
click node_tweak "https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/Tweak.m"
click node_tweak_manifest "https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/PreferenceLoader.plist"
click node_pslist "https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/libprefs/PSListController%2BPreferenceLoader.m"
click node_specifier_extension "https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/libprefs/PSSpecifier%2BPreferenceLoader.m"
click node_compatibility "https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/libprefs/SpecifiersFromPlist%2BCompatibility.m"
click node_custom_controller "https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/libprefs/PLCustomListController.m"
click node_localized_controller "https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/libprefs/PLLocalizedListController.m"
click node_firmware "https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/Firmware/Firmware.m"

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_makefile,node_pxl,node_injector,node_tweak_manifest toneBlue
class node_settings,node_tweak,node_pslist,node_specifier_extension,node_compatibility,node_legacy_preferences toneAmber
class node_preference_bundles,node_custom_controller,node_localized_controller,node_firmware toneMint
```

## Components

### Build & Deployment

- [Build & package](https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/Makefile): Make · Builds the injected binary and PXL package. · `Makefile`
- [PXL package metadata](https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/PxlPkg.plist): package manifest · `PxlPkg.plist`
- **MicroInjector**: injection runtime · Loads the tweak into the Settings process.
- [Injection manifest](https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/PreferenceLoader.plist): plist · `PreferenceLoader.plist`

### Injected Integration

- **Settings process**: host app
- [Injection hook](https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/Tweak.m): Objective-C tweak · Extends legacy Preferences behavior for external panes. · `Tweak.m`
- [PSListController integration](https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/libprefs/PSListController%2BPreferenceLoader.m): Preferences category · Loads managed specifiers and routes pane navigation. · `libprefs/PSListController+PreferenceLoader.m`
- [PSSpecifier extensions](https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/libprefs/PSSpecifier%2BPreferenceLoader.m): Preferences category · `libprefs/PSSpecifier+PreferenceLoader.m`
- [Plist specifier compatibility](https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/libprefs/SpecifiersFromPlist%2BCompatibility.m): compatibility layer · Adapts plist-to-specifier construction for iPhone OS 1. · `libprefs/SpecifiersFromPlist+Compatibility.m`
- **Legacy Preferences APIs**: private framework

### Preference Pane Runtime

- **Third-party preference bundles**: external bundles · Provide plist-defined panes and optional controller classes.
- [Custom list controller](https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/libprefs/PLCustomListController.m): pane controller base · Loads declared pane specifiers and joins Settings navigation. · `libprefs/PLCustomListController.m`
- [Localized list controller](https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/libprefs/PLLocalizedListController.m): pane controller · Resolves localized preference plists and strings. · `libprefs/PLLocalizedListController.m`
- [Firmware integration](https://github.com/theiphoneos1project/preferenceloader-iphoneos1/blob/main/Firmware/Firmware.m): Objective-C runtime support · `Firmware/Firmware.m`

## Connections

- Build & package → PXL package metadata: packages
- Build & package → Injection hook: builds
- PXL package metadata → Injection manifest: includes
- Injection manifest → MicroInjector: declares load target
- MicroInjector → Settings process: injects into
- Settings process → Injection hook: hosts
- Injection hook → PSListController integration: activates
- Injection hook → Third-party preference bundles: discovers
- PSListController integration → Plist specifier compatibility: loads specifiers through
- Plist specifier compatibility → PSSpecifier extensions: constructs
- Third-party preference bundles → Plist specifier compatibility: supplies plist definitions
- PSListController integration → Custom list controller: routes navigation to
- Third-party preference bundles → Custom list controller: names controller classes
- Custom list controller → Localized list controller: specialized by
- Custom list controller → Firmware integration: uses
- PSListController integration → Legacy Preferences APIs: augments
