diff --git a/AltStore/AppDelegate.swift b/AltStore/AppDelegate.swift index 6539cdcb..efd9f378 100644 --- a/AltStore/AppDelegate.swift +++ b/AltStore/AppDelegate.swift @@ -294,9 +294,9 @@ extension AppDelegate UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { (success, error) in } - #if DEBUG - UIApplication.shared.registerForRemoteNotifications() - #endif +// #if DEBUG +// UIApplication.shared.registerForRemoteNotifications() +// #endif } func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) diff --git a/AltStore/LaunchViewController.swift b/AltStore/LaunchViewController.swift index 38fae3a3..15bc1cc3 100644 --- a/AltStore/LaunchViewController.swift +++ b/AltStore/LaunchViewController.swift @@ -318,6 +318,7 @@ extension LaunchViewController self.updateKnownSources() + // Ask widgets to be refreshed WidgetCenter.shared.reloadAllTimelines() // Add view controller as child (rather than presenting modally) diff --git a/AltStore/Managing Apps/AppManager.swift b/AltStore/Managing Apps/AppManager.swift index b75ae610..a961d70b 100644 --- a/AltStore/Managing Apps/AppManager.swift +++ b/AltStore/Managing Apps/AppManager.swift @@ -2280,6 +2280,7 @@ private extension AppManager AnalyticsManager.shared.trackEvent(event) } + // Ask widgets to be refreshed WidgetCenter.shared.reloadAllTimelines() do diff --git a/AltStore/Operations/AuthenticationOperation.swift b/AltStore/Operations/AuthenticationOperation.swift index 730edd11..57995c3c 100644 --- a/AltStore/Operations/AuthenticationOperation.swift +++ b/AltStore/Operations/AuthenticationOperation.swift @@ -715,9 +715,9 @@ private extension AuthenticationOperation // If we're not using the same certificate used to install AltStore, warn user that they need to refresh. guard !provisioningProfile.certificates.contains(signer.certificate) else { return completionHandler(false) } -#if DEBUG - completionHandler(false) -#else +//#if DEBUG +// completionHandler(false) +//#else DispatchQueue.main.async { let context = AuthenticatedOperationContext(context: self.context) context.operations.removeAllObjects() // Prevent deadlock due to endless waiting on previous operations to finish. @@ -733,7 +733,7 @@ private extension AuthenticationOperation completionHandler(false) } } -#endif +//#endif } } diff --git a/AltStore/Operations/RemoveAppBackupOperation.swift b/AltStore/Operations/RemoveAppBackupOperation.swift index 45827c01..c72320b1 100644 --- a/AltStore/Operations/RemoveAppBackupOperation.swift +++ b/AltStore/Operations/RemoveAppBackupOperation.swift @@ -58,17 +58,17 @@ final class RemoveAppBackupOperation: ResultOperation } catch let error as CocoaError where error.code == CocoaError.Code.fileNoSuchFile { - #if DEBUG - - // When debugging, it's expected that app groups don't match, so ignore. - self.finish(.success(())) - - #else +// #if DEBUG +// +// // When debugging, it's expected that app groups don't match, so ignore. +// self.finish(.success(())) +// +// #else Logger.sideload.error("Failed to remove app backup directory \(backupDirectoryURL.lastPathComponent, privacy: .public). \(error.localizedDescription, privacy: .public)") self.finish(.failure(error)) - #endif +// #endif } catch { diff --git a/AltStore/Operations/ResignAppOperation.swift b/AltStore/Operations/ResignAppOperation.swift index e4b899ad..49c5f9b2 100644 --- a/AltStore/Operations/ResignAppOperation.swift +++ b/AltStore/Operations/ResignAppOperation.swift @@ -244,13 +244,13 @@ private extension ResignAppOperation { for case let fileURL as URL in enumerator { - #if DEBUG - guard !fileURL.lastPathComponent.lowercased().contains(".xctest") else { - // Remove embedded XCTest (+ dSYM) bundle from copied app bundle. - try FileManager.default.removeItem(at: fileURL) - continue - } - #endif +// #if DEBUG +// guard !fileURL.lastPathComponent.lowercased().contains(".xctest") else { +// // Remove embedded XCTest (+ dSYM) bundle from copied app bundle. +// try FileManager.default.removeItem(at: fileURL) +// continue +// } +// #endif guard let appExtension = Bundle(url: fileURL) else { throw ALTError(.missingAppBundle) } try prepare(appExtension) diff --git a/AltStore/Settings/PatreonViewController.swift b/AltStore/Settings/PatreonViewController.swift index 92f7bdb5..61b05616 100644 --- a/AltStore/Settings/PatreonViewController.swift +++ b/AltStore/Settings/PatreonViewController.swift @@ -318,11 +318,11 @@ extension PatreonViewController case .none: footerView.button.isIndicatingActivity = true case .success?: footerView.button.isHidden = true case .failure?: - #if DEBUG - let debug = true - #else +// #if DEBUG +// let debug = true +// #else let debug = false - #endif +// #endif if self.patronsDataSource.itemCount == 0 || debug { diff --git a/AltStoreCore/Extensions/UserDefaults+AltStore.swift b/AltStoreCore/Extensions/UserDefaults+AltStore.swift index cfb0fc31..021d4e7a 100644 --- a/AltStoreCore/Extensions/UserDefaults+AltStore.swift +++ b/AltStoreCore/Extensions/UserDefaults+AltStore.swift @@ -107,11 +107,11 @@ public extension UserDefaults (ProcessInfo.processInfo.isOperatingSystemAtLeast(ios14) && !ProcessInfo.processInfo.isOperatingSystemAtLeast(ios15_7_2)) || (ProcessInfo.processInfo.isOperatingSystemAtLeast(ios16) && !ProcessInfo.processInfo.isOperatingSystemAtLeast(ios16_2)) - #if DEBUG - let permissionCheckingDisabled = true - #else +// #if DEBUG +// let permissionCheckingDisabled = true +// #else let permissionCheckingDisabled = false - #endif +// #endif // Pre-iOS 15 doesn't support custom sorting, so default to sorting by name. // Otherwise, default to `default` sorting (a.k.a. "source order"). diff --git a/AltStoreCore/Model/DatabaseManager.swift b/AltStoreCore/Model/DatabaseManager.swift index a3758453..6a2ec236 100644 --- a/AltStoreCore/Model/DatabaseManager.swift +++ b/AltStoreCore/Model/DatabaseManager.swift @@ -87,21 +87,21 @@ public extension DatabaseManager guard !self.isStarted else { return finish(nil) } - #if DEBUG - // Wrap in #if DEBUG to *ensure* we never accidentally delete production databases. - if ProcessInfo.processInfo.isPreview - { - do - { - print("!!! Purging database for preview...") - try FileManager.default.removeItem(at: PersistentContainer.defaultDirectoryURL()) - } - catch - { - print("Failed to remove database directory for preview.", error) - } - } - #endif +// #if DEBUG +// // Wrap in #if DEBUG to *ensure* we never accidentally delete production databases. +// if ProcessInfo.processInfo.isPreview +// { +// do +// { +// print("!!! Purging database for preview...") +// try FileManager.default.removeItem(at: PersistentContainer.defaultDirectoryURL()) +// } +// catch +// { +// print("Failed to remove database directory for preview.", error) +// } +// } +// #endif if self.persistentContainer.isMigrationRequired { @@ -354,11 +354,11 @@ private extension DatabaseManager let fileURL = installedApp.fileURL - #if DEBUG - let replaceCachedApp = true - #else +// #if DEBUG +// let replaceCachedApp = true +// #else let replaceCachedApp = !FileManager.default.fileExists(atPath: fileURL.path) || installedApp.version != localApp.version || installedApp.buildVersion != localApp.buildVersion - #endif +// #endif if replaceCachedApp {