package eu.kanade.tachiyomi.di import android.app.Application import eu.kanade.domain.base.BasePreferences import eu.kanade.domain.source.service.SourcePreferences import eu.kanade.domain.sync.SyncPreferences import eu.kanade.domain.track.service.TrackPreferences import eu.kanade.domain.ui.UiPreferences import eu.kanade.tachiyomi.core.security.PrivacyPreferences import eu.kanade.tachiyomi.core.security.SecurityPreferences import eu.kanade.tachiyomi.network.NetworkPreferences import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences import eu.kanade.tachiyomi.util.system.isDevFlavor import tachiyomi.core.common.preference.AndroidPreferenceStore import tachiyomi.core.common.preference.PreferenceStore import tachiyomi.core.common.storage.AndroidStorageFolderProvider import tachiyomi.domain.backup.service.BackupPreferences import tachiyomi.domain.download.service.DownloadPreferences import tachiyomi.domain.library.service.LibraryPreferences import tachiyomi.domain.storage.service.StoragePreferences import uy.kohesive.injekt.api.InjektRegistrar class PreferenceModule(val app: Application) : InjektModule { override fun InjektRegistrar.registerInjectables() { addSingletonFactory { AndroidPreferenceStore(app) } addSingletonFactory { NetworkPreferences( preferenceStore = get(), verboseLogging = isDevFlavor, ) } addSingletonFactory { SourcePreferences(get()) } addSingletonFactory { SecurityPreferences(get()) } addSingletonFactory { PrivacyPreferences(get()) } addSingletonFactory { LibraryPreferences(get()) } addSingletonFactory { ReaderPreferences(get()) } addSingletonFactory { TrackPreferences(get()) } addSingletonFactory { DownloadPreferences(get()) } addSingletonFactory { BackupPreferences(get()) } addSingletonFactory { StoragePreferences( folderProvider = get(), preferenceStore = get(), ) } addSingletonFactory { UiPreferences(get()) } addSingletonFactory { BasePreferences(app, get()) } addSingletonFactory { SyncPreferences(get()) } } }