Skip to content

๐Ÿ›ก๏ธ NetShield - Android Firewall & Internet Blocker

Notifications You must be signed in to change notification settings

nikhil914/Netblocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ NetShield - Android Firewall & Internet Blocker NetShield is a modern, open-source Android firewall that gives you complete control over which applications can access the internet. Built with Jetpack Compose and Clean Architecture, it uses Android's native VpnService to block traffic without requiring ROOT access.

Protect your privacy, save data, and improve battery life by blocking unwanted background connections.

โœจ Key Features ๐Ÿšซ Granular Blocking: Block internet access for specific apps while allowing others to run freely.

๐Ÿ“ถ WiFi vs. Data Control: (Planned/Pro) Separate toggles to block an app only on Mobile Data or only on WiFi.

๐Ÿ” Smart Search & Sort: Quickly find apps by name, installation date, or blocking status.

๐Ÿ“ Connection Logs: View a history of blocked connection attempts to see what your apps are doing in the background.

๐ŸŒ‘ Dark Mode Support: Fully compliant with system dark/light themes using Material 3 design.

๐Ÿ”‹ Battery Efficient: Optimized to run in the background with minimal battery drain.

๐Ÿ”’ No Root Required: Works on all standard Android devices (Android 7.0+).

โš ๏ธ Important Usage Note Please Read: Due to the way Android's VpnService establishes routing rules, changes to the block list are not applied instantly.

Whenever you Block or Unblock an app in the list, you must manually restart the VPN service (Toggle the main ON/OFF button on the dashboard) for the new rules to take effect.

We are working on dynamic rule updates for future versions.

๐Ÿ› ๏ธ How It Works (Technical) NetShield works by creating a local "sinkhole" using the Android VpnService API.

Virtual Interface: The app creates a local VPN interface (tun0) on your device.

Traffic Routing: All outgoing network traffic from your phone is routed through this interface.

Packet Inspection:

The app inspects the UID (User ID) of every outgoing packet.

It compares this UID against your local Room Database of blocked apps.

Decision Engine:

Allowed Apps: Packets are forwarded to the actual network (WiFi/LTE) seamlessly.

Blocked Apps: Packets are dropped (filtered out) before they leave the device.

Privacy First: This process happens entirely locally on your phone. No data is ever sent to an external server.

๐Ÿ—๏ธ Tech Stack Language: Kotlin

UI Toolkit: Jetpack Compose (Material 3)

Architecture: MVVM (Model-View-ViewModel) + Clean Architecture

Dependency Injection: Dagger Hilt

Local Storage: Room Database

Concurrency: Coroutines & Flow

Networking: Android VpnService, ParcelFileDescriptor

๐Ÿš€ Getting Started Clone the repository:

Bash

git clone Open in Android Studio:

Requires Android Studio Koala or newer.

Build & Run:

Connect your device or start an emulator.

Run the app configuration.

Permissions On first launch, the app will request:

VPN Connection Request: Standard Android dialog to allow the VPN profile.

Notification Permission: Required for the foreground service to keep the VPN alive.

Query All Packages: To list all installed applications on your device.

๐Ÿค Contribution Contributions are welcome! If you'd like to improve the packet filtering logic or add dynamic rule reloading, please fork the repository and submit a Pull Request.

Fork the Project

Create your Feature Branch (git checkout -b feature/DynamicRules)

Commit your Changes (git commit -m 'Add dynamic rule reloading')

Push to the Branch (git push origin feature/DynamicRules)

Open a Pull Request

๐Ÿ“„ License Distributed under the MIT License. See LICENSE for more information.

About

๐Ÿ›ก๏ธ NetShield - Android Firewall & Internet Blocker

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages