Skip to content

HonzaV/anti-tracker

Repository files navigation

Anti-Tracker

GPS, Bluetooth, WiFi, mobile data, and carrier signal — all of these can be used to track you. Take back control with Anti-Tracker.

Anti-Tracker is an Android app that lets you quickly disable device radios and tracking vectors with a single tap. It uses Shizuku for privileged service toggling without requiring root access.


Features

Service Toggle Auto Turn-Off In-Use Detection
Bluetooth ✅ Timer-based Connected devices (A2DP, GATT, Headset)
WiFi ✅ Timer-based Connected to a network
GPS ✅ Timer-based — (no reliable API)
Mobile Data ✅ Timer-based Active cellular connection
Carrier Signal ✅ (airplane mode)
  • One-tap toggling — enable or disable services directly from the main screen
  • Auto turn-off — automatically disable a service after a configurable idle timer (when no longer in use)
  • Shizuku integration — programmatic toggling via privileged shell commands, no root needed
  • Settings fallback — if Shizuku is unavailable, the app opens the relevant Android settings panel
  • Material 3 / Dynamic Color — modern UI with dark mode support

Installation

Prerequisites

  • Android 14 or newer (API 34+)
  • Shizuku installed and running (for direct toggling)

Install Anti-Tracker

  1. Download the latest APK from the Releases page
  2. Enable Install from unknown sources for your file manager if prompted
  3. Install the APK

Set Up Shizuku

Shizuku grants Anti-Tracker the ability to toggle radios programmatically without root. Without it, tapping a service card will open the corresponding Android settings screen instead.

Step 1 — Install Shizuku

Install Shizuku from Google Play or from GitHub releases.

Step 2 — Start Shizuku

Choose one of these methods:

Option A — Wireless Debugging (recommended, no PC needed, Android 11+):

  1. Go to Settings → Developer options → Wireless debugging and enable it
  2. Open Shizuku and tap Start via Wireless Debugging
  3. Follow the on-screen pairing instructions

Option B — ADB via PC:

  1. Enable USB Debugging in Developer options
  2. Connect your phone to a PC via USB
  3. Run: adb shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh

⚠️ Shizuku must be restarted after each device reboot (unless you use the Wireless Debugging method with the auto-start notification).

Step 3 — Grant Permission

  1. Open Anti-Tracker
  2. The Shizuku permission banner appears at the top — tap Grant Permission
  3. Approve the Shizuku authorization dialog

Once the banner shows Shizuku: Ready, direct toggling is active.


Usage

Toggling Services

Tap any service card to toggle it on or off:

  • With Shizuku running — the service is toggled instantly via shell commands
  • Without Shizuku — the relevant Android settings screen opens for manual toggling

The card icon color indicates status:

  • 🟢 Green tint = service enabled
  • ⚫ Dimmed = service disabled

Auto Turn-Off

For Bluetooth, WiFi, GPS, and Mobile Data:

  1. Tap the expand arrow (▼) on a service card
  2. Enable the Auto turn off when not in use switch
  3. Optionally set a timer (in seconds, minimum 1s, default 300s)

When enabled, the app monitors whether the service is actively in use:

  • Bluetooth — checks for connected devices across profiles (A2DP, GATT, Headset)
  • WiFi — checks for an active WiFi network connection
  • GPS — no reliable usage detection; auto-off triggers when timer expires after GPS is enabled
  • Mobile Data — checks for an active cellular data connection

If the service becomes idle (not in use), the countdown begins. When it expires, the service is automatically disabled.

Carrier Signal

Carrier signal toggling works by enabling/disabling airplane mode. This affects all radios simultaneously. Auto turn-off is not supported for this service.


Developer Guide

Tech Stack

Component Technology Version
Language Kotlin 2.0.21
UI Jetpack Compose (Material 3) BOM 2024.12.01
DI Hilt (Dagger) 2.53.1
Architecture MVVM + Clean Architecture
Annotation Processing KSP 2.0.21-1.0.28
Privileged Access Shizuku API 13.1.5
Serialization kotlinx-serialization 1.7.3
Build System Gradle (Kotlin DSL) 8.10.2
Android Gradle Plugin 8.7.2
Min SDK Android 14 API 34
Target/Compile SDK Android 15 API 35
Java Target 17

Project Structure

