microG + Android Auto fully working

Search This thread

dieudeglace

Member
Nov 11, 2021
23
11
dont know how you guys got all this to work, on my moto 5g ace (kiev) it says system is full with zero space left. So i cannot use the android auto addon unfortunately. Don't know what to do, as im using this phone to test stuff out to hopefully use it on my pixel 6 pro
 

Xurde78

Member
Jun 29, 2020
24
6
Xiaomi Poco F1
I

You have to install a few things: LsPosed, XPrivacyLua and its Pro-App.
Installing is a bit of a pain, you have to enable XprivacyLua in LsPosed, check AA there (you have to unhide system apps) AND in XPrivacyLua
It provides Hooks for 2 different AA versions. These have to be imported by the Pro Companion app and again activated in XprivacyLua.
To figure out the values that has to be changed in the hook check the AA.apk with
java -jar Bytecode-Viewer-2.11.2.jar and look for the string "isPackageAllowed3p". All credits go to "UnlockAA" who not only figured that out but alos helped me a lot with that.
hello everyone.
@starbright_ I have installed LsPosed and XPrivacyLua, but I am lost with Pro-App
Can you tell me "step by step" what steps should I follow now....
Thank you
 

starbright_

Senior Member
Apr 11, 2010
1,463
261
I've merged @byReqz's pull request (thanks for the great contribution!) and released a new version: https://github.com/sn-00-x/aa4mg/releases/tag/v0.3-a13
I am on LOS20+microG. I just stuck at the startup of AA (it required an update before by the way) - it keeps complaining about missing permission in Maps. But I enabled all permission and replugged a few times. I also get position in GMaps.
One thing. If I touch in settings/Google location services : nothing happened. Any idea?
 
Last edited:

starbright_

Senior Member
Apr 11, 2010
1,463
261
@sn00x & @byReqz and others:
This problem with green screen in AA requesting the location permission for maps (although they have been granted and maps shows location) can this be the reason?


Maybe it is possible to fix by your magisk module?

I use a phone with no SIM in it - at least for the initial test. I see no reason why it shouldn't work. But I don't pass that above mentioned section.

@byReqz @braga2 : In your readme.md for the Magisk Module:
Would it be more precise to add the need of installing GMaps too?
And I think there is no option to update AA as it is just a stub, right?

The updates needed to be done outside AA not out of AA, because you likely have to add them from Aurora store.
Correct?

One more point.
Even with activated developer settings/unknown sources - if I remember right you won't see other navigation apps.
 

byReqz

Senior Member
Jul 14, 2016
257
68
Can you provide the Google APP Stub?
You can get the prebuilt apk from here: https://github.com/dylangerdaly/Gcam-Services-Provider/releases .

I am on LOS20+microG. I just stuck at the startup of AA (it required an update before by the way) - it keeps complaining about missing permission in Maps. But I enabled all permission and replugged a few times. I also get position in GMaps.
One thing. If I touch in settings/Google location services : nothing happened. Any idea?
That used to happen to me when going from 11 to 12. Needed to update the base version. Are you sure there arent any leftovers or older versions installed?

@sn00x & @byReqz and others:
This problem with green screen in AA requesting the location permission for maps (although they have been granted and maps shows location) can this be the reason?


Maybe it is possible to fix by your magisk module?

I use a phone with no SIM in it - at least for the initial test. I see no reason why it shouldn't work. But I don't pass that above mentioned section.

@byReqz @braga2 : In your readme.md for the Magisk Module:
Would it be more precise to add the need of installing GMaps too?
And I think there is no option to update AA as it is just a stub, right?

The updates needed to be done outside AA not out of AA, because you likely have to add them from Aurora store.
Correct?

One more point.
Even with activated developer settings/unknown sources - if I remember right you won't see other navigation apps.
Try resetting data for AA and Maps and then granting everything manually before starting both the first time. I havent had this issue in a while (A13 was cleanly installed so also didnt have previous app data). Im not sure how that stackoverflow is related as we didn't develop any of the shipped apps. As they are from Google themselfs, its likely that there isn't an error there.

I wouldnt consider it important to let users know that they need to install Maps as the app will tell you anyways. It doesn't need to be installed in any special way. I can add it to the readme if thats desired tho.

The AA stub is just there to act as a properly preinstalled system app. You can just update it through Play/Aurora, updates will be installed as user and work fine.

