A Magisk module for Android that automatically switches device profiles based on Android Auto connection state (wired/wireless) and intelligently manages device resources for in-car use.
- WIRED Mode: Activated when USB is connected AND Android Auto is running
- WIRELESS Mode: Activated when Bluetooth is connected to your car AND Android Auto is running
- IDLE Mode: Activated when not in car (battery saving mode)
- WiFi Control: Keep WiFi on/off in wired/idle modes (useful for VW Polo 6 compatibility)
- Mobile Data Management: Automatically enable/disable mobile data based on mode
- Bluetooth Control: Smart BT management in wired mode
- CPU Throttling: Limit CPU frequency when idle to save battery
- Charge Limiting: Reduce fast charging in wired mode to prevent overheating
- Battery Saver: Automatically enable when not in car
- Nova Launcher: Set as default launcher automatically
- π Auto Permissions: Automatically grants notification and location permissions to Android Auto, Waze, Google Maps, and Nova Launcher
- π΅ Audio Streaming: Stream audio from another device to car speakers via Bluetooth A2DP sink or WiFi hotspot
- User-configurable via
/sdcard/CarOS/config.env - Supports multiple car Bluetooth names (regex patterns)
- MAC address matching support
- Verbose logging for troubleshooting
- π See EXAMPLES.md for car-specific configurations
- Android device with root access
- Magisk v20.4 or higher
- Android Auto app installed
- Optional: Nova Launcher (for launcher switching feature)
- Download the latest release ZIP from the
rel/directory or [releases page] - Open Magisk Manager
- Go to Modules β Install from storage
- Select the downloaded ZIP file
- Reboot your device
After installation, edit the configuration file at /sdcard/CarOS/config.env:
π‘ Quick Start: See EXAMPLES.md for ready-to-use configurations for Audi, VW, BMW, Mercedes, and more!
# Car Bluetooth name(s) - supports regex (e.g., "Audi|VW|Volkswagen")
AUDI_BT_NAMES="Audi"
# Optional: Match by MAC address instead
AUDI_BT_MAC=""
# Wired mode: Keep Bluetooth on (1) or off (0)
ALLOW_BT_IN_WIRED=1
# Mobile data management
DATA_OFF_OUTSIDE=1 # Disable data when idle
KEEP_DATA_IN_CAR=1 # Keep data on in car (for Waze/Spotify)
# CPU throttling when idle (in kHz, e.g., 1516800 = ~1.5 GHz)
IDLE_MAX_CPU_FREQ=""
# Limit fast charging in wired mode (reduces heat)
LIMIT_QUICK_CHARGE_WIRED=1
# Set Nova Launcher as default
SET_NOVA_DEFAULT=1
# WiFi management
KEEP_WIFI_IN_WIRED=1 # Keep WiFi on in wired mode (VW Polo 6, etc.)
KEEP_WIFI_IN_IDLE=1 # Keep WiFi on when idle
# Automatic permission management
AUTO_GRANT_PERMISSIONS=1 # Auto-grant notifications & location to AA, Waze, Maps
# Audio streaming options (choose one or both based on what works for your setup)
ENABLE_BT_AUDIO_SINK=0 # Bluetooth A2DP sink (may not work if BT used for car audio)
ENABLE_WIFI_AUDIO_HOTSPOT=0 # WiFi hotspot for audio streaming (alternative to BT)
# WiFi hotspot settings (if using WiFi audio streaming)
WIFI_AUDIO_HOTSPOT_SSID="CarOS-Audio"
WIFI_AUDIO_HOTSPOT_PASSWORD="caros123"
# Verbose logging
VERBOSE=1Stream audio from another phone to your car speakers via Bluetooth or WiFi. Two methods available:
When enabled (ENABLE_BT_AUDIO_SINK=1), your CarOS device can receive audio from another phone via Bluetooth.
Limitation: May not work if Bluetooth is already used for car audio/calls (even in wired mode).
How to use:
- Enable in config:
ENABLE_BT_AUDIO_SINK=1 - Connect your CarOS phone to car via USB
- On the emitting phone:
- Go to Bluetooth settings
- Find and pair with your CarOS device
- Connect and play music
When enabled (ENABLE_WIFI_AUDIO_HOTSPOT=1), your CarOS device creates a WiFi hotspot that other devices can connect to for streaming audio.
Advantages:
- β Works even if Bluetooth is used for car audio
- β Higher quality audio streaming
- β Can work in WIRED mode when WiFi is not used by the car
How to use:
- Enable in config:
ENABLE_WIFI_AUDIO_HOTSPOT=1 WIFI_AUDIO_HOTSPOT_SSID="CarOS-Audio" WIFI_AUDIO_HOTSPOT_PASSWORD="caros123"
- Connect your CarOS phone to car via USB
- On the emitting phone:
- Connect to the WiFi hotspot (SSID: CarOS-Audio)
- Use an audio streaming app (e.g., SoundWire, AudioRelay, etc.)
- Stream audio to CarOS device
- Stream music from a passenger's phone to your car speakers
- Multiple people can share music during the drive
- Alternative to passing phone cables around
- Both methods work in WIRED mode only (USB connection to car)
- Does NOT work in WIRELESS mode (both Bluetooth and WiFi may be used by car)
- Automatically disabled when IDLE to save battery
- WiFi hotspot method requires an audio streaming app on the emitting phone
- Bluetooth method may not work on all devices (A2DP sink support required)
- Boot: The module starts automatically via
service.sh - Permissions: Automatically grants notification and location permissions to critical apps (Android Auto, Waze, Google Maps, Nova Launcher)
- Monitoring: Every 3 seconds, the module checks:
- USB connection status
- Bluetooth connection to configured car device
- Android Auto process state
- Profile Application: When state changes, applies appropriate profile:
| Profile | WiFi | Bluetooth | Mobile Data | CPU | Battery Saver | Charging |
|---|---|---|---|---|---|---|
| WIRED | Configurable | Configurable | Configurable | Max | Off | Limited* |
| WIRELESS | On | On | Configurable | Max | Off | Normal |
| IDLE | Configurable | N/A | Off* | Limited* | On | Normal |
*Configurable via config file
# Set version number
$VERSION = "0.2.4"
# Create release directory if it doesn't exist
New-Item -ItemType Directory -Force -Path "rel"
# Create the ZIP file (from project root)
Compress-Archive -Path "caros_config.sh", "module.prop", "post-fs-data.sh", "service.sh", "system.prop", "grant_permissions.sh", "META-INF" -DestinationPath "rel/CarOS_Profile_Switcher-v$VERSION.zip" -Force
Write-Host "Release created: rel/CarOS_Profile_Switcher-v$VERSION.zip"-
Update Version Numbers:
# Edit module.prop version=0.2.4 versionCode=5 # Increment by 1 description=... # Update changelog
-
Update Service Script Version:
# Edit service.sh (around line 257) log "CarOS Profile Switcher service v0.2.4 started"
-
Create ZIP Archive: Include these files/directories:
caros_config.shmodule.proppost-fs-data.shservice.shsystem.propgrant_permissions.shMETA-INF/(entire directory)
-
Name Convention:
CarOS_Profile_Switcher-v{VERSION}.zipExample:
CarOS_Profile_Switcher-v0.2.4.zip -
Save to Release Directory:
# Move to rel/ directory Move-Item "CarOS_Profile_Switcher-v0.2.4.zip" "rel/"
#!/bin/bash
VERSION="0.2.4"
mkdir -p rel
zip -r "rel/CarOS_Profile_Switcher-v${VERSION}.zip" \
caros_config.sh \
module.prop \
post-fs-data.sh \
service.sh \
system.prop \
grant_permissions.sh \
META-INF
echo "Release created: rel/CarOS_Profile_Switcher-v${VERSION}.zip"π‘ Tip: Check the FAQ.md for common issues and solutions!
View module logs:
adb shell cat /data/adb/modules/caros-switcher/log.txtadb shell cat /data/adb/modules/caros-switcher/state.jsonModule not working:
- Ensure Magisk is properly installed
- Check that Android Auto is installed
- Verify Bluetooth name in config matches your car
Bluetooth not detected:
- Enable verbose logging (
VERBOSE=1) - Check logs for Bluetooth dump
- Try using MAC address instead of name
WiFi/Data not switching:
- Some Android versions have restricted APIs
- Check logs for error messages
- May require additional permissions/SELinux changes
caros-profile-switcher/
βββ build.ps1 # PowerShell build script
βββ build.sh # Bash build script
βββ caros_config.sh # Central configuration defaults
βββ grant_permissions.sh # Automatic permission management
βββ module.prop # Magisk module metadata
βββ post-fs-data.sh # Early boot initialization
βββ service.sh # Main service loop
βββ system.prop # System property overrides
βββ README.md # This file
βββ CHANGELOG.md # Version history
βββ CONTRIBUTING.md # Developer guide
βββ EXAMPLES.md # Configuration examples
βββ LICENSE # MIT License
βββ .gitignore # Git ignore rules
βββ META-INF/ # Magisk installer
β βββ com/google/android/
β βββ update-binary # Installation script
β βββ updater-script # Magisk marker
βββ rel/ # Release builds (not in repo)
- v0.2.3: WiFi smart management + VW Polo 6 compatible + bug fixes
- v0.2.2: Nova Launcher default setting
- v0.2.1: Configuration fixes
- v0.2.0: Initial release with profile switching
See CHANGELOG.md for detailed version history.
- README.md - Main documentation (you are here)
- EXAMPLES.md - Car-specific configuration examples
- FAQ.md - Frequently asked questions
- CONTRIBUTING.md - Developer guide
- CHANGELOG.md - Version history
This project is licensed under the MIT License - see the LICENSE file for details.
- Vincent Airiau - GitHub
- Magisk community for the module framework
- Android Auto developers
Note: This module requires root access and modifies system behavior. Use at your own risk. Always test in a safe environment first.