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.webkit.WebView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.fragment.app.Fragment
|
||||
import bypass.whitelist.R
|
||||
import bypass.whitelist.util.BLANK_URL
|
||||
@@ -62,6 +63,11 @@ class HeadlessVkFragment : Fragment() {
|
||||
val params = JSONObject(joinJson)
|
||||
params.put("tunnelMode", Prefs.tunnelMode.relayArg)
|
||||
relay.sendJoinParams(params.toString())
|
||||
activity?.runOnUiThread {
|
||||
webView.stopLoading()
|
||||
webView.loadUrl(BLANK_URL)
|
||||
webView.isVisible = false
|
||||
}
|
||||
}
|
||||
captchaView.setup()
|
||||
captchaView.start(url, displayName)
|
||||
@@ -70,6 +76,7 @@ class HeadlessVkFragment : Fragment() {
|
||||
override fun onDestroyView() {
|
||||
webView.stopLoading()
|
||||
webView.loadUrl(BLANK_URL)
|
||||
|
||||
webView.destroy()
|
||||
relay.stop()
|
||||
super.onDestroyView()
|
||||
|
||||
@@ -106,7 +106,7 @@ class VkCaptchaWebView(
|
||||
|
||||
@JavascriptInterface
|
||||
fun setStatus(message: String) {
|
||||
if (message.startsWith("ortc ERROR")) return
|
||||
if (message.contains("ortc ERROR")) return
|
||||
Log.d("CAPTCHA", "status: $message")
|
||||
activity.runOnUiThread { onStatus(message) }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user