31 lines
971 B
Kotlin
31 lines
971 B
Kotlin
package com.vanced.manager.di
|
|
|
|
import android.content.Context
|
|
import com.vanced.manager.datasource.PkgInfoDatasource
|
|
import com.vanced.manager.datasource.PkgInfoDatasourceImpl
|
|
import com.vanced.manager.datasource.PreferenceDatasource
|
|
import com.vanced.manager.datasource.PreferenceDatasourceImpl
|
|
import org.koin.android.ext.koin.androidContext
|
|
import org.koin.dsl.module
|
|
|
|
val datasourceModule = module {
|
|
|
|
fun providePkgInfoDatasource(
|
|
context: Context
|
|
): PkgInfoDatasource {
|
|
return PkgInfoDatasourceImpl(
|
|
packageManager = context.packageManager
|
|
)
|
|
}
|
|
|
|
fun providePreferenceDatasource(
|
|
context: Context
|
|
): PreferenceDatasource {
|
|
return PreferenceDatasourceImpl(
|
|
sharedPreferences = context.getSharedPreferences("manager_settings", Context.MODE_PRIVATE)
|
|
)
|
|
}
|
|
|
|
single { providePkgInfoDatasource(androidContext()) }
|
|
single { providePreferenceDatasource(androidContext()) }
|
|
} |