feat:autoupdate default useragent

This commit is contained in:
Xwite
2022-03-05 17:09:58 +08:00
parent fa715175f4
commit 625a6e9e79
@@ -2,6 +2,7 @@ package io.legado.app.help.config
import android.content.Context
import android.content.SharedPreferences
import io.legado.app.BuildConfig
import io.legado.app.constant.AppConst
import io.legado.app.constant.PreferKey
import io.legado.app.utils.*
@@ -293,7 +294,7 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
private fun getPrefUserAgent(): String {
val ua = appCtx.getPrefString(PreferKey.userAgent)
if (ua.isNullOrBlank()) {
return "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
return "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/" + BuildConfig.Cronet_Version + " Safari/537.36"
}
return ua
}