[GUIDE] microG - Deodex - Signature Spoofing - Debloat Gapps!

Search This thread

DoR3M3

Senior Member
Feb 17, 2018
1,281
384
Portwenn
Don't know what I did but location thing is sorted.

Yes this is the original microG from F-Droid. Managed to get past the extension privilege thing when trying to upgrade and now have this message.

Did you tell me in IRC that you had XPrivacyLua installed? After my last reply, I forgot to mention, that something you installed might of caused this, like XPrivacyLua...

Anyhow glad it's working, I've never seen it before not working, other areas more complicated, but Location just always works.


I've managed to get this app working on my Nexus 5 this way.

1-Flashed normal Lineage 14.1 (non microG) without Gapps, rebooted ,done settings.
2-Flashed Magsik 18 and Nano-Droid patcher Beta 20.2.90.99999999, rebooted.
3-Flashed nano-Droid Beta 20.2.90.99999999
4-Allowed microG permissions, Installed latest version of BT Sports app and VOILA

I understand that this is not stock ROM and was already Deodex but since it didn't work with the official microG Lineage ROM your assumption that it needed a new version was correct.

https://downloads.nanolx.org/NanoDroid/Beta/NanoDroid-20.2.90.99999999.zip

https://downloads.nanolx.org/NanoDroid/Beta/NanoDroid-patcher-20.2.90.99999999.zip

Would I be correct in thinking that if I had a Deodex Oneplus Stock ROM this method would work or since it's stock even being Deodex would still require all your steps?


First question, unless typo, why did you flash NanoDroid-patcher twice?

LOS is a Deodex rom, all Custom Roms are also suppose to be in a state of Deodex, that means, you just start at the guide section of where you are already Deodex and proceed from there with the guide.

On the Nexus 5 BT is working? Also what version of microG are you using?
 
Last edited:

bluegrass55

Senior Member
Sep 29, 2011
636
91
London
Did you tell me in IRC that you had XPrivacyLua installed? After my last reply, I forgot to mention, that something you installed might of caused this, like XPrivacyLua...

Anyhow glad it's working, I've never seen it before not working, other areas more complicated, but Location just always works.





First question, unless typo, why did you flash NanoDroid-patcher twice?

LOS is a Deodex rom, all Custom Roms are also suppose to be in a state of Deodex, that means, you just start at the guide section of where you are already Deodex and proceed from there with the guide.

On the Nexus 5 BT is working? Also what version of microG are you using?

This time it was a permission Network access in XprivacyLua (your "favorite" app) that was the cause of the location thing. But on previous installs Lua wasn't installed till the microG setup had finished.

Regarding the patching thing it was my error of flashing the patch twice.I had never flashed the full version of NanoDroid before as I didn't want all the extra stuff that comes with it.

Yes as I mentioned Lineage was already Deodex hence this method worked. I wonder if it would be as easy as this on Stock Deodex ROM?

And yes BT Sport app has sprang back to life and is working. I'm not sure the microG version. It's whatever that was included in the beta NanoDroid zip 20.2.90.99999999. I didn't install it separately.
 

DoR3M3

Senior Member
Feb 17, 2018
1,281
384
Portwenn
This time it was a permission Network access in XprivacyLua (your "favorite" app) that was the cause of the location thing. But on previous installs Lua wasn't installed till the microG setup had finished.

Regarding the patching thing it was my error of flashing the patch twice.I had never flashed the full version of NanoDroid before as I didn't want all the extra stuff that comes with it.

Yes as I mentioned Lineage was already Deodex hence this method worked. I wonder if it would be as easy as this on Stock Deodex ROM?

And yes BT Sport app has sprang back to life and is working. I'm not sure the microG version. It's whatever that was included in the beta NanoDroid zip 20.2.90.99999999. I didn't install it separately.


I would stay away from XrpivacyLua and just use AFWall+.

There is NanoDroid and there is NanoDroid-microG, also if you want the latest version of microG from NanoDroid I mentioned before, after installing the official version, all you have to do is add in the Nanodroid-microG repo and update microG in F-Droid.

http://nanolx.org/fdroid/repo/

You asked about the Deodex, I mentioned it in my last reply;

LOS is a Deodex rom, all Custom Roms are also suppose to be in a state of Deodex, that means, you just start at the guide section of where you are already Deodex and proceed from there with the guide.

Open up microG and look at the bottom, it shows the version number. ;)

Cheers
 

bluegrass55

Senior Member
Sep 29, 2011
636
91
London
I would stay away from XrpivacyLua and just use AFWall+.

There is NanoDroid and there is NanoDroid-microG, also if you want the latest version of microG from NanoDroid I mentioned before, after installing the official version, all you have to do is add in the Nanodroid-microG repo and update microG in F-Droid.

http://nanolx.org/fdroid/repo/

You asked about the Deodex, I mentioned it in my last reply;

LOS is a Deodex rom, all Custom Roms are also suppose to be in a state of Deodex, that means, you just start at the guide section of where you are already Deodex and proceed from there with the guide.

Open up microG and look at the bottom, it shows the version number. ;)

Cheers



Hallelujah- BT Sport working:D:D:D:D:D:D:D:D:D:D


I finally managed to get BT Sport app to work on the 5T by using,
FakeStore
GmsCore (official)
GsfProxy
Extracted from the latest Beta Nanodroid zip 20.2.90.99999999.MicroG version is 0.2.6.14799-dirty-118.

I had problems updating as per your instructions, so did it as a fresh install.

Now to get all the location boxes ticked again. Don't know why I keep having problems with it.

The tab tip in TWRP was very handy. Saved a lot of time.Thanks.::good:
 

DoR3M3

