Skip to content

About

Switch Google account back to a designated one when a bluetooth device is detected or the tablet is docked.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Google Account Reset Automator

License: MIT Android 11+ Zero Internet Permission Latest Release

Does Gemini or Google Assistant on Android Auto keep answering as your work or school account? Maybe "Hey Google" in the car says it can't do that with a Workspace account, or your personal calendar, contacts and routines have gone missing. The Google app has quietly switched to a secondary account, and Android Auto offers no way to switch it back.

This app switches it back for you: when your phone connects to your car's Bluetooth, it opens the Google app's account switcher and picks your primary account, before you've pulled out of the driveway.

The app's dashboard: Accessibility Service status, primary account email, target car, and a Manual Trigger button Automated account switch demonstration

What it can and can't do

The app does the switch through an Android Accessibility Service, which is powerful, so here is exactly what it uses:

  • No internet access. The app doesn't request Android's network permission, so it can't send anything anywhere.
  • Only the Google app's account switcher. The Accessibility Service only listens to the Google app (com.google.android.googlequicksearchbox) and only taps through its account switcher. The one exception is Manual Trigger, which afterwards also taps Force stop on Android Auto's App info page so Android Auto picks up the account.
  • Stores two settings: your primary account's email and your car's Bluetooth name and address, on the phone only.
  • Open source: the code is here, and every release is built by CI from this repository and signed with the same key.

Known issue: Accessibility Service stops running

Occasionally, after the phone has been locked for a while, Android stops the app's Accessibility Service without restarting it, even though it is still switched on in Settings. Switches then can't run: the app shows Accessibility Service isn't running as a notification, and Enabled but not running on its dashboard. To fix it, go to Settings → Accessibility → Google Account Reset Automator, turn it off, and turn it back on.

To help prevent Android from killing the background service while the phone is locked, set the app's battery usage to Unrestricted (Settings → Apps → Google Account Reset Automator → Battery → Unrestricted). Some device makers (especially Samsung, Xiaomi, and OnePlus) aggressively kill background services; see dontkillmyapp.com for manufacturer-specific workarounds.

Overview

On BT connect or dock, the app automatically switches the Google app back to your configured primary account. The switch is driven by an AccessibilityService that taps through the Google app's own account-switcher UI — no root, no ADB pairing, and no clearing of app data.

Core Architecture

  • MainActivity.kt: Compose-based frontend to handle runtime Bluetooth permissions, configure the target vehicle and primary account email via SharedPreferences, show whether the Accessibility Service is enabled (with a link to Settings, since Android has no runtime prompt for it), and provide manual diagnostic execution.
  • AutomatorReceiver.kt: A manifest-registered broadcast receiver listening for BluetoothDevice.ACTION_ACL_CONNECTED and Intent.ACTION_DOCK_EVENT. It matches the connected device by Bluetooth MAC address against the saved target car, then starts the switch (or, if the Accessibility Service is off, shows a notification linking to its settings).
  • AccountSwitchAccessibilityService.kt: Launches the Google app and walks its accessibility node tree to open the account switcher and tap the row matching the saved primary email.

Install

Add to Obtainium

  1. Download the APK from the latest release, or tap the badge above to add this repository directly to Obtainium for automatic updates.
  2. Open it on your phone. Android will ask you to allow installs from that source (your browser or file manager) the first time.
  3. Follow the one-time device setup below. On Android 13 and newer, the Accessibility switch for an app installed this way is greyed out at first: open the app's App info, tap ⋮ → Allow restricted settings, then turn the service on.

Requires Android 11 (API 30) or newer.


Build & Environment Setup

Prerequisites

  1. Android Studio (Ladybug or newer recommended)
  2. Android SDK 36
  3. Java Development Kit (JDK) 17

Step 1: Clone and Project Initialization

Open the project folder inside Android Studio. Ensure your project level build.gradle.kts configuration aligns with standard Android Gradle Plugin (AGP) version dependencies.

Step 2: One-Time Device Setup

After installing the app:

  1. Set your primary account email and pick the target car from the paired Bluetooth device list.
  2. Enable the service under Settings → Accessibility → Google Account Reset Automator — Android has no in-app permission dialog for this, it must be granted manually.
  3. Set the app's battery usage to Unrestricted under Settings → Apps → Google Account Reset Automator → Battery so OEM task killers don't stop the Accessibility Service in the background.

About

Switch Google account back to a designated one when a bluetooth device is detected or the tablet is docked.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages