apps/rebreak-binder-mac/ — neue macOS-App die User durch den kompletten Self-Bind-Prozess führt: Welcome → Preflight → Supervise → Enroll → Configure (MDM-Push + Pre/Post-Check) → Sideload Lock-Profile (AirDrop). 3-Layer Smart-Resume: supervised? + Enrollment-Profil installed (cfgutil Ground-Truth)? + MDM-Ack fresh (NanoMDM-DB via ssh+psql)? Services: DeviceDetector (ideviceinfo + cfgutil), SuperviseRunner (spawnt supervise-magic CLI), MDMClient (PUT /v1/enqueue?push=1, Apple XML-Plist, identisch zum server-watcher-Format), MDMStatus (DB-Real- Check + ManagedApplicationList-Result-Read). Plus: - fix(supervise-magic): EOF nach ProcessMessage Response (ErrorCode=0) ist Success, nicht Error — vermeidet false-fail bei iPhone-Restore- Reboot - feat(mdm-profiles): rebreak-content-filter-mdm.mobileconfig als MDM-Push-Variante (ohne ConsentText, ohne globales allowAppRemoval= false — per-app via managed-state) End-to-End validiert: App-Push via Ad-Hoc-Manifest (silent), Managed- State via ManagedApplicationList-Query, NEFilter-Mode nach App-Force- Quit, Lock-Profile non-removable nach Sideload. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
99 lines
3.5 KiB
Swift
99 lines
3.5 KiB
Swift
import SwiftUI
|
|
|
|
struct PreflightView: View {
|
|
@Environment(WizardModel.self) private var model
|
|
|
|
@State private var fmiConfirmed = false
|
|
@State private var sdpConfirmed = false
|
|
@State private var appleIdConfirmed = false
|
|
@State private var rebreakAppInstalled = false
|
|
|
|
var body: some View {
|
|
ScrollView {
|
|
VStack(alignment: .leading, spacing: 24) {
|
|
header
|
|
|
|
Text("Bevor wir dein iPhone supervisieren, müssen ein paar Apple-Sicherheitschecks erledigt sein. Hak die Punkte ab, sobald du sie auf dem iPhone gemacht hast.")
|
|
.foregroundStyle(.secondary)
|
|
|
|
checklist
|
|
|
|
Spacer()
|
|
|
|
navigationBar
|
|
}
|
|
.padding(40)
|
|
}
|
|
}
|
|
|
|
private var header: some View {
|
|
HStack {
|
|
Image(systemName: "checklist")
|
|
.font(.system(size: 30))
|
|
.foregroundStyle(.tint)
|
|
Text("Pre-Flight Check")
|
|
.font(.title).bold()
|
|
}
|
|
}
|
|
|
|
private var checklist: some View {
|
|
VStack(spacing: 12) {
|
|
checklistItem(
|
|
checked: $fmiConfirmed,
|
|
title: "Find My iPhone deaktiviert",
|
|
detail: "Settings → [Apple-ID] → Wo ist? → Mein iPhone suchen → AUS. Ohne das blockiert Apple das Supervisieren (ErrorCode 211)."
|
|
)
|
|
checklistItem(
|
|
checked: $sdpConfirmed,
|
|
title: "Stolen Device Protection ausgeschaltet",
|
|
detail: "Settings → Face ID & Code → Schutz für gestohlene Geräte → AUS. SDP zwingt FMI an — muss VOR FMI-Toggle aus."
|
|
)
|
|
checklistItem(
|
|
checked: $appleIdConfirmed,
|
|
title: "Apple-ID-Passwort griffbereit",
|
|
detail: "Apple fragt evtl. dein Apple-ID-PW während des FMI-Toggles ab. Halte es bereit."
|
|
)
|
|
checklistItem(
|
|
checked: $rebreakAppInstalled,
|
|
title: "ReBreak-App ist auf dem iPhone installiert",
|
|
detail: "Über TestFlight (https://testflight.apple.com/join/...). Erst danach kann der Wizard die App in den Managed-State versetzen."
|
|
)
|
|
}
|
|
}
|
|
|
|
private func checklistItem(checked: Binding<Bool>, title: String, detail: String) -> some View {
|
|
Button(action: { checked.wrappedValue.toggle() }) {
|
|
HStack(alignment: .top, spacing: 12) {
|
|
Image(systemName: checked.wrappedValue ? "checkmark.square.fill" : "square")
|
|
.font(.title3)
|
|
.foregroundStyle(checked.wrappedValue ? Color.accentColor : Color.secondary)
|
|
VStack(alignment: .leading, spacing: 4) {
|
|
Text(title).font(.headline)
|
|
Text(detail).font(.callout).foregroundStyle(.secondary)
|
|
}
|
|
Spacer()
|
|
}
|
|
.padding()
|
|
.background(Color.gray.opacity(0.05))
|
|
.cornerRadius(8)
|
|
.contentShape(Rectangle())
|
|
}
|
|
.buttonStyle(.plain)
|
|
}
|
|
|
|
private var allChecked: Bool {
|
|
fmiConfirmed && sdpConfirmed && appleIdConfirmed && rebreakAppInstalled
|
|
}
|
|
|
|
private var navigationBar: some View {
|
|
HStack {
|
|
Button("Zurück") { model.goTo(.welcome) }
|
|
.buttonStyle(.bordered)
|
|
Spacer()
|
|
Button("Supervisieren starten →") { model.advance() }
|
|
.buttonStyle(.borderedProminent)
|
|
.disabled(!allChecked)
|
|
}
|
|
}
|
|
}
|