Senior Member
Feb 17, 2018
1,281
384
Portwenn
MicroG 0.2.6.14799-dirty-118 is the solution then...

Make sure you add in the NanoDroid Repo to F-Droid to either update to the NanoDroid version, or to keep it updated.

If the guide is followed exactly, Location will always be checked. microG is telling you it's either turned off or not supported, and the "not supported" part, the OP5T has the support.
 

bluegrass55

Senior Member
Sep 29, 2011
636
91
London
MicroG 0.2.6.14799-dirty-118 is the solution then...

Make sure you add in the NanoDroid Repo to F-Droid to either update to the NanoDroid version, or to keep it updated.

If the guide is followed exactly, Location will always be checked. microG is telling you it's either turned off or not supported, and the "not supported" part, the OP5T has the support.

I did add the repo but kept having issues. I wonder if it would be a good idea for you to add a step by step guide for updating.

Solved one issue now this location thing is bugging me. I did it without Xprivacy. I might be too aggressive in the AFWall+ settings, though I haven't applied it to any microG ones nor location Backends.

It's been a good learning experience. Thanks for your support and input.
 

DoR3M3

Senior Member
Feb 17, 2018
1,281
384
Portwenn
I did add the repo but kept having issues. I wonder if it would be a good idea for you to add a step by step guide for updating.

Solved one issue now this location thing is bugging me. I did it without Xprivacy. I might be too aggressive in the AFWall+ settings, though I haven't applied it to any microG ones nor location Backends.

It's been a good learning experience. Thanks for your support and input.


I do have Update information for microG, but this only pertains to the Official Release, I've yet to put anything in for also including the NanoDroid repo.

Because I'm always testing, changing and updating the guide, I've been doing this on my OP5T hundreds of hours, this is all I do in Android 24/7 and I've never had Location not work. In the testing process I also do things in various ways to try and see if I can accomplish it, break something, or find bugs, and I've never been able to not get the Location to stop working. It's something you are doing on your end to cause this.

What's odd is I can't even make it not work, it just works. :)
 
Last edited:

BootloopedMillennials

Senior Member
Dec 25, 2010
1,054
295
Google Pixel 6
You mention in the OP you won't get into the Vdex Extractor compiling. Do you have a resource that will help learn about compiling in general? Certainly it's not as easy as the readme.md makes it seem. Install dependencies, clone repo, ./make.sh.
 

DoR3M3

Senior Member
Feb 17, 2018
1,281
384
Portwenn
You mention in the OP you won't get into the Vdex Extractor compiling. Do you have a resource that will help learn about compiling in general? Certainly it's not as easy as the readme.md makes it seem. Install dependencies, clone repo, ./make.sh.

You bring up a valid question/point and I have elaborated a bit about what was being shown on the Vdex Extractor Github Repo, so please look back under the VDEXEXTRACTOR section for some more information, listed at numbers 1,2,3...
 
Last edited:

bluegrass55

Senior Member
Sep 29, 2011
636
91
London
Android Pie

During almost 2 months of trouble free usage a couple of working apps (ITV Hub, All4) have suddenly developed a very fierce hunger for Google Play Services after their latest updates.

Surprisingly the original complainant BT Sports is not missing Google even after updates.

Instead of tinkering with the current setup I'm thinking of updating to Pie and trying this version of Xposed. I assume the steps to remove Google would be the same on Pie?

https://xdaforums.com/xposed/android-9-0-xposed-solutions-t3889513

Thanks again for setting up this guide. It really has made a noticeable difference without the Google bloat.
 

DoR3M3

Senior Member
Feb 17, 2018
1,281
384
Portwenn
During almost 2 months of trouble free usage a couple of working apps (ITV Hub, All4) have suddenly developed a very fierce hunger for Google Play Services after their latest updates.

Surprisingly the original complainant BT Sports is not missing Google even after updates.

Instead of tinkering with the current setup I'm thinking of updating to Pie and trying this version of Xposed. I assume the steps to remove Google would be the same on Pie?

https://xdaforums.com/xposed/android-9-0-xposed-solutions-t3889513

Thanks again for setting up this guide. It really has made a noticeable difference without the Google bloat.



I mentioned in the guide that Pie does not support Xposed.

I forgot, but I thought you mentioned you are now using the NanoDroid-microG version? If not, as of now, it's better to use the NanoDroid version of microG and GsfProxy, you need them both from NanoDroid, because both of these apps need the same Signatures.

Stable Download (Nanolx) - NanoDroid-microG-20.6.20190126.zip
https://xdaforums.com/apps/magisk/module-nanomod-5-0-20170405-microg-t3584928

Take them both out of the zip and replace both of these and everything hopefully should be working again.

My ROM should be released tomorrow on XDA, stay tuned! :)

P.S. I updated the guide and added in a "NANODROID-MICROG" section, recommending that people now use the NanoDroid version instead!
 
Last edited:

bluegrass55

Senior Member
Sep 29, 2011
636
91
London
I mentioned in the guide that Pie does not support Xposed.

I forgot, but I thought you mentioned you are now using the NanoDroid-microG version? If not, as of now, it's better to use the NanoDroid version of microG and GsfProxy, you need them both from NanoDroid, because both of these apps need the same Signatures.

Stable Download (Nanolx) - NanoDroid-microG-20.6.20190126.zip
https://xdaforums.com/apps/magisk/module-nanomod-5-0-20170405-microg-t3584928

Take them both out of the zip and replace both of these and everything hopefully should be working again.

My ROM should be released tomorrow on XDA, stay tuned! :)

P.S. I updated the guide and added in a "NANODROID-MICROG" section, recommending that people now use the NanoDroid version instead!

