Updated service to use extra transformer so the service itself is not plagued by unnecessary code

This commit is contained in:
Viktor De Pasquale
2019-07-11 19:10:12 +02:00
committed by John Wu
parent 78282c1a49
commit 7cd814d917
3 changed files with 84 additions and 50 deletions

View File

@@ -4,6 +4,8 @@ import android.content.Context
import androidx.preference.PreferenceManager
import com.skoumal.teanity.rxbus.RxBus
import com.topjohnwu.magisk.App
import com.topjohnwu.magisk.model.download.ModuleTransformer
import com.topjohnwu.magisk.model.entity.internal.DownloadSubject
import org.koin.dsl.module
@@ -15,4 +17,6 @@ val applicationModule = module {
factory(Protected) { get<App>().protectedContext }
single(SUTimeout) { get<Context>(Protected).getSharedPreferences("su_timeout", 0) }
single { PreferenceManager.getDefaultSharedPreferences(get<Context>(Protected)) }
factory { (subject: DownloadSubject) -> ModuleTransformer(get(), subject) }
}