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
Fix FCM registration for apps using firebase >= 20.1.1 #1069
Conversation
With version 20.1.1 the Firebase Cloud Messaging SDK started to use the Firebase Installations SDK, which affects the FCM registration process. The implementation of FCM registration in microG failed to pass extra parameters that became relevant with the introduction of the Firebase Installations SDK to the FCM registration endpoint. These additional parameters are passed through to the endpoint with an 'X-' prefix.
Thanks for the work! We've merged it into our @NoGooLag fork. |
I am having a similar error when starting N26 (v. 202024002), I never managed to activate GCM for that app although it is working for other apps. Hope this will solve it! Thank you.
Then, while using the app, I am getting those issues:
Full log: n26.txt |
Can somebody please link an apk to download including this fix so that people can continue using signal the gcm way? How can I build the apk myself? Maybe using @NoGooLag Fork by @FriendlyNeighborhoodShane ... do you guys have an apk or build instructions? Thanks in advance and nice weekend everybody! |
How can I install your MircoG Fork? |
@vollzeitaffe |
Includes microg/GmsCore#1069 Change-Id: Ib9612de405cc10e5f55661c33fbecf9a59010fb0
The linked release there is not updated with this fix |
Thanks for the hint. Its an interesting article and will be important once I upgrade to LOS17. But as I am still on LOS16 and the microg release is not yet fixed, this doesnt help in relation to this issue, unfortunately... |
@FriendlyNeighborhoodShane How should we go about installing your MicroG fork? I'd really like to get it working because I currently can't receive Discord notifications and I believe it's relevant to this PR. |
You can install the minmicrog fork from here: Instructions are here : |
@fdawans are you sure? According to the commits (https://github.com/FriendlyNeighborhoodShane/MinMicroG/commits) it doesnt look like this release (which dates back to 28th April 2020) includes the fcmfix that @FriendlyNeighborhoodShane did for @NoGooLag fork in "fcmfix" branch (https://github.com/NoGooLag/android_packages_apps_GmsCore/commits/fcmfix) Did somebody allready try out MinMicroG? |
Sorry I was on the wrong thread, I was talking about the location permission fix for Android 10. For FCM, I used an older version on the app to make it work. |
I have clone and built from the @NoGooLag fork (fcmfix) but the apk that it produces won't install. This is my first time compiling an apk and using gradle. I builty on Manjaro Linux with openjdk 8 (openjdk 14 (Arch Linux's default) will produce errors since gradle was compiled with jdk older than 14).
After a successful build the only apks that this produces are: Trying to install either of those on my OnePlus3T using a microG prebuilt Lineage image fails. I suspect I'm doing something wrong on my build since the produced apks are half the size of the original GsmCore.apk file from microG's site. |
Hello everybody! Sorry for being so late to check this thread out (thanks for pinging me @TSedlar) I've been planning to make a release soon, it just kept getting pushed further. @TSedlar I assume you were building it through the SDK CLI and perhaps you got the error about local.properties file? in which case the solution is either to open the project once in the studio or:
(Yes, that variable needs to be substituted.) @lakestonelabs you've succeeded in building it, now you need to sign them and place them in an installer zip. But the size difference is because by default VTM (old maps implementation) is used instead of mapbox. To use mapbox:
These two things really need to be added to the building wiki. |
@FriendlyNeighborhoodShane Thanks for the info. So I made your suggested change to the local.properties file to use mapbox, and also used the Android Studio to create a new release keystore to sign my apk. I then used Studio's option under Build->Generate Signed Bundle/APK, chose my new keystore and it successfully generated a signed apk, which is now substantially larger (~28MB) due to using mapbox change, very cool. This is awesome, but I still can't install the apk. I suspect it's because it's trying to update an existing install of GmsCore and there is a certificate mismatch between the version that was bundled with my microG+Linieage image and my apk. How do I get around this or is there something else I need to do? Thanks again for the help. I'm soooooo close! |
Rebased and merged as 5146559. Thanks :) |
@mar-v-in Thanks for merging back into the parent microG. Do you know when we can expect an updated release build with this fix to be available? Again, thanks for everyone's hard work in making microG a thing and giving us the freedom from G. |
@lakestonelabs You just need to replace the APK in your system partition through a custom recovery or flashable zip installer. |
@FriendlyNeighborhoodShane So I booted into the TeamViewWin bootloader (or whatever it's called) and did an adb push 'my_built_core_apk.apk' to the /system and also to the /system/priv-app locations. Notifications in Slack are still broke. I also renamed my signed-built apk to GmsCore.apk before doing the adb push. |
@FriendlyNeighborhoodShane I think the reason this is failing is because my phone is not "technically" rooted and I'm not able to write to the /system partition. I can do an adb list /system but it shows as blank. And trying to install my signed apk via adb confirms that it won't do it since the signatures don't match: Bummer... :( I guess I could root my phone but I'm really not in the mood to reinstall/configure everything. It would be nice if microG could release a new release with the fix. At any rate, thanks again for all of the help everyone. We'll get there eventually.g |
Ok, I was being dumb. I was able to successfully write my GmsCore.apk signed file to the /system partition after mounting the /system partition using the TeamWin in recovery mode and selecting "Mount" option and checking "/system". However, the notification tests in Slack are still not working. |
The location should be the |
@JonnyTech Thanks for the tip. I now have the new version of GmsCore installed. Really cool. However Slack notifications are still not working, and I've noticed that under the microG settings app it's stating "Permission Missing... A permission required for proper functionality of microG Service Core is not granted.". So I tap the "Request Missing Permission" button but nothing shows to allow permissions. I fear this missing permission is holding back the notifications. However, when I go to the "Self-Check" section everything looks good. Getting closer. |
@lakestonelabs You may need to wipe data for both your Slack and microG. If it still doesn't work there's some other steps you can try written somewhere in the NanoDroid docs. And I'm somewhat sure that the permission missing dialog is just a UI bug related to background location permissions. Don't worry about it. |
These are permission values from my device for the app from
Did you remember to reinstall Slack after installing microG? You may also need to register the app for FCM by dialing the |
@lakestonelabs If Slack notifications are a priority, try this. |
I tried stopping Slack, removing the cache and data, uninstalling Slack, reinstalling Slack and dialing |
I was lucky to have it working by following more or less what is detailed here. Also what does it say when you use 'Troubleshoot notifications' in slack? |
@schreven I cannot do an adb install of the new GmsCore.apk since there is a cert. mismatch between the one I built and the one that came bundled with my Lineage+microG image. Therefore I booted in to recover mode, used TeamWin and copied the newly created GmsCore.apk (the one that is signed using my truststore and cert) into the /system/priv-app/ subdir, then did a chmod to 644 then rebooted. Attached below are the screenshots of my microG version and the Slack notification troubleshooting page. |
Ok well the slack notification troubleshooting page is exactly what I had before installing the fixed (self-built) version. But it does look like you have the correct NoGoolag version with the latest commit. Personally I have |
Ah I just realized that I built and installed the GMsCore version from migroG repo, while you installed the one from NoGoolag, which may explain that I didn't encounter discrepancies with the certificate. |
@schreven The version I'm running actually was built using the merged microG repo. I forgot to mention that in my prev. post. I'll repeat the steps you outlined and see if I can make any headway. Thanks again for the tips/help. |
Finally got this thing to work!!
So the only thing I changed was installing root. Not sure if this is needed or not. One thing I'm still perplexed on @schreven and others is using Again, thanks everyone for all the help! Now I can be constantly pestered by Slack work notifications ;) |
Good to hear it's workin, congrats! I used adb install when booted in Lineage as well (not from twrp recovery mode), sorry if I was unclear about that. |
Hey @mar-v-in, when is this going to be in any release? I see that there were a lot of commits pushed after last release, when is this all going to be bundled in new apk? If this is still waiting to be finished and polished - how can I build apk myself to try this on my phone? Could you maybe release some beta apk? Edit: Oh, i found: https://github.com/microg/android_packages_apps_GmsCore/wiki/Building 😅 Can I safely build what's on master branch and install it on my phone? |
+1 It would be great to have an upgrade soon, which we could apply via F-Droid Repository. Also I suppose a lot of us are running LineageOS microg edition, which could also incorporate the updated version of microg and push it to the endusers via system ROM Upgrade. I helped a lot of friends who are not all tech savvy to get rid of Gapps (in favor for microg) on their phones. So I really hope their is an upgrade before they start blaming me lol ...
…On July 25, 2020 2:24:14 PM GMT+02:00, "Mateusz Soszyński" ***@***.***> wrote:
Hey @mar-v-in, when is this going to be in any release? I see that
there were a lot of commits pushed after last release, when is this all
going to be bundled in new apk?
If this is still waiting to be finished and polished - how can I build
apk myself to try this on my phone? Could you maybe release some beta
apk?
I see that @lakestonelabs posted a screenshot with some new/beta/
version that he compiled himself? Can I do this too?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#1069 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
I actually had LineageOS-for-microG before, and it was working fine, tho the guy who was maintaining it abondoned/stopped caring about(?) this project, and you don't get any system updates anymore :/ But microG updates are handled by F-Droid there, if I remember correctly |
As far as I know, it depends on the device and whether there is somebody who maintains Lineage OS for your specific device. MicroG editions of LOS are built on top of the LOS maintainers version of your specific device e.g. "klte" for Samsung Galaxy S5.
…On July 26, 2020 3:14:59 PM GMT+02:00, "Mateusz Soszyński" ***@***.***> wrote:
I actually had LineageOS-for-microG before, and it was working fine,
tho the guy who was maintaining it abondoned/stopped caring about(?)
this project, and you don't get any system updates anymore :/ But
microG updates are handled by F-Droid there, if I remember correctly
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#1069 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
@schreven @lakestonelabs could any of those folks who successfully built the fixed version please upload the apk / install.zip somewhere? @mar-v-in do you plan to push an upgrade (e.g. via fdroid) soon? Thank you and everybody involved very very much for the good work and afford!
…On July 26, 2020 3:44:53 PM GMT+02:00, "Mateusz Soszyński" ***@***.***> wrote:
You can take a look at this:
#1063>
> But as said above, @corna is not answering anymore regarding this
project, so…>
>
-- >
You are receiving this because you were mentioned.>
Reply to this email directly or view it on GitHub:>
#1069 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
@vollzeitaffe it was already released 6 days before your post. |
Ups my fault I have been missing this somehow. Thank you very much!
…On August 4, 2020 8:36:04 PM GMT+02:00, Emgalai ***@***.***> wrote:
@vollzeitaffe it was already released 6 days before your post.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#1069 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
With version 20.1.1 the Firebase Cloud Messaging SDK started to use the Firebase Installations SDK, which affects the FCM registration process.
The implementation of FCM registration in microG failed to pass extra parameters that became relevant with the introduction of the Firebase Installations SDK to the FCM registration endpoint. These additional parameters are passed through to the endpoint with an 'X-' prefix.
Apps that use a version of the Firebase Cloud Messaging SDK >= 20.1.1 were unable to register with microG for push notifications, because the request to the FCM registration endpoint failed with the error code
FIS_AUTH_ERROR
.First, I observed that Signal 4.61.6 failed to register with microG for push notifications. While it worked fine with Signal 4.60.9. After some debugging and searching on the internet, I found out that it's because Signal 4.61.1 uses a newer version of FCM (see signalapp/Signal-Android@c8dd4e5 and #313).
This pull request should fix #313 and #1068 (tested it myself).
For reference: Requests to the FCM registration endpoint (
https://android.clients.google.com/c2dm/register3
), which I captured while working on this issue.microG - Signal 4.61.6
Request
Response
Error=FIS_AUTH_ERROR
Google Apps - Signal 4.61.6
Request
Response
token=eSLlghbbKSQ:APA91bHUaHNvl-vv-m7flt86UEssQ4K1S2pJ5Rpyx4jQPTxeUbeq1UFDTMAEArRZ88zRcU60d0KAm8DDGjw1CLetH-UurduMl58wE4lySEhk-PIStp9xNl-QQymU-qY6ppNhn6ONGMsl
microG (fixed) - Signal 4.61.6
Request
Response
``
microG - Signal 4.60.9
Request
Response
token=APA91bF7xWB7eKEw1T_nBSRzOaB5OowndBTNboDLIWo4XzNB5aZVb1fg25Iq__0X46ATwVC4IvNMGM8q0QKeZ7sQQqF_QfKxxbdREy30d7ZTjuk2kQniEfjDkUI1ZiUPC4tRVHBYzac-
Google Apps - Signal 4.60.9
Request
Response
token=cn91oO9qM5k:APA91bFOEDxOSyX9A5Sgy6Gb192VvQXLNccuMAfymu1LTAluH95SYliIH9OY5RPkiTvrmKF3TmkWSYBFWV6nXPS6nV07Mgid5fTApxm2YJ4TkLGA6NjyB7qXp9AHvqSWr3CtDSXkFp_n
microG (fixed) - Signal 4.60.9
Request
Response
token=cxHTg_z2BiU:APA91bF5WZY8adWVx4YZmDGlTY9_VWyiQhkRw2RlqpfLj1mTGf0NLtGvkeseWvxgTobSmGjwhDzCgSZGdQ1tyGxCeAXGO03py0f85A8w749GJqq67igNdBQ3VgcH8PyEF5dJR-jbg2rO