# 0-blu/stikjit architecture

> Architecture diagram of the GitHub repository 0-blu/stikjit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/0-blu/stikjit
- Repository: https://github.com/0-blu/stikjit

## Overview

1. **Project shape**
   - `StikDebug` is a single iOS app target built in Xcode with SwiftUI.
   - The app is entirely device-side/local: there is no backend service in the repo. Its “system boundary” is the connected iPhone/iPad plus a pairing file used to authorize device communication.

2. **App shell and navigation**
   - `StikJIT/StikJITApp.swift` is the entry point.
   - `Views/MainTabView.swift` likely hosts the primary navigation, with feature screens split into focused tabs/pages such as Home, Tools, Settings, Console Logs, Installed Apps, Process Inspector, Map Selection, and Profile.

3. **Core device-communication layer**
   - The most important architectural boundary is the native device bridge in `Utilities/IdeviceFFIBridge.swift` plus the bundled `idevice/libidevice_ffi.a` and `idevice/module.modulemap`.
   - This layer wraps the underlying `idevice` library and is the app’s gateway to pairing, device queries, process control, app launching, and JIT-related device operations.

4. **Device session and connection state**
   - `Utilities/DeviceConnectionContext.swift` and related managers appear to hold the active session state with the device.
   - `Utilities/Security.swift` and the pairing-file flow described in the README suggest that the app depends on imported pairing material to establish a trusted connection before any advanced action can happen.

5. **JIT enablement pipeline**
   - The central feature is JIT enabling for sideloaded apps.
   - `Utilities/JITEnableContext.swift`, `Utilities/mountDDI.swift`, and `Utilities/Intents.swift` indicate a multi-step orchestration around enabling developer capabilities, mounting the Developer Disk Image when needed, and then targeting a chosen installed app.
   - The UI path is likely: user selects an app in `InstalledAppsListView` or `HomeView`, then the JIT context performs the device-side enablement.

6. **Installed app and process management**
   - `Views/InstalledAppsListView.swift` and `Views/ProcessInspectorView.swift` are the main user-facing views for enumerating installed apps and running processes.
   - Supporting utilities like `DeviceInfoManager.swift` and the device bridge provide the metadata and control operations needed to launch apps or terminate processes.
   - This is a direct app-to-device control path, not a server-mediated workflow.

7. **Logging and console streaming**
   - `Views/ConsoleLogsView.swift` is backed by `Utilities/LogManager.swift`, `Utilities/LogManagerBridge.swift`, and `Utilities/SystemLogStream.swift`.
   - This subsystem likely aggregates both live system logs and app-specific logs, then streams them into the console UI.
   - The data flow is one-way from device/system sources into the app’s log manager and then into the SwiftUI view.

8. **Script automation subsystem**
   - The `JSSupport` folder (`ScriptEditorView.swift`, `ScriptListView.swift`, `RunJSView.swift`, `JSDebugSupport.swift`) is a separate automation surface inside the app.
   - The bundled JavaScript files under `Scripts/` (`Geode.js`, `UTM-Dolphin.js`, `attachDetach.js`, `maciOS.js`, `manic.js`, `universal.js`) are prebuilt workflows, likely used to automate JIT-related or device-specific actions.
   - This subsystem is distinct from the main SwiftUI/device-bridge path: user selects or edits scripts, then JS support drives scripted device interactions.

9. **Location simulation and background helpers**
   - `Views/MapSelectionView.swift` and `Utilities/BackgroundLocationManager.swift` indicate a location-spoofing or location-simulation feature.
   - `Utilities/BackgroundAudioManager.swift` suggests the app uses iOS background modes to keep certain workflows alive or stable while device interaction is in progress.
   - These helpers are supporting infrastructure, not primary features, but they affect runtime behavior and background execution.

10. **App metadata, UI polish, and auxiliary utilities**
   - `Utilities/DeviceInfoManager.swift`, `AppStoreIconFetcher.swift`, `HapticFeedbackHelper.swift`, `Localization.swift`, `TabConfiguration.swift`, and `Extensions.swift` are cross-cutting support code.
   - These modules feed richer UI state, device metadata, icons, localization, and convenience behavior into the main screens.

11. **State boundaries and flow**
   - The main data flow is: user action in SwiftUI view → context/manager in `Utilities` → native device bridge / system APIs → device response or log stream → updated UI state.
   - The app’s architecture is therefore “UI + orchestration layer + native device bridge,” with separate subfeatures for logs, scripts, process/app management, and location simulation.

12. **Build and distribution**
   - The repository is Xcode-centric (`StikDebug.xcodeproj`) with GitHub Actions workflows for building an IPA and updating the source distribution metadata.
   - That means the repo supports both local development/debugging in Xcode and packaged release distribution, but the runtime architecture remains entirely client-side on iOS.

Main entry points: [`StikJIT/Views/MainTabView.swift`](https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/MainTabView.swift) (Main tabs), [`StikJIT/Utilities/IdeviceFFIBridge.swift`](https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/IdeviceFFIBridge.swift) (iDevice bridge), [`StikJIT/Utilities/JITEnableContext.swift`](https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/JITEnableContext.swift) (JIT pipeline), [`StikJIT/Utilities/LogManager.swift`](https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/LogManager.swift) (Log manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g1["App shell"]
  node_n1(("App entry<br/>SwiftUI app<br/>[StikJITApp.swift]"))
  node_n2["Main tabs<br/>navigation<br/>[MainTabView.swift]"]
end

subgraph group_g2["Device control"]
  node_n11(("Device session<br/>session context"))
  node_n12["iDevice bridge<br/>ffi bridge"]
  node_n13{{"JIT pipeline<br/>orchestration"}}
  node_n14["Mount DDI<br/>device setup<br/>[mountDDI.swift]"]
  node_n15["Intents<br/>actions<br/>[Intents.swift]"]
  node_n16[("Log manager<br/>log aggregation<br/>[LogManager.swift]")]
  node_n20["Security<br/>pairing<br/>[Security.swift]"]
end

subgraph group_g3["Feature surfaces"]
  node_n3["Home<br/>dashboard view<br/>[HomeView.swift]"]
  node_n4["Tools<br/>utility view<br/>[ToolsView.swift]"]
  node_n5["Settings<br/>preferences view<br/>[SettingsView.swift]"]
  node_n6["Profile<br/>[ProfileView.swift]"]
  node_n7["Installed apps<br/>app list view"]
  node_n8["Process inspector<br/>process view"]
  node_n9["Console logs<br/>log view"]
  node_n10["Map selection<br/>location view"]
  node_n17["JS support<br/>script runtime"]
end

subgraph group_g4["Support systems"]
  node_n18["Scripts<br/>script library<br/>[universal.js]"]
  node_n19["Device info<br/>metadata"]
  node_n21["Background helpers<br/>runtime helpers"]
  node_n22["UI support<br/>shared helpers"]
end

node_n1 -->|"launches"| node_n2
node_n2 -->|"shows"| node_n3
node_n2 -->|"shows"| node_n4
node_n2 -->|"shows"| node_n5
node_n2 -->|"shows"| node_n6
node_n2 -->|"shows"| node_n7
node_n2 -->|"shows"| node_n8
node_n2 -->|"shows"| node_n9
node_n2 -->|"shows"| node_n10
node_n3 -->|"starts"| node_n13
node_n7 -->|"targets"| node_n13
node_n8 -->|"controls"| node_n15
node_n13 -->|"mounts"| node_n14
node_n13 -->|"uses"| node_n12
node_n12 -->|"updates"| node_n11
node_n11 -->|"requires"| node_n20
node_n12 -->|"queries"| node_n19
node_n9 -->|"reads"| node_n16
node_n16 -->|"streams"| node_n12
node_n16 -->|"renders"| node_n9
node_n17 -->|"runs"| node_n18
node_n17 -->|"drives"| node_n12
node_n10 -->|"uses"| node_n21
node_n4 -->|"uses"| node_n22
node_n3 -->|"uses"| node_n22
node_n7 -->|"uses"| node_n19
node_n8 -->|"uses"| node_n19

click node_n1 "https://github.com/0-blu/stikjit/blob/main/StikJIT/StikJITApp.swift"
click node_n2 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/MainTabView.swift"
click node_n3 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/HomeView.swift"
click node_n4 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/ToolsView.swift"
click node_n5 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/SettingsView.swift"
click node_n6 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/ProfileView.swift"
click node_n7 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/InstalledAppsListView.swift"
click node_n8 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/ProcessInspectorView.swift"
click node_n9 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/ConsoleLogsView.swift"
click node_n10 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/MapSelectionView.swift"
click node_n11 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/DeviceConnectionContext.swift"
click node_n12 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/IdeviceFFIBridge.swift"
click node_n13 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/JITEnableContext.swift"
click node_n14 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/mountDDI.swift"
click node_n15 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/Intents.swift"
click node_n16 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/LogManager.swift"
click node_n17 "https://github.com/0-blu/stikjit/blob/main/StikJIT/JSSupport/JSDebugSupport.swift"
click node_n18 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Scripts/universal.js"
click node_n19 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/DeviceInfoManager.swift"
click node_n20 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/Security.swift"
click node_n21 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/BackgroundAudioManager.swift"
click node_n22 "https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/TabConfiguration.swift"

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_n1,node_n2 toneBlue
class node_n11,node_n12,node_n13,node_n14,node_n15,node_n16,node_n20 toneAmber
class node_n3,node_n4,node_n5,node_n6,node_n7,node_n8,node_n9,node_n10,node_n17 toneMint
class node_n18,node_n19,node_n21,node_n22 toneRose
```

## Components

### App shell

SwiftUI entry point and primary navigation

- [App entry](https://github.com/0-blu/stikjit/blob/main/StikJIT/StikJITApp.swift): SwiftUI app · Application bootstrap and scene setup · `StikJIT/StikJITApp.swift`
- [Main tabs](https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/MainTabView.swift): navigation · Primary tab and page composition · `StikJIT/Views/MainTabView.swift`

### Device control

Native device bridge, session state, and JIT orchestration

- [Device session](https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/DeviceConnectionContext.swift): session context · Active connection and device-session state · `StikJIT/Utilities/DeviceConnectionContext.swift`
- [iDevice bridge](https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/IdeviceFFIBridge.swift): ffi bridge · Native wrapper around libidevice for pairing and control · `StikJIT/Utilities/IdeviceFFIBridge.swift`
- [JIT pipeline](https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/JITEnableContext.swift): orchestration · Coordinates enablement flow for targeted apps · `StikJIT/Utilities/JITEnableContext.swift`
- [Mount DDI](https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/mountDDI.swift): device setup · Developer Disk Image mounting step · `StikJIT/Utilities/mountDDI.swift`
- [Intents](https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/Intents.swift): actions · Device-side commands and intent helpers · `StikJIT/Utilities/Intents.swift`
- [Log manager](https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/LogManager.swift): log aggregation · Collects and prepares logs for the console · `StikJIT/Utilities/LogManager.swift`
- [Security](https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/Security.swift): pairing · Pairing-file and trust handling for device access · `StikJIT/Utilities/Security.swift`

### Feature surfaces

User-facing tools built on top of the device layer

- [Home](https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/HomeView.swift): dashboard view · Landing surface for the app's main actions · `StikJIT/Views/HomeView.swift`
- [Tools](https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/ToolsView.swift): utility view · General-purpose control and utilities screen · `StikJIT/Views/ToolsView.swift`
- [Settings](https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/SettingsView.swift): preferences view · Configuration and app options · `StikJIT/Views/SettingsView.swift`
- [Profile](https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/ProfileView.swift): profile view · Device or user profile surface · `StikJIT/Views/ProfileView.swift`
- [Installed apps](https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/InstalledAppsListView.swift): app list view · Lists installed apps for JIT and launch actions · `StikJIT/Views/InstalledAppsListView.swift`
- [Process inspector](https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/ProcessInspectorView.swift): process view · Shows running processes and control actions · `StikJIT/Views/ProcessInspectorView.swift`
- [Console logs](https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/ConsoleLogsView.swift): log view · Live log console for streamed device output · `StikJIT/Views/ConsoleLogsView.swift`
- [Map selection](https://github.com/0-blu/stikjit/blob/main/StikJIT/Views/MapSelectionView.swift): location view · Location simulation or map-based selection UI · `StikJIT/Views/MapSelectionView.swift`
- [JS support](https://github.com/0-blu/stikjit/blob/main/StikJIT/JSSupport/JSDebugSupport.swift): script runtime · JavaScript editing and execution surface · `StikJIT/JSSupport/JSDebugSupport.swift`

### Support systems

Shared helpers, scripts, and distribution/build plumbing

- [Scripts](https://github.com/0-blu/stikjit/blob/main/StikJIT/Scripts/universal.js): script library · Bundled automation workflows for device actions · `StikJIT/Scripts/universal.js`
- [Device info](https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/DeviceInfoManager.swift): metadata · Fetches device and app metadata for UI and actions · `StikJIT/Utilities/DeviceInfoManager.swift`
- [Background helpers](https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/BackgroundAudioManager.swift): runtime helpers · Background audio and location support · `StikJIT/Utilities/BackgroundAudioManager.swift`
- [UI support](https://github.com/0-blu/stikjit/blob/main/StikJIT/Utilities/TabConfiguration.swift): shared helpers · Icons, haptics, localization, and tab config · `StikJIT/Utilities/TabConfiguration.swift`

## Connections

- App entry → Main tabs: launches · App entry loads the main navigation shell
- Main tabs → Home: shows · Main tabs include the home dashboard
- Main tabs → Tools: shows · Main tabs include tools
- Main tabs → Settings: shows · Main tabs include settings
- Main tabs → Profile: shows · Main tabs include profile
- Main tabs → Installed apps: shows · Main tabs include installed apps
- Main tabs → Process inspector: shows · Main tabs include process inspection
- Main tabs → Console logs: shows · Main tabs include console logs
- Main tabs → Map selection: shows · Main tabs include map selection
- Home → JIT pipeline: starts · Home can trigger the JIT enablement flow
- Installed apps → JIT pipeline: targets · Selected installed apps feed the JIT pipeline
- Process inspector → Intents: controls · Process actions route through device intents
- JIT pipeline → Mount DDI: mounts · JIT flow may mount the developer disk image
- JIT pipeline → iDevice bridge: uses · JIT flow delegates device operations to the native bridge
- iDevice bridge → Device session: updates · Bridge operations depend on the active device session
- Device session → Security: requires · Trusted connection depends on pairing and security material
- iDevice bridge → Device info: queries · Bridge and session use device metadata
- Console logs → Log manager: reads · Console view consumes aggregated log state
- Log manager → iDevice bridge: streams · Log manager receives device-side output through the bridge
- Log manager → Console logs: renders · Managed logs are presented in the console UI
- JS support → Scripts: runs · JS support executes bundled scripts
- JS support → iDevice bridge: drives · Script runtime can invoke device bridge actions
- Map selection → Background helpers: uses · Location UI depends on background helpers
- Tools → UI support: uses · Tooling screens rely on shared UI helpers
- Home → UI support: uses · Home shares icons, haptics, and localization
- Installed apps → Device info: uses · Installed-app listing needs app and device metadata
- Process inspector → Device info: uses · Process inspection uses device metadata
