Skip to content

Android Auto as user app with media apps support on GrapheneOS / Android 14

Notifications You must be signed in to change notification settings

sn-00-x/android-auto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Android Auto as user app with media apps support on GrapheneOS / Android 14

This repository describes how to use my fork of GrapheneOS to add Android Auto support (with media apps support) to Android 14. However, the changes themselves don't rely on GrapheneOS, so it should be possible to make this work on a different OS with slight modifications. (If you are looking for an Android 13 patch, see here)

To make this run, you need to build your own rom. If you are instead looking for a simpler method to run Android Auto (that involves rooting your device), have a look at aa4mg

Build

I've forked some repositories of GrapheneOS and am going to apply my patches onto their stable releases. However, I will do this irregularly and don't commit to any schedules. It may sometimes take ages for me to release a new version. If you can't wait, you can always apply the patches yourself.

When there is a new version, you will find a new tag under platform_manifest tags. The tag name is always "-sn" appended to a valid GrapheneOS stable release. At the time of writing the current tag is 2023112900-sn

Simply follow the official GrapheneOS build instructions, but use my platform manifest instead of GrapheneOS's (replace TAG_NAME with a valid tag from platform_manifest tags):

repo init -u https://github.com/sn-00-x/grapheneos-platform_manifest.git -b refs/tags/TAG_NAME

That's it. Now you already would be able to install Android Auto as a user app (see below).

Optional:

  • If you additionally want to use Screen2Auto, you need to change it's package name and set it together with the sha256 hash of your signing cert in frameworks/base/core/java/android/app/compat/sn00x/AndroidAutoHelper.java ( PACKAGE_SCREEN2AUTO and SIGNATURE_SCREEN2AUTO). There is a helper script to do that. See Install Screen2Auto section below.
  • To be able to play content protected by DRM, such as Netflix, the device must be missing liboemcrypto.so. There's a helper script to disable it. Just run script/liboemcrypto-disable.sh after downloading proprietary files (That means: Run it after adevtool). Note that without liboemcrypto.so Widevine DRM will fall back to using L3 and Netflix will only stream in SD, but at least can be mirrored to the head unit.

Get Android Auto and Google Maps

  • Be sure to get Android Auto and Maps with correct signatures. When downloading directly from PlayStore (without having preinstalled stubs on your system), the apps may be provided with other signatures. However, those may checked and rejected when connecting to a car. Android Auto must be signed with eeb557fc154afc0d8eec621bdc7ea950 / 9ca91f9e704d630ef67a23f52bf1577a92b9ca5d. Get it e.g. here and then update to the latest version. Google Maps must be signed with 38918a453d07199354f8b19af05ec6562ced5788 / f0fd6c5b410f25cb25c3b53346c8972fae30f8ee7411df910480ad6b2d60db83. Get it e.g. here and then update to the latest version.
  • Go to phone settings and grant "nearby devices" permission to Android Auto
  • Connect to car, follow instructions
  • In case your device says there is no app to handle the connection, go to phone settings -> Apps -> Android Auto -> Additional settings in the app, then replug the device.
  • When an error regarding restricted settings is shown, go to phone settings -> Apps -> Android Auto -> click the three dots in the upper right corner -> Allow restricted settings
  • Continue setting up android auto
  • In case you run in any problems, replug device and/or try to go to phone settings -> Apps -> Android Auto -> Additional settings in the app -> click "+ CONNECT A CAR"

Get Google App and Text to Speech

Either get "Google" and "Speech Recognition & Synthesis" from PlayStore or use @SolidHal's G Apps stub and Speech Services stub from SolidHal/android-auto-stub.

Install Screen2Auto

Screen2Auto 3.7 can be obtained from https://inceptive.ru/projects/s2a/download

However Google has blacklisted Screen2Auto (after all it circumvents security restrictions of Android Auto). So you need to find a way to rename the package and sign it with your own cert. I will neither provide a renamed package nor provide any information on how to do this. I don't want Google to blacklist the version I use or change the way they blacklist apps.

After renaming and signing Screen2Auto, you must set it's package name and cert hash in AndroidAutoHelper.java. There's a helper script to do that. Just run e.g.:

script/screen2auto.sh your.package.name 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF

Assuming you have a renamed version of Screen2Auto, install it and only grant "System settings recording" when asked for permissions. Screen2Auto needs this permission to modify system settings to be able to e.g. rotate the screen. Leave the other permissions untouched. The patch in this repo handles granting "display over other apps" permission to Screen2Auto only while connected to a head unit.

Make the following changes in Screen2Auto:

  • Touch button settings -> Set Double tab to "Launcher"
  • Other settings -> Enable "Alternative touch" (but click cancel when asked for enabling Accessibility Service)

If touch does not work for you correctly, try to select another profile under Other settings -> Alternative touch

Patches used

frameworks/base:

packages/modules/Permission:

script:

Thanks

big thanks to everyone involved in the thread here microg/GmsCore#897

https://github.com/VarunS2002/Xposed-Disable-FLAG_SECURE

https://github.com/Magisk-Modules-Repo/liboemcryptodisabler

About

Android Auto as user app with media apps support on GrapheneOS / Android 14

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages