-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discord fails to load unless microG is disabled #759
Comments
Discord works fine for me, even push messages do work. I'm opted in to the beta tho (Discord Public Test Build https://play.google.com/apps/testing/com.discord or from apkmirror). |
Oh, ok. |
This seems to be a regression caused by 7259265 |
So wait.... adding functionality made Discord not work? That's weird. |
I think we need to tag @voidstarstar here, |
Thanks for letting me know. I suspect this is due to the default @mar-v-in Regarding licenses, MGit is GPL-3, so explicit permission from the original author may be needed to use this code without changing the microG license. The code is pretty straight forward, so I'm not sure if there's any other way to go about it. |
I already tried if applying these additional code helps, but it doesn't. Also I checked the details of the code, some of it is valid and covers the sidecase when the SSLContext was used before The reflection bit is completely obsolete though, as calling |
Oh interesting find. Did they diverge from the openjdk implementation, but not update the Javadoc?
I just tried and can confirm that the vanilla v0.2.6.13280 seems to connect just fine. Maybe conscrypt disabled some cyphers that the Discord servers require? |
From the logcat:
May not fix the problem but maybe implementing the method getModuleVersion and creating the folder /data/user/0/com.google.android.gms/shared_prefs may allow to go ahead a bit. |
|
I'd like to join in, although with a bit less technical information compared to what's been posted so far. My experiences with Discord on a Pixel 3 with microG are the following:
Something goes wrong from here. Log from debug:
Also, when the app tries to fetch The odd thing is though: We still get notifications from messages. There are no servers to interact with, no account info, but notifications through FCM works. So that's positive. It's just the rest of the app that's missing. I tried filing this as a bug with Discord but their answer was straight up "if you hack around with Play Services then you're on your own". I then tried reasoning with them asking why their app relied on Play Services to be present, as getting data from an API and the lack of Play Services shouldn't conflict with pure, raw Android with no Play Services present. No answer. |
As a workaround, I'm using the app Shelter to run Discord in a work profile that has microG disabled. Not sure if push notifications with it will work or not though. |
Initially I deleted the following comment but after testing for 4 days, I can somewhat confirm this. A possible workaround (or even solution) might be to use Magisk Hide to hide SU from Discord. However, Discord Testers confirmed that root has nothing to do with the app. But adding Discord to the list, both notifications and chat works flawlessly. I even confirmed it by removing Discord from the Magisk Hide list again, and the problems were back. Re-adding it to Magisk Hide solved it for me. What Magisk Hide does versus what Discord API does with FCM still boggles me a bit. Maybe @mar-v-in can fill us in. |
Oh wow, you're right. Are you using microG with a Magisk module such as NanoDroid? My guess is that using Magisk Hide hides that module from Discord as well as root. As noted in the OP, disabling microG makes it work. So if using Magisk Hide hides microG from Discord, that could explain why it works. Did you log in originally without Magisk Hide on and enable it after, or enable it and then log in? |
@BeeeWall Yep, I had to resort to using NanoDroid. Otherwise my Pixel 3 wouldn't boot. And maybe you're right in what causes it to work with Magisk Hide. I just noticed that it worked after hiding root from Discord. And yes, I tested it by removing hide again, and Discord stopped working. What I noticed this time was that it asked the API for the correct user-ID, but it still failed. |
Have any other apps had issues with the For what it's worth, it does not appear that Discord is using any old version of SSL/TLS, bad ciphers, etc., so I don't think it's an intended failure to connect.
This is a bug with microG, not Discord, so please try to avoid bothering their devs over this issue. It would definitely be nice to better understand what their app is doing, but it's understandable that they don't want to support microG. It's the responsibility of microG to be compatible with Discord, not the other way around. They rely on Play Services for, among other things, push notifications, which is perfectly reasonable. |
I may add that using Magisk Hide does not solve the issue for most. Yes, for whatever reason for some it fixes it (though no one knows why), but for most (including me), it doesn't. I have not yet run across other apps causing regressions (I only tested discord because others reported the issue), though except some Nintendo Games all my apps are Open Source apps that properly work without Play Services aswell, so my setup isn't really of help. |
Magisk Hide stopped helping for me recently. Not sure if it was a Discord update, a Magisk one, or what (I updated both around the same time). Currently I'm using Shelter to run it in a work profile with microG frozen. |
MagiskHide is working for me, I just downloaded the App from Play Store 2 minutes ago. I logged in, solved the capture in browser and then I logged in. When Discord tried to connect for ages, I closed the App and added it to MagiskHide. When I opened Discord after that, it connected immediately. Maybe it is not a good idea to add it to MagiskHide at the very beginning? |
While the Magisk Hide method is still working for me, a more sustainable solution is probably to follow @BeeeWall's example, and run Shelter to freeze microG in a work profile. Magisk sometimes just stop working without warning on my phone. Not just this phone; this also happened on my OnePlus 3T. So to have something a bit more reliable than a root that only stays running 90% of the time (again, this is my experience), is a priority. Until we solve the actual cause, that is. |
|
Well I'm both in the Discord alpha and on the Magisk Canary channel, so if something is broken it might not've reached stable or even beta yet. But hopefully it's just a me bug and it works for others. I wonder if maybe one of the canary Magisk updates changed MagiskHide at all? May look at the commit history to check. |
Fixed with commit 51e5f77 by mar-v-in Successfully tested it with latest Discord release (no Magisk Hide or whatever needed). Thanks. |
👏 |
Good work! The special exception for Discord seems like a good compromise. It should just be noted that this is a workaround where Discord isn't going to benefit from any security updates from conscrypt. Eventually Discord might disable older TLS versions on their server which could leave the app not working on older versions of Android. |
Problem is fixed and new version is released. |
logcat.txt
Just fails to connect. Will connect successfully, albeit with a "Google Play Services is nrequired" message, with microG disabled.
The text was updated successfully, but these errors were encountered: