ShizuStore

Redirect Guard

rdevz-ph

1.7 · GitHub

Download APK
Privacy Android 7.0+ 3 days ago Apache-2.0
240 ShizuStore
700 GitHub
21 Stars
1 MB Size

More about this app

Intercepts unwanted ad redirects and deep links to prompt before opening external apps, terminating redirected processes with Shizuku

Redirect Guard Icon

Redirect Guard

Platform Release Build Version Downloads Min SDK Target SDK Language Jetpack Compose Shizuku VirusTotal License

Warning

Redirect Guard uses Android Accessibility Service and Shizuku to detect unwanted app launches and immediately terminate redirected processes. Because Android window detection happens after an app begins to open, a redirected app may briefly appear on screen before being closed. While Redirect Guard includes battery optimization exemptions and health monitoring to stay active, aggressive device-specific battery savers may still restrict background services. Redirect Guard serves as a practical shield against intrusive ad redirects, not as a guaranteed security solution against malware.

Overview

Are you tired of ads instantly redirecting you to apps like Shopee or Lazada without your consent? What if you could use an Android app called Redirect Guard that asks for your permission before opening another app, giving you control over unwanted redirects?

Redirect Guard acts as a safety shield between your apps. When an ad, webpage, or link attempts to force-open an external application or deep link, Redirect Guard catches the redirect and gives you the choice to stay where you are or open the app.

Redirect Guard Banner

1 2 3 4
Redirect Guard Dashboard Redirect Guard Applications Management Redirect Guard Logs and Activity Redirect Guard Alert Prompt

Feature Preview

Redirect Guard Feature Preview

Download

Get it on GitHub Get it on ShizuStore

Note

If installation is blocked by Google Play Protect, this is normal for apps distributed outside the Google Play Store. It is recommended to install the app via ShizuStore, or tap "More details" and choose "Install anyway".

Tip

Want to test or verify the app functionality? Please use Redirect Tester (RedirectGuardTester-*-release.zip): An optional companion tool packaged as a ZIP archive to prevent app store indexers from mistaking it for the main app. Extract the ZIP to install the companion tester APK and verify Redirect Guard safely.

Features

  • Dedicated Setup Wizard: Guides first-time setup with an interactive checklist to verify requirements before entering the main dashboard, with one-tap configuration via Shizuku.
  • Permission Confirmation Prompt: Displays an alert asking whether you want to continue to the target app or remain in your current app, complete with a safety countdown timer.
  • Deep Link Interception: Stops unauthorized deep links from automatically loading before you grant permission.
  • Process Termination via Shizuku: Force-stops the target app process using Shizuku shell to terminate background tasks and cancel deep links completely.
  • Interception Modes:
    • Ask Confirmation: Shows a prompt with app icons and names so you can confirm or block each redirect.
    • Instant Auto-Return: Automatically terminates the redirected app immediately without displaying a prompt.
  • Smart Launcher and System App Whitelist: Distinguishes between accidental redirects and intentional user actions. Launching apps from your home screen, app drawer, recent apps screen, or system utilities is never blocked.
  • Dedicated Applications Management: Search, filter, and customize guard and whitelist settings for individual user and system applications, complete with automatic preset restoration and conflict prevention.
  • Guarded App Selection: Guard specific shopping and external apps using built-in presets, or turn on full protection to guard against redirects to any external application.
  • Activity Log: Keep track of intercepted redirects, showing timestamps, source apps, target apps, and actions taken.
  • Accessibility Service Health Checker: Automatically detects if Android has stopped or desynced the background accessibility service, allowing you to force stop the app to clear stuck states, enable it with one tap through Shizuku, or open system accessibility settings directly.

How It Works

  1. Detection: Redirect Guard monitors window transitions using Android Accessibility Service.
  2. Analysis: When a transition to a guarded app occurs, Redirect Guard checks the source. If the launch came from an ad, webpage, or external app rather than your home screen launcher or system UI, it is identified as an unauthorized redirect.
  3. Interception: Redirect Guard terminates the target app process using Shizuku shell to abort deep link execution.
  4. User Choice: In confirmation mode, a dialog asks if you want to allow the app to open. If you select "Stay in App" or let the timer expire, you remain safely in your original application.

Prerequisites and Permissions

  • Accessibility Service (Required): Needed to detect when apps transition to another application.
  • Shizuku (Required): Needed to terminate redirected apps and stop persistent deep links.
  • Display Over Other Apps (Required): Needed to show the confirmation prompt over the originating app.
  • Notifications (Android 13+): Required for service status indicators and alerts.
  • Ignore Battery Optimizations (Optional): Helps prevent Android from stopping the background accessibility service.

Building and Installation

Prerequisites

  • Android Studio Ladybug or newer
  • JDK 17 or newer
  • Android SDK with platform 37

Build Steps

  1. Clone the repository:
    git clone https://github.com/rdevz-ph/RedirectGuard.git
    
  2. Open the project in Android Studio or compile using the Gradle wrapper:
    ./gradlew assembleDebug
    
  3. Install the application on your connected Android device:
    ./gradlew installDebug
    

Building the Tester Companion App

The repository includes an optional companion app in the :tester module. It allows you to test Redirect Guard safely without needing to visit ad-heavy websites or trigger accidental app redirects.

The tester companion app allows you to:

  • Test redirects to common shopping apps (Shopee, Lazada, TikTok, and Amazon) using both web URLs and custom app schemes.
  • Run a 3-second delayed ad simulator to test background detection.
  • Test full-screen video player playback with an automatic ad redirect after 3 seconds to verify that video progress is saved and restored when a redirect is blocked.
  • Check if Redirect Guard is installed and whether its accessibility service is active.
  • Test custom deep links and package intents.

To compile and install the tester companion app:

  1. Build the tester debug APK:
    ./gradlew :tester:assembleDebug
    
  2. Or install it directly on your connected device:
    ./gradlew :tester:installDebug
    

Frequently Asked Questions (FAQ)

Why was this app built if ad blockers exist?

Mobile browsers and ad networks frequently trigger non-consensual deep links that launch external shopping apps (such as Shopee or Lazada). While ad blockers stop some scripts, they cannot intercept native intent transitions once initiated. Redirect Guard acts as an immediate post-launch checkpoint, restoring user control over app switching.

How does it handle legitimate deep links?

Redirect Guard gives you full control through multiple layers:

  • Confirmation Mode: Shows an instant dialog displaying the source app, target app, and deep link URL. You can proceed to the target app with one tap or choose "Always allow redirects from this app".
  • Applications & Whitelist Management: You can whitelist trusted source apps or exclude specific target apps directly from the Applications tab.
  • Normal Launch Protection: The service detects standard home screen launcher intents so that opening your apps normally from your launcher or app drawer is never blocked.

Is this secure?

Yes, Redirect Guard is designed with strict security and privacy standards:

  • No Internet Access: The app does not request the INTERNET permission in its AndroidManifest. Android physically prevents the app from accessing the network or transmitting data.
  • 100% Offline: All event checks, logs, and settings operate entirely on your device with zero telemetry or data collection.
  • Fully Open Source: The entire codebase is open source and reproducible, allowing anyone to inspect the source code and verify build integrity.

Why is an app guarded but Redirect Guard does not trigger?

If an app is on your guarded list but redirects are not being intercepted, check the following:

  • Source App Whitelist: Verify that the source app where the redirect begins (such as Google Chrome) is not whitelisted in the Applications tab. Whitelisted source apps are completely exempt from interception.
  • Accessibility Service Health: Check that Android background battery restrictions have not stopped or killed the Accessibility Service. You can check service health on the dashboard and re-enable it if needed.

Privacy Policy

Redirect Guard for Android operates completely offline. It does not collect, monitor, or transmit any personal data. You can read the full policy at Privacy Policy.

License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

Close

How Shizuku is used

Can block unwanted ad redirects by force-stopping apps and revealing deep links via `am force-stop` and `dumpsys activity` through Shizuku

This is an AI-assisted analysis of Shizuku-related usages in the app's public source code. It is best effort, so it may not catch every single usage.

How this app uses Shizuku

Redirect Guard uses Shizuku to stop unwanted ad redirects and apply its required system settings without manual setup.

  • Stop redirect targets: when an unwanted app opens from another app, it is immediately terminated with the am force-stop shell command through Shizuku and the user is returned to the original app or shown a confirmation prompt.
  • Show redirect links: the deep link address that triggered the redirect is recovered with the dumpsys activity recents shell command through Shizuku and shown in the prompt and history.
  • Avoid false interruptions: normal launches from the home screen and switches between apps are recognized with the dumpsys activity recents and dumpsys activity activities shell commands through Shizuku, so they are not blocked.
  • Return to original app: after blocking a redirect, the previous app task is brought back to the front with task focus commands through Shizuku, preserving its state such as video or browser tabs.
  • Turn on protection: the accessibility protection service is enabled or cleared with the settings get and settings put shell commands through Shizuku.
  • Allow overlay prompts: the permission to show the redirect prompt over other apps is granted with the appops set and pm grant shell commands through Shizuku.
  • Allow notifications: the permission for interception alerts is granted with the pm grant and appops set shell commands through Shizuku.
  • Stay active in background: exemption from battery optimization is applied with the cmd deviceidle whitelist shell command through Shizuku.

