Use moshi code-gen

This commit is contained in:
topjohnwu 2019-05-31 21:46:42 -07:00
parent ed43ec8ea2
commit 373dc10a40
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,6 @@
package com.topjohnwu.magisk.di
import com.squareup.moshi.Moshi
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import com.topjohnwu.magisk.Constants
import com.topjohnwu.magisk.data.network.GithubRawApiServices
import okhttp3.OkHttpClient
@ -35,9 +34,7 @@ fun createOkHttpClient(): OkHttpClient {
}
fun createConverterFactory(): Converter.Factory {
val moshi = Moshi.Builder()
.add(KotlinJsonAdapterFactory())
.build()
val moshi = Moshi.Builder().build()
return MoshiConverterFactory.create(moshi)
}

View File

@ -1,5 +1,8 @@
package com.topjohnwu.magisk.model.entity
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class MagiskConfig(
val app: MagiskApp,
val uninstaller: MagiskLink,