WSTxda / MicroG-RE

GmsCore fork for ReVanced with Material You, features and improvements
Apache License 2.0
919 stars 22 forks source link

(WebView) Sometimes login page doesn't follow system theme #28

Open 0xrxL opened 4 weeks ago

0xrxL commented 4 weeks ago

As I already described in the title, sometimes (probably when MicroG login service it's invoked in a new instance) login page appears white instead dark (as my system theme).

This bug is 100% reproducible (one time) during login on a new MicroG installation.

WSTxda commented 4 weeks ago

Are you referring to the webview login?

Yes, this bug has already been noticed, currently checks the app theme status instead of the system, was defined this way to prevent a reload that causes a pile of errors and then the webview closes.

You can reproduce this bug changing system theme with webview page open

Then check through the themedContext.getResources instead of uiModeManager.systemIsDark and based on that force dark mode in webview.

Despite the logs I couldn't find a good solution to solve this sudden closure, but following the application theme made it happen less frequently.

It's been a while since I did this so I might as well look at it again, I kept the implementation to avoid some flashbangs XD

0xrxL commented 4 weeks ago

Are you referring to the webview login?

Exactly.

0xrxL commented 4 weeks ago

An alternative could be a fully Material page to login, which interact with webview to fetch the web links to complete the login. 🤷‍♂️

WSTxda commented 4 weeks ago

I was just thinking about fixing the theme transition, which is likely what's causing this to happen.

WSTxda commented 2 weeks ago

Apparently it was fixed, check f4cbcd5 tested on avd sdk 29 and my personal device HyperOS sdk 34