microg / microg/GmsCore

GoogleApiAvailability.isGooglePlayServicesAvailable(Context context) always return SUCCESS

Open
#2,309 6 comments 1 reaction 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
As a library used as a substitute for Google libraries, the function should have the expect behavior. Currently, this return SUCCESS on devices with neither Google Play Services or microG services.

To Reproduce
See the code, it's self-speaking:
https://github.com/microg/GmsCore/blob/v0.3.1.240913/play-services-base/src/main/java/com/google/android/gms/common/GoogleApiAvailability.java#L160-L164

Expected behavior
The function should return one of the following:

  • ConnectionResult.SERVICE_MISSING if com.google.android.gms is not installed
  • ConnectionResult.SERVICE_UPDATING if ̀com.google.android.gms is currently updating and is not available
  • ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED if the lib version by the app is incompatible with com.google.android.gms version (must handle both microG and Google Play versions).
  • ConnectionResult.SERVICE_DISABLED if user has disabled com.google.android.gms package
  • ConnectionResult.SERVICE_INVALID for example if the signature of the com.google.android.gms package is not Google or microG signature, if failed to parse Manifest, etc
  • ConnectionResult.SUCCESS finally, if com.google.android.gms succeeded in all checks, this is what should be returned

I think the most important things to do in priority are: package is installed, not disabled and signature is valid.

Additional context
I intend to use play-services-location as a subtitle library in Breezy Weather, see breezy-weather/breezy-weather#901

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

Start at play-services-base/src/main/java/com/google/android/gms/common/GoogleApiAvailability.java around lines 160-164, where isGooglePlayServicesAvailable(Context context) currently returns SUCCESS. Trace the existing checks and compare them with the requested installed, updating, version, disabled, and signature outcomes. Done means the method distinguishes these cases for both Google Play Services and microG, returning SUCCESS only after all checks pass.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.