microG GmsCore

repository·master·Indexed 28 days ago

https://github.com/microg/gmscore

A FLOSS framework providing implementations of Google Play Services APIs to enable compatible apps to run on alternative Android environments. Includes documentation on map style variants, asset conversion for MapLibre, Firebase authentication via IdentityToolkitClient, and Advertising ID management through IAdvertisingIdService.

Tokens
2.5K
Snippets
3
Records
28
Agent score
96%

What's inside microg-gmscore

  1. Overview of microG Services

    master
    microG Services is a Free/Libre Open Source Software (FLOSS) framework designed to allow applications that require Google Play Services to function on systems where Google Play Services is not available.
  2. Convert map assets (sprites and fonts) for microG styles

    master

    To prepare assets for use in an application (e.g., play-services-maps-core-mapbox), use spreet for sprites and build_pbf_glyphs for fonts.

    Note: microG combines Open Sans Regular with Roboto Regular to ensure no glyphs are missing. A symbolic link is often used in the assets folder to point the font stack specification Open Sans Regular,Arial Unicode MS Regular to Roboto Regular to prevent MapLibre rendering failures.

    $ cp style-microg-{satellite,normal}-{mapbox,stadia}.json style-stadia-outdoors.json style-mapbox-outdoors-v12.json ../../play-services-maps-core-mapbox/src/main/assets/
    $ spreet sprite_sources/ ../../play-services-maps-core-mapbox/src/main/assets/sprites
    $ spreet --retina sprite_sources/ ../../play-services-maps-core-mapbox/src/main/assets/sprites@2x
    $ build_pbf_glyphs --overwrite -c fonts/combinations.json fonts/ ../../play-services-maps-core-mapbox/src/main/assets
    $ rm -r ../../play-services-maps-core-mapbox/src/main/assets/OpenSans\ Regular
  3. Configure Maputnik for microG styles

    master

    When using Maputnik to edit microG styles, it is convenient to point the sprite and glyphs sources to Mapbox-hosted sources instead of the local asset:// scheme used in the app.

    "sprite": "mapbox://sprites/microg/cjui4020201oo1fmca7yuwbor/8fkcj5fgn4mftlzuak3guz1f9",
    "glyphs": "mapbox://fonts/microg/{fontstack}/{range}.pbf",
  4. Identify microG map style variants

    master

    microG provides several map style JSON files for different schema requirements and vendors:

    • style-microg-normal-openmaptiles.json: Pure OpenMapTiles schema version. Sources are set to Stadia but can be modified for other schema-compliant vendors like MapTiler.
    • style-microg-normal-stadia.json: Variant containing Stadia custom layers.
    • style-microg-normal-mapbox.json: Historic, unmaintained variant for Mapbox.
    • style-microg-satellite-*.json: Satellite layer variants (the Stadia variant is almost pure OpenMapTiles, though OpenMapTiles does not specify a satellite layer).
    • style-stadia-outdoors.json: Identical to Stadia's Outdoors style but includes added microG metadata.
  5. Initialize IdentityToolkitClient

    master

    The IdentityToolkitClient is used to interact with the Firebase Identity Toolkit API. It requires a Context, an apiKey, and optional parameters for Android-specific identification to include in request headers.

    Constructor Parameters:

    • context: Android Context.
    • apiKey: The Firebase API key.
    • packageName (optional): The Android package name. If provided, it is sent in the X-Android-Package header.
    • certSha1Hash (optional): A ByteArray representing the SHA1 certificate hash. If provided, it is converted to an uppercase hex string and sent in the X-Android-Cert header.