fix: captcha dialog not triggering on VK's id.vk.ru auth domain

Real kernel log format is "CAPTCHA_SOLVE|<mode>|<url>|<token>", and
the URL's host is id.vk.ru (VK ID), not login.vk.com — the previous
regex only knew about login.vk.com/localhost/127.0.0.1, so the whole
line was ignored and the captcha dialog never opened. Also the old
\S* capture would have swallowed the trailing "|<token>" into the
captured URL since it doesn't stop at "|".

Now parses the CAPTCHA_SOLVE-prefixed line directly (stopping at the
next "|"), with the domain-list match kept only as a fallback.
This commit is contained in:
Claude committed 2026-07-04 08:39:52 +00:00
1 parent c732c9cbf4
commit c58cad2dfc
2 files changed
+11 -6

No files matched your search

@@ -55,7 +55,7 @@ fun CaptchaWebViewDialog(captchaUrl: String, onDismiss: () -> Unit) {
override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest): Boolean {
val url = request.url.toString()
// Allow all captcha-related domains to load inside WebView
val allowedDomains = listOf("localhost", "127.0.0.1", "fapi.vk.com", "login.vk.com", "api.vk.com", "captcha.vk.com", "vk.com", "vk.ru")
val allowedDomains = listOf("localhost", "127.0.0.1", "fapi.vk.com", "login.vk.com", "id.vk.ru", "api.vk.com", "captcha.vk.com", "vk.com", "vk.ru")
val isAllowed = allowedDomains.any { url.contains(it) }
// Only dismiss if navigating to a completely unrelated page
if (!isAllowed) {