Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

georgeto
Copy link
Contributor

@georgeto georgeto commented Jun 9, 2020

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

Header
Content-Type application/x-www-form-urlencoded
app org.thoughtcrime.securesms
Authorization AidLogin 4180318339633110089:3856385953474437405
User-Agent Android-GCM/1.3 (generic_x86_64 QP1A.190711.019)
Host android.clients.google.com
Connection Keep-Alive
Accept-Encoding gzip
Content-Length 328
Parameter
app org.thoughtcrime.securesms
app_ver 6473
app_ver_name 4.61.6
appid dfTUIjd0SBy9ib9GEkpTSQ
cert 45989dc9ad8728c2aa9a82fa55503e34a8879374
device 4180318339633110089
gmp_app_id 1:312334754206:android:a9297b152879f266
gmsv 19420000
osv 29
scope *
sender 312334754206
subtype 312334754206
X-GOOG.USER_AID 4180318339633110089

Response

Error=FIS_AUTH_ERROR

Google Apps - Signal 4.61.6

Request

Header
Authorization AidLogin 4109537073926052509:8941888930712902356
app org.thoughtcrime.securesms
gcm_ver 200414023
User-Agent Android-GCM/1.5 (generic_x86_64 PSR1.180720.120)
content-length 938
content-type application/x-www-form-urlencoded
Host android.clients.google.com
Connection Keep-Alive
Accept-Encoding gzip
Parameter
app org.thoughtcrime.securesms
app_ver 6473
cert 45989dc9ad8728c2aa9a82fa55503e34a8879374
device 4109537073926052509
gcm_ver 200414023
info MycplvjMe54VQEb1aBJ6XhwiPP1RKRc
plat 0
sender 312334754206
target_ver 28
X-app_ver 6473
X-app_ver_name 4.61.6
X-appid eSLlghbbKSQ
X-cliv fiid-20.2.0
X-firebase-app-name-hash R1dAH9Ui7M-ynoznwBdw01tLxhI
X-Firebase-Client fire-installations/16.3.1 fire-core/19.3.0 fire-fcm/20.2.0 fire-iid/20.2.0 fire-android/
X-Firebase-Client-Log-Type 1
X-gmp_app_id 1:312334754206:android:a9297b152879f266
X-gmsv 200414023
X-Goog-Firebase-Installations-Auth eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWQiOiJlU0xsZ2hiYktTUSIsInByb2plY3ROdW1iZXIiOjMxMjMzNDc1NDIwNiwiZXhwIjoxNTkyMjQ3ODgyLCJhcHBJZCI6IjE6MzEyMzM0NzU0MjA2OmFuZHJvaWQ6YTkyOTdiMTUyODc5ZjI2NiJ9.AB2LPV8wRgIhAJGvV7Gu7yaJmuvlaGxWH1ScLlasIWaEMIjMxRvxwYBDAiEAxDu0Eeh9iAiG8YyOrAtOo9OlbXfoGTCXK7yLumse9TY
X-osv 28
X-scope *
X-subtype 312334754206

Response

token=eSLlghbbKSQ:APA91bHUaHNvl-vv-m7flt86UEssQ4K1S2pJ5Rpyx4jQPTxeUbeq1UFDTMAEArRZ88zRcU60d0KAm8DDGjw1CLetH-UurduMl58wE4lySEhk-PIStp9xNl-QQymU-qY6ppNhn6ONGMsl

microG (fixed) - Signal 4.61.6

Request

Header
Content-Type application/x-www-form-urlencoded
app org.thoughtcrime.securesms
Authorization AidLogin 4180318339633110089:3856385953474437405
User-Agent Android-GCM/1.5 (generic_x86_64 QP1A.190711.019)
Host android.clients.google.com
Connection Keep-Alive
Accept-Encoding gzip
Content-Length 908
Parameter
app org.thoughtcrime.securesms
app_ver 6473
cert 45989dc9ad8728c2aa9a82fa55503e34a8879374
device 4180318339633110089
sender 312334754206
target_ver 29
X-app_ver 6473
X-app_ver_name 4.61.6
X-appid eiZ5JUbIQy2xhrVUUX74Vz
X-cliv fiid-20.2.0
X-firebase-app-name-hash R1dAH9Ui7M-ynoznwBdw01tLxhI
X-Firebase-Client fire-core/19.3.0 fire-installations/16.3.1 fire-fcm/20.2.0 fire-iid/20.2.0 fire-android/
X-Firebase-Client-Log-Type 1
X-gmp_app_id 1:312334754206:android:a9297b152879f266
X-gmsv 19420021
X-Goog-Firebase-Installations-Auth eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWQiOiJlaVo1SlViSVF5MnhoclZVVVg3NFZ6IiwicHJvamVjdE51bWJlciI6MzEyMzM0NzU0MjA2LCJleHAiOjE1OTIyNjUwNzQsImFwcElkIjoiMTozMTIzMzQ3NTQyMDY6YW5kcm9pZDphOTI5N2IxNTI4NzlmMjY2In0.AB2LPV8wRQIgajO4ZlCDxV5xRKGXM7-FHX2fA5PnUYrFR_gciCUAWykCIQDBYoRHH6_AjLlJnftEVf8gPyZG8n8iGslPzTPlbKBCsg
X-osv 29
X-scope *
X-subtype 312334754206

