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() }
|
2019-05-10 14:22:03 +00:00
|
|
|
factory { get<Context>().resources }
|
|
|
|
factory { get<Context>() as App }
|
|
|
|
factory { get<Context>().packageManager }
|
2019-05-12 13:49:42 +00:00
|
|
|
factory(Protected) { get<App>().protectedContext }
|
|
|
|
single(SUTimeout) { get<Context>(Protected).getSharedPreferences("su_timeout", 0) }
|
|
|
|
single { PreferenceManager.getDefaultSharedPreferences(get<Context>(Protected)) }
|
2019-05-23 16:11:23 +00:00
|
|
|
}
|