The link I provided is a new workaround for Xposed on Pie, which seems to work on some devices.

Good timing for my issues and your new ROM almost here.:D:D:D:D
 

dipole

Senior Member
Sep 1, 2010
410
74
Google Pixel 7 Pro
Great guide. I'm on a OP6T and have been struggling with this the past 2 days. I read in the nanodroid thread that this procedure doesn't work on pie yet. I believe there is an additional step and that's the part where I'm stuck as the instructions are very vague, would you be as so kind to include those instructions? I am so close to getting this to work but I bricked my device everytime.

EDIT: Nevermind! Got it working on a OP6T, a couple things had to be changed but your guide worked perfectly!
 
Last edited:

DoR3M3

Senior Member
Feb 17, 2018
1,281
384
Portwenn
Great guide. I'm on a OP6T and have been struggling with this the past 2 days. I read in the nanodroid thread that this procedure doesn't work on pie yet. I believe there is an additional step and that's the part where I'm stuck as the instructions are very vague, would you be as so kind to include those instructions? I am so close to getting this to work but I bricked my device everytime.

EDIT: Nevermind! Got it working on a OP6T, a couple things had to be changed but your guide worked perfectly!


Well I try to be perfect, LOL... So for what I have done in the past for all the various devices, the guide applies to any device, and where it doesn't I mentioned that, like possibly not needing Xposed, which should be it. Of course different apps on different devices would need to be debloated, but that shouldn't be anything needed to mention.

So please do share what you changed?
 

nickest15

New member
Apr 4, 2019
1
0
How did you do it?

Great guide. I'm on a OP6T and have been struggling with this the past 2 days. I read in the nanodroid thread that this procedure doesn't work on pie yet. I believe there is an additional step and that's the part where I'm stuck as the instructions are very vague, would you be as so kind to include those instructions? I am so close to getting this to work but I bricked my device everytime.

EDIT: Nevermind! Got it working on a OP6T, a couple things had to be changed but your guide worked perfectly!

I just did all of these to my OP6T too without success in the last check UnifiedNlP do not have Location to test Geocoder, but I have managed to get to work everything else.
This with the tomato debloater makes my privacy and security concerns relieved.

Anyways,
THANKS A LOT DoR3M3:D
 

DoR3M3

Senior Member
Feb 17, 2018
1,281
384
Portwenn
I just did all of these to my OP6T too without success in the last check UnifiedNlP do not have Location to test Geocoder, but I have managed to get to work everything else.
This with the tomato debloater makes my privacy and security concerns relieved.

Anyways,
THANKS A LOT DoR3M3:D

For "UnifiedNlP do not have Location to test Geocoder," If you followed everything in the guide correctly, then these cmds should also do the trick on the OP6T.

This is a permissions issue and these should fix it...

Code:
adb shell
su
pm grant com.google.android.gms android.permission.ACCESS_COARSE_LOCATION
pm grant com.google.android.gms android.permission.ACCESS_FINE_LOCATION
 

froman753

Member
May 9, 2017
12
1
I believe that Xposed does support Pie now, correct? Has this guide been updated yet to reflect that change? I'm eager to try this on my Oneplus 5 with the latest version of OxygenOS.
 

Adolamin

Senior Member
Oct 26, 2017
82
22
I'm going to have a shot at this on my op7pro running Android 10 OOS. Is it possible to just use the Magisk module MicroG Installer. I'd imagine you'd have to fully delete gmscore (not debloat it with .replace file)

Edit: I got MicroG working on OnePlus 7 Pro running Oxygen OS 10.3.0
I mounted system in TWRP and perm deleted GmsCore and Services Framework, then flashed the Magisk MicroG Installer. Debloated everything else, and bam.
Idk why but MicrogG cant access location all the time, only "while app is in use". I cant change this for some reason
 
Last edited:

bluegrass55

Senior Member
Sep 29, 2011
636
91
London
I'm going to have a shot at this on my op7pro running Android 10 OOS. Is it possible to just use the Magisk module MicroG Installer. I'd imagine you'd have to fully delete gmscore (not debloat it with .replace file)

Edit: I got MicroG working on OnePlus 7 Pro running Oxygen OS 10.3.0
I mounted system in TWRP and perm deleted GmsCore and Services Framework, then flashed the Magisk MicroG Installer. Debloated everything else, and bam.
Idk why but MicrogG cant access location all the time, only "while app is in use". I cant change this for some reason

Could you please post a step by step guide to how you did this? Just updated my 5T and went through the steps as per dev instructions. It works in the end but is very time consuming even though I've done it multiple times in the past.

Thanks.
 

CaptainFisch

New member
Jun 2, 2020
3
1
I tried the vdex commands on my Redmi Note 5 and Miui Global 11.03.
after

vdexExtractor -i framework/oat/arm64/services.vdex --ignore-crc-error

it should be services_classes.dex but i get the file services_classes.cdex

so what now? I tried to rename it but that does not work.

Edit: Ok i got it. I had to convert the cdex file with an other tool and than all worked.

