With recent updates, the petrol station app broke on my phone, couldn't get anywhere after login. Recording the screen revealed the WebView complained about unknown URL scheme. This was only seen momentarily before it closed and being back on the screen with login button (which I think is native, not part of web page). Seeing the app working on another phone, I suspected at first that maybe it doesn't like either the older version of WebView or maybe it's tripping on something related to modding (rooting and such). Updating WebView didn't solve it. Then I got the idea and tried disabling Google Chrome on another phone. That broke the app.
So the issue is actually connected to me not having any "normal" web browser on the phone. I tend to use Via that uses WebView. And Chrome is disabled.
I striked the conversation with ChatGPT. Without telling it specifically about the app I'm dealing with at first and just if it could be fixed by some simple modification to AndroidManifest.xml, it said this is typical of apps utilizing OAuth login method (that was without me telling it "oauth" word is actually in the problematic URL), where the server sends the URL with app's own scheme rather than HTTP / HTTPS, which Chrome can handle and can callback the app that registered the scheme, but fallback to WebView fails since it can only handle HTTP / HTTPS and could only work with properly programmed overridden shouldOverrideUrlLoading() method in the app to bypass WebView in this instance.
Long story short, besides suggesting the obvious easiest solution of installing a "normal" web browser, it offered to guide me towards fixing application. I agreed and since I already told it I have the app decompiled with apktool, its first suggestion was to search for one of 3 keywords, one being that well known shouldOverrideUrlLoading() method, which I picked first. I showed it 3 instances of that method, first two were easy and short, so it gave back the rewritten method checking for app's URL scheme and starting the activity if it's not HTTP / HTTPS URL.
I tried each one and the app's behavior didn't change. 3rd method I found was more complicated, 688 lines including blank lines when copied to Notepad. The AI figured this must be the real location where things go wrong, seeing checks for HTTP and HTTPS. It gave a code snippet with instruction where exactly it should be inserted (and to be careful to not disrupt surrounding code). I tried it, rebuilt the app, signed it, installed on the phone and to my surprise, login worked this time!
The next day, I could successfully pay for petrol at the petrol station with the patched app. Mind == blown!
I did not expect it would find a solution to such obscure problem. And Smali is particularly alien language (to me), being something intermediate below Java.