feat:autoupdate default useragent
This commit is contained in:
@@ -2,6 +2,7 @@ package io.legado.app.help.config
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
|
import io.legado.app.BuildConfig
|
||||||
import io.legado.app.constant.AppConst
|
import io.legado.app.constant.AppConst
|
||||||
import io.legado.app.constant.PreferKey
|
import io.legado.app.constant.PreferKey
|
||||||
import io.legado.app.utils.*
|
import io.legado.app.utils.*
|
||||||
@@ -293,7 +294,7 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
|
|||||||
private fun getPrefUserAgent(): String {
|
private fun getPrefUserAgent(): String {
|
||||||
val ua = appCtx.getPrefString(PreferKey.userAgent)
|
val ua = appCtx.getPrefString(PreferKey.userAgent)
|
||||||
if (ua.isNullOrBlank()) {
|
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
|
return ua
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user