sn-00-x / aa4mg

Android Auto 4 microG
125 stars 6 forks source link

Android Auto Wireless support #13

Open MrNessuno opened 1 year ago

MrNessuno commented 1 year ago

I successfully connected the phone via USB cable but my car also support Android Auto wireless. I tried connecting with that, the car is listed in the Android Auto app, but when I try to connect from the car the android auto app keep restating without successfully connecting. Am I doing something wrong?

panoskpv commented 1 year ago

I tried as per the instructions and disabled all network data from aa and wireless not working. When I allowed mobile and background data wireless is working. Is the denial of data usefull? is the app connecting to google even if i use XPrivacyLua and restrict all?

knuxyl commented 9 months ago

When I try wireless connection, it says to continue on the Android Auto device but nothing shows up on the screen. I got rid of the android auto device but I am getting a new one to test turning on the data permissions, which were off throughout testing. I don't know what data is being sent to Google. Maybe hosts block will work for this? Idk.

bioluks commented 7 months ago

I tried as per the instructions and disabled all network data from aa and wireless not working. When I allowed mobile and background data wireless is working. Is the denial of data usefull? is the app connecting to google even if i use XPrivacyLua and restrict all?

I tried to do this but it isn't working. Restricting everything in XPrivacyLua doesn't do that much for telemetry, code obfuscation can bypass this as seen in the documentation.

When I try wireless connection, it says to continue on the Android Auto device but nothing shows up on the screen. I got rid of the android auto device but I am getting a new one to test turning on the data permissions, which were off throughout testing. I don't know what data is being sent to Google. Maybe hosts block will work for this? Idk.

I was able to get the same screen, like you said nothing happens on the car head unit. Whenever it's about to start Android Auto on the car my Android Auto phone app restarts all the time.

@sn-00-x is there anything we can do about this? I'm ready to do tests and provide you with logs, with different testing environments where possible.

knuxyl commented 7 months ago

Sorry i forgot to post back, but apparently whenever a VPN is in use Android Auto won't work. That's what was causing my issue. It has something to do with what Android is using for the internet. I have no idea what to do about it, it's apparently a known bug.

bioluks commented 7 months ago

Thanks for getting back so quickly, yes I have an app called TrackerControl in the background, which is like many a fake VPN that does domain/DNS blocking on a per-app basis. Never thought about disabling it alltogether.

So with a disabled VPN, on a custom ROM with microG, and allowed background traffic for Android Auto everything just works fine for you @knuxyl ?

knuxyl commented 7 months ago

Thanks for getting back so quickly, yes I have an app called TrackerControl in the background, which is like many a fake VPN that does domain/DNS blocking on a per-app basis. Never thought about disabling it alltogether.

So with a disabled VPN, on a custom ROM with microG, and allowed background traffic for Android Auto everything just works fine for you @knuxyl ?

yeah everything worked as expected and i didnt use the lsposed module because i dont have any apps that didnt show up that i wanted. youtube didnt show up with or without the module so i didnt use it.

im using lineageos 21 for microg on a pixel 5 and typically use a wireguard vpn. with vpn turned off everything worked as expected. from what i read its not this app causing the issue, it's android auto itself. im wondering if theres a way around this though with this app.

bioluks commented 7 months ago

@knuxyl can't thank you enough, it was the local VPN that was causing issues. Even when you are using a fake DNS blocker VPN (like TrackerControl in my case) your device gets a spoofed local IPv4 address, generally visible in the About phone > Device Identifiers section (mine was 10.1.10.1), that probably didn't play well with the network stack and expectations of Android Auto, which assigns a 10.XX.XX.XX local IP address since it's using something like Wi-Fi direct to connect to your headunit. Enabling background traffic and the exclusion from the VPN did the trick, if any VPN out there has split-tunnel support just exclude Android Auto and it should be fine. @MrNessuno this issue can be closed, I will update the documentation and the README accordingly.

panoskpv commented 7 months ago

And how about any data end up to Google?

bioluks commented 7 months ago

And how about any data end up to Google?

I have explained the options one can go for in Pull-Request #24 . You can read it here.

Basically if you allow traffic (which you have to for Android Auto wireless to work) it WILL contact external servers. Question is how much you want Android Auto wireless. You could experiment a bit with root firewall solutions like AFWall and disallow traffic from there while still allowing in Android settings. That could work, didn't test it myself though.

prgreadonly commented 1 month ago

Is wireless android auto working with this module and recent versions of Android Auto? I haven't been able to get it to work with my Sony VAX-AX6000 (which does support Wireless Android Auto) When I enable WIreless Android Auto on my OnePlus 11 (running LineageOS/microG), I get the notification on my phone to check my stereo to connect to android auto, but my stereo doesn't see my phone. I only ever see the icon for Android Auto when I have a USB cable connected. Could anyone let me know if WIreless Android Auto is working for them with aa4mg and if so, what's your setup?

bioluks commented 1 month ago

@prgreadonly If you went through the steps in the README skip step 5, since Android Auto Wireless uses Wi-Fi in the background to connect to the Headunit of your car. With step 5 applied you can only use USB connection.

Like mentioned in this thread as well, a VPN somehow messes with the networking configuration Android Auto needs. You can turn off your VPN or fully exclude Android Auto if the app you use has such an option.

That's why I published a pull-request trying to be more clear about this in the documentation but I guess this project will have no more activity for the future.

In some rare cases (some specific Volkswagen cars) the headunit was produced with a bug that prevents them from connecting wirelessly unless you force restart the unit. You can do that by holding down the power button until it reboots (10-15 seconds generally).

prgreadonly commented 1 month ago

Thanks for the additional info @bioluks ! I had already seen your documentation PR and followed those instructions, but I'm still not able to connect wirelessly to Android Auto. I'm going to do some more troubleshooting with my Oneplus 11 and XAV-AX6000 to try to determine if the issue i'm encountering is specific to aa4mg or if the issue is present when google play services installed instead of microG/aa4mg

Sony has a support article mentioning there are Android 14 issues with XAV-series radios, so I could be encountering this issue: https://www.sony.com/electronics/support/articles/00336853 It's not clear from the google thread whether this has actually been fixed. There seem to be a lot of people that have issues: https://support.google.com/androidauto/thread/248064519?hl=en&msgid=256210564

UPDATE: I was able to get Android Auto Wireless to work with my oneplus 11 running android 14 on the xav-ax6000 by following @bioluks 's steps. I had to ensure that I installed the Android Auto update using Aurora Store's root installer - once I reinstalled the Android Auto with the root installer, android auto wireless worked immediately. Awesome!