Update dependencies

This commit is contained in:
topjohnwu 2020-02-21 23:40:20 -08:00
parent 696ab677be
commit 581419b6a3
10 changed files with 31 additions and 61 deletions

View File

@ -68,7 +68,7 @@ dependencies {
implementation 'com.ncapdevi:frag-nav:3.2.0' implementation 'com.ncapdevi:frag-nav:3.2.0'
implementation 'com.github.pwittchen:reactivenetwork-rx2:3.0.6' implementation 'com.github.pwittchen:reactivenetwork-rx2:3.0.6'
implementation 'io.reactivex.rxjava2:rxjava:2.2.16' implementation 'io.reactivex.rxjava2:rxjava:2.2.18'
implementation 'io.reactivex.rxjava2:rxkotlin:2.4.0' implementation 'io.reactivex.rxjava2:rxkotlin:2.4.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
@ -80,7 +80,7 @@ dependencies {
implementation "${bindingAdapter}:${vBAdapt}" implementation "${bindingAdapter}:${vBAdapt}"
implementation "${bindingAdapter}-recyclerview:${vBAdapt}" implementation "${bindingAdapter}-recyclerview:${vBAdapt}"
def vMarkwon = '4.2.0' def vMarkwon = '4.2.1'
implementation "io.noties.markwon:core:${vMarkwon}" implementation "io.noties.markwon:core:${vMarkwon}"
implementation "io.noties.markwon:html:${vMarkwon}" implementation "io.noties.markwon:html:${vMarkwon}"
implementation "io.noties.markwon:image:${vMarkwon}" implementation "io.noties.markwon:image:${vMarkwon}"
@ -101,30 +101,22 @@ dependencies {
implementation "com.squareup.retrofit2:converter-scalars:${vRetrofit}" implementation "com.squareup.retrofit2:converter-scalars:${vRetrofit}"
implementation "com.squareup.retrofit2:adapter-rxjava2:${vRetrofit}" implementation "com.squareup.retrofit2:adapter-rxjava2:${vRetrofit}"
def vOkHttp = '3.12.7' def vOkHttp = '3.12.8'
implementation("com.squareup.okhttp3:okhttp:${vOkHttp}") { implementation("com.squareup.okhttp3:okhttp:${vOkHttp}") {
force = true force = true
} }
implementation "com.squareup.okhttp3:logging-interceptor:${vOkHttp}" implementation "com.squareup.okhttp3:logging-interceptor:${vOkHttp}"
def vMoshi = '1.9.2' def vMoshi = '1.10.0-SNAPSHOT'
implementation "com.squareup.moshi:moshi:${vMoshi}" implementation "com.squareup.moshi:moshi:${vMoshi}"
kapt "com.squareup.moshi:moshi-kotlin-codegen:${vMoshi}"
def vKotshi = '2.0.2' def vRoom = '2.2.4'
implementation "se.ansman.kotshi:api:${vKotshi}" implementation "androidx.room:room-runtime:${vRoom}"
kapt "se.ansman.kotshi:compiler:${vKotshi}"
modules {
module('androidx.room:room-runtime') {
replacedBy('com.github.topjohnwu:room-runtime')
}
}
def vRoom = '2.2.3'
implementation "com.github.topjohnwu:room-runtime:${vRoom}"
implementation "androidx.room:room-rxjava2:${vRoom}" implementation "androidx.room:room-rxjava2:${vRoom}"
kapt "androidx.room:room-compiler:${vRoom}" kapt "androidx.room:room-compiler:${vRoom}"
def vNav = '2.1.0' def vNav = '2.2.1'
implementation "androidx.navigation:navigation-fragment-ktx:${vNav}" implementation "androidx.navigation:navigation-fragment-ktx:${vNav}"
implementation "androidx.navigation:navigation-ui-ktx:${vNav}" implementation "androidx.navigation:navigation-ui-ktx:${vNav}"
@ -134,10 +126,10 @@ dependencies {
implementation 'androidx.browser:browser:1.2.0' implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.preference:preference:1.1.0' implementation 'androidx.preference:preference:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0' implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.fragment:fragment-ktx:1.2.0-rc05' implementation 'androidx.fragment:fragment-ktx:1.2.2'
implementation 'androidx.work:work-runtime:2.2.0' implementation 'androidx.work:work-runtime:2.3.2'
implementation 'androidx.transition:transition:1.3.0-rc02' implementation 'androidx.transition:transition:1.3.1'
implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.core:core-ktx:1.2.0-rc01' implementation 'androidx.core:core-ktx:1.2.0'
implementation 'com.google.android.material:material:1.2.0-alpha03' implementation 'com.google.android.material:material:1.2.0-alpha03'
} }

View File

@ -39,7 +39,7 @@
} }
# Excessive obfuscation # Excessive obfuscation
-repackageclasses a -repackageclasses
-allowaccessmodification -allowaccessmodification
# QOL # QOL

View File

