GmsCore icon indicating copy to clipboard operation
GmsCore copied to clipboard

Target SDK 30 or above apps not registered with cloud messaging

Open sir-skipper opened this issue 4 years ago • 16 comments

Describe the bug App which use GSF and target SDK framework 30 or above are not registered with Cloud Messaging

To Reproduce Steps to reproduce the behavior:

  1. Install app that targets SDK 30 or above
  2. Check microG settings and it won't be registered in Cloud Messaging
  3. Install either older version of the same app or different one that targets SDK 29 or below
  4. Check microG settings and it will be registered in Cloud Messaging

Expected behavior App which use GSF and target SDK framework 30 or above should be registered

System Android Version: 11 Custom ROM: Havoc 4.8

Additional context The way I reproduced it is installed latest Signal Messenger via Aurora Store (it targets SDK 30), and it was not registered in Cloud Messaging. I deleted it, performed a manual download of an older version (the latest release of version 4), and it registered with Cloud Messaging without any issues. After I updated it to the latest version again, new messages stopped coming, and the latest message received was dated when version 4 was installed.

Might be related to #1559

PS.: Speaking of Signal, the latest version that successfully registers with GCM is 4.77.3 (manual download 7402 in Aurora store)

sir-skipper avatar Sep 24 '21 09:09 sir-skipper

While I did not do the 'downgrade' dance, push notifications seem to work fine on my android 9 phone, but fail on my android 11 phone, both using microg

As I did a fresh install on android 11, signal does pop up the message that push notifications are not available ... whereas other apps (ING mobile banking) registered and functions just fine.

oliv3r avatar Oct 21 '21 18:10 oliv3r

I can confirm this behaviour also with the Threema as well as Chess.com-App. They were able to register 1 or 2 versions ago. Now both of them are saying "(Google Play) Services not installed".

Has there been a change in the newest APIs so that microG GsmCore is not recognized as PlayServices anymore?

oli0044 avatar Dec 05 '21 13:12 oli0044

I can confirm this behaviour also with the Threema as well as Chess.com-App. They were able to register 1 or 2 versions ago. Now both of them are saying "(Google Play) Services not installed".

Has there been a change in the newest APIs so that microG GsmCore is not recognized as PlayServices anymore?

u already tried to install those apps by playstore?

RobertoWa avatar Dec 05 '21 14:12 RobertoWa

Hi Roberto,

I'm sorry, but I do not understand the question. Threema I got from their officiall website, Chess.com-app I downloaded via Aurora store.

I'm using microG with LineageOS so I cannot install via play store, or can I? Isn't the purpose of using microG to avoid play store?

Greetings

oli0044 avatar Dec 05 '21 14:12 oli0044

Hi Roberto,

I'm sorry, but I do not understand the question. Threema I got from their officiall website, Chess.com-app I downloaded via Aurora store.

I'm using microG with LineageOS so I cannot install via play store, or can I? Isn't the purpose of using microG to avoid play store?

Greetings

my experience on apps which say no google play service available is to install them by using the patched playstore on microg. for example signal messenger.

RobertoWa avatar Dec 05 '21 14:12 RobertoWa

Thanks for the tipp. I got it to work by installing microg as a Magisk module instead of the version via F-Droid. Don't know why, but now the apps work again.

oli0044 avatar Dec 06 '21 19:12 oli0044

my experience on apps which say no google play service available is to install them by using the patched playstore on microg. for example signal messenger.

I can confirm that this does make a difference, for whatever reason :/ If i install Signal through Aurora it will complain about missing Google Play Service and will give me the notification that it "permanently failed to register for push notifications" (or something along that line) despite Signal being registered in microg for GCM, not instantly but after around ~4 hours when opening Signal.

The only way to fix this (for the next ~4 hours) is re-installing Signal and re-registering.

I just installed Signal through (patched) Play Store and didn't get the message about missing Google Play Service.

I've seen a similar behavior with bought apps using IAP for license verification, like Nine mail (com.ninefolders.hd3) which will also claim Google Play isn't installed if installed through Aurora despite (patched) Play Store being installed/enabled and never restore the license unless installed through (patched) Play Store.

imho these apps check the install source for com.android.vending (as exposed under App Info -> App details -> App installed from...) wherever Google Play is available or not, which is, frankly, really fucking dumb.

this is all on LOS 18.1 w/ microG

defkev avatar Jan 21 '22 13:01 defkev

Signal downloaded from Aurora worked fine for me running on Android 11. Recently updated to 12 and Signal push notifications didn't work, it complained for Play Services. The same with 2 other apps. Apparently I had something missing.

I went to the installation steps again and did the extra step for location support. Reboot, self-recheck, reboot. Delete Signal app data (well you might want to backup your data first), run and setup again. This worked for me.

dragnev-dev avatar Jan 30 '22 21:01 dragnev-dev

