SriviharReddy/Back-Button

Back Button for Wear OS - Adds back button functionality to Wear OS devices, especially useful for OnePlus Watch users who want to remap hardware buttons.

★ 0Forks 0KotlinGitHub ↗Compare
accessibilityandroidonepluswear-oswearos

README

Back Button for Wear OS

A Wear OS application that adds back button functionality to Wear OS devices by utilizing an accessibility service.

Overview

This app allows users to remap a hardware button (or use the app directly) to perform a global back action on Wear OS devices. It's particularly useful for devices that may not have a dedicated back button or for users who want to customize their navigation experience.

Device Compatibility

This app was primarily built for the OnePlus Watch, which natively lets you remap the second button to any app.

Important Compatibility Notes:

  • Samsung watches: Directly let you assign a back action, so this app is not needed
  • Google Pixel watches: Don't let you remap buttons, so this app is useless on these devices
  • Other brands: Compatibility varies - some may work with this app, others may have native back button support

Features

  • Provides global back navigation on Wear OS devices
  • Uses Android Accessibility Service for system-level back actions
  • Remaps hardware buttons to perform back navigation
  • Simple, one-tap activation
  • No persistent UI - runs in the background

How It Works

  1. The app uses an Accessibility Service to perform global back actions
  2. When launched, the app checks if the accessibility service is enabled
  3. If enabled, it immediately performs a back action and closes
  4. If not enabled, it redirects the user to accessibility settings for one-time setup

Setup

  1. Build the APK with GitHub Actions or install a published artifact:
    • Push to GitHub and let the Build APK workflow generate artifacts
    • Or trigger it manually with gh workflow run "Build APK"
  2. Download the workflow artifact from GitHub and install it on your Wear OS device using one of these methods:
  3. Launch the app
  4. When prompted, go to the Accessibility settings
  5. Enable the "Back Button Service"
  6. Launch the app again, or trigger it with your remapped hardware button

Usage

Once the accessibility service is enabled, you can:

  • Launch the app directly to perform a back action
  • Remap a hardware button to launch this app for quick back navigation

OnePlus Watch Specific Instructions

For OnePlus Wear OS watches:

  1. Open the "Controls" section in Settings
  2. Open "Multifunction Button"
  3. Choose "Back" under "Press once to open"

Technical Details

  • Target SDK: 36
  • Minimum SDK: 30 (Android 11)
  • Built with Kotlin
  • Uses GLOBAL_ACTION_BACK from AccessibilityService

GitHub Actions

The repository includes .github/workflows/build-apk.yml to build both debug and release APKs on:

  • pushes to main or master
  • pull requests
  • manual dispatch

Useful gh commands:

gh workflow run "Build APK"
gh run list --workflow "Build APK"
gh run download --name back-button-apks

Permissions

This app requires the Accessibility Service permission to function, which allows it to perform global actions on the device. The permission is only used for the back navigation feature and no data is collected or transmitted.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributors

SriviharReddyvictoria-rose

Issues