Removed Kotpref and replaced it with PreferenceModel

This commit is contained in:
Viktor De Pasquale
2019-06-03 16:35:36 +02:00
committed by John Wu
parent 28efded624
commit d1dfda405f
13 changed files with 268 additions and 27 deletions

View File

@@ -2,7 +2,6 @@ package com.topjohnwu.magisk.di
import android.content.Context
import androidx.preference.PreferenceManager
import com.chibatching.kotpref.ContextProvider
import com.skoumal.teanity.rxbus.RxBus
import com.topjohnwu.magisk.App
import org.koin.dsl.module
@@ -16,11 +15,4 @@ val applicationModule = module {
factory(Protected) { get<App>().protectedContext }
single(SUTimeout) { get<Context>(Protected).getSharedPreferences("su_timeout", 0) }
single { PreferenceManager.getDefaultSharedPreferences(get<Context>(Protected)) }
single { createContextProvider(get(Protected)) as ContextProvider }
}
private fun createContextProvider(context: Context) = object : ContextProvider {
override fun getApplicationContext(): Context {
return context
}
}