Use Chrome useragent for authorization

This commit is contained in:
Koitharu
2023-04-07 18:08:52 +03:00
parent 0186517175
commit dba506cb42
2 changed files with 2 additions and 4 deletions

View File

@@ -86,7 +86,7 @@ dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.core:core-ktx:1.10.0'
implementation 'androidx.activity:activity-ktx:1.7.0'
implementation 'androidx.fragment:fragment-ktx:1.5.6'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'

View File

@@ -18,7 +18,6 @@ import org.koitharu.kotatsu.browser.BrowserCallback
import org.koitharu.kotatsu.browser.BrowserClient
import org.koitharu.kotatsu.browser.ProgressChromeClient
import org.koitharu.kotatsu.browser.WebViewBackPressedCallback
import org.koitharu.kotatsu.core.network.CommonHeaders
import org.koitharu.kotatsu.core.network.CommonHeadersInterceptor
import org.koitharu.kotatsu.core.parser.MangaRepository
import org.koitharu.kotatsu.core.parser.RemoteMangaRepository
@@ -64,8 +63,7 @@ class SourceAuthActivity : BaseActivity<ActivityBrowserBinding>(), BrowserCallba
}
with(binding.webView.settings) {
javaScriptEnabled = true
userAgentString = repository.headers?.get(CommonHeaders.USER_AGENT)
?: CommonHeadersInterceptor.userAgentFallback
userAgentString = CommonHeadersInterceptor.userAgentChrome
}
binding.webView.webViewClient = BrowserClient(this)
binding.webView.webChromeClient = ProgressChromeClient(binding.progressBar)