mirror of
https://github.com/gedoor/legado.git
synced 2025-01-08 11:47:32 +08:00
阅读默认UA只设置主要版本号 (#2543)
This commit is contained in:
parent
8906fc8439
commit
fe754feebf
2
.github/scripts/cronet.sh
vendored
2
.github/scripts/cronet.sh
vendored
@ -7,6 +7,7 @@ branch="Stable"
|
||||
lastest_cronet_version=`curl -s "https://chromiumdash.appspot.com/fetch_releases?channel=$branch&platform=Android&num=1&offset=0" | jq .[0].version -r`
|
||||
echo "lastest_cronet_version: $lastest_cronet_version"
|
||||
#lastest_cronet_version=100.0.4845.0
|
||||
lastest_cronet_main_version=${lastest_cronet_version%%\.*}.0.0.0
|
||||
|
||||
function checkVersionExit() {
|
||||
local jar_url="https://storage.googleapis.com/chromium-cronet/android/$lastest_cronet_version/Release/cronet/cronet_api.jar"
|
||||
@ -26,6 +27,7 @@ if [[ $current_cronet_version == $lastest_cronet_version ]];then
|
||||
else
|
||||
checkVersionExit
|
||||
sed -i s/CronetVersion=.*/CronetVersion=$lastest_cronet_version/ $path
|
||||
sed -i s/CronetMainVersion=.*/CronetMainVersion=$lastest_cronet_main_version/ $path
|
||||
sed "15a* 更新cronet: $lastest_cronet_version" -i $GITHUB_WORKSPACE/app/src/main/assets/updateLog.md
|
||||
echo "start download latest cronet"
|
||||
chmod +x gradlew
|
||||
|
@ -47,6 +47,7 @@ android {
|
||||
multiDexEnabled true
|
||||
|
||||
buildConfigField "String", "Cronet_Version", "\"$CronetVersion\""
|
||||
buildConfigField "String", "Cronet_Main_Version", "\"$CronetMainVersion\""
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
|
@ -389,7 +389,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/" + BuildConfig.Cronet_Version + " Safari/537.36"
|
||||
return "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/" + BuildConfig.Cronet_Main_Version + " Safari/537.36"
|
||||
}
|
||||
return ua
|
||||
}
|
||||
|
@ -36,4 +36,5 @@ android.defaults.buildfeatures.shaders=false
|
||||
android.nonTransitiveRClass=true
|
||||
#https://chromiumdash.appspot.com/releases?platform=Android
|
||||
CronetVersion=107.0.5304.105
|
||||
android.injected.testOnly=false
|
||||
CronetMainVersion=107.0.0.0
|
||||
android.injected.testOnly=false
|
||||
|
Loading…
Reference in New Issue
Block a user