Hope i will get GPS (UniefiedNlP) and connection to google servers to run
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 16
    microG


    I am no longer working on this, or updating any information here! This was created back in the day of Oreo.

    I've personally moved on and I'm presently using /e/ which you can see the info here and get the ROM for OP5T.


    /e/OS documentation - OnePlus 5T

    As of this post edit on 10/20/22 I'm using '
    e-1.4-r-20220922220394-dev-dumpling' and /e/ uses microg. It runs quite nice, so check it out!


    microG is Freedom, Security & Privacy from Google, by replacing the Google Services & Framwork, also improving phone and battery performance!

    This guide shows you the steps needed to Deodex, Signature Spoofing, Debloat Gapps and install microG.

    This is not just a OxygenOS guide, this works on any ROM with Gapps baked in, lack signature spoofing, or doesn't come with microG installed! The only areas specific to OxygenOS is using Xposed and the microG permissions, both which might not be needed on other ROMs, everything else you follow in this guide for any ROM.

    The information is here to give you a complete understanding of the process, it's just the Android way is all! Without the information and only steps to follow, there are a lot of areas you could experience problems, and not know how to deal with them.

    There is no shorter, or easier way to accomplish this, if there was I would of made a smaller quickie guide, this is the way it works in Android! If you want to do microG you're going to have to read, it looks like a lot but it's not, once you've done it a few times!

    Remember, the information is here to help you!

    Pie is not supported in Xposed, and at the present moment OxygenOS requires Xposed.

    You need to WIPE and install the ROM and start fresh, otherwise it can get complicated, you've been warned! You also need to follow the steps exactly, do not deviate, the process is picky, that is why the steps are to be done this way!

    When you go online for the first time do not allow any Google updates! Do not install any Gapps, or anything, other than what is mentioned in this guide!

    Keep online time limited to the steps needed in this guide. Connect only to accomplish what is needed and keep an eye out for Google updates and cancel them!

    I highly recommend making TWRP backups every step of the way, in case of a mistake, then you don't have to start all over!

    Once you get the steps down, the entire process takes around 30-60 minutes to complete!

    Each of the RED sections are the STEPS, just read and follow them one by one!


    DEODEX OR FAKEGAPPS


    For stock or custom roms that don't support signature spoofing, you can either deodex the rom with the VDEXEXTRACTOR steps and use the Nanodroid-patcher to apply signature spoofing, or use the Xposed FakeGapps module which enables signature spoofing support.

    If you use an application called "Signature Spoofing Checker" with the Xposed FakeGapps module installed and it shows the support disabled, ignore it. FakeGapps is working, it's a bug in the "Signature Spoofing Checker". 5.1.5 shows Green/Enabled and 5.1.6 shows Red/Disabled.

    If you use the Xposed FakeGapps module skip to the [MAGISK] SYSTEMLESS XPOSED section! If you know how to compile for vdexExtractor, there is no reason to use FakeGapps!


    VDEXEXTRACTOR

    This method shown below is a simple Deodex that NanoDroid uses. SuperR's Kitchen also uses vdexExtractor, but instead does a Full Deodex. The NanoDroid method is simpler, without the need for SuperR's Kitchen. I plan on eventually adding a method of using SuperR's Kitchen to the guide at some point in time.

    This NanoDroid Deodex method shown here is good, it's just not a Full Deodex, it hurts nothing, it's not better or worse, just different! So, if you aren't concerned with needing/wanting the full customization capability that a Full Deodex offers, or you have no idea of what is being said here, then don't worry!

    ROMs that are either in a state of VDEX or ODEX need to be DEODEX in order to apply Signature Spoofing! So depending on the ROM, check to find out which state it is in, and then you will apply either the VDEX or ODEX methods outlined in this guide; https://gitlab.com/Nanolx/NanoDroid/blob/master/doc/DeodexServices.md

    In this guide for OxygenOS you will be following the VDEX method. OxygenOS follows the VDEX method because it has both .odex and .vdex files in the system.

    You will have to compile the vdexExtractor source on either Windows, MacOS, or Linux, this guide doesn't cover compiling.

    At the end of this section where you download vdexExtractor on GitHub, under the Dependencies section being mentioned there, this is a brief explanation of that information to help get you started.

    This is only the basics explained to help get you now moving in the right direction for compiling. If you have any other concerns or questions please search on Google, there is a wealth of information online to help you.

    1. macOS users will need to compile by installing Homebrew https://brew.sh/ and adding the dependency zlib-devel as brew install zlib-devel. Then you should be able to use the terminal in macOS to run the command, ./make.sh gcc or sh make.sh gcc to now compile.

    2. For Linux users you need to make sure you have libz-dev installed and then at a terminal run either, ./make.sh gcc or sh make.sh gcc to compile.

    3. For Windows users you'll need to install cygwin, https://www.cygwin.com/ cygwin helps to give you a Unix/Linux like build environment. Make sure to install zlib-devel from the cygwin installer, it should be listed under the Devel section which you click it so it changes from the word Default to Install, if you don't see zlib-devel listed there, then search for it. There is a lot of information online about installing and using cygwin, hopefully this link below is still working fine for Windows 10 to help you setup the Cygwin Path to the Windows Environment Variable, to make it easier to use the command prompt to compile from. In Windows you'll also run the commands, either ./make.sh gcc or sh make.sh gcc to compile.

    Install Cygwin and How to Use Linux Commands in Windows with Cygwin
    https://www.howtogeek.com/howto/41382/how-to-use-linux-commands-in-windows-with-cygwin/

    If compiling is a problem you can always use the Xposed FakeGapps module, but it's best to DEODEX/PATCH the ROM!

    Learn to compile, you'll be better off for it in the long run, switch to Linux it makes the process of compiling a lot easier than any other OS.

    Be sure to look at the vdexExtractor Github for basic compile information, where you'll download the source; https://github.com/anestisb/vdexExtractor


    NANODROID PATCHER

    Download the NanoDroid-patcher; https://xdaforums.com/apps/magisk/module-nanomod-5-0-20170405-microg-t3584928

    Download from Stable Download (Nanolx) - As of to date it's version NanoDroid-patcher-20.2.20181122.zip


    DEODEX SETUP

    Boot to TWRP and mount the /system read-write.

    Once you have mounted the /system in TWRP run these commands on your computer to deodex!


    DEODEX COMMANDS
    Code:
    adb pull /system/framework framework
    
    cp framework/services.jar services.jar-backup
    
    vdexExtractor -i framework/oat/arm64/services.vdex --ignore-crc-error
    
    mv framework/oat/arm64/services_classes.dex classes.dex
    
    zip framework/services.jar classes.dex
    
    zip -j framework/services.jar classes.dex
    
    adb push framework/services.jar /system/framework
    
    adb shell
    
    chmod 644 /system/framework/services.jar
    
    chown root:root /system/framework/services.jar


    SIGNATURE SPOOFING

    Unmount the /system read-write - TWRP > Mount > uncheck System

    Install the NanoDroid-patcher in TWRP. (This takes around 10 minutes!)

    If you did the deodex correctly, when flashing NanoDroid-patcher it will say Deodex.

    When the patch has completed reboot the phone.


    [MAGISK] SYSTEMLESS XPOSED

    Xposed does not pass SafetyNet!

    Download [Magisk] Systemless Xposed - XposedInstaller_3.1.5-Magisk.apk; https://xdaforums.com/xposed/unofficial-systemless-xposed-t3388268


    MAGISK ROOT

    Boot to TWRP and install Magisk to root your phone.

    Reboot the phone and update Magisk.


    MAGISK MODULES

    Do not reboot until you have installed all three modules!

    Install the Xposed Framework (SDK 27) - For Xposed to install, Systemless Xposed and Magisk need to be the only two things first installed in the rom!
    Install the Debloater (Terminal Emulator) - Debloats the phone Systemlessly!
    Install the F-Droid Privileged Extension - Read about it here; https://f-droid.org/en/packages/org.fdroid.fdroid.privileged/

    After installing these three modules reboot your phone!


    XPOSED MODULES

    Open Xposed while connected online, it should be displaying in Green! If it is Red you might not of followed the steps correctly, especially the part about doing this on a "Fresh Clean ROM", and following the guide step by step.

    Install FakeGapps if you did not deodex the rom, and then apply the signature spoofing NanoDroid-patch!

    The XposedGmsCoreUnifiedNlP module will be installed later with microG, mentioned in the MICROG section!

    If you installed FakeGapps, go to the Modules section and check the module to enable it, then reboot the phone.


    F-DROID

    You have basically 3 choices for applications; Aurora Store, F-Droid, Yalp Store.

    For now I recommend you install F-Droid, download from https://f-droid.org/en/

    After installing F-Droid go to Settings, toggle on Expert mode, make sure Privileged Extension is checked, close and reopen F-Droid and then update F-Droid if a new version is available!

    You'll need a terminal emulator in Android because Debloater (Terminal Emulator) runs from the command line, it doesn't have a GUI. I recommend using Termux, it's a very powerful terminal emulator with many features.

    Search for an install Termux!


    DEBLOATING APPS SYSTEMLESSLY

    Do not debloat the Google Play Store if you plan on using it!

    Do not create/add a Google Account, it will only get removed when you debloat out Google, instead wait to the last section I WANT MY GOOGLE & STAY PRIVATE TOO, and add it after you have installed and setup microG!

    If you want to keep some Gapps that's your choice! Be sure to run any Gapps that you want to keep before debloating. This is not always the common situation where you need to run Gapps before debloating, it's typically rare, but some odd applications will have a hard time working with microG if this isn't done. For applications you are not sure of, be sure to run them, especially applications that use Location, such as OnePlus Weather and the Camera, etc., before debloating!

    Make sure you are connected online when you run Termux for the first time.

    With Termux running, at the command prompt type su for superuser access and grant root access.

    Type debloat and you'll remove from 1 - System Apps & 2 - System Priv-Apps.

    Type the numbers with spaces in between for the applications you are debloating, as an example; 15 16 17.

    When you have the applications typed in and you are ready to debloat, tap enter.

    For the best Gapps Free experience debloat all of these;

    Android Setup
    Calendar
    Chrome
    Drive
    Duo
    Gboard
    Gmail
    Google
    Google Backup Transport
    Google One Time Init
    Google Partner Setup
    Google Pay
    Google Play Movies
    Google Play Music
    Google Play Services
    Google Play Store - (Do not debloat if you're going to use!)
    Google Services Framework
    Market Feedback Agent
    Maps
    Photos

    On a note of Privacy, there's information online in regards to OnePlus and Analytics/Data Mining as it relates to the below applications.

    I highly recommend that if you're serious about privacy to do your own research and judge for yourself, but if you're asking me I debloated all of them!

    BugReportLite
    EngSpecialTest
    FactoryMode
    Insight Provider
    LogKitSdService
    OnePlusLogKit
    Oneplus System Service
    RfToolkit

    After debloating you are suppose to reboot your phone for the changes to take effect!

    If you debloated Chrome, make sure you update the Android System WebView in either the Aurora Store or Yalp Store, after you've completed the installation of microG!

    Make sure you debloated Gboard, be sure to install another keyboard before rebooting! I recommend installing AnySoftKeyboard from F-Droid!

    If you make any mistakes, you have the option to reinstall applications!

    Reboot the phone...

    If any updates occurred, after debloating some Gapps might still appear in the system. These now turn into User-Installed applications, so either in the Settings > Apps > Application List, you'll have the option to uninstall, or if the application is in the App Drawer, you can now uninstall it from there!

    If the Google Play Services is listed in the phone but no option shown to uninstall, follow the GMS PROBLEMS section! Regardless of what you see or don't see in the Application List be sure to still follow the GMS PROBLEMS section!


    GMS PROBLEMS

    Before installing microG you need to make sure this GMS directory com.google.android.gms is out of the system!

    Run this command;
    Code:
    adb uninstall com.google.android.gms
    If com.google.android.gms exists and you were able to remove it, you'll see this reply; Success

    If you see a lot of output with this line, then you have no changes or updates installed, there's nothing to remove;

    java.lang.IllegalArgumentException: Unknown package: com.google.android.gms

    If com.google.android.gms exists and the Google Play Services is still active, you'll see this reply; Failure [DELETE_FAILED_DEVICE_POLICY_MANAGER]

    If the Google Play Services is still active you will have to manually remove com.google.android.gms.

    Run these commands;
    Code:
    adb shell
    su
    cd /data/data
    rm -rf com.google.android.gms

    If you run rm -rf com.google.android.gms and get this reply back; rm: databases: Directory not empty, just run the command over!

    Even if the command gave you a success response, or unknown package, be sure to visually check for the presence of com.google.android.gms in /data/data!

    Exit and reboot your phone!

    If you had to manually remove com.google.android.gms, go to the Settings > Apps > Application List > Three Dots (Upper Right) > Show system apps. If you see the Google Play Services uninstall it, the option to uninstall should now be available. Click uninstall and wait a few seconds for a popup to appear and click ok to remove.

    microG creates com.google.android.gms, do not remove it after you have microG installed!


    DALVIK CACHE & CACHE

    Before installing microG, boot into TWRP and Wipe the Dalvik Cache and Cache!

    When done wiping reboot the phone back into the system.


    NANODROID-MICROG

    At the present moment it is better to use the NanoDroid-microG version! Official microG is not getting as much development!

    Visit the NanoDroid post on XDA;

    https://xdaforums.com/apps/magisk/module-nanomod-5-0-20170405-microg-t3584928

    Down from the Stable Download (Nanolx) link!

    If you use the NanoDroid-microG version, take the "FakeStore" "GmsCore" "GsfProxy" from the zip, look for them in the folders under /system/priv-app/ use the "GmsCore_NanoDroid" and "GsfProxy_NanoDroid" and be sure to rename them, and follow the MICROG steps below using these versions instead of the Offical microG!


    MICROG

    microG on stock Android sometimes take a little more effort with Gapps installed compared to custom roms without Gapps, but the process typically only involves dealing with the preinstalled Gapps and Google updates. Most of the time you only need to follow the GMS PROBLEMS steps outlined in the guide when running into problems.

    If you debloat the Play Store and then later reinstall it, make sure you do not have FakeStore installed, Play Store will not go back in with FakeStore installed!

    microG DroidGuard Helper is only required if you want to use applications that require SafetyNet or to test DroidGuard!

    The microG UnifiedNlP package at this point in time is not supported in OxygenOS, for this reason the XposedGmsCoreUnifiedNlP Xposed module needs to be installed!

    Open Xposed and install XposedGmsCoreUnifiedNlP, go to the Modules section, check the module to enable it!

    Android 7 (or later) needs to have microG installed to the /system.

    If you use the Official microG download FakeStore GmsCore GsfProxy! (It's higly recommened to use the Nanodroid-microG version!)

    FakeStore - (Only needed if you're not using the Play Store)
    https://github.com/microg/android_packages_apps_FakeStore/releases

    GmsCore
    https://github.com/microg/android_packages_apps_GmsCore/releases

    GsfProxy
    https://github.com/microg/android_packages_apps_GsfProxy/releases

    Rename all the APK!

    FakeStore.apk
    GmsCore.apk
    GsfProxy.apk

    Create theses directory names and place the APK in them!

    FakeStore
    GsfProxy

    GmsCore already has a directory in /system/priv-app!

    Debloater (Terminal Emulator) places a file .replace in all the /system/priv-app directories that you debloated.

    In GmsCore the contents of ".replace" is "Google%Play%Services", so that the Google Play Services apk doesn't populate the directory. If you were to remove or rename ".replace" and rebooted, you would see the actual Google Play Services GmsCore.apk in the directory!

    Do not touch these hidden ".replace" files!

    Because GmsCore already has a directory in /priv-app, copy the microG GmsCore.apk to your phone with a File Manager that gives you root access to /system/priv-app/GmsCore.

    Do not adb push GmsCore.apk in TWRP, it will only get removed when you reboot!

    Boot to TWRP and mount the /system read-write.

    Use this command to push the directories for FakeStore and GsfProxy. - (FakeStore is only needed if you're not using the Play Store)
    Code:
    adb push FakeStore /system/priv-app
    adb push GsfProxy /system/app
    Make sure /system is still mounted in TWRP, then > Advanced > Terminal.

    Run these commands to make sure you have the correct permissions! - (FakeStore is only needed if you're not using the Play Store)
    Code:
    chmod 755 /system/priv-app/FakeStore
    chmod 644 /system/priv-app/FakeStore/FakeStore.apk
    chown -R root:root /system/priv-app/FakeStore/FakeStore.apk
    
    chmod 755 /system/priv-app/GmsCore
    chmod 644 /system/priv-app/GmsCore/GmsCore.apk
    chown -R root:root /system/priv-app/GmsCore/GmsCore.apk
    
    chmod 755 /system/app/GsfProxy
    chmod 644 /system/app/GsfProxy/GsfProxy.apk
    chown -R root:root /system/app/GsfProxy/GsfProxy.apk

    Do not update microG through Aurora Store or Yalp Store, only update through F-Droid!

    If at any time there are any new updates, you'll need to follow the steps over for adb push, copying GmsCore, and the permissions for FakeStore - GmsCore - GsfProxy! Delete all the old APK first before copying and doing adb push!

    If you use the Official microG Open F-Droid, Settings, tap on Repositories and add in the microG repo; https://microg.org/fdroid/repo so you can keep microG updated!

    If you use NanoDroid-microG, in F-Droid, Settings, tap on Repositories and add in the NanoDroid-microG repo; https://nanolx.org/fdroid/repo/ so you can keep microG updated!

    Unmount the /system read-write and reboot the phone.


    MICROG SETUP

    Open F-Droid and search for microg. The Network-based Geolocation choices are, Deja VU - MozillaNlPBackend - Local GSM Location. It's good to just install all three, or experiment to see which works best for you, either alone or in combination. For address lookup and to also test Geocoder, install NominatimNlPBackend.

    Make sure WiFi, Mobile data, "Location ( Mode - High Accuracy)" are all turned on in the phone before opening microG!

    Open microG, you'll notice at the top it says Permission missing, tap on this, tap on the words REQUEST MISSING PERMISSIONS and ALLOW all of them!

    If your deodex went successful, or you went with FakeGapps, you should notice at the top System spoofs signature checked.

    You should now only see two check marks missing at the bottom for Location backend(s) setup and UnifiedNlP do not have Location to test Geocoder.

    Network-based location enabled should be checked if you didn't turn off Location in the Phone Settings.

    Make sure Battery optimizations ignored is also checked!

    To get Location working properly in microG, under Self-Check tap on Google device registration and toggle it ON.

    Google device registration needs to be ON, when signing up or logging into your Account, or the Play Store for the first time, afterwards it can be turned OFF if you don't need Location support! If at any time an application doesn't run, trying turning Google device registration back ON to see if it helps.

    Go to the phone Settings > Location and put the Mode on "High Accuracy".

    In the "UnifiedNlP Settings" configure the "Network-based Geolocation" backends you just installed!

    Under "Address lookup" for the NominatimNlPBackend, tap Choose Nominatim API Server and pick MapQuest! I recommend using MapQuest, you'll need to sign up for a free account at MapQuest to get an API key.

    https://developer.mapquest.com/

    When you get your key, tap on MapQuest Developer API Key and add it in.

    The MapQuest API key only allows 15,000 transactions a month!


    MICROG PERMISSIONS

    To get UnifiedNlP do not have Location to test Geocoder checked in microG, you need to add these two permissions.
    Code:
    adb shell
    su
    pm grant com.google.android.gms android.permission.ACCESS_COARSE_LOCATION
    pm grant com.google.android.gms android.permission.ACCESS_FINE_LOCATION
    After adding the permissions reboot your phone.

    If you go into the microG settings before it's updated the Location, you will still see UnifiedNlP do not have Location to test Geocoder unchecked. Go back out of Self-Check and wait a few seconds then check it again, sometimes you need to scroll up and down a few times too. After a few seconds your Location should be updated and everything should be checked.

    This time you'll see it says Geocoder provides address resolution from location checked. Also scroll up and down for a few seconds, and this time under UnifiedNlP status you should have 6 sections now checked.

    Over a period of time, depending on what you do, you might see UnifiedNlP do not have Location to test Geocoder become unchecked, if this happens just run the permissions over!


    I WANT MY GOOGLE & STAY PRIVATE TOO

    All of this just depends on your level of privacy and concerns in regards to Google!

    If you debloated Chrome, before you can add a Google Account in the phone settings through microG, you need to update Android System WebView!

    These steps below are only if you need paid applications through the Play Store! Free and paid applications can also be downloaded through Aurora Store and Yalp Store, F-Droid can only download free applications.

    If you want to stay away from Google, you can use your Google Account on either Aurora Store or Yalp Store. Some paid applications with their License Checks might not work without being downloaded through the Play Store, or if the Play Store isn't installed, you'll have to test this out with various applications to see how they work.

    Besides paid applications, system applications will also appear through Aurora Store and Yalp Store, so you can limit the time using the Play Store for privacy, and update everything through either Aurora Store or Yalp Store, possibly even paid applications too.

    Aurora Store and Yalp Store violates §3.3 of Google Play Terms of Service, so your account could be disabled, but as it's mentioned on the Yalp Store site, they've never heard of any real cases of accounts being disabled.

    https://github.com/yeriomin/YalpStore
    https://gitlab.com/AuroraOSS/AuroraStore

    To make this step of privacy work, you will need to create a Google account for the first time, because if you did it the normal way on your phone, then you have exposed your device, given up your carrier name, mobile or wifi ip address, geo location etc... If you signed up on a computer, depending on what you did, you might of also exposed yourself!

    If you want to create your Google account on a computer, be sure to cover your tracks, like using a VPN!

    If you need paid applications from the Play Store, create your Google account after you've done all the steps outlined in this guide for privacy!

    Before you follow the steps, make sure Location is off, WiFi is off, Mobile Data is off, and switch the sim card! You do not need an active sim card to use the Play Store! With dual sims, deactivate the good one, and activate the dead/spoofed one! Make sure the spoofed sim card is also the sim card set as the default for the Phone, text, mobile data!

    Follow these steps even if you are signing up through a computer, to make sure you are ready to sign into the Play Store on your phone you've prepared!

    Every time you sign into the Play Store on your device, if you want privacy with as little attention drawn to the account, then you need to always connect to the Play Store with all of the same phone settings, sim card, etc., otherwise you will get a new device added to the account.

    Make sure you never sign into a Google account using your real sim, wifi/mobile network IP, or Location on! Anything that can track you, make sure it's spoofed or off!

    For the best Privacy use a VPN that does not log, then sign into the Play Store over wifi using this VPN! As an example you can also use some throw away sim card that you paid for by cash that has no trail to you, but remember the Carrier Network does place you locally! If Geo Locality is a concern, use a VPN!

    It's also recommended to maintain the same network(s) and GEO location when signing into the Play Store!

    If at anytime you want to update, or get more applications, follow the steps over repeating the process!


    Here's a break down in the steps! - (1 - 4)


    1.
    You can sign up for the Google account on your computer, then add it into your phone, but don't forget to follow step #2 when you add the account in the device.

    2. When signing up or adding your Gmail/Google account on your device, use another sim card in your phone so the mobile network goes through a different carrier, or a spoofed sim card that doesn't work, or wifi over a VPN, Phone, text, mobile data all set on the spoofed sim card, Location is off! Make sure anything that can track you is off or spoofed!

    3. If you are either signing up, or logging into your Account on your device, make sure Google device registration is ON in microG! This also needs to be ON the first time you log into the Play Store!

    4. When you are done using the Play Store for the first time you can turn Google device registration OFF in microG, if you don't need phone Location! If at any time applications aren't working properly try turning Google device registration ON!

    Be careful with the Account and Play Store on the phone, that you don't access either of them with anything that gives up your identity, as you can see there are a few things you could forget!

    NANODROID PHONESKY

    If at anytime you have problems with the original Play Store, you can get Phonesky.apk from NanoDroid-microG, it's a patched version to work with microG. Download it from Stable Download (Nanolx), it's located in the /system/priv-app/Phonesky directory.

    https://xdaforums.com/apps/magisk/module-nanomod-5-0-20170405-microg-t3584928

    Copy Phonesky.apk with a File Manager to the Download directory.

    Boot to TWRP and mount the /system read-write.

    Rename the original Phonesky.apk in /priv-app to keep a backup, also so it won't run. Rename it like; Phonesky.bak - Phonesky.orig

    In TWRP copy the Nanodroid version to /priv-app/Phonesky.

    In TWRP > Advanced > Terminal, run this command to make sure you have the correct permissions on the Nanodroid version of Phonesky!
    Code:
    chmod 644 /system/priv-app/Phonesky/Phonesky.apk
    Unmount the /system read-write and reboot the phone.

    The Nanodroid version of the Play Store is now located in the App Drawer.

    If Privacy is a concern, when you are done using the Play Store you can go to Settings > Apps > Application List > Google Play Store - Tap Disable to stop the Play Store from running, then you can Enable it later when you want to run it again! You do not need to debloat the Play Store! You can also tap Permissions and disable all of them!

    Settings > Security & lock screen > Apps with usage access > Google Play Store > Permit usage access - Disable this for better privacy!

    That's all there is to accomplishing microG on OxygenOS, Stock Android ROMs, and Custom ROMs!
    >
    >
    >
    If this post helped you in any way, please press the THANKS button! :)
    3
    Excelent guide, I run microg about 3,5 years, now with oxygen the only thing i miss is signature spoofing but I didn't have any problem except of some messages eg when opening tapatalk. Is there any way to deodex on macos?

    Sent from my ONEPLUS 5T


    Everything is mentioned in these steps, please look them over again, you can always use FakeGapps...

    DEODEX OR FAKEGAPPS

    VDEXEXTRACTOR

    I made some changes to make it clearer. But if you went to the vdexExtractor Github, you would of seen mention of MacOS if you want to compile and DEODEX instead of FakeGapps.
    2
    Thank you for your time and effort with this detailed tutorial.

    I understand every step except for the VDEX bit. Can I bypass this part? I don't use Playstore but one app (BT sport) after some updates refuses to work without it. Even on Lineage microG.

    BT Sport wants the Play Store in order to work?

    For VDEX I mentioned it before, but this time I changed it to make it more noticeable.

    Look back up at ---> DEODEX OR FAKEGAPPS

    What computer OS you running?
    2
    Windows 8.1 Pro.

    Yes BT sport needs to feel the presence of Playstore to work. Even though I'm not logged into Playstore, full restriction using XprivacyLua and blocked internet access via AFWall+. When on dedicated Lineage 15.1 microG it used to work. But not anymore.

    Play Store is mentioned in the Guide, so if you need it, just follow these steps;

    I WANT MY GOOGLE & STAY PRIVATE TOO

    I would also suggest filing an Issue on the microG Github, maybe the microG DEVs will have some suggestions/ideas on how to do this without the Play Store;

    https://github.com/microg/android_packages_apps_GmsCore
    2
    Managed to install this via the Fake Gapps route but it failed the Signature Spoofing check via the app from Fdroid. Flashed the NanoDroid Patcher which fixed it.

    https://downloads.nanolx.org/NanoDroid/Stable/NanoDroid-patcher-19.1.1.20181103.zip

    For some strange reason I still have Faceunlock function even with all Google stuff uninstalled.MicroG self test has everything ticked and Fdroid is working.

    This was a test run on an already debloated stock 5.1.6 ROM. Will try again on a later date with clean fresh ROM as recommended. Looked into the Deodex thing again but still non the wiser on how to achieve it.

    The 5.1.6 OTA is available for me to download, and I checked it, and it's VDEX!

    Do you remember when you were installing the NanoDroid-patcher, at the beginning it said "Deodex"?

    See the attached image where it says; services.jar status: VDEX this is on 5.1.5 & 5.1.6 showing that the ROMs have not be DEODEX yet. It needs to say; services.jar status: DEODEX in order for the Nanodroid-patcher to work...

    I noticed too that the Signature Spoofing Checker shows "Disabled" in 5.1.6. microG shows the support, so it appears that the "Signature Spoofing Checker" has a bug and I'll remove it from the post until it can be fixed.

    BT Sports is complaining about the Google Play Services, which is not the Play Store. So as I mentioned, just follow the last step of the Guide for the Play Store and see if BT Store works, and if not, make the Issue at the microG GitHub for help.