I'm on microg 0.2.23.214816 and haven't gotten it to work yet. I wiped and/reset signal (but did restore a backup, not sure if that matters, trying to see if that is different now ... it does not :()

micro-g's selfcheck is good all over, I do have 1 other cloud messaging app working just fine (ING banking app). Google device registration is on; location modules are on.

oliv3r avatar Feb 01 '22 18:02 oliv3r

I'm on microg 0.2.23.214816 and haven't gotten it to work yet. I wiped and/reset signal (but did restore a backup, not sure if that matters, trying to see if that is different now ... it does not :()

micro-g's selfcheck is good all over, I do have 1 other cloud messaging app working just fine (ING banking app). Google device registration is on; location modules are on.

Been you able to find a workaround for this?

waltercool avatar Feb 11 '22 18:02 waltercool

Been you able to find a workaround for this?

Nope, other then the 'background connection' signal offers...

oliv3r avatar Feb 15 '22 20:02 oliv3r

I had this issue with Threema and Signal after moving to an Adroid 12 ROM. Nothing worked, except...

I installed the microG Installer Revived module for Magisk. After that Threema automatically re-registered, since it has that option when you disable polling. Signal I had to uninstall and reinstall (and restore from backup).

I think the issue may come down to microG Services and Framewok Proxy have to be systems apps.

temporarium avatar Mar 06 '22 14:03 temporarium

I think the issue may come down to microG Services and Framewok Proxy have to be systems apps.

Not sure about that; I have the same issue with Signal (only with Signal, Threema works fine) on LineageOS with MicroG, where I'm assuming they are installed as system apps.

lazyteddy avatar Mar 07 '22 05:03 lazyteddy

I just fixed it for myself. I'm running LineageOS 18.1 with MicroG on a Fairphone 3, rooted with Magisk, and with AFWall+ and AdAway running. I reset the Signal app, disabled both the firewall and the adblocker, re-registered on Signal, and this time it worked. Then I could re-enable both apps, and it continued to work. It seems to be only an issue during registration. Not sure which one of the two apps caused the problem, since I simply disabled both of them.

I find it interesting, though, that neither the ProtonMail app nor Threema had this issue. They both registered just fine with firewall and adblocker running.

lazyteddy avatar Mar 18 '22 04:03 lazyteddy

So installing it to /system/priv-app did the trick; I hadn't uninstalled microg; so I have it in 'both' locations. I put all 3 apk's there (FakeStore, GsfProxy and GmsCore)in their own sub-dirs, like the other apps are. I also added the /system/etc/permissions/ files as per https://github.com/microg/GmsCore/issues/462. Next wipe, I'll try to reduce the number of apk's to see which one is sufficient, but for now, this at least works.

edit: Just did a reinstall, but pushing microg to `/system/priv-app/ without first installing things, but that ended up in a boot-loop (something with permissions in the logs ...)

06-19 20:06:29.576  4594  4594 W android.permission.PermissionManager: Missing ActivityManager; assuming 1000 holds android.permission.SET_PREFERRED_APPLICATIONS

I've since installed them into /vendor/app which also works fine :) (a little cleaner imo and on my device it's mostly an unused partition)

oliv3r avatar Jun 05 '22 10:06 oliv3r

Could you please update to the latest nightly build of microG GmsCore and report back?

ale5000-git avatar Sep 19 '22 13:09 ale5000-git

Oh, forgot to update here from my side. This issue was resolved to me by adding https://github.com/lineageos4microg/android_vendor_partner_gms into my repository.

waltercool avatar Sep 19 '22 13:09 waltercool

I'm closing this since it is mostly an install issue and very old. If you have any other issue, please open another ticket.

ale5000-git avatar Sep 19 '22 14:09 ale5000-git

Could you please update to the latest nightly build of microG GmsCore and report back?

Nope, doesn't fix it; needs to be in priv-app still. "Install issue" is true, but this is not something your average user can easily do of course. Then again, MicroG isn't for the average user? :)

oliv3r avatar Sep 27 '22 07:09 oliv3r

microG need to be in priv-app, it is a strict requirement and it will never be different.

If someone have been able to make it working without being priv-app it is because it wasn't using the features that aren't working or because they are using an old version of Android that is more permissive.

PS: If you are interested, my installer (microG unofficial installer) does everything automatically (except signature spoofing patch) and it is perfect for the average user.

ale5000-git avatar Sep 27 '22 12:09 ale5000-git

See my comments above for a solution.

temporarium avatar Sep 27 '22 12:09 temporarium

microG GmsCore use permissions granted only to priv-apps, so install it as system app is obligatory. There isn't any other problem under Android 11 (the one specified in the first post). For Android 12 there is an additional (separate) problem where microG can't wakeup apps but it is already fixed in the latest nightly.

So what is the issue that you have?

ale5000-git avatar Sep 27 '22 13:09 ale5000-git

@ale5000-git it seems it can also be in /vendor/app/GmsCore/ or is it only working by coincidence in that I had it in priv-app before?

My comment was more about the fact that it was hushed off as an 'install issue', which while technically true, is not so trivial.

oliv3r avatar Oct 03 '22 08:10 oliv3r

@oliv3r microG GmsCore technically works in every case, only the functions that need privileged permissions will fail but everything else will still work.

Note: If you use /vendor/priv-app you need to put the xml in /vendor/etc/permissions instead if you use /system/priv-app you need to put the xml in /system/etc/permissions. Using /vendor/app isn't different from installing as user app I think.

ale5000-git avatar Oct 03 '22 13:10 ale5000-git

@ale5000-git yes, absolutely aware, that the permissions need to put on the same 'disk' folder.

What I'm uncertain off whether /vendor/priv-app is a thing. So far it seems to work; though signal occasionally states that it is having trouble with the connection, though it is properly registered in microg. What is odd however, is that in microg settings, the 'connection' for GMS in general, somtimes states 'disconnected' but there's no way to click it to attempt to reconnect or anything. It does recover but it seems to toggle every few hours/days ...

oliv3r avatar Oct 06 '22 09:10 oliv3r

My installer include also a configuration xml that is needed to make it working correctly: https://github.com/micro5k/microg-unofficial-installer/blob/main/zip-content/files/etc/sysconfig/google.xml Do you have it?

ale5000-git avatar Oct 06 '22 10:10 ale5000-git