Files
Magisk/app/src/main/java/com/topjohnwu/magisk/di/ApplicationModule.kt
T
Viktor De Pasquale a9b00dd537 Updated deprecation statements and moved components init after attaching base context
This needed to be done in order to get the Koin working as it requires injection before calling onCreate
2019-04-27 11:27:42 +02:00

21 lines
596 B
Kotlin

package com.topjohnwu.magisk.di
import android.content.Context
import androidx.preference.PreferenceManager
import com.skoumal.teanity.rxbus.RxBus
import com.topjohnwu.magisk.App
import org.koin.dsl.module
val applicationModule = module {
single { RxBus() }
single { get<Context>().resources }
single { get<Context>() as App }
single { get<Context>().packageManager }
single(SUTimeout) {
get<App>().protectedContext
.getSharedPreferences("su_timeout", 0)
}
single { PreferenceManager.getDefaultSharedPreferences(get<App>().protectedContext) }
}