From 2b00ea5107eb2effd82da45181e9041eaf41d0c0 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Thu, 11 Jun 2020 16:15:45 -0700 Subject: [PATCH] [AltDaemon] Fixes certificate becoming untrusted after refreshing --- AltDaemon/AppManager.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/AltDaemon/AppManager.swift b/AltDaemon/AppManager.swift index 50d5bb3f..e2e4bca9 100644 --- a/AltDaemon/AppManager.swift +++ b/AltDaemon/AppManager.swift @@ -15,6 +15,11 @@ private extension URL static let profilesDirectoryURL = URL(fileURLWithPath: "/var/MobileDevice/ProvisioningProfiles", isDirectory: true) } +private extension CFNotificationName +{ + static let updatedProvisioningProfiles = CFNotificationName("MISProvisioningProfileRemoved" as CFString) +} + struct AppManager { static let shared = AppManager() @@ -94,6 +99,9 @@ struct AppManager { completionHandler(.failure(error)) } + + // Notify system to prevent accidentally untrusting developer certificate. + CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), .updatedProvisioningProfiles, nil, nil, true) } } @@ -121,6 +129,9 @@ struct AppManager { completionHandler(.failure(error)) } + + // Notify system to prevent accidentally untrusting developer certificate. + CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), .updatedProvisioningProfiles, nil, nil, true) } } }