A powerful network monitoring and management tool for Android, built with modern Jetpack Compose.
Harpy is a network monitoring application that gives you complete visibility and control over devices on your local network. Discover connected devices, manage network access, and configure advanced network protocols—all from an intuitive Material 3 interface.
Note: This application requires root access to function properly.
- Real-time device scanning using ARP protocol
- Detailed device information including IP address, MAC address, and manufacturer
- Gateway detection with visual indicators
- Custom device naming with persistent storage
- Device pinning to keep important devices at the top
- IPv4/IPv6 filtering for better organization
- Real-time Interface Selection: Dynamic detection of active network interfaces (e.g.,
wlan0,ap0,eth0) for all scanning operations. - Interface Mismatch Protection: Visual warning banner with instant "Switch Interface" logic when the system network changes.
- Block/unblock devices using ARP spoofing
- Persistent blocking that survives app restarts
- Bulk operations to unblock all devices at once
- Ping testing to verify device connectivity
- Gateway blocking (nuclear option) to disconnect all devices
- DNS spoofing for domain redirection
- DHCP spoofing for custom IP assignment
- Performance monitoring with real-time CPU/memory charts and process management
- Network topology mapping
- Real-time logging with export functionality
- Root helper binary for secure privileged operations
- Built entirely with Jetpack Compose and Material 3
- Dark theme optimized for OLED displays
- Smooth animations and transitions
- Bottom navigation for easy feature access
- Responsive design that adapts to different screen sizes
- Stack-based navigation with scroll state preservation
- Enhanced Stability: Multi-layered MAC deduplication to prevent UI crashes on complex networks (Fixes #2).
- Full API 24/25 Support: Robust backward-compatible process management using custom
ProcessUtilsfor Android 7.x devices.
Coming soon
Runtime Requirements:
- Android device with root access
- Android 7.0 (API 24) or higher
- Active Wi-Fi connection
Development Requirements:
- Android Studio Hedgehog or later
- JDK 21
- Android SDK 36
- Gradle 8.13
- Clone the repository:
git clone https://github.com/VishaL6i9/HarpyAndroid.git
cd HarpyAndroid- Build the debug APK for your desired flavor:
Standard flavor:
./gradlew assembleStandardDebugCTOS flavor:
./gradlew assembleCtosDebug- Install on your device:
Standard flavor:
adb install app/build/outputs/apk/standard/debug/app-standard-debug.apkCTOS flavor:
adb install app/build/outputs/apk/ctos/debug/app-ctos-debug.apkOr build and install in one step:
Standard flavor:
./gradlew installStandardDebugCTOS flavor:
./gradlew installCtosDebug- Grant all requested permissions
- Grant root access when prompted
- Tap "Scan Network" to discover devices
- Open the app and navigate to the Network Monitor tab
- Tap the Scan Network button. The app will automatically detect the correct interface and alert you if the selection is mismatched.
- Wait for the scan to complete (typically 5-10 seconds)
- View all discovered devices in the list
Block a device:
- Tap the block icon on any device card
- Confirm the action in the dialog
Unblock a device:
- Tap the checkmark icon on a blocked device
Customize device name:
- Tap the edit icon on any device
- Enter a custom name
- The device will appear at the top of the list
Pin a device:
- Tap the pin icon to keep the device visible at the top
Test connectivity:
- Tap the ping icon to verify if a device is reachable
- Navigate to the DNS Spoofing tab
- Tap Start DNS Spoofing
- Enter the domain to spoof (e.g.,
example.com) - Enter the IP address to redirect to
- Specify the network interface (usually
wlan0) - Tap Start
- Navigate to the DHCP Spoofing tab
- Tap Start DHCP Spoofing
- Enter the target device's MAC address
- Configure the spoofed IP, gateway, and DNS settings
- Tap Start
- Navigate to Settings > Performance Monitor
- View real-time CPU usage, memory consumption, and thermal stats
- Tap on any metric to see detailed graphs
- Access the process list to view all running processes
- Sort processes by memory, CPU, name, or UID
- Kill misbehaving processes or adjust OOM scores (requires root)
Harpy follows modern Android development best practices with a clean architecture approach and Product Flavors for build variants.
Harpy uses Android Product Flavors to manage multiple build variants (standard and ctos) while maintaining a unified codebase:
Shared Code Structure (src/main/):
- All common code, screens, and business logic
- Shared repositories, use cases, and ViewModels
- Common UI components and navigation
Flavor-Specific Code:
src/standard/- Standard theme and flavor-specific configurationsrc/ctos/- CTOS theme and flavor-specific configuration
Theme Injection via Hilt:
ThemeProviderinterface defines theme contractStandardThemeModule- Provides StandardTheme for standard flavorCtosThemeModule- Provides CtosTheme for ctos flavor- Automatic theme injection through Hilt dependency injection
This approach eliminates 88% code duplication while maintaining clean separation of concerns.
app/src/main/kotlin/com/vishal/harpy/
├── core/ # Shared utilities and components
│ ├── native/ # JNI bindings for C++ code
│ ├── network/ # Network utilities
│ ├── ui/ # Common UI components
│ ├── di/ # Dependency injection modules
│ ├── service/ # Background services
│ ├── state/ # State management
│ └── utils/ # Helper classes
├── features/ # Feature modules
│ ├── device_manager/
│ │ ├── data/ # Data layer (repositories)
│ │ ├── domain/ # Business logic (use cases)
│ │ └── presentation/ # ViewModels
│ ├── network_monitor/
│ ├── dns/
│ │ ├── data/
│ │ ├── domain/
│ │ └── di/
│ └── dhcp/
│ ├── data/
│ ├── domain/
│ └── di/
├── ui/ # Compose UI layer
│ ├── screens/ # Screen composables
│ │ ├── network/
│ │ ├── dns/
│ │ ├── dhcp/
│ │ ├── settings/
│ │ ├── status/
│ │ ├── device_management/
│ │ └── performance/ # Performance monitoring screens
│ ├── components/ # Reusable UI components
│ ├── theme/ # Material 3 theme (shared interface)
│ ├── di/ # Theme provider modules
│ ├── viewmodel/ # Shared ViewModels
│ └── HarpyApp.kt # Main app composable
└── main/
└── MainActivityCompose.kt # Entry point
app/src/standard/kotlin/com/vishal/harpy/
├── ui/
│ ├── theme/
│ │ └── StandardTheme.kt # Standard flavor theme
│ └── di/
│ └── StandardThemeModule.kt # Hilt module for standard theme
└── ... # Other flavor-specific overrides
app/src/ctos/kotlin/com/vishal/harpy/
├── ui/
│ ├── theme/
│ │ └── CtosTheme.kt # CTOS flavor theme
│ └── di/
│ └── CtosThemeModule.kt # Hilt module for CTOS theme
└── ... # Other flavor-specific overrides
UI Layer:
- Jetpack Compose for declarative UI
- Material 3 components
- Compose Navigation with stack-based back navigation
- Lifecycle-aware state management
- Scroll state preservation across navigation
Domain Layer:
- Use cases for business logic
- Repository pattern for data access
- Kotlin Coroutines for async operations
Data Layer:
- SharedPreferences with
SettingsRepositoryfor application and device preferences - Native C++ for low-level network operations
- Root helper binary for privileged operations
Dependency Injection:
- Hilt for compile-time DI with custom ServiceEntryPoint
Native Code:
- C++ for raw socket operations
- JNI for Kotlin-C++ interop
- CMake for native builds
Harpy uses a combination of techniques for network operations:
Device Discovery:
- ARP scanning with optimized packet pacing
- Multi-pass scanning for reliability
- Vendor identification using OUI database
Device Blocking:
- Bidirectional ARP spoofing
- Persistent block state tracking
- Automatic restoration after app restart
DNS Spoofing:
- UDP socket listener on port 53
- DNS packet parsing and response crafting
- Domain-to-IP redirection
DHCP Spoofing:
- UDP socket listener on port 67
- DHCP packet interception
- Custom IP configuration injection
For security and stability, privileged operations are performed by a separate root helper binary (libharpy_root_helper.so). This provides:
- Better security isolation
- Granular permission control
- Improved stability
- Easier debugging
The helper supports these commands:
scan- Network device discoverymac- MAC address resolutionblock- Device blocking via ARP spoofingunblock- Device unblockingdns_spoof- DNS query interceptiondhcp_spoof- DHCP request interception
Harpy is optimized for efficiency:
- Fast scanning: Typical network scan completes in 5-10 seconds
- Low memory footprint: Efficient data structures and caching
- Battery friendly: Operations are performed on-demand
- Smooth UI: 60 FPS animations with Compose
- Root access required: All privileged operations require explicit root permission
- Local operation: No data is sent to external servers
- Transparent logging: All operations are logged for debugging
- Open source: Code is available for security review
The developers of Harpy are not responsible for any misuse of this application. Use at your own risk.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Kotlin coding conventions
- Use meaningful variable and function names
- Add comments for complex logic
- Write unit tests for new features
- Jetpack Compose migration with Material 3
- Network device discovery and management
- Device blocking/unblocking with ARP spoofing
- DNS and DHCP spoofing
- Persistent device preferences
- Root helper binary architecture
- Real-time logging system with log management utilities
- Comprehensive application settings (Scan timeout, interface selection, debug mode)
- Performance monitoring with root-based CPU/memory tracking
- Process list with kill and OOM score adjustment
- Stack-based navigation with scroll state preservation
- Dark mode theme with system theme support
- Real-time Interface Selection and Mismatch Warning System
- Comprehensive API 24/25 (Android 7.0/7.1) Stability Pack
- Product Flavors Build Architecture - Consolidated standard and ctos builds with 88% code duplication eliminated
- Hilt-based Theme Injection - Flavor-specific theme injection via dependency injection
- Comprehensive unit testing
- Integration tests
- Performance benchmarking
- Network traffic analysis
- Bandwidth monitoring per device
- Scheduled blocking
- Network usage statistics
- SSL/TLS interception
- HTTP/HTTPS proxying
- VpnService-based non-root mode
- Ensure your device is rooted
- Grant root permission when prompted
- Check logcat for error messages
- Verify you're connected to Wi-Fi
- Check that root access is granted
- Try increasing scan timeout in Settings > Scan Settings
- Ensure the correct network interface is selected in Settings > Interface Selection (The app will now show a Real-time Warning if there is a mismatch)
- Ensure the device is on the same network
- Verify root helper binary is installed correctly
- Check logs for error messages
# Clean and rebuild
./gradlew clean
./gradlew assembleDebug --refresh-dependenciesHarpy is inspired by the iOS jailbreak tweak of the same name. Special thanks to:
- The Android development community
- Contributors to open-source networking tools
- The Jetpack Compose team at Google
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Disclaimer: This tool is provided for educational and authorized network management purposes only. Always obtain proper authorization before monitoring or modifying network traffic.