@ -5,20 +5,13 @@ import android.content.Context
import android.content.res.Configuration import android.content.res.Configuration
import androidx.appcompat.app.AppCompatDelegate import androidx.appcompat.app.AppCompatDelegate
import androidx.multidex.MultiDex import androidx.multidex.MultiDex
import androidx.room.Room
import androidx.work.WorkManager import androidx.work.WorkManager
import androidx.work.impl.WorkDatabase
import androidx.work.impl.WorkDatabase_Impl
import com.topjohnwu.magisk.BuildConfig import com.topjohnwu.magisk.BuildConfig
import com.topjohnwu.magisk.DynAPK import com.topjohnwu.magisk.DynAPK
import com.topjohnwu.magisk.FileProvider import com.topjohnwu.magisk.FileProvider
import com.topjohnwu.magisk.core.su.SuCallbackHandler import com.topjohnwu.magisk.core.su.SuCallbackHandler
import com.topjohnwu.magisk.core.utils.RootInit import com.topjohnwu.magisk.core.utils.RootInit
import com.topjohnwu.magisk.core.utils.updateConfig import com.topjohnwu.magisk.core.utils.updateConfig
import com.topjohnwu.magisk.data.database.RepoDatabase
import com.topjohnwu.magisk.data.database.RepoDatabase_Impl
import com.topjohnwu.magisk.data.database.SuLogDatabase
import com.topjohnwu.magisk.data.database.SuLogDatabase_Impl
import com.topjohnwu.magisk.di.ActivityTracker import com.topjohnwu.magisk.di.ActivityTracker
import com.topjohnwu.magisk.di.koinModules import com.topjohnwu.magisk.di.koinModules
import com.topjohnwu.magisk.extensions.get import com.topjohnwu.magisk.extensions.get
@ -42,14 +35,6 @@ open class App() : Application() {
Shell.Config.addInitializers(RootInit::class.java) Shell.Config.addInitializers(RootInit::class.java)
Shell.Config.setTimeout(2) Shell.Config.setTimeout(2)
FileProvider.callHandler = SuCallbackHandler FileProvider.callHandler = SuCallbackHandler
Room.setFactory {
when (it) {
WorkDatabase::class.java -> WorkDatabase_Impl()
RepoDatabase::class.java -> RepoDatabase_Impl()
SuLogDatabase::class.java -> SuLogDatabase_Impl()
else -> null
}
}
// Always log full stack trace with Timber // Always log full stack trace with Timber
Timber.plant(Timber.DebugTree()) Timber.plant(Timber.DebugTree())

View File

@ -1,10 +1,10 @@
package com.topjohnwu.magisk.core.model package com.topjohnwu.magisk.core.model
import android.os.Parcelable import android.os.Parcelable
import com.squareup.moshi.JsonClass
import kotlinx.android.parcel.Parcelize import kotlinx.android.parcel.Parcelize
import se.ansman.kotshi.JsonSerializable
@JsonSerializable @JsonClass(generateAdapter = true)
data class UpdateInfo( data class UpdateInfo(
val app: ManagerJson = ManagerJson(), val app: ManagerJson = ManagerJson(),
val uninstaller: UninstallerJson = UninstallerJson(), val uninstaller: UninstallerJson = UninstallerJson(),
@ -12,12 +12,12 @@ data class UpdateInfo(
val stub: StubJson = StubJson() val stub: StubJson = StubJson()
) )
@JsonSerializable @JsonClass(generateAdapter = true)
data class UninstallerJson( data class UninstallerJson(
val link: String = "" val link: String = ""
) )
@JsonSerializable @JsonClass(generateAdapter = true)
data class MagiskJson( data class MagiskJson(
val version: String = "", val version: String = "",
val versionCode: Int = -1, val versionCode: Int = -1,
@ -27,7 +27,7 @@ data class MagiskJson(
) )
@Parcelize @Parcelize
@JsonSerializable @JsonClass(generateAdapter = true)
data class ManagerJson( data class ManagerJson(
val version: String = "", val version: String = "",
val versionCode: Int = -1, val versionCode: Int = -1,
@ -35,7 +35,7 @@ data class ManagerJson(
val note: String = "" val note: String = ""
) : Parcelable ) : Parcelable
@JsonSerializable @JsonClass(generateAdapter = true)
data class StubJson( data class StubJson(
val versionCode: Int = -1, val versionCode: Int = -1,
val link: String = "" val link: String = ""

View File

@ -1,5 +1,6 @@
package com.topjohnwu.magisk.core.tasks package com.topjohnwu.magisk.core.tasks
import com.squareup.moshi.JsonClass
import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.core.Const
import com.topjohnwu.magisk.core.model.module.Repo import com.topjohnwu.magisk.core.model.module.Repo
import com.topjohnwu.magisk.data.database.RepoDao import com.topjohnwu.magisk.data.database.RepoDao
@ -8,7 +9,6 @@ import io.reactivex.Completable
import io.reactivex.Flowable import io.reactivex.Flowable
import io.reactivex.rxkotlin.toFlowable import io.reactivex.rxkotlin.toFlowable
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import se.ansman.kotshi.JsonSerializable
import timber.log.Timber import timber.log.Timber
import java.net.HttpURLConnection import java.net.HttpURLConnection
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
@ -89,7 +89,7 @@ private val dateFormat: SimpleDateFormat =
timeZone = TimeZone.getTimeZone("UTC") timeZone = TimeZone.getTimeZone("UTC")
} }
@JsonSerializable @JsonClass(generateAdapter = true)
data class GithubRepoInfo( data class GithubRepoInfo(
val name: String, val name: String,
val pushed_at: String val pushed_at: String

View File

@ -4,7 +4,7 @@ import androidx.room.*
import com.topjohnwu.magisk.core.Config import com.topjohnwu.magisk.core.Config
import com.topjohnwu.magisk.core.model.module.Repo import com.topjohnwu.magisk.core.model.module.Repo
@Database(version = 6, entities = [Repo::class, RepoEtag::class]) @Database(version = 6, entities = [Repo::class, RepoEtag::class], exportSchema = false)
abstract class RepoDatabase : RoomDatabase() { abstract class RepoDatabase : RoomDatabase() {
abstract fun repoDao() : RepoDao abstract fun repoDao() : RepoDao

View File

@ -6,7 +6,7 @@ import io.reactivex.Completable
import io.reactivex.Single import io.reactivex.Single
import java.util.* import java.util.*
@Database(version = 1, entities = [MagiskLog::class]) @Database(version = 1, entities = [MagiskLog::class], exportSchema = false)
abstract class SuLogDatabase : RoomDatabase() { abstract class SuLogDatabase : RoomDatabase() {
abstract fun suLogDao(): SuLogDao abstract fun suLogDao(): SuLogDao

View File

@ -1,7 +1,6 @@
package com.topjohnwu.magisk.di package com.topjohnwu.magisk.di
import android.content.Context import android.content.Context
import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.Moshi import com.squareup.moshi.Moshi
import com.topjohnwu.magisk.BuildConfig import com.topjohnwu.magisk.BuildConfig
import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.core.Const
@ -20,7 +19,6 @@ import retrofit2.Retrofit
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import retrofit2.converter.moshi.MoshiConverterFactory import retrofit2.converter.moshi.MoshiConverterFactory
import retrofit2.converter.scalars.ScalarsConverterFactory import retrofit2.converter.scalars.ScalarsConverterFactory
import se.ansman.kotshi.KotshiJsonAdapterFactory
val networkingModule = module { val networkingModule = module {
single { createOkHttpClient(get()) } single { createOkHttpClient(get()) }
@ -49,9 +47,7 @@ fun createOkHttpClient(context: Context): OkHttpClient {
} }
fun createMoshiConverterFactory(): MoshiConverterFactory { fun createMoshiConverterFactory(): MoshiConverterFactory {
val moshi = Moshi.Builder() val moshi = Moshi.Builder().build()
.add(KotshiJsonAdapterFactory)
.build()
return MoshiConverterFactory.create(moshi) return MoshiConverterFactory.create(moshi)
} }
@ -63,9 +59,6 @@ fun createRetrofit(okHttpClient: OkHttpClient): Retrofit.Builder {
.client(okHttpClient) .client(okHttpClient)
} }
@KotshiJsonAdapterFactory
abstract class JsonAdapterFactory : JsonAdapter.Factory
inline fun <reified T> createApiService(retrofitBuilder: Retrofit.Builder, baseUrl: String): T { inline fun <reified T> createApiService(retrofitBuilder: Retrofit.Builder, baseUrl: String): T {
return retrofitBuilder return retrofitBuilder
.baseUrl(baseUrl) .baseUrl(baseUrl)

View File

@ -43,7 +43,7 @@ subprojects {
getPlugins().hasPlugin('com.android.application')) { getPlugins().hasPlugin('com.android.application')) {
android { android {
compileSdkVersion 29 compileSdkVersion 29
buildToolsVersion '29.0.2' buildToolsVersion '29.0.3'
defaultConfig { defaultConfig {
if (minSdkVersion == null) if (minSdkVersion == null)

View File

@ -58,7 +58,7 @@ archs = ['armeabi-v7a', 'x86']
arch64 = ['arm64-v8a', 'x86_64'] arch64 = ['arm64-v8a', 'x86_64']
support_targets = ['magisk', 'magiskinit', 'magiskboot', 'magiskpolicy', 'resetprop', 'busybox', 'test'] support_targets = ['magisk', 'magiskinit', 'magiskboot', 'magiskpolicy', 'resetprop', 'busybox', 'test']
default_targets = ['magisk', 'magiskinit', 'magiskboot', 'busybox'] default_targets = ['magisk', 'magiskinit', 'magiskboot', 'busybox']
build_tools = os.path.join(os.environ['ANDROID_HOME'], 'build-tools', '29.0.2') build_tools = os.path.join(os.environ['ANDROID_HOME'], 'build-tools', '29.0.3')
# Global vars # Global vars
config = {} config = {}