[APP] microG GmsCore - lightweight free software clone of Google Play Services

Search This thread

ale5000

Senior Member
Dec 24, 2013
1,253
1,142
And that cheats safetynet attestation into a phone without GApps or magisk or ih8sn?
The requisite to pass is that your device doesn't have hardware attestation or that the ROM block hardware attestation for SafetyNet (there are patches available and some ROMs already include them).

After this you mainly need to spoof info (with device profiles) in one of the way:
- Create a profile from a device that pass SafetyNet and doesn't physically have hardware attestation: you can use it directly;
- Create a profile from a device that pass SafetyNet and does have hardware attestation: you need to add a space in the model name and then you can use it.
 

AnonVendetta

Senior Member
Apr 29, 2016
1,574
574
The requisite to pass is that your device doesn't have hardware attestation or that the ROM block hardware attestation for SafetyNet (there are patches available and some ROMs already include them).

After this you mainly need to spoof info (with device profiles) in one of the way:
- Create a profile from a device that pass SafetyNet and doesn't physically have hardware attestation: you can use it directly;
- Create a profile from a device that pass SafetyNet and does have hardware attestation: you need to add a space in the model name and then you can use it.
Need more clarification. So the steps are?:
1. Generate profile while SN fully passes
2. Once the profile file is generated, literally add a space in the model name of the file, like SM-N986N would become SM- N986N(?)
3. Import into microg

My intention is to generate the profile on stock rom, then use it with MicroG running on a custom gsi rom

I can already pass SN with Magisk and a few modules, but I'd like to find a way to fully pass without needing root stuff. So basically, unlocked bootloader + gsi + MicroG + no Magisk
 

ale5000

Senior Member
Dec 24, 2013
1,253
1,142
Need more clarification. So the steps are?:
1. Generate profile while SN fully passes
2. Once the profile file is generated, literally add a space in the model name of the file, like SM-N986N would become SM- N986N(?)
3. Import into microg

My intention is to generate the profile on stock rom, then use it with MicroG running on a custom gsi rom

I can already pass SN with Magisk and a few modules, but I'd like to find a way to fully pass without needing root stuff. So basically, unlocked bootloader + gsi + MicroG + no Magisk
The space thing is explained better here:
https://github.com/ProtonAOSP/android_frameworks_base/commit/a99ac1b48a9b

The ROM patch is explained here:

PS: I can't test this thing specifically since my device doesn't support hardware attestation so I don't have any problem.
 
Last edited:

AnonVendetta

Senior Member
Apr 29, 2016
1,574
574
The space thing is explained better here:
https://github.com/ProtonAOSP/android_frameworks_base/commit/a99ac1b48a9b

The ROM patch is explained here:

PS: I can't test this thing specifically since my device doesn't support hardware attestation so I don't have any problem.
Still need more clarification on the space. I've checked the github link. I'm not sure if the space goes in the name of the generated profile file. Or if the file is meant to be edited, with a space added somewhere inside it. Can you give an actual example of without space vs with space?

How to check whether the device supports hardware attestation? I'm still running the stock firmwares. I also relocked the bootloaders, SN does now fully pass on both devices. I'm sure that they do support attestation, since they're not ancient, but I'd like to check. Both are currently running stock Android 13.
 
Last edited:

ale5000

Senior Member
Dec 24, 2013
1,253
1,142
Still need more clarification on the space. I've checked the github link. I'm not sure if the space goes in the name of the generated profile file. Or if the file is meant to be edited, with a space added somewhere inside it. Can you give an actual example of without space vs with space?
I cannot test it but it should be like this, from:
Code:
<data key="Build.MODEL" value="SM-N986N" />
to:
Code:
<data key="Build.MODEL" value="SM-N986N " />
 

ale5000

Senior Member
Dec 24, 2013
1,253
1,142
How to check whether the device supports hardware attestation? I'm still running the stock firmwares. I also relocked the bootloaders, SN does now fully pass on both devices. I'm sure that they do support attestation, since they're not ancient, but I'd like to check. Both are currently running stock Android 13.
Run this app and check if it say HARDWARE_BACKED or BASIC.
 
Last edited:

AnonVendetta

Senior Member
Apr 29, 2016
1,574
574
@ale5000: I couldn't fix the ADB issues in Windows, but it seems the script runs fine on a much older (2014) device that doesnt support attestation. I ran it in Manjaro Linux, after connecting via ADB. It's just easier to run Linux sh scripts within Linux, instead of futzing around on Windows with manual Busybox installs. And Windows doesnt understand how to execute sh files anyway.

Still have 2 more to run it against (the ones I already mentioned earlier). It will be awhile longer before I can test the profiles with MicroG in GSIs, I'm not quite ready to go back that route yet.
 

ale5000

Senior Member
Dec 24, 2013
1,253
1,142
@ale5000: I couldn't fix the ADB issues in Windows, but it seems the script runs fine on a much older (2014) device that doesnt support attestation. I ran it in Manjaro Linux, after connecting via ADB. It's just easier to run Linux sh scripts within Linux, instead of futzing around on Windows with manual Busybox installs [...]

The busybox linked by me is the most advanced and it doesn't need to be installed, just for example:
Code:
busybox sh ./script_name.sh

PS: On my repo this is really simplified (on Windows), you just need to:
1) Download the entire source repo from here: https://github.com/micro5k/microg-unofficial-installer/archive/refs/heads/main.zip
2) Extract it
3) Double click on cmdline.bat
4) Then just type:
Code:
profgen > my_profile.xml

The only thing more difficult is setup adb, just placing the file in the same directory may not work, the best thing is install it system-wide or alternatively place it in one folder and just setup PATH manually every time after step 3 and before step 4 with this:
Code:
PATH="C:/path_of_the_folder_of_adb;${PATH:?}"
 

tom.android

Senior Member
Jul 12, 2016
1,352
401
Samsung Galaxy Tab A7 Lite
Hi,
I have created a script to automatically generate a device profile (usable by microG) from a device connected via adb: https://github.com/micro5k/microg-unofficial-installer/blob/main/utils/profile-generator.sh
Only adb and a device are needed (on Windows you also need busybox to execute the script).

I would like a feedback from all interested people.

PS: It can create a profile from most devices and even emulators but it only make sense to create a profile from devices that pass SafetyNet.
test with this condition. "
After this you mainly need to spoof info (with device profiles) in one of the way:
- Create a profile from a device that pass SafetyNet and doesn't physically have hardware attestation: you can use it directly;

Result: success. ( A13 GSI on Stock A13 , no root , no magisk)
Thanks

delete s/n , install Busybox64 overwrite Platform-tools
test.png
 
Last edited:
  • Like
Reactions: ale5000

AnonVendetta

Senior Member
Apr 29, 2016
1,574
574
The busybox linked by me is the most advanced and it doesn't need to be installed, just for example:
Code:
busybox sh ./script_name.sh

PS: On my repo this is really simplified (on Windows), you just need to:
1) Download the entire source repo from here: https://github.com/micro5k/microg-unofficial-installer/archive/refs/heads/main.zip
2) Extract it
3) Double click on cmdline.bat
4) Then just type:
Code:
profgen > my_profile.xml

The only thing more difficult is setup adb, just placing the file in the same directory may not work, the best thing is install it system-wide or alternatively place it in one folder and just setup PATH manually every time after step 3 and before step 4 with this:
Code:
PATH="C:/path_of_the_folder_of_adb;${PATH:?}"
Yeah, I know how to put adb and other binaries in a custom location and then add that path to the system environment variables. I use lots of 3rd party binaries that aren't built into Windows, it's easier to call them that way because you don't need to specify their absolute path.

The real issue is that adb works for me in Windows (i can call it from it), but it can't detect any device. I've tried with all 3 devices, nothing. Was working fine a few days ago. It seems likely to me that an OS update screwed with something, it auto installed a big feature update.

Manjaro's adb recognizes them just fine, so it's likely a driver issue in Windows.
 
  • Like
Reactions: ale5000

ale5000

Senior Member
Dec 24, 2013
1,253
1,142
Yeah, I know how to put adb and other binaries in a custom location and then add that path to the system environment variables. I use lots of 3rd party binaries that aren't built into Windows, it's easier to call them that way because you don't need to specify their absolute path.

The real issue is that adb works for me in Windows (i can call it from it), but it can't detect any device. I've tried with all 3 devices, nothing. Was working fine a few days ago. It seems likely to me that an OS update screwed with something, it auto installed a big feature update.

Manjaro's adb recognizes them just fine, so it's likely a driver issue in Windows.
Personally I use this to get the right drivers: https://www.glenn.delahoy.com/snappy-driver-installer-origin/
But for those that aren't expert I don't suggest to touch most things and just use it to update the drivers related to their phone.
 

AnonVendetta

Senior Member
Apr 29, 2016
1,574
574
Personally I use this to get the right drivers: https://www.glenn.delahoy.com/snappy-driver-installer-origin/
But for those that aren't expert I don't suggest to touch most things and just use it to update the drivers related to their phone.
JSYK, the program you're using is based on Snappy Driver Installer, whose homepage is Snappy Driver Installer. SDI is the "OG" that alot of driver updaters/driver packs are based on. As soon as I saw the screenshots, I knew it looked eerily familiar. I've been using SDI for years to keep my drivers updated, but not exclusively. In order of preference, I will use manufacturer/OEM drivers, then SDI, then Windows Update for anything that's missed.

I've generated profiles for 3 devices. No issues generating the profiles, and again, from Linux. I don't feel that there is a need to duplicate my efforts in Windows.

However, I did notice that the IMEI field comes up empty during profile generation, for 2 of the 3 devices. No error, just an empty value. On the legacy phone running stock Marshmallow, the IMEI is shown correctly. On the newer, already mentioned devices, the value is empty but the profiles generate fine. They are running Android 13, which is much more locked down and restricts access to a lot of things, I think this is why.

I checked all 3 xml files, there are no references to IMEI anywhere, not even on the one where it was detected. So this leads me to believe that the profile itself doesn't need/use it, even though your script tries to check the value. Which makes me ask, what is the purpose of querying it?

The newer devices both have active cellular service plans, and all mobile carriers worldwide check this, so it's not an issue of something being wrong with the IMEIs.

The device serial #s are correctly detected on all 3, and are present in the profile xml files.
 
Last edited:

ale5000

Senior Member
Dec 24, 2013
1,253
1,142
The IMEI retrieval is more restricted on newer versions of Android (it is a thing that I will fix later if possible) but still, as you see, IMEI never appears in the profile.

Only the white text is the real profile, eveything else is just additional info for your information.
I have deciced to add additonal info to the script because it can be useful in general (outside microG).

PS: It is strange that it is displayed empty, it should display "IMEI not found" when it fail.
Could you please take a screenshot of the IMEI line? (I just need to see that line)
 

AnonVendetta

Senior Member
Apr 29, 2016
1,574
574
The IMEI retrieval is more restricted on newer versions of Android (it is a thing that I will fix later if possible) but still, as you see, IMEI never appears in the profile.

Only the white text is the real profile, eveything else is just additional info for your information.
I have deciced to add additonal info to the script because it can be useful in general (outside microG).

PS: It is strange that it is displayed empty, it should display "IMEI not found" when it fail.
Could you please take a screenshot of the IMEI line? (I just need to see that line)
Fine, but I will only do so for 1 of the 3 devices, that should be all you need.

Is the IMEI *SUPPOSED* to be in the profile xml file? Or is it your intention that the generated profile doesn't need it? Just want to make sure it's not a case of "it should be there, but isnt", so I can avoid generating again.

White text *WHERE*? That's a vague statement.

Screenshot in a bit...
 

ale5000

Senior Member
Dec 24, 2013
1,253
1,142
No, the IMEI isn't supposed to be in the profile xml file, in fact when you use "sh ./profile-generator.sh > profile-name.xml" only the white text will go in the file.

The output of the script is:
- White text => what should go in the profile
- Green text => informational messages
- Brown text => warnings
- Red text => errors

@AnonVendetta
@tom.android
PS: My script was previously putting the exact serial number in the xml but now it will put an anonymized one.
The serial in the profile is just a template so there isn't any difference, microG only use the serial number to generate another rendomly but with similar characteristics.
The only reason I have added anonymization is that now people can share the xml without giving the real serial number.

profile-generator.png
 
Last edited:

Top Liked Posts

  • 1
    Get a flip cover with small pockets. Stick some NFC payment or credit cards into.
    Had that before, but got rid of it in favor of the ordinary silicone cover that came with the phone, because it's a lot more convenient to handle this way.

    I have my little wallet with card with me at all times, it is manageable, but of course just using the phone would be easier.
  • 1
    Get a flip cover with small pockets. Stick some NFC payment or credit cards into.
    Had that before, but got rid of it in favor of the ordinary silicone cover that came with the phone, because it's a lot more convenient to handle this way.

    I have my little wallet with card with me at all times, it is manageable, but of course just using the phone would be easier.
  • 566
    hXY4lcC.png

    Introduction
    microG GmsCore is a FLOSS (Free/Libre Open Source Software) framework to allow applications designed for Google Play Services to run on systems, where Play Services is not available. If you use your phone without GAPPS this might become a useful tool for you.
    microG GmsCore is one of the two core components of the microG project.
    More up-to-date descriptions and instructions might be available on the wiki

    Instructions
    Preparation:
    1. You need a 4/5/6 ROM that is GAPPS-free. Either don't install them or remove them, if your ROM ships them. Please note that microG GmsCore might run on a cleaned stock ROM, but it might also brick it or cause random bugs. Be aware that only latest Android versions (4.4+) are regularly tested and thus prioritized over older versions when issues occur.
    2. You need a ROM that supports signature faking. Some custom ROMs are patched to support signature faking out of the box, including all OmniROM-based ones. Stock CyanogenMod denied the inclusion, as the possibility of third-party play services implementations is considered a security issue (read here about why it's not). Please ask your ROM developer if unsure. The latest version of signature spoofing for Android < 6.0 has to be enabled at the bottom of the developer settings first. If your ROM does not support signature faking, but you use Xposed, you can grab a Xposed module here.
      If you are a ROM developer or just do custom builds for whatever reason, you can download and include the patch from here and here for Android 5.1 or here for Android 6.0.
    3. Remove UnifiedNlp. In case you installed it before. You can keep your backend modules installed, microG Services will be able to use them later and provide the same feature set (to be precise, microG Services includes UnifiedNlp).

    Installation:
    The installation does not require any modification of the /system partition. All installations should be done using the default app installer included with Android or using `adb install`. This means you need to enable third-party sources or developer mode first.
    1. Install GmsCore.apk as provided in the download section below.
    2. If you want to use Google Cloud Messaging ("Push-Notifications"), Install GsfProxy.apk as provided in the download section below. The GsfProxy version does not need to match the GmsCore.apk version.
      • If you have BlankStore installed, continue with the next step.
      • If you want to be able to access the Play Store, install BlankStore from its thread. It is not a requirement that you set it up correctly and this is not covered by this instructions. If you need help ask in the original thread.
      • If you don't care about Play Store access, Install FakeStore.apk as provided in the download section below.
    3. Open the microG Settings, which are available in the launcher now. If you want to use any Google services (Log-In, Cloud Messaging), tick both checkboxes for background services. This is the only supported setup, but you are free to disable them if you like playing with fire. You can also open the UnifiedNlp settings to enable the location backends of your choice. If you don't have any yet, check out F-Droid. For further questions and concerns regarding UnifiedNlp, use its corresponding thread.
    4. Reboot your device. If you skip this step, everything unwanted is possible.

    Using it:
    • You can test Google Cloud Messaging using this test application. Push notifications do not require account registration.
    • You can add an account through the system settings. Some applications might ask you to do so, if you don't.
    • Use your applications as you like. But note that apps that use Cloud Messaging must be installed after GmsCore, else they will not work. Some hint of applications that can run due to microG GmsCore: TextSecure/Signal, Play Music, YouTube
    • When using AdAway make sure to put mtalk.google.com on your whitelist, else problems are likely to occur when using Google Cloud Messaging. Thanks @benstyle1 for the hint.

    Downloads
    See this wiki page for Downloads. You can find details on the F-Droid repository on https://microg.org/fdroid/.

    Signing key
    The NOGAPPS and microG Project use a shared signing key. Apps and the F-Droid repository are signed using this key. You can verify app signatures using the Checkey app (not when signature spoofing is enabled) and the F-Droid key in F-Droid repository details.
    The SHA-256 hash of the key is:
    9B D0 67 27 E6 27 96 C0 13 0E B6 DA B3 9B 73 15 74 51 58 2C BD 13 8E 86 C4 68 AC C3 95 D1 41 65

    Current implementation progress
    Please check this wiki page for up to date implementation progress.

    Please report bugs
    This project is still rather unstable. Please report bugs as they occur. Whenever you report a bug, please tell us what application caused the bug, including its exact version. If you're the developer, name the play services library you are using. Please do not bother the original app author when it might be related to microG services. If the problem is related to geolocation with UnifiedNlp, report it in the UnifiedNlp thread, even if you're using it through GmsCore.

    Thanks
    Big thanks to everyone who continuously supported me doing this, by donating, pull-requests or just feedback.

    XDA:DevDB Information
    microG GmsCore, App for all devices (see above for details)

    Contributors
    MaR-V-iN
    Source Code: https://github.com/microg/android_packages_apps_GmsCore


    Version Information
    Status: Beta
    Current Beta Version: v0.2.13.203915
    Beta Release Date: 2020-10-19

    Created 2015-10-04
    Last Updated 2020-10-20
    56
    I am still alive, but just super busy.

    Starting end of February, I set aside 20 hours a week to work solely on microG.

    But please don't expect any update earlier than that, I have to ensure that there are no loose ends before I remove myself from some of the obligations I have right now, so probably will be even busier than before.

    Thanks for your ongoing support everyone.
    28
    Nice! Even original Play Store started to work with this! Not fully, but now you can login, search for apps and see already installed ones. Just download doesn't work yet. Keep up good work! Original GMSCore is android cancer.
    26
    Thanks for your feedback @emandt. I appreciate it, although it's impossible for me to not agree with @Ultramanoid that it feels like trolling. I will try to answer to all your concerns.

    It's true that Google API change. This project has some history and still uses some code from 2013. In the meantime, I saw some API changes, but most APIs stay stable. This is because not all play services users update directly and Google does not want important system features to break. I know that Google is aware of this project (or atleast some Google employees are) longer than you are and atleast one change in the web service implementation was targeting a third party software, with microG being the only one I know that fits into that. So yes, I agree that Google is unlikely to be happy with this project. But as Ingress players know, even the mighty Google is not able to block users out that really want to do something with their services. We will always find a way.

    This project is all about privacy. As mentioned above it existed long before I posted it here on XDA and it was reviewed by several people. I also know that at least one "Android company" is working with it. The source code is still fairly simple to follow, and if you want you can check every future commit (and those from the past) one-by-one. It should also be noted that I built privacy related tools for Android the last years, some of them being published here on XDA as well or being integrated in e.g. OmniROM.
    As I don't want users credentials to end up in wrong hands, microG GmsCore doesn't even safe or access your google account password, the login is done through Google's OAuth based website.

    You complained that not "any warning/advice about privacy, credential or critical actions" was stated on the first post. As you mentioned that you're a XDA user for ten years, this can only be trolling: I never saw a ROM or Patched WhatsApp or darkened Play Store or anything else on XDA state something like this in the first post. And most of them were not open source. I expect users to be able to think theirself that, if you enter confidential data, random things might happen with that. I actually pointed that out by mentioning that "This is currently alpha-grade Software. Don't use it if you're not aware of possible consequences." in red letters :)

    I agree that payments are crucial and it is important that they work fluidly. Until now I did not implement anything related to payments for that reason. Inside Play Store, payments are not directed through Play Services, so this is nothing to fear about (this is all about microG GmsCore now, not about a future implementation of the Play Store). On the other hand, as already pointed out by others, payments should be managed server side. It should NEVER be possible to pay more than needed.

    Reducing the enormous size and bloat in Play Services is one of the goals of the project. And I'm quiet sure that this will be possible, because some things inside Play Services just don't need to be there or can be made a lot simpler. The majority of the size until now actually do not really belong to the project (but is the map rendering library used in the backend and the android-support libraries). I did not use proguard until now, I have a single release for all major instruction set (play services use multiple) and 500KB of assets that can also be reduced in size. Although i did not try it yet, I am quiet sure the size final packages size will stay below 10MB. I am not going into details why play services is so huge here, if you're interested in that, ask me when we meet in person.

    And finally I wanted to point out that most Google applications do not user Play Services intensively. Play Store is using it primarily for Auth and checkin, as well as some smaller things like advertisement id. Only Google Plus related apps (Google+, Hangouts) use Play Services a lot. This is not really a surprise considering that Play Services was originally invented for Google+ and OAuth 2 APIs.

    Finally, I'd like to thank you for the insights in your feelings about this project. I guess these answers will not sufficiently satisfy you, but there is not a lot more I can do. Trust me or don't - it's up to you.

    Puh, what a post...
    26
    what is the best way to download this these days? little confused by all the different updates and forks.

    is f droid repo a good place to install from still?

    Here's what I know:

    NanoDroid is an app pack that contains, among other things, MicroG. It also replaces system apps and is compatible with Magisk overlays. It is configured with a text file that can be generated using a zip installer with Aroma. It is currently using @Setialpha's fork of microG. There are also basic subset packs for just MicroG or just system app replacements. It comes with a patched version of Play Store that allows for IAP, but can also install FakeStore.
    @ale5000's zip I think was the first of the unofficial zips and AFAIK just installs official MicroG and related dependencies, as well as removing conflicting apps (important for location services), which NanoDroid does as well. I'm not following the thread for this zip for some reason, and probably should find it so I can follow it. AFAIK, there is no simple configuration for this zip.

    My zips are built by downloading the latest MicroG apps by parsing the F-Droid repo's index file for URLs and thus only follows official releases. There are separate zips for installing with FakeStore, official Play Store, and the NanoDroid patched Play Store. There are also separate NoGapps packs that mirror OpenGapps but with apps from F-Droid (and no MicroG, as that's in a separate installer). Configuration is done at build time, but I provide my build tool and build recipes for easy modification.

    The NoGoolag installer I think is most similar to NanoDroid in that it installs its own fork of MicroG as well as F-Droid system app replacements. I'm least familiar with it, but it's in pretty active development, for what that's worth. I don't know much more about it than that, though.

    All of the above zips AFAIK will ensure best compatibility with your device by uninstalling system apps that will interfere, e.g. with location services; extracting libraries from apps that get installed to /system (Android generally can't find the libraries otherwise); and similar things. This tends to provide a better/easier experience than installing straight from F-Droid, though that is still a valid option. Also, if you use an installer that uses the official MicroG, you can get updates from that F-Droid repo.

    TL;DR: Which installer you use will depend on what you're looking for from it. I will almost always recommend mine, but I am opinionated on the subject. It may be worth you looking deeper into what each does and does not provide and if you need that thing, then make a decision. I would highly recommend using one of the zip installers though, even if it's not mine.