mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-26 08:17:30 +00:00
Use moshi code-gen
This commit is contained in:
parent
ed43ec8ea2
commit
373dc10a40
@ -1,7 +1,6 @@
|
|||||||
package com.topjohnwu.magisk.di
|
package com.topjohnwu.magisk.di
|
||||||
|
|
||||||
import com.squareup.moshi.Moshi
|
import com.squareup.moshi.Moshi
|
||||||
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
|
||||||
import com.topjohnwu.magisk.Constants
|
import com.topjohnwu.magisk.Constants
|
||||||
import com.topjohnwu.magisk.data.network.GithubRawApiServices
|
import com.topjohnwu.magisk.data.network.GithubRawApiServices
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
@ -35,9 +34,7 @@ fun createOkHttpClient(): OkHttpClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun createConverterFactory(): Converter.Factory {
|
fun createConverterFactory(): Converter.Factory {
|
||||||
val moshi = Moshi.Builder()
|
val moshi = Moshi.Builder().build()
|
||||||
.add(KotlinJsonAdapterFactory())
|
|
||||||
.build()
|
|
||||||
return MoshiConverterFactory.create(moshi)
|
return MoshiConverterFactory.create(moshi)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
package com.topjohnwu.magisk.model.entity
|
package com.topjohnwu.magisk.model.entity
|
||||||
|
|
||||||
|
import com.squareup.moshi.JsonClass
|
||||||
|
|
||||||
|
@JsonClass(generateAdapter = true)
|
||||||
data class MagiskConfig(
|
data class MagiskConfig(
|
||||||
val app: MagiskApp,
|
val app: MagiskApp,
|
||||||
val uninstaller: MagiskLink,
|
val uninstaller: MagiskLink,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user