feat:autoupdate default useragent

pull/1687/head
Xwite 3 years ago
parent fa715175f4
commit 625a6e9e79
  1. 3
      app/src/main/java/io/legado/app/help/config/AppConfig.kt

@ -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
}

Loading…
Cancel
Save