osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.56k stars 1k forks source link

Android Auto launcher not showing sideloaded OsmAnd for Android 11 and above #15400

Open polarbearing opened 1 year ago

polarbearing commented 1 year ago

There are several discussions where OsmAnd (plus or not) does not show in the Android Auto launcher when not installed directly from G. Playstore, i.e. installed from other stores (Fdroid, Aurora, Amazon) or sideloaded. The behaviour and workaround depend on the Android version, but in Android 11 and above it differs between VLC and OsmAnd. I compared an Android 7 and an Android 11 device. My problem is that currently I cannot test nightly builds of OsmAnd under AA in Android 11, and AA itself stops working in Android 7.


Android 7 with the last AA version that works under Android 7 Install without package installer name:

adb push VLC_for_Android_v3.3.0_armeabi-v7a.apk /data/local/tmp/tmp.apk
adb shell
$ pm install /data/local/tmp/tmp.apk                                                               
Success

Now the VLC is listed in AA, but does not show in the launcher We simply reinstall the same file and set the package installer name:

$ pm install -r -i "com.android.vending" /data/local/tmp/tmp.apk                                   
Success

Now the VLC also shows in the Launcher. The same way, OsmAnd used to work until summer 2022 in AA. It still shows in the Launcher.

Screenshot_20221002-104754_A7_AA7 listed sScreenshot_20221002-104946 A7 VLC_and_OSMAND_shown s

However now AA either throws timebombs, declaring things are too old, or throws communication error 14 claiming the clocks between car and phone were allegedly out of sync (which they are not) Screenshot_20220910-133233 Error14 c


In Android 11, apparently the package installer name is not needed anymore.

AA developer setting "Unknown sources" is ticked. When I untick that, the VLC remains listed in AA, but disappears from the Launcher. I tick it again, it is back. Not so for OsmAnd.

Screenshot_20221002-100830_A11 AA8 listed sScreenshot_20221002-111744_VLC_shown s

While it is known that VLC and OsmAnd are in different categories, media and navigation, I see no reason why Google would it make easier for media apps to be sideloaded than for navigation apps.

Related Discussions:

13514 OsmAnd+ (from Amazon App Store) does not connect to Android Auto

3391 Android Auto ... in OsmAnd

Fdroid: Osmand~: 4.1.9 doesn't show up in Android Auto microG + Android Auto fully working

vshcherb commented 1 year ago

That's quite unfortunate cause now we're stuck to Beta-Release cycle on Google Play

polarbearing commented 1 year ago

Unless we find the reason why a sideloaded VLC behaves different from a sideloaded OsmAnd.

vshcherb commented 1 year ago

You mentionned it's a media apps there were less strict and different perspective from the beginning. FOR a long time only waze and google was navigation only but vlc was already there

UnlockAA commented 1 year ago

Anyone who uses XPrivacyLua can unlock all apps for Android Auto with one hook. Currently I have created the hook for two versions. Maybe the other hooks are also interesting for you... https://github.com/UnlockAA/XPrivacyLuaHook

kevinmcmurtrie commented 1 year ago

Does the Play Store version support microSD card maps yet? I'm on F-Droid builds solely to avoid Google's monopolistic permissions rules.

michaelblyons commented 1 year ago

Root cause

The actual root cause is unclear, but Google is pretty explicit about what users should expect in Android Auto:

Important: Apps must meet the criteria listed in this page to qualify as an Android Auto or Android Automotive OS app on Google Play. Apps don't work with Android Auto unless they are installed from the Play Store or the ONE store.

Clearly this is not strictly followed for some apps, since people have had success sideloading messaging and media apps.

Workarounds

So far, I've only seen two major types of workaround.

Misrepresent the installer source

Since Google only allows this app when "installed from the Play Store," pretend that is the case. There are a couple ways to do this:

Patch Android Auto to allow your app

If your phone is rooted and XPrivacy is installed, @UnlockAA has a module that will do this.

starbrights commented 1 year ago

If I remember right this adb install trick works only on <=A11, right?

flo-at commented 1 year ago

If I remember right this adb install trick works only on <=A11, right?

I'm using Android 12 and I used adb to spoof the installer. In the app's details it says that it was installed from the Play Store. It doesn't show up in Android Auto though. So I guess you're right, unfortunately. :disappointed:

My phone is not rooted so I guess there aren't many options.

Thestroyer commented 2 months ago

Yeah, unfortunately it does not work in higher Android versions (Android 14). It's interesting though, it shows "installed from the Play Store" and still does not authorize it, how is it authorized then?

flo-at commented 2 months ago

Google recently changed the policy (https://developer.android.com/docs/quality-guidelines/car-app-quality). Now they don't mention that Android Auto only works for apps installed from the Play Store anymore. I cannot test it because I'm stuck at an older version of Android. If they still don't allow this, it probably violates the Digital Markets Act for installations in the EU.

Edit: here you can see the old version of their guidelines.

Thestroyer commented 2 months ago

Yeah AA works for some other apps (from other sources), but you need to enable developer mode...unfortunately maps are different and need to be installed from play store

souija-wtf commented 2 months ago

Looks like there is a difference between running on the SDK desktop-head-unit and a real car also. DHU is working with a nightly build perfectly well, but a real head unit isn't showing it at all, not even in the launcher config.

Running on GrapheneOS / Pixel 8 Pro / Sandboxed Google Play / APK installed OsmAnd. Not exactly standard, but something has changed recently on the AA side of things which breaks OsmAnd in this setup.

khimaros commented 1 month ago

i wonder if it is possible to launch an intent with adb, this might be an acceptable workaround for the lack of launcher icon.

starbrights commented 1 month ago

I think that one should help: https://github.com/sn-00-x/aa4mg

M0P commented 1 week ago

Hi everyone! I just wanted to share that I was able to get this to work by following this comment: https://gitlab.com/fdroid/fdroiddata/-/issues/2567#note_2042922228.

It uses https://github.com/chenxiaolong/AlterInstaller, and you'll need at least temporary root. I hope this helps!