Update dependencies

Jcenter will sunset
This commit is contained in:
vvb2060 2021-04-17 17:32:07 +08:00 committed by John Wu
parent a328e2bf3c
commit 69b00d3782
21 changed files with 40 additions and 47 deletions

View File

@ -16,20 +16,18 @@ kapt {
javacOptions {
option("-Xmaxerrs", 1000)
}
arguments {
arg("room.incremental", "true")
}
}
android {
defaultConfig {
applicationId = "com.topjohnwu.magisk"
vectorDrawables.useSupportLibrary = true
multiDexEnabled = true
versionName = Config.version
versionCode = Config.versionCode
ndk.abiFilters("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
javaCompileOptions.annotationProcessorOptions.arguments(
mapOf("room.incremental" to "true")
)
}
buildTypes {
@ -211,10 +209,9 @@ dependencies {
implementation("com.github.topjohnwu.libsu:core:${vLibsu}")
implementation("com.github.topjohnwu.libsu:io:${vLibsu}")
val vKoin = "2.1.6"
implementation("org.koin:koin-core:${vKoin}")
implementation("org.koin:koin-android:${vKoin}")
implementation("org.koin:koin-androidx-viewmodel:${vKoin}")
val vKoin = "2.2.2"
implementation("io.insert-koin:koin-android:${vKoin}")
implementation("io.insert-koin:koin-androidx-viewmodel:${vKoin}")
val vRetrofit = "2.9.0"
implementation("com.squareup.retrofit2:retrofit:${vRetrofit}")
@ -226,7 +223,7 @@ dependencies {
implementation("com.squareup.okhttp3:logging-interceptor:${vOkHttp}")
implementation("com.squareup.okhttp3:okhttp-dnsoverhttps:${vOkHttp}")
val vMoshi = "1.11.0"
val vMoshi = "1.12.0"
implementation("com.squareup.moshi:moshi:${vMoshi}")
kapt("com.squareup.moshi:moshi-kotlin-codegen:${vMoshi}")

View File

@ -19,7 +19,7 @@ import com.topjohnwu.magisk.events.*
import com.topjohnwu.magisk.utils.ObservableHost
import com.topjohnwu.magisk.utils.set
import kotlinx.coroutines.Job
import org.koin.core.KoinComponent
import org.koin.core.component.KoinComponent
abstract class BaseViewModel(
initialState: State = State.LOADING

View File

@ -5,11 +5,11 @@ import android.content.ContextWrapper
import android.content.Intent
import com.topjohnwu.magisk.core.base.BaseReceiver
import com.topjohnwu.magisk.core.magiskdb.PolicyDao
import com.topjohnwu.magisk.ktx.inject
import com.topjohnwu.magisk.view.Shortcuts
import com.topjohnwu.superuser.Shell
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import org.koin.core.inject
open class Receiver : BaseReceiver() {

View File

@ -5,9 +5,9 @@ import android.content.Context
import androidx.work.*
import com.topjohnwu.magisk.BuildConfig
import com.topjohnwu.magisk.data.repository.NetworkService
import com.topjohnwu.magisk.ktx.inject
import com.topjohnwu.magisk.view.Notifications
import org.koin.core.KoinComponent
import org.koin.core.inject
import org.koin.core.component.KoinComponent
import java.util.concurrent.TimeUnit
class UpdateCheckService(context: Context, workerParams: WorkerParameters)

View File

@ -83,6 +83,7 @@ abstract class BaseActivity : AppCompatActivity() {
override fun onRequestPermissionsResult(
requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
var success = true
for (res in grantResults) {
if (res != PackageManager.PERMISSION_GRANTED) {

View File

@ -5,7 +5,7 @@ import android.content.Context
import android.content.ContextWrapper
import android.content.Intent
import com.topjohnwu.magisk.core.wrap
import org.koin.core.KoinComponent
import org.koin.core.component.KoinComponent
abstract class BaseReceiver : BroadcastReceiver(), KoinComponent {

View File

@ -3,7 +3,7 @@ package com.topjohnwu.magisk.core.base
import android.app.Service
import android.content.Context
import com.topjohnwu.magisk.core.wrap
import org.koin.core.KoinComponent
import org.koin.core.component.KoinComponent
abstract class BaseService : Service(), KoinComponent {
override fun attachBaseContext(base: Context) {

View File

@ -10,14 +10,14 @@ import com.topjohnwu.magisk.core.ForegroundTracker
import com.topjohnwu.magisk.core.base.BaseService
import com.topjohnwu.magisk.core.utils.ProgressInputStream
import com.topjohnwu.magisk.data.repository.NetworkService
import com.topjohnwu.magisk.ktx.inject
import com.topjohnwu.magisk.view.Notifications
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import okhttp3.ResponseBody
import org.koin.android.ext.android.inject
import org.koin.core.KoinComponent
import org.koin.core.component.KoinComponent
import timber.log.Timber
import java.io.IOException
import java.io.InputStream

View File

@ -7,12 +7,13 @@ import com.topjohnwu.magisk.core.Const
import com.topjohnwu.magisk.core.utils.MediaStoreUtils.displayName
import com.topjohnwu.magisk.core.utils.MediaStoreUtils.inputStream
import com.topjohnwu.magisk.core.utils.unzip
import com.topjohnwu.magisk.ktx.inject
import com.topjohnwu.magisk.ktx.writeTo
import com.topjohnwu.superuser.Shell
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.koin.core.KoinComponent
import org.koin.core.inject
import org.koin.core.component.KoinComponent
import timber.log.Timber
import java.io.File
import java.io.FileNotFoundException

View File

@ -14,10 +14,7 @@ import com.topjohnwu.magisk.core.utils.MediaStoreUtils.inputStream
import com.topjohnwu.magisk.core.utils.MediaStoreUtils.outputStream
import com.topjohnwu.magisk.data.repository.NetworkService
import com.topjohnwu.magisk.di.Protected
import com.topjohnwu.magisk.ktx.reboot
import com.topjohnwu.magisk.ktx.symlink
import com.topjohnwu.magisk.ktx.withStreams
import com.topjohnwu.magisk.ktx.writeTo
import com.topjohnwu.magisk.ktx.*
import com.topjohnwu.magisk.utils.Utils
import com.topjohnwu.signing.SignBoot
import com.topjohnwu.superuser.Shell
@ -34,8 +31,7 @@ import org.kamranzafar.jtar.TarEntry
import org.kamranzafar.jtar.TarHeader
import org.kamranzafar.jtar.TarInputStream
import org.kamranzafar.jtar.TarOutputStream
import org.koin.core.KoinComponent
import org.koin.core.inject
import org.koin.core.component.KoinComponent
import timber.log.Timber
import java.io.*
import java.nio.ByteBuffer

View File

@ -6,8 +6,8 @@ import androidx.core.content.ContextCompat
import androidx.fragment.app.FragmentActivity
import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.core.Config
import org.koin.core.KoinComponent
import org.koin.core.get
import com.topjohnwu.magisk.ktx.get
import org.koin.core.component.KoinComponent
object BiometricHelper: KoinComponent {

View File

@ -6,9 +6,9 @@ import com.topjohnwu.magisk.core.Info
import com.topjohnwu.magisk.core.download.DownloadService
import com.topjohnwu.magisk.core.download.Subject
import com.topjohnwu.magisk.data.repository.NetworkService
import com.topjohnwu.magisk.ktx.get
import com.topjohnwu.magisk.ktx.inject
import com.topjohnwu.magisk.view.MagiskDialog
import org.koin.core.get
import org.koin.core.inject
import java.io.File
class ManagerInstallDialog : MarkDownDialog() {

View File

@ -6,13 +6,13 @@ import androidx.annotation.CallSuper
import androidx.lifecycle.lifecycleScope
import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.core.base.BaseActivity
import com.topjohnwu.magisk.ktx.inject
import com.topjohnwu.magisk.view.MagiskDialog
import io.noties.markwon.Markwon
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.koin.core.KoinComponent
import org.koin.core.inject
import org.koin.core.component.KoinComponent
import timber.log.Timber
import kotlin.coroutines.cancellation.CancellationException

View File

@ -1,10 +1,10 @@
package com.topjohnwu.magisk.ktx
import org.koin.core.context.KoinContextHandler
import org.koin.core.context.GlobalContext
import org.koin.core.parameter.ParametersDefinition
import org.koin.core.qualifier.Qualifier
fun getKoin() = KoinContextHandler.get()
fun getKoin() = GlobalContext.get()
inline fun <reified T> inject(
qualifier: Qualifier? = null,

View File

@ -14,11 +14,11 @@ import com.topjohnwu.magisk.core.Info
import com.topjohnwu.magisk.data.repository.NetworkService
import com.topjohnwu.magisk.events.MagiskInstallFileEvent
import com.topjohnwu.magisk.events.dialog.SecondSlotWarningDialog
import com.topjohnwu.magisk.ktx.get
import com.topjohnwu.magisk.ui.flash.FlashFragment
import com.topjohnwu.magisk.utils.set
import com.topjohnwu.superuser.Shell
import kotlinx.coroutines.launch
import org.koin.core.get
import timber.log.Timber
import java.io.File
import java.io.IOException

View File

@ -14,6 +14,7 @@ import com.topjohnwu.magisk.core.Const
import com.topjohnwu.magisk.data.repository.NetworkService
import com.topjohnwu.magisk.ktx.createClassLoader
import com.topjohnwu.magisk.ktx.reflectField
import com.topjohnwu.magisk.ktx.inject
import com.topjohnwu.magisk.ktx.writeTo
import com.topjohnwu.magisk.view.MagiskDialog
import com.topjohnwu.signing.CryptoUtils
@ -26,8 +27,7 @@ import kotlinx.coroutines.withContext
import org.bouncycastle.asn1.ASN1Encoding
import org.bouncycastle.asn1.ASN1Primitive
import org.bouncycastle.est.jcajce.JsseDefaultHostnameAuthorizer
import org.koin.core.KoinComponent
import org.koin.core.inject
import org.koin.core.component.KoinComponent
import timber.log.Timber
import java.io.ByteArrayInputStream
import java.io.File

View File

@ -9,12 +9,12 @@ import androidx.databinding.Bindable
import com.topjohnwu.magisk.BR
import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.ObservableItem
import com.topjohnwu.magisk.ktx.get
import com.topjohnwu.magisk.utils.TextHolder
import com.topjohnwu.magisk.utils.asText
import com.topjohnwu.magisk.utils.set
import com.topjohnwu.magisk.view.MagiskDialog
import org.koin.core.KoinComponent
import org.koin.core.get
import org.koin.core.component.KoinComponent
sealed class BaseSettingsItem : ObservableItem<BaseSettingsItem>() {

View File

@ -22,10 +22,10 @@ import com.topjohnwu.magisk.events.AddHomeIconEvent
import com.topjohnwu.magisk.events.RecreateEvent
import com.topjohnwu.magisk.events.dialog.BiometricEvent
import com.topjohnwu.magisk.ktx.activity
import com.topjohnwu.magisk.ktx.get
import com.topjohnwu.magisk.utils.Utils
import com.topjohnwu.superuser.Shell
import kotlinx.coroutines.launch
import org.koin.core.get
class SettingsViewModel(
private val repositoryDao: RepoDao

View File

@ -10,8 +10,7 @@ plugins {
buildscript {
repositories {
google()
jcenter()
maven { url = uri("https://kotlin.bintray.com/kotlinx") }
mavenCentral()
}
val vNav = "2.3.5"
@ -19,7 +18,7 @@ buildscript {
dependencies {
classpath("com.android.tools.build:gradle:4.1.3")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31")
classpath(kotlin("gradle-plugin", version = "1.4.32"))
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:${vNav}")
// NOTE: Do not place your application dependencies here; they belong
@ -53,9 +52,8 @@ fun Task.applyOptimize() = doLast {
subprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url = uri("https://jitpack.io") }
maven { url = uri("http://oss.sonatype.org/content/repositories/snapshots") }
}
afterEvaluate {

View File

@ -2,7 +2,7 @@ plugins {
`kotlin-dsl`
}
repositories {
jcenter()
mavenCentral()
}
gradlePlugin {

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip