chahinebrini b31066a04c feat(chat): native action sheet + Insta-style heart for DM messages
- ChatBubble: useActionSheet replaces custom Modal (native iOS popup, Android bottom sheet)
- DM mode (isDM prop): hides like-count, shows Insta-style heart badge under bubble when liked
- Group chat unchanged
- Cleanup: remove unused Modal/Platform imports, sheet styles, actionsOpen state
- deploy.sh: auto-detect ANDROID_HOME + auto-create local.properties for local Gradle
- NEXT_RELEASE.md: DM reactions release note
- Includes other staged work across binder-mac, marketing, ops/mdm, ios/
2026-05-30 09:14:32 +02:00

69 lines
2.6 KiB
Swift

import Foundation
struct DeviceState: Equatable {
var udid: String
var productType: String
var productVersion: String
var deviceName: String
var isFmiOn: Bool? // nil = unknown / not yet checked
var isSdpOn: Bool?
var isSupervised: Bool?
var supervisorOrgName: String? // z.B. "ReBreak" wenn schon by uns gebunden
var isEnrolled: Bool?
var enrollmentStatus: EnrollmentStatus? // Real-Check via NanoMDM-DB
var installedProfileIDs: [String] = [] // cfgutil-list Ground-Truth!
var installedAppBundleIDs: [String] = [] // cfgutil installedApps für Pre-Check
var isManaged: Bool?
var isFilterActive: Bool?
/// Identifier des Enrollment-Profils muss mit ops/mdm/enrollment-profile matchen.
static let enrollmentProfileID = "org.rebreak.mdm.enrollment"
/// Identifier des Lock-Sideload-Profils.
static let lockProfileID = "org.rebreak.protection.contentfilter.sideload"
var isOwnedByReBreak: Bool {
(isSupervised == true) && (normalizedSupervisorOrgName?.localizedCaseInsensitiveCompare("ReBreak") == .orderedSame)
}
/// Entfernt Quotes/Whitespace aus OrganizationName damit Skip-Logik robust ist
/// (z.B. wenn Tools "ReBreak" statt ReBreak liefern).
var normalizedSupervisorOrgName: String? {
supervisorOrgName?
.trimmingCharacters(in: .whitespacesAndNewlines)
.trimmingCharacters(in: CharacterSet(charactersIn: "\"'"))
}
/// Ground-Truth: ist das Enrollment-Profil aktuell auf dem iPhone installiert?
/// (cfgutil-Liste statt NanoMDM-DB DB hat Lag wenn User Profil manuell entfernt.)
var hasEnrollmentProfile: Bool {
installedProfileIDs.contains(Self.enrollmentProfileID)
}
var hasLockProfile: Bool {
installedProfileIDs.contains(Self.lockProfileID)
}
/// True nur wenn iPhone supervised durch uns IST, das Enrollment-Profil tatsächlich
/// installiert ist, UND MDM-Channel kürzlich aktiv war.
var isFullyBound: Bool {
isOwnedByReBreak && hasEnrollmentProfile && (enrollmentStatus?.isFresh == true)
}
var displayModel: String {
Self.modelMap[productType] ?? productType
}
private static let modelMap: [String: String] = [
"iPhone18,4": "iPhone Air",
"iPhone17,1": "iPhone 16 Pro",
"iPhone17,2": "iPhone 16 Pro Max",
"iPhone17,3": "iPhone 16",
"iPhone17,4": "iPhone 16 Plus",
"iPhone16,1": "iPhone 15 Pro",
"iPhone16,2": "iPhone 15 Pro Max",
"iPhone15,4": "iPhone 15",
"iPhone15,5": "iPhone 15 Plus",
]
}