问题描述
该应用是在Kotlin中开发的,我使用okHttpClient进行API调用 我试图将其托管在Play商店中,但它们给了我一个漏洞问题:
HostnameVerifier
Your app(s) are using an unsafe implementation of the HostnameVerifier interface. You can find more information about how to resolve the issue in this Google Help Center article.
我的代码:
private val gson = GsonBuilder().setLenient().create()
private var httpLogger = HttpLoggingInterceptor()
.setLevel(HttpLoggingInterceptor.Level.BODY)
private val customClient = OkHttpClient.Builder()
.addInterceptor(httpLogger)
.addInterceptor(ConnectivityInterceptor())
.build()
private val sRetrofitBuilder = Retrofit.Builder()
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.client(customClient)
.addConverterFactory(GsonConverterFactory.create(gson))
.baseUrl(DataUtils.getString(R.string.api_base_url))
.build()
虽然该应用在调试版本中运行良好
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)