Android APIs or commands used

  • am force-stop
  • dumpsys activity recents
  • dumpsys activity activities
  • settings get
  • settings put
  • settings delete
  • appops set
  • pm grant
  • cmd deviceidle whitelist
  • dumpsys deviceidle whitelist
  • am task focus
  • cmd activity task to-top
  • am stack to-top

Notable details

Terminating redirected apps requires Shizuku; without it the app can only warn. Returning to the original app falls back to a normal launch intent without Shizuku. Overlay, notification, battery and accessibility options can also be enabled manually in system settings.

Close

Changelog

What's new for version 1.7

Redirect Guard v1.7

What's New in v1.7

Added

  • Automatic Accessibility Toggle on Pause: Added an automatic toggle that disables the accessibility service via Shizuku when protection is paused, allowing banking apps to open without accessibility warnings, and re-enables it automatically when protection is resumed.

Optimized

  • Source App Task Restoration: Optimized source app restoration after an auto-kill by focusing the active task ID through Shizuku shell to preserve video playback and active screens without resetting child activities (#2).
  • Home Screen Focus Guard: Added a focus guard in the accessibility service to catch and redirect unwanted launcher focus back to the originating app after an auto-kill.

Note

If an app is guarded but Redirect Guard does not trigger, verify that the source app (such as Google Chrome) is not whitelisted in the applications list. Also check that the Accessibility Service has not been killed by Android background battery restrictions.

For full version history and previous release notes, see CHANGELOG.md.

Features

  • Deep link and app redirect interception using Android Accessibility Service
  • Choice between Confirmation Prompt and Instant Auto-Return modes
  • Reliable process termination for intercepted apps via Shizuku
  • Dedicated Applications screen with search and category filters (All, Guarded, Whitelisted, Shopping Presets, User Apps, System)
  • Automatic sync between global protection switches and individual application settings
  • Automatic conflict resolution between guarded and whitelisted applications
  • Smart shopping presets that adapt to installed apps on the device
  • Automatic exclusion for home screens, app drawers, and system components
  • Guarded app selection with presets for common shopping apps
  • Interactive confirmation dialog with safety timer
  • In-app live activity and debug log viewer with filter toggles and search
  • Floating Material 3 Expressive toolbar with integrated refresh action
  • Crash reporter with line preservation and direct GitHub issue filing
  • Shizuku integration for one-tap permission setup and app termination
  • Accessibility service health checker with one-tap enablement and stuck state clearing
  • Optional Redirect Tester companion app for testing redirects safely
  • Modern Material 3 user interface with dynamic theme support

Requirements

  • Android 7.0+ (API 24+)
  • Accessibility Service permission
  • Display over other apps permission (SYSTEM_ALERT_WINDOW)
  • Shizuku (running and authorized to terminate redirected apps)

Installation & Setup Guides

Download the APK from the assets below, install it, and grant the Accessibility Service, Display over other apps, and Shizuku permissions when prompted.

Note

Which APK should I download?

  • Release APK (RedirectGuard-*-release.apk) [Recommended]: Signed with the developer's official release key. Use this build if you want seamless in-place updates from GitHub in the future without needing to reinstall.
  • Debug APK (RedirectGuard-*-debug.apk): Signed with the default Android SDK debug key generated by automated CI builds. Useful for testing, but switching to a release build in the future will require uninstalling first due to Android signature verification.
  • Redirect Tester (RedirectGuardTester-*-release.zip): An optional companion tool packaged as a ZIP archive to prevent app store indexers from mistaking it for the main app. Extract the ZIP to install the companion tester APK and verify Redirect Guard safely.

Warning

If you use apps or games that rely on shortcuts or redirects to other apps (such as opening messages from notifications in Messenger, or games that require browser sign-in), do not enable Guard All External Apps. Keep that setting disabled and only add specific apps that cause unwanted redirects, such as shopping apps, to your guarded apps list.

Close

Permissions

8 permissions requested

  • android.permission.SYSTEM_ALERT_WINDOW
  • moe.shizuku.api.permission.SHIZUKU
  • android.permission.FOREGROUND_SERVICE
  • android.permission.FOREGROUND_SERVICE_SPECIAL_USE
  • android.permission.POST_NOTIFICATIONS
  • android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
  • com.rdevzph.redirectguard.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION
  • moe.shizuku.manager.permission.API_V23
Close

Sources

2 sources

1.7 Universal GitHub · com.rdevzph.redirectguard
Selected Download
1.3 Universal GitHub · com.rdevzph.redirectguard
Download