Skip to content

Laviesss/InputBlocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

247 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ InputBlocker

Intelligent ghost-tap filtering for failing Android touchscreens

CI Build Release Pipeline MIT License GitHub Release Issues Platform Min SDK Root Managers PRs Welcome

Quick Start β€’ Features β€’ How It Works β€’ Downloads β€’ Docs β€’ FAQ


πŸ“‹ Table of Contents


πŸ€” Why InputBlocker?

The problem: Failing digitizers cause ghost taps β€” phantom touches from electrical noise. These random touches can:

  • Interrupt your typing with random taps
  • Click things you never intended to touch
  • Drain battery by keeping the screen active
  • Make your device nearly unusable

Existing solutions block entire chunks of the screen unconditionally, turning usable displays into wastelands.

InputBlocker filters touches at the OS input level based on physical properties (pressure, duration). Your screen stays usable. Ghosts get blocked. No blind screen blocks.


⚑ Quick Start

Requirements

Dependency Details
Root access Magisk (β‰₯20400), KernelSU, or APatch
Xposed framework LSPosed or Vector installed in your root manager
Android 6.0+ (API 23)
ADB For PC tool β€” USB Debugging enabled (optional)

Installation

# 1. Download the latest module from Releases
# 2. Flash in your root manager (Magisk / KernelSU / APatch)
# 3. Reboot
# 4. Enable InputBlocker in LSPosed Manager for "System Framework"
# 5. Reboot again
# 6. Open the InputBlocker companion app to verify

First time? See Getting Started Guide for a full walkthrough.

Emergency Recovery

Situation Action
Overlay blocks everything Press Volume Down Γ— 3 β†’ Volume Up Γ— 3
Boot loop Boot Safe Mode β†’ disable module in LSPosed
Crash detected adb shell rm /data/adb/modules/inputblocker/config/crash_detected
Hard disable echo "1" > /data/adb/modules/inputblocker/config/kill_switch

✨ Features

Core Engine

Feature Description
System-level filtering Hooks InputDispatcher.dispatchMotionLocked in system_server β€” touches blocked before apps see them
Surgical blocking Filter by touch contact area (ghost taps have tiny contact patches, reported as low "pressure" by Android) + duration (stuck pixels long-press)
Shape support Rectangle, Circle, and Ellipse regions β€” not just squares
Exclude zones Create "holes" in blocked regions for buttons you need
Per-app profiles Different blocking configs for different applications
Kill switch Emergency file-based disable β€” no UI needed

Companion App

Feature Description
Visual editor Draw regions directly on a screen preview
Live overlay See active blocking regions rendered on screen
4 themes System, Light, Dark, AMOLED (battery-saving pure black)
Auto-detection Captures ghost tap samples, suggests optimized regions
Preset system Export/import .ibpreset files for sharing configs
Block log viewer Review every filtered touch with full metadata
Community gallery Browse and download presets from other users
Update checker In-app notification when new releases are available
Quick Settings tile Toggle blocking from the notification shade
Emergency gesture Configurable button combo to disable blocking instantly

PC Designer Tool

Feature Description
Visual region editor Drag, resize shapes on a screen preview
DBSCAN auto-tuning Clusters ghost tap data to suggest optimal regions
ADB bridge Push configs and pull logs wirelessly
Cross-platform Windows (EXE), Linux (DEB), macOS (DMG)

Safety & Reliability

Feature Description
Crash-safe design Hot-path try/catch + boot-time detection prevents lockouts
Safe mode Auto-disables blocking after abnormal shutdown
Async logging Dedicated logger thread prevents I/O from blocking touch dispatch
Resolution-independent Normalized coordinates (0.0–1.0) β€” one config works across screen sizes
Low overhead Sub-millisecond filtering with two-tier caching

πŸ”§ How It Works

Ghost taps from failing digitizers have three telltale characteristics:

Signal Ghost Tap Real Finger
Contact Area Tiny electrical spike β†’ very low "pressure" (< 0.10) Full finger pad β†’ normal "pressure" (0.15 – 1.00)
Duration Instant spike OR stuck hold Brief, natural tap
Location Clusters in dead zones Anywhere on screen

Note on "Pressure": Capacitive touchscreens don't measure physical force. Android's MotionEvent.getPressure() reports touch contact area β€” how many capacitive nodes the finger covers. A larger contact patch = higher value. Electrical noise from a failing digitizer produces a minimal contact signature, so the value is very low. This still makes it an effective filter signal.

The Filter Formula

BLOCK if (ContactArea < MinPressure) OR (Duration > MaxDuration)
            Touch Event
                β”‚
                β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚ In exclude     │──YES──> PASS THROUGH
        β”‚ zone?          β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚ NO
                β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚ In blocked     │──NO──> PASS THROUGH
        β”‚ zone?          β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚ YES
                β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚ Contact area   β”‚
        β”‚ < threshold?   │──YES──> BLOCK (ghost)
        β”‚ OR             β”‚
        β”‚ Duration >     β”‚
        β”‚ max?           β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚ NO (real touch)
                β–Ό
            PASS THROUGH

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              PC Designer                      β”‚
β”‚        Visual config editor + DBSCAN          β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚ ADB push config               β”‚ ADB pull logs
       β–Ό                               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Companion App (Overlay + UI)          β”‚
β”‚    On-device management, visual editor        β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚ Write config                   β”‚ Read crash flag
       β–Ό                               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      Module Config (on-device storage)        β”‚
