A lightweight Android browser that can intercept links from other apps, track attempts per app, and block or redirect those attempts to another browser.
- Registers as a web browser for
http/httpsintents. - Logs how many times each app tried to open a link.
- Per-app action mode: allow, ask, or deny.
- Optional per-app redirect to a different browser.
- Optional global redirect for all apps without a per-app override.
- Built-in WebView browser for allowed links.
- Per-app link history with timestamped entries and optional source hints.
- Filter and sort the app list by attempts or name.
- App list includes installed app icons when available.
- Optional per-app allowlist patterns to restrict which URLs can open, including regex with a
re:prefix. - Allowlist entries can optionally redirect a matching link via
pattern => com.example.browser. - Optional redirect rules let matching links open in a specific app without blocking other URLs.
- Manual label overrides for app entries (including unknown sources).
- Add app rules proactively by selecting an installed app or entering a package name.
- Export or import the full policy list as JSON, including global redirect, link history, and label overrides.
- Import preview shows how many apps are in the pasted JSON.
- Copy policy JSON to the clipboard.
- Reset attempt counts per app or for all apps.
LinkInterceptorActivityreceives browser intents and attributes the source app via the referrer when available (with best-effort parsing when only a referrer string is provided).- Attempts and per-app link history are stored in
SharedPreferencesas JSON. - The app stores a short hint from the intent (action, categories, referrer fields, browser app id, package, and extra keys).
- Policies determine whether to allow, ask, deny, redirect, or open inside the built-in WebView.
- Global redirect applies when a per-app redirect is not set.
- If an allowlist exists for an app, only URLs containing those patterns are allowed. Prefix a pattern with
re:to treat it as a regular expression. Usepattern => packageto redirect a matching link. - Redirect rules use the same
pattern => packagesyntax but do not block non-matching links.
- Open the project in Android Studio.
- Ensure Android Gradle Plugin 8.2+ and JDK 17 are installed.
- Sync and run on a device.
- Optional: run
./gradlew tasksto validate the wrapper.
- Install the app.
- Set it as the default browser when Android prompts.
- Open the app to see the list of attempts.
- Set each app to
Allow,Ask, orDeny. - When asked, choose allow/deny once or set an always allow/deny rule.
- Use
Redirect toto forward links to a different browser. - Use
Global redirectto set a default browser when no per-app redirect is set. - Tap an app row to see its link history by timestamp and optionally set a custom label.
- Use
Export policiesto share settings orImport policiesto replace or merge them from JSON (preview shows app count). - Use
Reset countper app orReset all countsto clear attempt tracking. - Use
Copy policiesto put the JSON on the clipboard.
- Source app attribution depends on the caller providing referrer data or a browser app id/package extra; when it's missing, the app is shown as unknown.
- Link history is capped at 200 entries per app to keep storage bounded.
- Package visibility restrictions are handled via
<queries>in the manifest. - Minimum SDK is set to 19 for broad compatibility.
- Import merge behavior: attempt counts are added together, and imported action/redirect/allowlist settings override existing ones for that app. Imported link history is appended and capped.
- Regex allowlist safety limits: max 20 regex patterns per app, max 200 characters per regex.
- Redirect rules share the same regex safety limits as allowlists.
- The allowlist editor validates
re:patterns and will refuse invalid or too-long regex entries. - Blocked links close immediately with a short toast (no blocked screen).
- The external browser chooser filters out Block Store Links itself; if no other browsers are installed, it falls back to the built-in WebView.
- When package visibility blocks resolving a label, the package name is shown instead of an unknown label.
- Label overrides are included in export/import.
app/src/main/java/com/duda/blockstorelinks/LinkInterceptorActivity.ktapp/src/main/java/com/duda/blockstorelinks/MainActivity.ktapp/src/main/java/com/duda/blockstorelinks/AppPolicyStore.ktapp/src/main/java/com/duda/blockstorelinks/BrowserActivity.kt