fix false-positive ortc error status parsing (maybe) (#43)
* fix false-positive ortc error status parsing (maybe) * remove webview parent check
This commit is contained in:
1 parent
15b836e75c
commit
03d1e7234f
2 files changed
+8
-1
No files matched your search
@@ -7,6 +7,7 @@ import android.view.View
|
|||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.webkit.WebView
|
import android.webkit.WebView
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.core.view.isVisible
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import bypass.whitelist.R
|
import bypass.whitelist.R
|
||||||
import bypass.whitelist.util.BLANK_URL
|
import bypass.whitelist.util.BLANK_URL
|
||||||
@@ -62,6 +63,11 @@ class HeadlessVkFragment : Fragment() {
|
|||||||
val params = JSONObject(joinJson)
|
val params = JSONObject(joinJson)
|
||||||
params.put("tunnelMode", Prefs.tunnelMode.relayArg)
|
params.put("tunnelMode", Prefs.tunnelMode.relayArg)
|
||||||
relay.sendJoinParams(params.toString())
|
relay.sendJoinParams(params.toString())
|
||||||
|
activity?.runOnUiThread {
|
||||||
|
webView.stopLoading()
|
||||||
|
webView.loadUrl(BLANK_URL)
|
||||||
|
webView.isVisible = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
captchaView.setup()
|
captchaView.setup()
|
||||||
captchaView.start(url, displayName)
|
captchaView.start(url, displayName)
|
||||||
@@ -70,6 +76,7 @@ class HeadlessVkFragment : Fragment() {
|
|||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
webView.stopLoading()
|
webView.stopLoading()
|
||||||
webView.loadUrl(BLANK_URL)
|
webView.loadUrl(BLANK_URL)
|
||||||
|
|
||||||
webView.destroy()
|
webView.destroy()
|
||||||
relay.stop()
|
relay.stop()
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ class VkCaptchaWebView(
|
|||||||
|
|
||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
fun setStatus(message: String) {
|
fun setStatus(message: String) {
|
||||||
if (message.startsWith("ortc ERROR")) return
|
if (message.contains("ortc ERROR")) return
|
||||||
Log.d("CAPTCHA", "status: $message")
|
Log.d("CAPTCHA", "status: $message")
|
||||||
activity.runOnUiThread { onStatus(message) }
|
activity.runOnUiThread { onStatus(message) }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user