Commit 373dc10a authored by topjohnwu's avatar topjohnwu

Use moshi code-gen

parent ed43ec8e
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)
}
......
package com.topjohnwu.magisk.model.entity
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class MagiskConfig(
val app: MagiskApp,
val uninstaller: MagiskLink,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment