Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Gimp/libgimpwidgets/   (Gimp Bildeditor Version 3.2.0©)  Datei vom 14.2.2026 mit Größe 7 kB image not shown  

Quellcode-Bibliothek SetupApp.swift   Sprache: JAVA

 

import Foundation
import RemoteSecretProtocol
import ThreemaFramework
import ThreemaMacros
import UIKit

// MARK: - SetupApp

/// Migration steps that have to run once an identity is available, both on a normal launch and at the end of
/// onboarding.
///
/// The remote secret and keychain setup that used to live here is now owned by `RemoteSecretResolver`.
enum SetupApp {

    @MainActor @discardableResult static func runDatabaseMigrationIfNeeded(
        remoteSecretManager: RemoteSecretManagerProtocol
    ) async throws -> DatabaseManagerProtocol {
        let databaseManager = AppLaunchManager.shared
            .initializeDatabaseManager(remoteSecretManager: remoteSecretManager)

        #if DEBUG
            AppLaunchManager.shared.importOldVersionDatabase(databaseManager: databaseManager)
        #endif

        if AppLaunchManager.shared.isRepairedDatabaseImportRequired {
            try await SpinnerPresenter.presentSpinner(
                label: #localize("updating_database"),
                window: SharedAppProvider.window
            ) {
                try AppLaunchManager.shared.importRepairedDatabase(databaseManager: databaseManager)
            }
        }

        if try AppLaunchManager.shared.isDatabaseMigrationRequired(databaseManager: databaseManager) {
            try await SpinnerPresenter.presentSpinner(
                label: #localize("updating_database"),
                window: SharedAppProvider.window
            ) {
                try AppLaunchManager.shared.migrateDatabase(databaseManager: databaseManager)
            }
        }

        return databaseManager
    }

    @MainActor static func runAppMigrationIfNeeded(
        businessInjector: BusinessInjectorProtocol
    ) async throws {
        guard AppLaunchManager.shared.isAppMigrationRequired else {
            return
        }

        let appMigration = AppMigration(businessInjector: businessInjector)

        if AppSetup.hasPreexistingDatabaseFile {
            try appMigration.run()
        }
        else {
            appMigration.updateAppMigrationVersionToLatest()
        }
    }
}

Messung
CHZG
86929189

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.7Bemerkung:  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland