|
|
@ -34,6 +34,7 @@ class WebViewActivity : VMBaseActivity<ActivityWebViewBinding, WebViewModel>() { |
|
|
|
private val imagePathKey = "imagePath" |
|
|
|
private val imagePathKey = "imagePath" |
|
|
|
private var customWebViewCallback: WebChromeClient.CustomViewCallback? = null |
|
|
|
private var customWebViewCallback: WebChromeClient.CustomViewCallback? = null |
|
|
|
private var webPic: String? = null |
|
|
|
private var webPic: String? = null |
|
|
|
|
|
|
|
private var isCloudflareChallenge = false |
|
|
|
private val saveImage = registerForActivityResult(HandleFileContract()) { |
|
|
|
private val saveImage = registerForActivityResult(HandleFileContract()) { |
|
|
|
it.uri?.let { uri -> |
|
|
|
it.uri?.let { uri -> |
|
|
|
ACache.get().put(imagePathKey, uri.toString()) |
|
|
|
ACache.get().put(imagePathKey, uri.toString()) |
|
|
@ -68,7 +69,7 @@ class WebViewActivity : VMBaseActivity<ActivityWebViewBinding, WebViewModel>() { |
|
|
|
R.id.menu_copy_url -> sendToClip(viewModel.baseUrl) |
|
|
|
R.id.menu_copy_url -> sendToClip(viewModel.baseUrl) |
|
|
|
R.id.menu_ok -> { |
|
|
|
R.id.menu_ok -> { |
|
|
|
if (viewModel.sourceVerificationEnable) { |
|
|
|
if (viewModel.sourceVerificationEnable) { |
|
|
|
viewModel.saveVerificationResult { |
|
|
|
viewModel.saveVerificationResult(intent) { |
|
|
|
finish() |
|
|
|
finish() |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -226,6 +227,16 @@ class WebViewActivity : VMBaseActivity<ActivityWebViewBinding, WebViewModel>() { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
binding.titleBar.title = intent.getStringExtra("title") |
|
|
|
binding.titleBar.title = intent.getStringExtra("title") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (title == "Just a moment...") { |
|
|
|
|
|
|
|
isCloudflareChallenge = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (isCloudflareChallenge && title != "Just a moment...") { |
|
|
|
|
|
|
|
if (viewModel.sourceVerificationEnable) { |
|
|
|
|
|
|
|
viewModel.saveVerificationResult(intent) { |
|
|
|
|
|
|
|
finish() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|