Skip to content

ItsMeVikashKumarSingh/AppBlocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AppBlocker

AppBlocker is an Android application that restricts access to specific apps by monitoring their usage via accessibility services and navigating away from them using home and back actions. It is designed for purposes such as parental control, productivity enhancement, or limiting access to distracting or unauthorized apps (e.g., games, WhatsApp mods, VPNs, or app hiders). The app hides itself from the launcher for stealth operation and includes custom crash handling for stability.

Warning: This app requires accessibility services and device admin privileges, which grant significant control over the device. Use it responsibly, only on devices you own or have explicit permission to manage, and comply with local laws and privacy regulations.

Table of Contents

Features

  • Monitors app usage using Android accessibility services
  • Automatically navigates away from targeted apps (e.g., sends home intent, performs back action)
  • Hides its launcher icon to operate discreetly
  • Implements custom exception handling for crash recovery
  • Uses device admin privileges to prevent easy uninstallation
  • Targets specific apps like games, WhatsApp mods, VPNs, and app hiders

Installation

  1. Clone the repository:
    git clone https://github.com/ItsMeVikashKumarSingh/appblocker.git
  2. Open the project in Android Studio (version 4.0 or higher recommended).
  3. Build and install the app on an Android device (API 30+ for full compatibility).

Note: After installation, the app disables its launcher icon, making it invisible in the app drawer. To manage or uninstall, use Settings > Apps or ADB commands (e.g., adb uninstall com.softwareupdateservice.official).

Setup

  1. Enable Accessibility Service:

    • Go to Settings > Accessibility > AppBlocker.
    • Toggle the service on to allow monitoring of screen content.
    • Confirm any prompts to grant permissions.
  2. Grant Device Admin Privileges:

    • Navigate to Settings > Security > Device Administrators (or follow in-app prompts).
    • Enable AppBlocker as a device admin to enhance persistence and prevent uninstallation without deactivation.
  3. Customize Targeted Apps (Optional):

    • The app blocks a predefined list of apps (see Targeted Apps).
    • To modify, edit the processChild method in app/src/main/java/com/softwareupdateservice/official/Service.java and rebuild the app.

Usage

After setup, AppBlocker runs in the background and monitors for targeted apps. When a targeted app is detected:

  • It sends the home intent (ACTION_MAIN with CATEGORY_HOME) up to five times to return to the home screen.
  • It performs a global back action (GLOBAL_ACTION_BACK) to close or navigate away from the app.

The app recursively traverses the accessibility node tree to identify targeted apps, which may impact performance on low-end devices.

Targeted Apps

AppBlocker blocks the following package names (hardcoded in Service.java):

  • Games:
    • com.tencent.iglite (Tencent games)
    • com.pubg.imobile (PUBG Mobile)
    • com.pubg.krmobile (PUBG KR)
  • WhatsApp and Mods:
    • com.whatsapp (Official WhatsApp)
    • com.sb.wa, com.fmwhatsapp, com.gbwhatsapp, com.yowhatsapp (Unofficial mods)
  • App Hiders:
    • com.calculator.hideu, com.app.hider.master.pro, com.app.calcuator.vault.hider, com.app.notepad.vault.hider, etc.
  • VPNs:
    • com.fast.free.unblock.secure.vpn, com.cloudflare.onedotonedotonedotone, free.vpn.unblock.proxy.turbovpn, etc.
  • Launchers and Privacy Apps:
    • com.anddoes.launcher, com.phone.launcher.lite, com.privacyspace.hideapps.socialspace, etc.

For the full list, refer to the processChild method in Service.java. To customize, modify the package names in the code and rebuild.

Technical Details

  • MainActivity:

    • Initializes the UI with R.layout.activity_main.
    • Disables its launcher icon using PackageManager.setComponentEnabledSetting.
    • Sets a custom uncaught exception handler (MyExceptionHandler) for crash recovery.
    • Enables StrictMode to detect leaked closable objects.
  • MyApplication:

    • Extends Application to check the top activity.
    • Terminates the process if the top activity does not match my.app.top.activity to prevent unintended behavior.
  • MyDeviceAdminReceiver:

    • Extends DeviceAdminReceiver to handle device admin events.
    • Displays a toast notification when admin privileges are enabled.
  • MyExceptionHandler:

    • Implements Thread.UncaughtExceptionHandler to capture uncaught exceptions.
    • Restarts the app with an intent containing the exception stack trace for debugging.
  • Service:

    • An AccessibilityService that processes AccessibilityEvent objects.
    • Recursively traverses the accessibility node tree to detect targeted app package names.
    • Executes home and back actions to block apps.

Requirements:

  • Android API 30 (Android 11) or higher for accessibility features.
  • Accessibility service and device admin permissions.
  • Android Studio for building and debugging.

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a feature branch: git checkout -b feature/your-feature.
  3. Commit changes: git commit -m "Add your feature".
  4. Push to the branch: git push origin feature/your-feature.
  5. Open a pull request.

Suggested improvements:

  • Add a user interface to manage targeted apps dynamically.
  • Optimize accessibility node traversal for better performance.
  • Implement logging for blocked app events.

License

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

Contact

For questions or support, contact Vikash Kumar Singh at vikashkumarsingh8352@gmail.com.

Disclaimer

This app is provided as-is, without any warranty. The developer is not liable for any damage, data loss, or unintended consequences resulting from its use. Use caution when granting accessibility or device admin permissions, and ensure compliance with local laws and privacy policies. Always back up your data before using this app.

About

A app made to block game and vpn

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published