diff --git a/app/src/main/java/io/legado/app/help/http/EncodeConverter.kt b/app/src/main/java/io/legado/app/help/http/EncodeConverter.kt index a371135d0..b17f50ef8 100644 --- a/app/src/main/java/io/legado/app/help/http/EncodeConverter.kt +++ b/app/src/main/java/io/legado/app/help/http/EncodeConverter.kt @@ -6,7 +6,7 @@ import retrofit2.Retrofit import java.lang.reflect.Type import java.nio.charset.Charset -class EncodeConverter private constructor(private val encode: String? = null) : Converter.Factory() { +class EncodeConverter(private val encode: String? = null) : Converter.Factory() { override fun responseBodyConverter( type: Type?, @@ -33,10 +33,4 @@ class EncodeConverter private constructor(private val encode: String? = null) : } } - companion object { - - fun create(encode: String? = null): EncodeConverter { - return EncodeConverter(encode) - } - } } diff --git a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt index 5ae7c286e..2945d2882 100644 --- a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt +++ b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt @@ -44,7 +44,7 @@ object HttpHelper { fun getRetrofit(baseUrl: String, encode: String? = null): Retrofit { return Retrofit.Builder().baseUrl(baseUrl) //增加返回值为字符串的支持(以实体类返回) - .addConverterFactory(EncodeConverter.create(encode)) + .addConverterFactory(EncodeConverter(encode)) //增加返回值为Observable的支持 .addCallAdapterFactory(CoroutinesCallAdapterFactory.create()) .client(client)