microg / microg/GmsCore

Cloud/Push Messaging "ghost entry" when same app still installed on work profile

Open
#1,714 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
14.6k
Forks
3.2k
Avg merge
12d 11h
Merged PRs (30d)
4

Description

Describe the bug
I expect when you uninstall an app, the related app is unregistered and removed completely from Gms.
But it doesn't happen when you try to uninstall app that the same app also still installed on 'work profile'

To Reproduce
Steps to reproduce the behavior:

  1. have same app both on main and work profile
  2. main profile cloud msg registered
  3. uninstall app from main app
  4. the app in questions is still on "cloud messaging" app list, with showing App ID and green android icon, so call "ghost entry"

possibly related context : #743 #744

Expected behavior
I expect when you uninstall an app, the related app is unregistered and removed completely from Gms.

System
Android Version: Android 10
Custom ROM: Lineage 17.1
GmsCore installed as system-priv, self-check all OK, permissions using nanodroid permissions xmls

Additional context
Android seems not broadcasting android.intent.action.PACKAGE_REMOVED act intent to GmsGcmUnregisterRcvr when same app still installed on the system. I think maybe this is intentional.

If that app on work profile is removed, and then uninstall the app from main profile, GmsGcmUnregisterRcvr received PACKAGE_FULLY_REMOVED action intent and the ghost list is removed.
D GmsGcmUnregisterRcvr: Package changed: Intent { act=android.intent.action.PACKAGE_FULLY_REMOVED dat=package:com.debug.fcm flg=0x5000010 cmp=com.google.android.gms/org.microg.gms.gcm.UnregisterReceiver (has extras) }

I think something need to be done to check whether particular app still exist to receive messages. As my experiment on latest release, gms still happily accepts the messages (msg count increasing). The nature of gms that "set and forget" so this removal must be done on background.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the work-profile scenario and start by tracing GmsGcmUnregisterRcvr handling of PACKAGE_REMOVED versus PACKAGE_FULLY_REMOVED; issues #743 and #744 provide related context. Determine how package presence across profiles should affect registration cleanup, then verify that an uninstalled app no longer appears in the Cloud Messaging list or continues receiving messages.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.