Response

``

microG - Signal 4.60.9

Request

Header
Content-Type application/x-www-form-urlencoded
app org.thoughtcrime.securesms
Authorization AidLogin 4180318339633110089:3856385953474437405
User-Agent Android-GCM/1.3 (generic_x86_64 QP1A.190711.019)
Host android.clients.google.com
Connection Keep-Alive
Accept-Encoding gzip
Content-Length 317
Parameter
app org.thoughtcrime.securesms
app_ver 6403
app_ver_name 4.60.9
appid eJc4q01O6VE
cert 45989dc9ad8728c2aa9a82fa55503e34a8879374
device 4180318339633110089
gmp_app_id 1:312334754206:android:a9297b152879f266
gmsv 19420000
osv 29
scope *
sender 312334754206
subtype 312334754206
X-GOOG.USER_AID 4180318339633110089

Response

token=APA91bF7xWB7eKEw1T_nBSRzOaB5OowndBTNboDLIWo4XzNB5aZVb1fg25Iq__0X46ATwVC4IvNMGM8q0QKeZ7sQQqF_QfKxxbdREy30d7ZTjuk2kQniEfjDkUI1ZiUPC4tRVHBYzac-

Google Apps - Signal 4.60.9

Request

Header
Authorization AidLogin 4109537073926052509:8941888930712902356
app org.thoughtcrime.securesms
gcm_ver 200414023
User-Agent Android-GCM/1.5 (generic_x86_64 PSR1.180720.120)
content-length 408
content-type application/x-www-form-urlencoded
Host android.clients.google.com
Connection Keep-Alive
Accept-Encoding gzip
Parameter
app org.thoughtcrime.securesms
app_ver 6403
cert 45989dc9ad8728c2aa9a82fa55503e34a8879374
device 4109537073926052509
gcm_ver 200414023
info MycplvjMe54VQEb1aBJ6XhwiPP1RKRc
plat 0
sender 312334754206
target_ver 28
X-app_ver 6403
X-app_ver_name 4.60.9
X-appid cn91oO9qM5k
X-cliv fiid-12451000
X-gmp_app_id 1:312334754206:android:a9297b152879f266
X-gmsv 200414023
X-osv 28
X-scope *
X-subtype 312334754206

Response

token=cn91oO9qM5k:APA91bFOEDxOSyX9A5Sgy6Gb192VvQXLNccuMAfymu1LTAluH95SYliIH9OY5RPkiTvrmKF3TmkWSYBFWV6nXPS6nV07Mgid5fTApxm2YJ4TkLGA6NjyB7qXp9AHvqSWr3CtDSXkFp_n

microG (fixed) - Signal 4.60.9

Request

Header
Content-Type application/x-www-form-urlencoded
app org.thoughtcrime.securesms
Authorization AidLogin 4180318339633110089:3856385953474437405
User-Agent Android-GCM/1.5 (generic_x86_64 QP1A.190711.019)
Host android.clients.google.com
Connection Keep-Alive
Accept-Encoding gzip
Content-Length 345
Parameter
app org.thoughtcrime.securesms
app_ver 6403
cert 45989dc9ad8728c2aa9a82fa55503e34a8879374
device 4180318339633110089
sender 312334754206
target_ver 28
X-app_ver 6403
X-app_ver_name 4.60.9
X-appid cxHTg_z2BiU
X-cliv fiid-12451000
X-gmp_app_id 1:312334754206:android:a9297b152879f266
X-gmsv 19420021
X-osv 29
X-scope *
X-subtype 312334754206

Response

