disable carplay on ios 26db4+ and make CarPlayManager

This commit is contained in:
leminlimez committed 2025-08-12 14:45:49 -04:00
1 parent d35636c0be
commit dd902d2c30
8 files changed
+158 -123

No files matched your search

@@ -52,7 +52,7 @@ struct CarPlayView: View {
DispatchQueue.global(qos: .userInitiated).async {
do {
try pbManager.applyCarPlay(appHash: cpHash, wallpapers: wallpapers)
try CarPlayManager.applyCarPlay(appHash: cpHash, wallpapers: wallpapers)
SymHandler.cleanup() // just to be extra sure
UIApplication.shared.dismissAlert(animated: false)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.35, execute: {
@@ -103,7 +103,7 @@ struct CarPlayView: View {
// load active wallpapers from user defaults
activeWallpapers = UserDefaults.standard.array(forKey: "ActiveCarPlayWallpapers") as? [String] ?? []
// load the wallpapers
let cppURL = PosterBoardManager.shared.getCarPlayPhotosURL()
let cppURL = CarPlayManager.getCarPlayPhotosURL()
let frameworkPath = "/System/Library/PrivateFrameworks/CarPlayUIServices.framework"
do {
for file in try FileManager.default.contentsOfDirectory(at: URL(fileURLWithPath: frameworkPath), includingPropertiesForKeys: nil, options: .skipsHiddenFiles) {
@@ -127,7 +127,7 @@ struct CarPlayView: View {
}
}
// sort them
if let sortedWallpapers = PosterBoardManager.shared.getCarPlayWallpaperNames() {
if let sortedWallpapers = CarPlayManager.getCarPlayWallpaperNames() {
wallpapers = wallpapers.reorder(by: sortedWallpapers)
}
} catch {
+1 -1
View File
@@ -18,7 +18,7 @@ struct RootView: View {
.tabItem {
Label("Videos", systemImage: "camera")
}
if UIDevice.current.userInterfaceIdiom == .phone {
if CarPlayManager.supportsCarPlay() {
CarPlayView()
.tabItem {
Label("CarPlay", systemImage: "car")
+2 -2
View File
@@ -23,7 +23,7 @@ struct SettingsView: View {
TextField("Enter PosterBoard App Hash", text: $pbHash)
.textFieldStyle(RoundedBorderTextFieldStyle())
.font(.system(.body, design: .monospaced))
if UIDevice.current.userInterfaceIdiom == .phone {
if CarPlayManager.supportsCarPlay() {
TextField("Enter CarPlayWallpaper App Hash", text: $cpHash)
.textFieldStyle(RoundedBorderTextFieldStyle())
.font(.system(.body, design: .monospaced))
@@ -89,7 +89,7 @@ struct SettingsView: View {
Button(action: {
UIImpactFeedbackGenerator(style: .soft).impactOccurred()
UserDefaults.standard.set(nil, forKey: "ActiveCarPlayWallpapers")
try? FileManager.default.removeItem(at: PosterBoardManager.shared.getCarPlayPhotosURL())
try? FileManager.default.removeItem(at: CarPlayManager.getCarPlayPhotosURL())
Haptic.shared.notify(.success)
UIApplication.shared.alert(title: NSLocalizedString("CarPlay Applied Wallpapers Successfully Cleared!", comment: ""), body: "")
}) {