chahinebrini 2919ce45b8 feat(magic): sync current ReBreak Magic app state
Include recent Magic app work: Tauri native shell, iOS device detection
via supervise-magic sidecar, MDM client, local HTTP server, new pages
(detect, enroll, supervise, sideload, pair, preflight, configure, done),
and updated device section/status UI.
2026-06-18 05:23:26 +02:00

6.3 KiB

ReBreak Magic — Unified Desktop App (Nuxt + Tauri)

Ziel

Eine einheitliche Cross-Platform-Desktop-App für Mac und Windows, die:

  • Mac + iPhone in den ReBreak-Schutz einbindet
  • Windows-PC in den ReBreak-Schutz einbindet
  • iOS-Supervision ohne Erase über supervise-magic durchführt
  • Sideload-Protect-Profil über lokalen HTTP-Server + QR-Code installiert
  • Später ABM/ADE-Silent-Enrollment vorbereitet

Tech-Stack

  • Frontend: Nuxt 4.1.3 + @nuxt/ui 4.5.1 + Tailwind CSS 4 + Vue 3
  • Desktop-Runtime: Tauri 2.x (Rust Core + WebView)
  • System-Zugriff: Rust-Tauri-Commands + Sidecars
  • iOS-Supervision: supervise-magic Go-Binary als Sidecar
  • Profile-Transfer: Lokaler Rust-HTTP-Server + QR-Code

Vergleich: Aktuelle Mac vs. Windows

Bereich Mac (SwiftUI) Windows (Tauri/React) Unified (Nuxt+Tauri)
UI-Framework SwiftUI React + Vite Nuxt + NuxtUI
Desktop-Runtime Native App Tauri 2 Tauri 2
System-Core Swift Services Rust Rust
Login Supabase JWT 6-stelliger Pairing-Code Nur Pairing-Code
iPhone Detection libimobiledevice via Shell libimobiledevice Sidecar
iOS Supervision supervise-magic Go-Binary supervise-magic Sidecar
Sideload-Profil AirDrop Lokaler HTTP-Server + QR-Code
MDM-Enrollment NanoMDM HTTP-API NanoMDM HTTP-API
Mac-PC-Schutz .mobileconfig DNS-Profil .mobileconfig + profiles command
Windows-PC-Schutz DoH via PowerShell DoH + Tamper-Service
Tamper-Protection MDM/NanoMDM SYSTEM-Service Plattformabhängig
Token-Speicher macOS Keychain Windows Credential Manager Rust keyring crate
Installer DMG + Notarization NSIS DMG (Mac) + NSIS/MSI (Win)

Gemeinsamer Wizard-Flow

  1. Welcome — Plattform erkennen, Willkommen
  2. Pairing — 6-stelliger Pairing-Code aus der ReBreak-App
  3. Device Detection — iPhone per USB erkennen (Mac) / PC-Info sammeln (Win)
  4. Pre-Flight — Find-My-iPhone prüfen, Voraussetzungen checken
  5. Supervisesupervise-magic ausführen, iPhone rebootet
  6. Sideload Profile — Lokaler Server starten, QR-Code anzeigen, User installiert Profil
  7. MDM Enrollment — QR-Code/Download für NanoMDM-Enrollment-Profil
  8. Configure — NanoMDM Commands pushen (Take-Management + mdmSupervised=true)
  9. Protection Active — Schutzstatus anzeigen, Release-Cooldown verwalten

Plattformspezifische Rust-Module

src-tauri/src/
├── main.rs                 # Entry + Tauri-Setup
├── lib.rs                  # Öffentliche Commands
├── platform/
│   ├── mod.rs              # Trait + Dispatcher
│   ├── macos.rs            # Mac-spezifisch (DNS-Profil, Keychain, USB)
│   └── windows.rs          # Windows-spezifisch (DoH, Service, Credential Manager)
├── sidecar/
│   └── supervise_magic.rs  # Go-Binary Management
├── server/
│   └── local_http.rs       # Lokaler HTTP-Server für Profile
├── config.rs               # App-Konfiguration
├── backend/
│   └── api.rs              # /api/magic/* Client
└── error.rs                # Gemeinsame Fehler-Typen