β”‚  /data/adb/modules/inputblocker/config/       β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚ Read                          β”‚ Write flag
       β–Ό                               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    Xposed Hook (InputDispatcher hook)         β”‚
β”‚  Intercepts all touch events in system_server β”‚
β”‚  β†’ Blocks ghosts β†’ Apps never see them       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“¦ Components

Component Description Tech Stack
Xposed Hook System-level touch filter engine Legacy Xposed API, Kotlin
Companion App On-device management UI + overlay Jetpack, Material 3, Kotlin
PC Designer Desktop visual region editor Compose Desktop, Kotlin
Shared Core Normalized coordinate math, Region model Kotlin Multiplatform
Module Scripts Root installation, service, health-check Shell (POSIX)

πŸ“₯ Downloads

Platform Format Get It
Android module .zip Releases page
PC Designer (Windows) .exe Releases page
PC Designer (Linux) .deb Releases page
PC Designer (macOS) .dmg Releases page

The companion APK is bundled inside the module ZIP and installs automatically on first boot.


βš™οΈ Configuration

Config file (/data/adb/modules/inputblocker/config/profiles/default.conf):

enabled=1
lsposed_mode=1

# Format: isExclude,type,x1,y1,x2,y2,minPressure,maxDuration
# isExclude: 0=block, 1=exclude; type: 0=rect, 1=circle, 2=ellipse
# x1,y1,x2,y2: normalized 0.0-1.0; minPressure: 0.0-1.0; maxDuration: ms

0,0,0.65,0.0,1.0,1.0,0.15,300
1,2,0.88,0.92,0.06,0.08,0.0,0

Per-app profiles: Place at config/profiles/<package_name>.conf β€” engine auto-switches when the app is in the foreground.

Special flags: See Configuration Reference.


πŸ“Š Comparison

Feature InputBlocker TouchBlocker Screen Block Manual ADB hack
Filtering level Input dispatcher Overlay-only Overlay Overlay
Pressure filtering βœ… ❌ ❌ ❌
Duration filtering βœ… ❌ ❌ ❌
Shape support Rect, Circle, Ellipse Rect only Rect only Rect only
Exclude zones βœ… ❌ ❌ ❌
Per-app profiles βœ… ❌ ❌ ❌
PC visual designer βœ… ❌ ❌ ❌
Auto-detection βœ… (DBSCAN) ❌ ❌ ❌
Crash safety βœ… ❌ βœ… ❌
Emergency gesture βœ… ❌ ❌ ❌
Resolution-independent βœ… (normalized) ❌ ❌ ❌
Open source βœ… (MIT) ❌ ❌ ❌

πŸ“š Documentation

Document What's Covered
πŸ“– Getting Started Full walkthrough with screenshots for new users
πŸ“˜ Technical Docs Architecture, engine internals, configuration reference
πŸ”§ Troubleshooting Common issues, solutions, and recovery
❓ FAQ Frequently asked questions
πŸ”¬ Advanced DBSCAN tuning, custom scripts, power user tips
πŸ—οΈ Build Guide Building from source, CI/CD, outputs
🀝 Contributing How to contribute code and report issues
πŸ”’ Security Vulnerability reporting and disclosure policy
πŸ“‹ Changelog Release history

❓ FAQ

Q: Does this work with any Android device?
A: Any device running Android 6.0+ with root access and LSPosed/Vector installed.

Q: Will this affect my battery?
A: Minimal. The filtering overhead is sub-millisecond with aggressive caching. Async logging prevents I/O on the dispatch thread.

Q: Can I use this without LSPosed/Vector?
A: Yes β€” use "Overlay Mode" in the companion app. Less precise than the Xposed hook, but works without a framework module.

Q: I found ghost taps β€” how do I configure it?
A: Run Auto-Detection in the companion app to capture samples, then review and save the suggested regions. Or use the PC Designer for manual control.

Q: Will an Android update break this?
A: The hook targets InputDispatcher.dispatchMotionLocked, a stable internal API. Major Android versions rarely change this, but test after OS updates.

Q: Can I share configs?
A: Yes β€” export as .ibpreset files. Normalized coordinates make them cross-device compatible.


πŸ§ͺ Testing & Reporting

InputBlocker is in active testing and needs real-world data.

What to test:

  • Filter tuning (minPressure / maxDuration values)
  • Region layering (exclude zones inside blocking zones)
  • Emergency reset gesture
  • Per-app profile switching
  • Performance (input lag, battery drain)

How to report: Open a GitHub Issue with device model, Android version, logs (Share Log button), and your config file.


πŸ—οΈ Building from Source

git clone https://github.com/Laviesss/InputBlocker.git
cd InputBlocker
./gradlew buildAll -PVERSION_NAME="0.1.0" -PVERSION_CODE=1

Requirements: JDK 17, Android SDK (API 34). See BUILD.md for details.


🀝 Contributing

Contributions welcome! See CONTRIBUTING.md.

  • πŸ› Bugs β†’ Open an issue
  • πŸ’‘ Ideas β†’ Feature request
  • πŸ”§ Fixes β†’ PRs gladly accepted

πŸ“„ License

MIT License β€” see LICENSE.


⭐ If InputBlocker saved your device, give it a star! ⭐

Back to Top ↑

About

No description or website provided.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors