2019-04-11 18:01:49 +00:00
|
|
|
package com.topjohnwu.magisk.di
|
|
|
|
|
|
|
|
import android.content.Context
|
2019-04-27 09:27:42 +00:00
|
|
|
import androidx.preference.PreferenceManager
|
2019-04-11 18:01:49 +00:00
|
|
|
import com.skoumal.teanity.rxbus.RxBus
|
2019-04-12 22:14:37 +00:00
|
|
|
import com.topjohnwu.magisk.App
|
2019-04-11 18:01:49 +00:00
|
|
|
import org.koin.dsl.module
|
|
|
|
|
|
|
|
|
|
|
|
val applicationModule = module {
|
|
|
|
single { RxBus() }
|
|
|
|
single { get<Context>().resources }
|
2019-04-12 22:14:37 +00:00
|
|
|
single { get<Context>() as App }
|
2019-04-17 16:27:03 +00:00
|
|
|
single { get<Context>().packageManager }
|
2019-04-26 19:23:25 +00:00
|
|
|
single(SUTimeout) {
|
|
|
|
get<App>().protectedContext
|
|
|
|
.getSharedPreferences("su_timeout", 0)
|
|
|
|
}
|
2019-04-27 09:27:42 +00:00
|
|
|
single { PreferenceManager.getDefaultSharedPreferences(get<App>().protectedContext) }
|
2019-04-11 18:01:49 +00:00
|
|
|
}
|