mirror of
https://github.com/SideStore/SideStore.git
synced 2026-03-27 04:45:39 +01:00
[cleanup]: commented out debug-only code until CI is switched to release builds
This commit is contained in:
@@ -294,9 +294,9 @@ extension AppDelegate
|
|||||||
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { (success, error) in
|
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { (success, error) in
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DEBUG
|
// #if DEBUG
|
||||||
UIApplication.shared.registerForRemoteNotifications()
|
// UIApplication.shared.registerForRemoteNotifications()
|
||||||
#endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
|
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
|
||||||
|
|||||||
@@ -318,6 +318,7 @@ extension LaunchViewController
|
|||||||
|
|
||||||
self.updateKnownSources()
|
self.updateKnownSources()
|
||||||
|
|
||||||
|
// Ask widgets to be refreshed
|
||||||
WidgetCenter.shared.reloadAllTimelines()
|
WidgetCenter.shared.reloadAllTimelines()
|
||||||
|
|
||||||
// Add view controller as child (rather than presenting modally)
|
// Add view controller as child (rather than presenting modally)
|
||||||
|
|||||||
@@ -2280,6 +2280,7 @@ private extension AppManager
|
|||||||
AnalyticsManager.shared.trackEvent(event)
|
AnalyticsManager.shared.trackEvent(event)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ask widgets to be refreshed
|
||||||
WidgetCenter.shared.reloadAllTimelines()
|
WidgetCenter.shared.reloadAllTimelines()
|
||||||
|
|
||||||
do
|
do
|
||||||
|
|||||||
@@ -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.
|
// 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) }
|
guard !provisioningProfile.certificates.contains(signer.certificate) else { return completionHandler(false) }
|
||||||
|
|
||||||
#if DEBUG
|
//#if DEBUG
|
||||||
completionHandler(false)
|
// completionHandler(false)
|
||||||
#else
|
//#else
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
let context = AuthenticatedOperationContext(context: self.context)
|
let context = AuthenticatedOperationContext(context: self.context)
|
||||||
context.operations.removeAllObjects() // Prevent deadlock due to endless waiting on previous operations to finish.
|
context.operations.removeAllObjects() // Prevent deadlock due to endless waiting on previous operations to finish.
|
||||||
@@ -733,7 +733,7 @@ private extension AuthenticationOperation
|
|||||||
completionHandler(false)
|
completionHandler(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
//#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,17 +58,17 @@ final class RemoveAppBackupOperation: ResultOperation<Void>
|
|||||||
}
|
}
|
||||||
catch let error as CocoaError where error.code == CocoaError.Code.fileNoSuchFile
|
catch let error as CocoaError where error.code == CocoaError.Code.fileNoSuchFile
|
||||||
{
|
{
|
||||||
#if DEBUG
|
// #if DEBUG
|
||||||
|
//
|
||||||
// When debugging, it's expected that app groups don't match, so ignore.
|
// // When debugging, it's expected that app groups don't match, so ignore.
|
||||||
self.finish(.success(()))
|
// self.finish(.success(()))
|
||||||
|
//
|
||||||
#else
|
// #else
|
||||||
|
|
||||||
Logger.sideload.error("Failed to remove app backup directory \(backupDirectoryURL.lastPathComponent, privacy: .public). \(error.localizedDescription, privacy: .public)")
|
Logger.sideload.error("Failed to remove app backup directory \(backupDirectoryURL.lastPathComponent, privacy: .public). \(error.localizedDescription, privacy: .public)")
|
||||||
self.finish(.failure(error))
|
self.finish(.failure(error))
|
||||||
|
|
||||||
#endif
|
// #endif
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -244,13 +244,13 @@ private extension ResignAppOperation
|
|||||||
{
|
{
|
||||||
for case let fileURL as URL in enumerator
|
for case let fileURL as URL in enumerator
|
||||||
{
|
{
|
||||||
#if DEBUG
|
// #if DEBUG
|
||||||
guard !fileURL.lastPathComponent.lowercased().contains(".xctest") else {
|
// guard !fileURL.lastPathComponent.lowercased().contains(".xctest") else {
|
||||||
// Remove embedded XCTest (+ dSYM) bundle from copied app bundle.
|
// // Remove embedded XCTest (+ dSYM) bundle from copied app bundle.
|
||||||
try FileManager.default.removeItem(at: fileURL)
|
// try FileManager.default.removeItem(at: fileURL)
|
||||||
continue
|
// continue
|
||||||
}
|
// }
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
guard let appExtension = Bundle(url: fileURL) else { throw ALTError(.missingAppBundle) }
|
guard let appExtension = Bundle(url: fileURL) else { throw ALTError(.missingAppBundle) }
|
||||||
try prepare(appExtension)
|
try prepare(appExtension)
|
||||||
|
|||||||
@@ -318,11 +318,11 @@ extension PatreonViewController
|
|||||||
case .none: footerView.button.isIndicatingActivity = true
|
case .none: footerView.button.isIndicatingActivity = true
|
||||||
case .success?: footerView.button.isHidden = true
|
case .success?: footerView.button.isHidden = true
|
||||||
case .failure?:
|
case .failure?:
|
||||||
#if DEBUG
|
// #if DEBUG
|
||||||
let debug = true
|
// let debug = true
|
||||||
#else
|
// #else
|
||||||
let debug = false
|
let debug = false
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
if self.patronsDataSource.itemCount == 0 || debug
|
if self.patronsDataSource.itemCount == 0 || debug
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -107,11 +107,11 @@ public extension UserDefaults
|
|||||||
(ProcessInfo.processInfo.isOperatingSystemAtLeast(ios14) && !ProcessInfo.processInfo.isOperatingSystemAtLeast(ios15_7_2)) ||
|
(ProcessInfo.processInfo.isOperatingSystemAtLeast(ios14) && !ProcessInfo.processInfo.isOperatingSystemAtLeast(ios15_7_2)) ||
|
||||||
(ProcessInfo.processInfo.isOperatingSystemAtLeast(ios16) && !ProcessInfo.processInfo.isOperatingSystemAtLeast(ios16_2))
|
(ProcessInfo.processInfo.isOperatingSystemAtLeast(ios16) && !ProcessInfo.processInfo.isOperatingSystemAtLeast(ios16_2))
|
||||||
|
|
||||||
#if DEBUG
|
// #if DEBUG
|
||||||
let permissionCheckingDisabled = true
|
// let permissionCheckingDisabled = true
|
||||||
#else
|
// #else
|
||||||
let permissionCheckingDisabled = false
|
let permissionCheckingDisabled = false
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
// Pre-iOS 15 doesn't support custom sorting, so default to sorting by name.
|
// Pre-iOS 15 doesn't support custom sorting, so default to sorting by name.
|
||||||
// Otherwise, default to `default` sorting (a.k.a. "source order").
|
// Otherwise, default to `default` sorting (a.k.a. "source order").
|
||||||
|
|||||||
@@ -87,21 +87,21 @@ public extension DatabaseManager
|
|||||||
|
|
||||||
guard !self.isStarted else { return finish(nil) }
|
guard !self.isStarted else { return finish(nil) }
|
||||||
|
|
||||||
#if DEBUG
|
// #if DEBUG
|
||||||
// Wrap in #if DEBUG to *ensure* we never accidentally delete production databases.
|
// // Wrap in #if DEBUG to *ensure* we never accidentally delete production databases.
|
||||||
if ProcessInfo.processInfo.isPreview
|
// if ProcessInfo.processInfo.isPreview
|
||||||
{
|
// {
|
||||||
do
|
// do
|
||||||
{
|
// {
|
||||||
print("!!! Purging database for preview...")
|
// print("!!! Purging database for preview...")
|
||||||
try FileManager.default.removeItem(at: PersistentContainer.defaultDirectoryURL())
|
// try FileManager.default.removeItem(at: PersistentContainer.defaultDirectoryURL())
|
||||||
}
|
// }
|
||||||
catch
|
// catch
|
||||||
{
|
// {
|
||||||
print("Failed to remove database directory for preview.", error)
|
// print("Failed to remove database directory for preview.", error)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
if self.persistentContainer.isMigrationRequired
|
if self.persistentContainer.isMigrationRequired
|
||||||
{
|
{
|
||||||
@@ -354,11 +354,11 @@ private extension DatabaseManager
|
|||||||
|
|
||||||
let fileURL = installedApp.fileURL
|
let fileURL = installedApp.fileURL
|
||||||
|
|
||||||
#if DEBUG
|
// #if DEBUG
|
||||||
let replaceCachedApp = true
|
// let replaceCachedApp = true
|
||||||
#else
|
// #else
|
||||||
let replaceCachedApp = !FileManager.default.fileExists(atPath: fileURL.path) || installedApp.version != localApp.version || installedApp.buildVersion != localApp.buildVersion
|
let replaceCachedApp = !FileManager.default.fileExists(atPath: fileURL.path) || installedApp.version != localApp.version || installedApp.buildVersion != localApp.buildVersion
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
if replaceCachedApp
|
if replaceCachedApp
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user