Frontend-Struktur (Nuxt)

app/
├── app.vue                 # Tauri-Root + Layout
├── pages/
│   ├── index.vue           # Welcome / Wizard-Start
│   ├── pair.vue            # Pairing-Code (UPinInput)
│   ├── detect.vue          # Geräte-Erkennung
│   ├── supervise.vue       # Supervision-Step
│   ├── sideload.vue        # Lokaler Server + QR-Code
│   ├── enroll.vue          # MDM-Enrollment
│   ├── protect.vue         # Schutz aktivieren
│   └── status.vue          # Status + Release
├── components/
│   ├── WizardStep.vue
│   ├── QrDisplay.vue
│   ├── DeviceCard.vue
│   └── ProtectionStatus.vue
├── composables/
│   ├── useTauri.ts
│   ├── useMagicApi.ts
│   └── useLocalServer.ts
└── assets/
    └── css/main.css

Wichtige Entscheidungen

  1. Nuxt statt React: Einheitlicher Stack mit Admin/Marketing, besseres Ökosystem-Sharing.
  2. Tauri statt Electron: Kleinere Bundle-Größe, Rust-Performance, bessere System-Integration.
  3. Lokaler HTTP-Server statt AirDrop: Plattformunabhängiger Profil-Transfer.
  4. Sidecar für Go-Binary: supervise-magic muss nicht nach Rust portiert werden.
  5. ABM vorbereiten: Architektur soll später Silent-Enrollment unterstützen, aber aktuell manuell.

Risiken / Offene Punkte

  • supervise-magic Windows-Build noch nicht verifiziert
  • Verhalten von PayloadRemovalDisallowed bei Webserver-Download noch nicht getestet
  • ABM-Beantragung dauert Wochen
  • macOS Code-Signing + Notarization erforderlich für Production
  • Windows Code-Signing (EV empfohlen) für Production

Aktueller Stand

  • Nuxt 4 + Tauri 2 Skelett unter apps/rebreak-magic
  • Wizard-Pages mit NuxtUI: Welcome, Pair, Detect, Supervise, Sideload, Enroll, Status
  • Rust-Module: Config, Backend-API, Platform-Abstraction, lokaler HTTP-Server, Sidecar-Integration
  • supervise-magic Go-Binary als Tauri-Sidecar eingebunden
  • Lokaler HTTP-Server für Sideload-Profil + QR-Code-Generierung
  • cargo check erfolgreich
  • pnpm build erfolgreich (Nuxt mit nitro.preset: "static" erzeugt index.html)
  • .app Bundle mit rebreak-magic + supervise-magic Sidecar wird erzeugt
  • Komplette Backend-Logik: Pairing-Code einlösen, Gerät registrieren, Status/Device-Liste abrufen, Release anfragen/abbrechen
  • Token sicher im System-Keyring gespeichert
  • Profil-Download vom Backend + lokaler QR-Code-Server für Sideload
  • Release-Cooldown in Status-Seite angezeigt
  • ⚠️ .app Bundle nur (kein DMG, um Bundling-Probleme zu vermeiden)

Nächste Schritte

  1. Plattformspezifische Schutzmechanismen implementieren (Mac DNS-Profil, Windows DoH + Service)
  2. Echte Backend-API-Calls für Pairing / Status implementieren
  3. Profil-Generierung in Rust ergänzen (statt hartcodiertem /tmp/... Pfad)
  4. Windows-Build der supervise-magic Sidecar verifizieren
  5. Code-Signing + Notarization für Production vorbereiten
  6. CI-Pipeline für Mac + Windows Builds