token=cxHTg_z2BiU:APA91bF5WZY8adWVx4YZmDGlTY9_VWyiQhkRw2RlqpfLj1mTGf0NLtGvkeseWvxgTobSmGjwhDzCgSZGdQ1tyGxCeAXGO03py0f85A8w749GJqq67igNdBQ3VgcH8PyEF5dJR-jbg2rO

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.
@FriendlyNeighborhoodShane

Thanks for the work! We've merged it into our @NoGooLag fork.

@fdawans
Copy link

fdawans commented Jun 19, 2020

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.

06-19 23:46:56.671  3144  3495 D GmsHttpFormClient: -- Response --
06-19 23:46:56.671  3144  3495 D GmsHttpFormClient: Error=FIS_AUTH_ERROR
06-19 23:46:56.675  3393  3419 W FirebaseInstanceId: Token retrieval failed: SERVICE_NOT_AVAILABLE. Will retry token retrieval

Then, while using the app, I am getting those issues:

[17:59:16.495  3144  3144 D GmsGcmRegisterSvc: onBind: Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms }
06-19 17:59:16.504 24083 24105 E FirebaseInstanceId: Token retrieval failed without exception message. Will retry token retrieval
06-19 17:59:16.927 24083 24259 W FirebaseRemoteConfig: No value of type 'String' exists for parameter key 'sessions_max_length_minutes'.
06-19 17:59:16.928 24083 24184 W FirebaseRemoteConfig: No value of type 'String' exists for parameter key 'sessions_feature_enabled'.](url)

Full log: n26.txt
I fixed the issue by downloading N26 (v. 202015002) from AuroraStore & (apparently) desactivating the 'Confirm New Apps' toggle in MicroG settings before reinstalling.

@vollzeitaffe
Copy link

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!

@vollzeitaffe
Copy link

vollzeitaffe commented Jul 3, 2020

Thanks for the work! We've merged it into our @NoGooLag fork.

How can I install your MircoG Fork?

@eggercomputerchaos
Copy link

MSe1969 added a commit to MSe1969/android_prebuilts_prebuiltapks that referenced this pull request Jul 4, 2020
Includes microg/GmsCore#1069

Change-Id: Ib9612de405cc10e5f55661c33fbecf9a59010fb0
@schreven
Copy link

schreven commented Jul 5, 2020

@vollzeitaffe
did you try this?
https://blog.peterge.de/install-lineage-17/

The linked release there is not updated with this fix

@vollzeitaffe
Copy link

@vollzeitaffe
did you try this?
https://blog.peterge.de/install-lineage-17/

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...

@TSedlar
Copy link

TSedlar commented Jul 7, 2020

@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.

@fdawans
Copy link

fdawans commented Jul 7, 2020

You can install the minmicrog fork from here:
https://github.com/friendlyneighborhoodshane/minmicrog_releases/releases

Instructions are here :
https://github.com/FriendlyNeighborhoodShane/MinMicroG

@vollzeitaffe
Copy link

vollzeitaffe commented Jul 7, 2020

You can install the minmicrog fork from here:
https://github.com/friendlyneighborhoodshane/minmicrog_releases/releases

Instructions are here :
https://github.com/FriendlyNeighborhoodShane/MinMicroG

@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?

@fdawans
Copy link

fdawans commented Jul 7, 2020

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.

