fix(en.comix): handle waf challenge - #652
Conversation
|
@GohanXF could you test if this works for you? |
|
@kkantan I can verify the Comix WAF but afterwards I'm getting hit with a nonstop Cloudflare verification. Tested on cellular, wifi, and VPN. EDIT: I took a screen recording of what's happening on my screen but wanted to make sure I should upload it here or send it somewhere else. |
Comix added a custom WAF captcha in front of Cloudflare. Ports the workaround from Aidoku-Community#652 (thanks @jianmingyong) on top of the local mirror changes: - adds a "Verify Comix Captcha" web login setting that intercepts the waf_pass cookie, and a WebLoginHandler that validates it (30 minute lifetime) - attaches waf_pass to every request via create_request_get - reports the captcha requirement with instructions to the verify button rather than a confusing internal error Also fixes "Failed to find installer function", which happened even when the page itself loaded: the signer module was imported by the web view, whose requests don't carry waf_pass, so the site blocked it and window.vm ended up empty. Fetch the module over the app's network stack and import it from a blob instead — it has no relative imports, so a blob url is safe. Every remaining request in web.rs now carries the cookie too. Challenge detection matches only the interstitial's page title; the other markers considered (/@waf/challenge, captcha_required) don't appear in real pages and risked mislabelling unrelated failures. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@GohanXF |
|
The CF part is what's confusing to me now. I didn't have any CF issues before this, it was only the Comix WAF. Another thing to add is that I wasn't getting the WAF challenge when I was on cellular or Wifi + VPN. Comix would load just fine. The webview is showing up just fine and I can get past that challenge. Is it possible that Comix made the CF challenge more aggressive? |
|
@GohanXF they did increase the security level to mess with the mihon users. Of course this had a side effect of having CF checks more often. The app normally handle this just fine but sometimes it can fail. |
| "contentRating": 1, | ||
| "languages": ["en"] | ||
| "languages": ["en"], | ||
| "minAppVersion": "0.8.4" |
There was a problem hiding this comment.
do these changes still require 0.8.4?
|
I think cloudflare may have updated their verification process, since multiple sources that use it have stopped working (#654). I was working on a source that was working before, but now no longer can bypass cloudflare despite completing the captcha. requests return cloudflare page html. I'm not sure if this is something we can resolve from the source side, or if it requires an app update. |
Co-authored-by: kantan <31490942+kkantan@users.noreply.github.com>
|
Nothing much you could do with cloudflare. If you can solve the cloudflare captcha in a webview, then it should work just fine with 0.8.4 update. You can always manually grab the cloudflare cookies with the fake login button but that should be handled by aidoku app. 0.8.3 should not be used for any cloudflare sources as that one doesn’t set the cookie correctly. I forgot to add a better error check in the webview initialization. It would also print module not found for cf related error. |
This is a workaround to comix WAF Challenge page. It is still not heavily tested on whether it would work properly or not so we really need some tester.
For some reason I couldn't get the async JS to work so that is now not in use... idk why the app keep crashing -_-
For anyone who wish to test it out:
package.zip
Fixes: #642