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