Merge branch 'devel' into feature/mal

This commit is contained in:
Zakhar Timoshenko
2023-02-05 18:31:22 +03:00
4 changed files with 6 additions and 6 deletions

View File

@@ -86,7 +86,7 @@ afterEvaluate {
}
}
dependencies {
implementation('com.github.KotatsuApp:kotatsu-parsers:7f630184c0') {
implementation('com.github.KotatsuApp:kotatsu-parsers:c28e2a72d5') {
exclude group: 'org.json', module: 'json'
}

View File

@@ -31,7 +31,7 @@ class BrowserActivity : BaseActivity<ActivityBrowserBinding>(), BrowserCallback
}
with(binding.webView.settings) {
javaScriptEnabled = true
userAgentString = UserAgentInterceptor.userAgent
userAgentString = UserAgentInterceptor.userAgentChrome
}
binding.webView.webViewClient = BrowserClient(this)
binding.webView.webChromeClient = ProgressChromeClient(binding.progressBar)

View File

@@ -42,7 +42,7 @@ class CloudFlareDialog : AlertDialogFragment<FragmentCloudflareBinding>(), Cloud
cacheMode = WebSettings.LOAD_DEFAULT
domStorageEnabled = true
databaseEnabled = true
userAgentString = UserAgentInterceptor.userAgent
userAgentString = UserAgentInterceptor.userAgentChrome
}
binding.webView.webViewClient = CloudFlareClient(cookieJar, this, url.orEmpty())
CookieManager.getInstance().setAcceptThirdPartyCookies(binding.webView, true)

View File

@@ -13,7 +13,7 @@ class UserAgentInterceptor : Interceptor {
return chain.proceed(
if (request.header(CommonHeaders.USER_AGENT) == null) {
request.newBuilder()
.addHeader(CommonHeaders.USER_AGENT, userAgent)
.addHeader(CommonHeaders.USER_AGENT, userAgentChrome)
.build()
} else request
)
@@ -29,7 +29,7 @@ class UserAgentInterceptor : Interceptor {
Build.BRAND,
Build.DEVICE,
Locale.getDefault().language
)
) // TODO Decide what to do with this afterwards
val userAgentChrome
get() = (
@@ -40,4 +40,4 @@ class UserAgentInterceptor : Interceptor {
Build.MODEL,
)
}
}
}