@lakestonelabs
Copy link

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).
Overall the steps I did were:

  1. Cloned forx (fcmfix branch) using `git clone --recurse-submodules https://github.com/NoGooLag/android_packages_apps_GmsCore.git
  2. Downloaded and installed the Android SDK.
  3. exported the ANDROID_SDK_ROOT and ANDROID_HOME env. vars. NOTE ANDROID_HOME is deprecated but still used in this gradle config/build process.
  4. Ran the ./gradlew --stacktrace assemble.

After a successful build the only apks that this produces are:
./play-services-core/build/outputs/apk/debug/play-services-core-debug.apk
./play-services-core/build/outputs/apk/release/play-services-core-release-unsigned.apk

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.
I too would like some guidance to properly build this branch of the fork or be provided prebuild apks.

@FriendlyNeighborhoodShane
Copy link

FriendlyNeighborhoodShane commented Jul 8, 2020

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:

echo "sdk.dir=$ANDROID_SDK_ROOT" >> [root_of_project]/local.properties

(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:

echo "mapbox.enabled=true" >> [root_of_project]/local.properties

These two things really need to be added to the building wiki.

@lakestonelabs
Copy link

@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!

@mar-v-in
Copy link
Member

mar-v-in commented Jul 9, 2020

Rebased and merged as 5146559. Thanks :)

@lakestonelabs
Copy link

@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.

@FriendlyNeighborhoodShane

@lakestonelabs You just need to replace the APK in your system partition through a custom recovery or flashable zip installer.

@lakestonelabs
Copy link

@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.

@lakestonelabs
Copy link

@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:
adb install GmsCore.apk Performing Streamed Install adb: failed to install GmsCore.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.google.android.gms signatures do not match previously installed version; ignoring!]

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

@lakestonelabs
Copy link

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.

@JonnyTech
Copy link

The location should be the priv-app folder, ie /system/priv-app/gmscore.apk with permissions set to 644 and your ROM must support signature spoofing.

@lakestonelabs
Copy link

@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.

@FriendlyNeighborhoodShane
Copy link

@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.

@JonnyTech
Copy link

JonnyTech commented Jul 11, 2020

These are permission values from my device for the app from dumpsys package com.android.google.gms, maybe you can compare with yours:

requested permissions:
      android.permission.FAKE_PACKAGE_SIGNATURE
      android.permission.ACCESS_NETWORK_STATE
      android.permission.INTERNET
      android.permission.ACCESS_COARSE_LOCATION
      android.permission.ACCESS_FINE_LOCATION
      android.permission.READ_PHONE_STATE
      android.permission.AUTHENTICATE_ACCOUNTS
      android.permission.GET_ACCOUNTS
      android.permission.MANAGE_ACCOUNTS
      android.permission.USE_CREDENTIALS
      android.permission.WAKE_LOCK
      android.permission.READ_SYNC_SETTINGS
      android.permission.WRITE_SYNC_SETTINGS
      android.permission.READ_SYNC_STATS
      android.permission.WRITE_EXTERNAL_STORAGE: restricted=true
      android.permission.READ_EXTERNAL_STORAGE: restricted=true
      com.google.android.c2dm.permission.RECEIVE
      com.google.android.c2dm.permission.SEND
      com.google.android.gtalkservice.permission.GTALK_SERVICE
      org.microg.gms.STATUS_BROADCAST
      android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
      android.permission.RECEIVE_BOOT_COMPLETED
      android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST
      android.permission.INSTALL_LOCATION_PROVIDER
      android.permission.ACCESS_COARSE_UPDATES
      org.microg.permission.FORCE_COARSE_LOCATION
      com.android.settings.INJECT_SETTINGS
      android.permission.ACCESS_WIFI_STATE
    install permissions:
      com.google.android.c2dm.permission.RECEIVE: granted=true
      android.permission.USE_CREDENTIALS: granted=true
      android.permission.INSTALL_LOCATION_PROVIDER: granted=true
      android.permission.MANAGE_ACCOUNTS: granted=true
      android.permission.WRITE_SYNC_SETTINGS: granted=true
      android.permission.RECEIVE_BOOT_COMPLETED: granted=true
      android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS: granted=true
      android.permission.AUTHENTICATE_ACCOUNTS: granted=true
      android.permission.INTERNET: granted=true
      org.microg.gms.STATUS_BROADCAST: granted=true
      com.google.android.c2dm.permission.SEND: granted=true
      android.permission.ACCESS_NETWORK_STATE: granted=true
      android.permission.READ_SYNC_STATS: granted=true
      android.permission.READ_SYNC_SETTINGS: granted=true
      android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST: granted=true
      android.permission.ACCESS_WIFI_STATE: granted=true
      android.permission.WAKE_LOCK: granted=true
      com.google.android.gtalkservice.permission.GTALK_SERVICE: granted=true
    User 0: ceDataInode=-4294870862 installed=true hidden=false suspended=false stopped=false notLaunched=false enabled=0 instant=false virtual=false
    overlay paths:
      /product/overlay/NavigationBarMode3Button/NavigationBarMode3ButtonOverlay.apk
      /product/overlay/IconPackFilledAndroid/IconPackFilledAndroidOverlay.apk
      /product/overlay/StatusBar2/StatusBar2Overlay.apk
      /product/overlay/FontExo2/FontExo2Overlay.apk
      gids=[3003]
      runtime permissions:
        android.permission.ACCESS_FINE_LOCATION: granted=true, flags=[ USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED]
        android.permission.FAKE_PACKAGE_SIGNATURE: granted=true
        android.permission.READ_EXTERNAL_STORAGE: granted=true, flags=[ USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED|APPLY_RESTRICTION]
        android.permission.ACCESS_COARSE_LOCATION: granted=true, flags=[ USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED]
        android.permission.READ_PHONE_STATE: granted=true, flags=[ USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED]
        android.permission.GET_ACCOUNTS: granted=true, flags=[ USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED]
        android.permission.WRITE_EXTERNAL_STORAGE: granted=true, flags=[ USER_SENSITIVE_WHEN_GRANTED|USER_SENSITIVE_WHEN_DENIED|APPLY_RESTRICTION]
isSystemUserPackagesBlacklistSupported: false

Did you remember to reinstall Slack after installing microG?

You may also need to register the app for FCM by dialing the *#*#CHECKIN#*#* code (https://github.com/microg/android_packages_apps_GmsCore/wiki/Helpful-Information).

@luken-dev
Copy link

@lakestonelabs If Slack notifications are a priority, try this.

@lakestonelabs
Copy link

lakestonelabs commented Jul 14, 2020

I tried stopping Slack, removing the cache and data, uninstalling Slack, reinstalling Slack and dialing *#*#CHECKIN#*#* to no avail.

@schreven
Copy link

I was lucky to have it working by following more or less what is detailed here.
Are you sure you have your version installed; did you uninstall the regular one first? One thing I don't see clearly mentioned that I had to do is adb install GmsCore.apk

Also what does it say when you use 'Troubleshoot notifications' in slack?

@lakestonelabs
Copy link

@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.
Screenshot_20200714-103356_Slack
Screenshot_20200714-103327_microG_Services_Core

@schreven
Copy link

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 Version 0.2.10.19420-6-dirty. Anyway I don't know what could be wrong on your end. I'll just detail my process:
Just like you I had installed microG with lineageOS. I first deleted the GmsCore.apk that I found in /system/priv-app/. Simply copy pasting my new version of GmsCore.apk didn't cut it, and microG was not on my phone anymore. So I had to adb install. I mounted /system/ from twrp and did all the rest through my computer. Btw my phone is rooted. I didn't get a certification issue but I did have to sign my apk (which I did through android studio). After that version of microG was installed, I had to reregister to firebase which I did by dialing *#*#2432546#*#*, then I had to reinstall slack and many other apps, which would not function properly anymore.

@schreven
Copy link

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.

@lakestonelabs
Copy link

@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.

@lakestonelabs
Copy link

lakestonelabs commented Jul 21, 2020

Finally got this thing to work!!

  1. I rooted my phone (don't know if this was needed but at this point I'll try anything) by installing the appropriate addonsu.zip from here: https://download.lineageos.org/extras in twrp recovery mode under the Sideload option and rebooted into Lineage.
  2. Rebooted into recovery twrp and removed the GmsCore.zip from the /system/priv-app directory.
  3. Rebooted into Lineage and verified there was no more microG installed.
  4. Rebooted into recovery mode, mounted /system partition.
  5. Copied over my self-signed GmsCore.apk to the /system/priv-app/ directory.
  6. Chmod the file to 0644.
  7. Rebooted, ran though the microG setting checklist and granted whatever perms were needed.
  8. Stopped Slack, deleted cache and storage, and uninstalled Slack.
  9. Dialed *#*#2432546#*#*
  10. Reinstalled Slack, ran notification checklist. All checks passed!!

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 adb install inside twrp recovery mode. I was never able to run adb install in recovery mode, only when the phone is booted into Lineage. Even after rooting the device I still could not run adb install in recovery. What special options/steps do you do to allow this?

Again, thanks everyone for all the help! Now I can be constantly pestered by Slack work notifications ;)

@schreven
Copy link

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.

@TheLastGimbus
Copy link

TheLastGimbus commented Jul 25, 2020

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?

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?

@vollzeitaffe
Copy link

vollzeitaffe commented Jul 26, 2020 via email

@TheLastGimbus
Copy link

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

@vollzeitaffe
Copy link

vollzeitaffe commented Jul 26, 2020 via email

@TheLastGimbus
Copy link

You can take a look at this: #1063

But as said above, @corna is not answering anymore regarding this project, so…

@vollzeitaffe
Copy link

vollzeitaffe commented Aug 1, 2020 via email

@Emgalai
Copy link

Emgalai commented Aug 4, 2020

@vollzeitaffe it was already released 6 days before your post.

@vollzeitaffe
Copy link

vollzeitaffe commented Aug 4, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Firebase Cloud Messaging