AA will crash when trying to download apps as it cant open the Play store. You can just do that by hand using Aurora.

Unknown sources lets all apps show up that are on the device and support AA. It shouldn't impact navigation apps if they are already working with AA.
 

Xurde78

Member
Jun 29, 2020
24
6
Xiaomi Poco F1
Unknown sources lets all apps show up that are on the device and support AA. It shouldn't impact navigation apps if they are already working with AA.
Hello everyone,
On my Pocophone F1 with CrDroid 8.12 Android 12 + microg AA version 9.0630834 still couldn't show Osmand 4.2.7 in AA launcher, nor Sygic... none gps. Only Mpas and Waze, even if it's a mod.
To test, I directly installed the Waze mod 4.92 app, directly from the native installer and it shows up in the AA launcher, the app name shows up as "com.waze".
It may be that AA always shows Gmaps and Waze, regardless of where it is installed.
Absurd question, can an Osmand apk be modified so that the name "com.waze" appears...
 

Attachments

  • WhatsApp Image 2023-03-30 at 11.32.31.jpeg
    WhatsApp Image 2023-03-30 at 11.32.31.jpeg
    77.1 KB · Views: 9
  • WhatsApp Image 2023-03-30 at 11.32.30 (1).jpeg
    WhatsApp Image 2023-03-30 at 11.32.30 (1).jpeg
    54.9 KB · Views: 13
  • WhatsApp Image 2023-03-30 at 11.32.30.jpeg
    WhatsApp Image 2023-03-30 at 11.32.30.jpeg
    57.1 KB · Views: 10
  • WhatsApp Image 2023-03-30 at 11.32.32.jpeg
    WhatsApp Image 2023-03-30 at 11.32.32.jpeg
    41.3 KB · Views: 9

starbright_

Senior Member
Apr 11, 2010
1,463
261
On my Pocophone F1 with CrDroid 8.12 Android 12 + microg AA version 9.0630834 still couldn't show Osmand 4.2.7 in AA launcher, nor Sygic... none gps. Only Mpas and Waze, even if it's a mod.
Yes, for that another step is needed. So first step it to get AA running with microG - that what works for your already. With my new LOS20 I am still struggeling (see above). It's quite some pain get it working and testing - as you have to be in the car.

@byReqz I remember I did need a lot of trials while setting up my LOS19 few month back. At some point it works without knowing what exactly has been changed. Is the a special order needed? Update AA from stub to app before or after installing GMAPs? In most stock devices both is already pre-installed.
I am operating usually with AFWall+ enabled to aware google apps from "calling home". Not sure but at some point it is required to connect them to internet, right? Is there a need for GoogleSpeach to ever connect to internet? Is it required to download some data for offline speach synthesis?

