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-05-12 15:49:42 +02:00
|
|
|
factory(Protected) { get<App>().protectedContext }
|
|
|
|
single(SUTimeout) { get<Context>(Protected).getSharedPreferences("su_timeout", 0) }
|
|
|
|
single { PreferenceManager.getDefaultSharedPreferences(get<Context>(Protected)) }
|
2019-04-11 20:01:49 +02:00
|
|
|
}
|