Merge branch 'devel' into feature/mal

pull/302/head
Zakhar Timoshenko 3 years ago
commit ec137d2513

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

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

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

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

Loading…
Cancel
Save