A second step is required if you want to use any other than Google (Maps, Waze) Navigation system. The way I know is not as easy but works in my LOS19 device. I its the one you already asked me about. I would give some additional comments after setting up a new device. I didn't forget you, but first of all AA has to work on my side again.
Some other way might work with king-installer. ( https://inceptive.ru/blog/king-installer-no-root) I don't know how trustworthy it is. If I got it right it just fakes an app is installed by GooglePlayStore. That is what should be the reason why it is not listed in AA-Launcher. Didn't try that because the LSExposed method was already running.
 
Last edited:
  • Like
Reactions: Xurde78

starbright_

Senior Member
Apr 11, 2010
1,463
261
Again - Regarding Google Speach Services. After installation there are two ways to access it
* Settings/system/speach&input/speach. If I there push the "speach output" buttom it opens for a second and does a forced close.
The other is via:
* Setting/usage help/ Speach output . where happens the same as above.
Is that normal? Howto avoid?
Granting wifi access to speach services and download a language doesn't seem to help.
 

byReqz

Senior Member
Jul 14, 2016
257
68
@byReqz I remember I did need a lot of trials while setting up my LOS19 few month back. At some point it works without knowing what exactly has been changed. Is the a special order needed? Update AA from stub to app before or after installing GMAPs? In most stock devices both is already pre-installed.
I am operating usually with AFWall+ enabled to aware google apps from "calling home". Not sure but at some point it is required to connect them to internet, right? Is there a need for GoogleSpeach to ever connect to internet? Is it required to download some data for offline speach synthesis?
There shouldn't be any special steps necessary. In my experience, 13 has been the easiest with this setup. I just install the module, reboot and install Maps and Speech from Aurora. I used to also use a stub for Speech so im pretty sure its not actually necessary or _needs_ to connect to the internet. You should then just not have TTS (which is fine imo).

Are you on the latest MicroG version? I had to update mine when I went to 13. Im on v0.2.27.223616.
 

Xurde78

Member
Jun 29, 2020
24
6
Xiaomi Poco F1
king-installer didn't work for me, neither did aaease https://inceptive.ru/projects/aaease, I think they do the same try to simulate origin in GPlay
Also try "pm install -i com.android.vending /data/app//net.osmand.plus/base.apk" but it just shows normal "Fake Shop".... since I don't have G Play
I'm waiting for your instructions @starbright_, but don't worry, I'm not in a hurry, everything works fine for me with Maps offline navigation.
 

starbright_

Senior Member
Apr 11, 2010
1,463
261
@byReqz Have same microG version (istalled via magisk from nift4).
What location modules do you have installed in microG?
Google registration/Cloud messaging enabled?
No TTS, does it mean no voice output from MagicEarth or OSMAnd? I am pretty sure there is no ethernet connection needed once it is installed.
 

byReqz

Senior Member
Jul 14, 2016
257
68
@byReqz Have same microG version (istalled via magisk from nift4).
What location modules do you have installed in microG?
Google registration/Cloud messaging enabled?
No TTS, does it mean no voice output from MagicEarth or OSMAnd? I am pretty sure there is no ethernet connection needed once it is installed.
Mine is self-build NanoDroid but that should be the same. I use Deja Vu, Mozilla and Nominatim for location. Device is registered with GCM yeah.
I have no idea how OSMAnd or MagicEarth do TTS and I basically only use Spotify on AA but Google Maps will just be quiet if no SpeechServices are installed.
 

starbright_

Senior Member
Apr 11, 2010
1,463
261
Got AA installed now. Done everything from scratch, installed magisk-aa-module, G-stub, GMaps, Gpeech and update AA. Don't test GMaps. While plug phone to care it ask me for some permissions on car's screen and advised me to add GMaps to location apps. That was a new procedure to me that something happend right away on cars screen.

So I can check for 2nd part.
Install in Magisk the Zygisk-LSPosed Module. After reboot check for Notification and create a desktop icon. Install XprivacyLua via FDroid. and enable it in LSPosed.
About the XPrivacyLua pro : https://github.com/M66B/XPrivacyLua/blob/master/DEFINE.md
But what I see now - XprivacyLua and pro seems not to be supported anymore?
 
  • Like
Reactions: Xurde78

starbright_

Senior Member
Apr 11, 2010
1,463
261
I try to find the values for the hook fore a more recent AA for this solution:

Frankly speaking I failed to reproduce the finding of parameter for my own hook that I have posted in "issues" section. That's for a 8.5 and it is running, but I can't remember how It get this values. Looking into code I come to completely other values for class and method now?!?

So I would try another alternative.
Someone of you can either compile or explain howto compile that? https://gitlab.com/annexhack/king-installer ?
 
Last edited:

Rikj000

Senior Member
May 4, 2016
86
133
github.com
OnePlus One
OnePlus 2
Just released my forks + opened PRs! 🎉
They should help with bringing better Anrdoid Auto support on (LineageOS based) MicroG devices.
Enjoy!

AndroidAuto4MicroG - v0.4-a13
- Fork Repo
- Fork ReadMe
- Fork Release
- Pull Request (Status: Merged)
- ChangeLog:
  • BugFix: BlackScreens in apps
  • Feature: Added CoolWalk support
  • Feature: Added dependency stubs
  • Feature: Added Android Auto for phone screens
  • Docs: Updated ReadMe
King Installer - v1.3
- Fork Repo
- Fork ReadMe
- Fork Release
- Pull Request (Status: Merged)
- ChangeLog:
  • Added root installer method
  • Reworked UI
Edit: All my PRs are merged + the original developers published official releases! 🎉
 
Last edited:

starbright_

Senior Member
Apr 11, 2010
1,463
261
Just released my forks + opened PRs! 🎉
That just sounds great!
As @Xurde78 already reported (and I repeatet the test), the King installer doesn't seem to work (in terms of faking the installation source). I used one of the already released Magisk packages that works fine for Maps or VLC, but not for any other navigation app. Installing OSMAnd~ by KingInstaller showed me in Setting/Apps/OSMAnd~/Appstore: Installed by Kinginstaller ...and it is not listed in Launcher. I belive you that it works for you, but why that works for us? Do you have an idea? I am on LOS20 too.

Question: Do you see in the /settings/apps/xxx/app-shop really: Google Play Store?

Reading the full manual I see few difference:
* You install stubs and AA BEFORE installing the Magisk-AA-Module.
* You installed the stubs with King-installer too, but if that doesn't work with OSMand, why it should work with the stubs? Or does it more than fake installation source?
* You used Aurora root installation mode, while I used default (session installation?).
 

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    This is how you can use Android Auto with microG and connect your phone with your car.

    Prerequisites:
    Android 10+
    Newest microG core (https://github.com/microg/GmsCore/releases)
    A custom recovery to flash a zip file

    Let's begin:

    For Android Auto we'll use nikgapps Android Auto add-on and modify one file in the flashable zip.
    Download nikgapps Android Auto add-on here: https://sourceforge.net/projects/nikgapps/files/Releases/
    Dpending on your Android version, choose the correct Addons-(Q/R) folder, then, you want to download "NikGapps-Addon-10/11-AndroidAuto-date-signed.zip"

    Now open the downloaded package and open the folder "common". In there you'll find "nikgapps_functions.sh". This file needs to be modified as follows:

    Open this file and search for "is_on_top_of_nikgapps"

    Remove the following (this code checks if you have installed nikgapps core already, but since we don't want to install that, it must be removed):
    Code:
    is_on_top_of_nikgapps() {
      nikgapps_present=false
      # shellcheck disable=SC2143
      if [ "$(grep 'allow-in-power-save package=\"com.mgoogle.android.gms\"' "$system"/etc/sysconfig/*.xml)" ] ||
            [ "$(grep 'allow-in-power-save package=\"com.mgoogle.android.gms\"' "$system"/product/etc/sysconfig/*.xml)" ]; then
        nikgapps_present=true
      fi
      addToLog "- Is on top of NikGapps: $nikgapps_present"
      if [ "$nikgapps_present" != "true" ]; then
        abort "This Addon can only be flashed on top of NikGapps"
      fi
    }

    It should look something like this now:

    Code:
    .....
        else
          addToLog "- Failed to write $install_location"
          abort "Installation Failed! Looks like Storage space is full!"
        fi
      fi
    }
    
    # Check if the partition is mounted
    .....

    That's it! Now you can flash this zip with your recovery and you'll have fully working Android Auto!
    6
    I just created a Magisk Module that provides Android Auto for devices running microG on Android 11. I've made this mainly for myself, but wanted to share:

    Basically just install aa4mg-v0.1.zip as Magisk Module, reboot, optionally upgrade in Aurora Store, profit.

    But please see readme on github: https://github.com/sn-00-x/aa4mg
    5
    I've merged @byReqz's pull request (thanks for the great contribution!) and released a new version: https://github.com/sn-00-x/aa4mg/releases/tag/v0.3-a13
    5
    Til now I didn't hear of anyone get it working on A13.
    I did it. You need a A13 LineageOS-20.0 rom with signature spoofing patch. Here is my patch https://github.com/braga2/sigspoof
    Apply that patch and build as described in official instruction https://wiki.lineageos.org/devices/barbet/build instead of barbet use your device codename. I built for my bluejay.
    Burn the ROM.

    Install Google APP Stub. I built it from sources from here https://git.sr.ht/~dylanger/Google-App-Stub
    Install Mozilla UnifiedNLP Backend from F-droid.

    Then you have to install latest MicroG GmsCore and FakeStore from official github https://github.com/microg as a regular apps with forceQueryable flag enabled. I used such commands:
    adb install --force-queryable FakeStore-v0.1.0.apk
    adb install --force-queryable com.google.android.gms-223616052.apk
    Enable signature spoofing for both these apps and other required permissions.
    Enable Mozilla UnifiedNLP (Mozilla Location Service) in MicroG.
    Of course you can disable internet access for this app and for MicroG as well.

    Then reboot to LIneage Recovery and install 'android auto stub'. I used latest NikGapps-Addon-13-AndroidAuto from official sourceforge https://sourceforge.net/projects/ni...n-13-AndroidAuto-20220908-signed.zip/download
    I installed it manually without using scripts. Mounted system in recovery, then mounted /product in adb and put these 3 files using 'adb push': AndroidAutoOverlay.apk into /product/overlay, AndroidAutoStubPrebuilt.apk into /product/priv-app/AndroidAutoStubPrebuilt and com.google.android.projection.gearhead.xml into /product/etc/permissions
    Maintain correct permissions for files root:rw-r-r and for AndroidAutoStubPrebuilt dir root:rwx-rx-rx

    Also important! grep gearhed /product/etc/permissions/* and remove or comment all xml permission tags except our installed file(com.google.android.projection.gearhead.xml). I found it in privapp-permissions-google-p-lineage.xml and commented whole corresponding xml tag so it looks like this:
    Code:
        <!--privapp-permissions package="com.google.android.projection.gearhead">
            <permission name="android.permission.ACTIVITY_EMBEDDING"/>
            <permission name="android.permission.BLUETOOTH_PRIVILEGED"/>
            <permission name="android.permission.CALL_PRIVILEGED"/>
            <permission name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"/>
            <permission name="android.permission.COMPANION_APPROVE_WIFI_CONNECTIONS"/>
            <permission name="android.permission.CONTROL_INCALL_EXPERIENCE"/>
            <permission name="android.permission.DUMP"/>
            <permission name="android.permission.ENTER_CAR_MODE_PRIORITIZED"/>
            <permission name="android.permission.LOCAL_MAC_ADDRESS"/>
            <permission name="android.permission.LOCATION_HARDWARE"/>
            <permission name="android.permission.MANAGE_USB"/>
            <permission name="android.permission.MODIFY_AUDIO_ROUTING"/>
            <permission name="android.permission.MODIFY_DAY_NIGHT_MODE"/>
            <permission name="android.permission.READ_PRIVILEGED_PHONE_STATE"/>
            <permission name="android.permission.REQUEST_COMPANION_SELF_MANAGED"/>
            <permission name="android.permission.START_ACTIVITIES_FROM_BACKGROUND"/>
            <permission name="android.permission.UPDATE_APP_OPS_STATS"/>
        </privapp-permissions-->

    Well. Reboot system now and install latest Android Auto, Google Maps, Google TTS from Aurora Store (or any other source).
    Enable location permission for GMaps and all permissions for Android Auto. Internet access for Android Auto can be disabled.
    Disable USB-debug in Android developer menu.
    Reboot the phone.
    Cross your fingers and try to connect to head-unit.
    When AA asks for maps location permission just hit Cancel.
    If it does not connect - disconnect USB cable and clear storage for GMaps and AA and try again. It should work!

    ps. Google Translate online does not work. It throws https 403 forbidden error but without MicroG it works fine.
    Also GMaps works only english US language. I could not switch it to any other language even if phone language was ok. I guess the reason is the same 403 error, google bans the requests to their services by some headers. I plan to reverse-engineer and fix this ;)
    4
    I have got in running finally on LOS19+microG, including OSMAnd and other Navi-apps and Screen2Auto. It was a long way to go. I try to summerize it:

    You can start here:

    I want to do a shortcut and put a recent AA into this package. (84624324). It is not as easy just to change the app, you also have to extract the libs from app and change that, but also change the permission.xml. You get the required data out of Manifest, decode the app with apktool
    Installation as it is described in the link.

    What drives me nuts was the thing about permission. Starting it in the car I get short after start a green screen with request to set location permission to Maps (although it was given - and it even shows my position). Not sure but maybe it was some location setting in microG that has to be called first.

    The next thing is to get other Navis than Maps running. It sees it needs to be installed from Playstore, but I don't have it on my device. But this can be faked.
    You have to install a few things: LsPosed, XPrivacyLua and its Pro-App.
    Installing is a bit of a pain, you have to enable XprivacyLua in LsPosed, check AA there (you have to unhide system apps) AND in XPrivacyLua
    It provides Hooks for 2 different AA versions. These have to be imported by the Pro Companion app and again activated in XprivacyLua.
    To figure out the values that has to be changed in the hook check the AA.apk with
    java -jar Bytecode-Viewer-2.11.2.jar and look for the string "isPackageAllowed3p". All credits go to "UnlockAA" who not only figured that out but alos helped me a lot with that.

    Screen2Auto works without root. But I need to enable the Alternative Touch method to get feedback from cars screen.
    With this you can mirror your phones screen, so no need for an app that is ready for AA.


    Although the orginal work has done by others (linked) I spend some hours to figure things out and get it working. Hope that will help others too.