app/src/main/
├── aidl/com/antitracker/
│   └── ICommandService.aidl          # Shizuku UserService AIDL interface
├── java/com/antitracker/
│   ├── AntiTrackerApp.kt             # Hilt Application class
│   ├── MainActivity.kt               # Single-activity entry point
│   ├── model/
│   │   └── Models.kt                 # TrackingService enum, ServiceState, ServiceConfig
│   ├── data/
│   │   ├── ServiceController.kt      # Interface abstracting service operations
│   │   ├── SystemServiceController.kt # Real Android API implementation
│   │   ├── ShizukuServiceToggler.kt  # Shizuku lifecycle, permissions, shell commands
│   │   └── CommandService.kt         # Shizuku UserService (runs in privileged process)
│   ├── di/
│   │   ├── AppModule.kt              # Hilt module: ServiceController binding
│   │   ├── DispatcherModule.kt       # Hilt module: coroutine dispatchers
│   │   └── IoDispatcher.kt           # @IoDispatcher qualifier
│   └── ui/
│       ├── MainViewModel.kt          # Business logic, auto-off scheduling, state
│       ├── MainScreen.kt             # Compose screen with service grid
│       ├── components/
│       │   └── ServiceCard.kt        # Individual service toggle card
│       └── theme/
│           └── Theme.kt              # Material 3 theme with dynamic color
├── res/
│   ├── values/strings.xml            # All user-facing strings (i18n-ready)
│   ├── values/themes.xml             # Light theme
│   └── values-night/themes.xml       # Dark theme
app/src/test/
└── java/com/antitracker/ui/
    └── MainViewModelTest.kt          # Unit tests (14 tests)

Architecture

The app follows Clean Architecture with three layers:

┌─────────────────────────────────┐
│  UI Layer (Compose + ViewModel) │  MainScreen, ServiceCard, MainViewModel
├─────────────────────────────────┤
│  Domain Layer (Interfaces)      │  ServiceController interface
├─────────────────────────────────┤
│  Data Layer (Implementations)   │  SystemServiceController, ShizukuServiceToggler
└─────────────────────────────────┘
  • ServiceController — interface that abstracts all service operations (observe state, toggle, open settings, Shizuku availability)
  • SystemServiceController — production implementation using Android APIs + Shizuku
  • MainViewModel — manages UI state, handles toggle logic with Shizuku/settings fallback, schedules auto-off jobs
  • Hilt provides dependency injection throughout

Shizuku UserService Pattern

Anti-Tracker uses Shizuku's UserService mechanism to execute privileged shell commands:

  1. CommandService extends ICommandService.Stub() (AIDL) — not android.app.Service
  2. Shizuku instantiates it via reflection in its privileged process
  3. Shell commands (svc bluetooth disable, cmd location set-location-enabled false, etc.) run with elevated privileges
  4. No root access required — Shizuku provides the privilege escalation

Building

# Clone the repository
git clone https://github.com/HonzaV/anti-tracker.git
cd anti-tracker

# Build debug APK
./gradlew assembleDebug

# Run unit tests
./gradlew testDebugUnitTest

# Run lint checks
./gradlew lintDebug

Requirements:

  • JDK 17
  • Android SDK with API 35 installed
  • No device/emulator needed for unit tests

Testing

Unit tests use:

  • JUnit 4 as the test framework
  • kotlinx-coroutines-test (1.9.0) with runTest and StandardTestDispatcher
  • MainDispatcherRule to replace Dispatchers.Main in tests
  • FakeServiceController — test double implementing the full ServiceController interface

Run tests:

./gradlew testDebugUnitTest

CI/CD

GitHub Actions pipeline (.github/workflows/ci.yml) runs on every PR to main:

  1. BuildassembleDebug
  2. TesttestDebugUnitTest
  3. LintlintDebug

Test and lint reports are uploaded as artifacts on failure.

Coding Standards

  • Kotlin — follow official Kotlin coding conventions
  • Compose — stateless composables with state hoisting; rememberSaveable for UI state that should survive configuration changes
  • Coroutines — structured concurrency via viewModelScope; IO work on @IoDispatcher
  • i18n — all user-facing strings in res/values/strings.xml; use @StringRes references
  • License headers — Apache 2.0 header on all source files
  • Error handling — always rethrow CancellationException; fallback gracefully (Shizuku → settings)

Permissions

Permission Purpose
BLUETOOTH_CONNECT Detect connected Bluetooth devices (runtime permission)
ACCESS_WIFI_STATE Check WiFi enabled state
ACCESS_NETWORK_STATE Detect active network connections

No internet permission is requested. The app does not collect or transmit any data.


License

Copyright 2024 The Anti-Tracker Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

GPS, Bluetooth, WiFi, Data and carrier cellphone signal all those can be used to track you. Get rid of tracking with this Android App.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors