# ReBreak Binder (Mac) End-User-Wizard für Self-Binding eines iPhones an ReBreak. Macht in einem 5-Step-Flow: 1. **Welcome** — Detect iPhone via USB (lockdownd) 2. **Pre-Flight** — Find-My-iPhone + Stolen-Device-Protection prüfen/ausschalten 3. **Supervise** — `supervise-magic` Plist-Inject + Reboot (kein Erase) 4. **Enroll** — MDM-Enrollment-Profile auf iPhone installieren 5. **Configure** — NanoMDM pusht: Lock-Profile + Take-Management + Settings(mdmSupervised=true) Resultat: iPhone supervised by "ReBreak", App nicht löschbar, NEFilter aktiv (kein User-Toggle in Settings). **Pre-Requirement**: ReBreak-App muss VOR Wizard-Start aus TestFlight installiert sein. Wizard nutzt `InstallApplication` mit `ChangeManagementState: Managed` (kein ManifestURL nötig, kein ABM-Account). Auto-Install via MDM-Push ist Phase 2 (braucht ABM oder Manifest-Hosting). ## Status 🚧 Phase 1 — Skelett. Nur lokal nutzbar (User+Olfa+Dev-iPhones). ## Voraussetzungen | Tool | Wie | |---|---| | Xcode 26+ | App Store | | xcodegen | `brew install xcodegen` | | libimobiledevice | `brew install libimobiledevice` | | supervise-magic binary | aus `../../ops/mdm/supervise-magic/` (`make build`) | | cfgutil | Apple Configurator (App Store) → `/Applications/Apple Configurator.app/Contents/MacOS/cfgutil` für silent profile install | ## Build ```bash cd apps/rebreak-binder-mac # Einmalig: dependencies + supervise-magic-binary bauen (cd ../../ops/mdm/supervise-magic && make tidy && make build) # Xcode-Project generieren (oder neu generieren nach project.yml Änderungen) xcodegen generate # Bauen + öffnen open RebreakBinder.xcodeproj # → ⌘R in Xcode ``` Oder CLI-only: ```bash xcodebuild -project RebreakBinder.xcodeproj -scheme RebreakBinder -configuration Debug build open build/Debug/RebreakBinder.app ``` ## Config (lokal) NanoMDM-API-Key braucht die App für Step 5 (Configure). Lege ein lokales config-file an: ```bash cat > ~/.config/rebreak-binder/config.json <<'EOF' { "mdmServer": "https://mdm.rebreak.org", "mdmUser": "nanomdm", "mdmApiKey": "<32-char-hex from /root/.nanomdm_admin_pass on rebreak-mdm>" } EOF chmod 600 ~/.config/rebreak-binder/config.json ``` Production-Version legt das in Keychain ab — heute reicht plain JSON. ## TODOs (post-Skelett) - [ ] **Lock-Profile-Refactor**: `allowAppRemoval=false` GLOBAL raus aus `rebreak-content-filter-sideload.mobileconfig`. Per-App-Lock kommt über Managed-App-State (MDM `InstallApplication` mit `ChangeManagementState: Managed` → iOS deaktiviert App-Wackel-„X" automatisch für managed apps). Andere Apps bleiben löschbar (bessere UX). - [ ] App-Versions-Mgmt: `InstallApplication`-Manifest-URL-Pointer auf latest IPA (siehe `ops/mdm/PHASES.md` Phase F.5) - [ ] Trustee-Setup-Optional in DoneView (Email an Vertrauensperson) - [ ] 7-Tage-Cooldown-Persistenz (lokale SQLite oder Backend) - [ ] Code-Signing + Notarization (Developer-ID) - [ ] Backend `/api/binder/*` Endpoints — Mac-App spricht heute MDM-Server direkt ## Architektur - **SwiftUI macOS-App** mit `@Observable` State-Machine (`WizardModel`) - **Services** sind dünne Wrapper um: - `ideviceinfo` (libimobiledevice) — Device-Detection - `supervise-magic` Go-CLI — Supervise + Status-Check - `cfgutil` (optional, Apple Configurator 2) — Silent Profile-Install - NanoMDM HTTP-API (`mdm.rebreak.org`) — InstallProfile + Settings-Commands - **Kein Backend-Account-Login** für MVP — API-Key in lokalem Config ## Sicherheit - API-Key sollte langfristig in Keychain (heute: plain JSON, chmod 600) - App ist **unsigned** für lokales Testen — Gatekeeper-Warning beim ersten Öffnen - Process-Spawn von go-binaries braucht **disabled App-Sandbox** (gesetzt in `project.yml`)