Skip to content

Repository files navigation

Net Swiss Knife – Android Networking Utilities

Net Swiss Knife is an Android "Swiss army knife" app for network diagnostics and utilities. It provides a collection of networking tools in a clean, modern Jetpack Compose + Material 3 UI.


Features

Ping

ICMP round-trip latency measurement with real-time streaming results.

  • Configurable probe count (1–50 via slider; default configurable up to 100 in Settings), timeout (100–30,000 ms), and packet size (1–65,507 bytes)
  • Per-probe RTT reporting with sequence numbers and status (SUCCESS / TIMEOUT / ERROR)
  • Live stats panel during active ping: packet loss %, min, avg, and max RTT updating after every packet
  • RTT chart with Y-axis ms labels and fill gradient, rendered as results arrive
  • Continuous mode — toggle replaces the count slider; pings indefinitely while the app is on screen, screen kept on automatically, stops when backgrounded or screen locked
    • Rolling window of the last 100 packets drives live stats and chart
    • Full session log streamed to a temp CSV file; shareable via the Share button on completion
  • Recent hosts saved per-session and offered as quick-select chips

Traceroute

Network path analysis with per-hop geolocation enrichment.

  • Configurable max hops (1–64), timeout (500–30,000 ms), and probes per hop (1–5)
  • Dual protocol support: ICMP and UDP
  • Automatic MTU discovery or custom packet size (28–1,472 bytes)
  • Each hop shows IP address, reverse-DNS hostname, RTT, and geographic location

Port Scanner

TCP port reachability scanning with service identification.

  • 7 preset port groups: Common Services, Well-Known (1–1024), Web, Databases, Mail, Remote Access, and Custom range (up to 10,000 ports)
  • Concurrent scanning (1–500 simultaneous probes), per-port timeout (100–30,000 ms)
  • Service name resolution and banner grabbing for open ports

LAN Scanner

Local network device discovery across IPv4 subnets.

  • CIDR subnet scanning (/16–/30) with automatic current-subnet detection
  • Per-host details: IP, reverse-DNS hostname, MAC address, OUI vendor name, open ports, RTT, gateway flag
  • Concurrent host probes (1–500) with real-time progress streaming and final summary
  • Search results by IP, hostname, or vendor; filter by gateway or hosts with open ports

DNS Lookup

Full DNS record resolution with multiple resolver options.

  • 10 record types: A, AAAA, MX, TXT, CNAME, NS, SOA, PTR, SRV, CAA
  • Resolver options: system default, Google (8.8.8.8), Cloudflare (1.1.1.1), or custom server
  • PTR queries auto-reverse IPv4 addresses to .in-addr.arpa and IPv6 to .ip6.arpa form — just enter the IP
  • Returns resolved records, query time, and raw DNS response

Wi-Fi Scanner

Wi-Fi environment analysis with SSID grouping and spectrum visualisation.

  • Access points grouped by SSID + security; mesh/dual-band routers appear as one entry with a per-BSSID drill-down
  • Spectrum Analyser — frequency-domain triangle chart per AP (X = MHz, Y = RSSI −100 to −30 dBm) with SSID labels and channel gridlines; each network gets a stable accent colour derived from its SSID hash
  • Band tab-row switches between detected 2.4 / 5 / 6 GHz bands; spectrum and network list update per band
  • Best-channel callout recommends the least-congested channel (1, 6, or 11) when 2.4 GHz is active
  • Expandable network cards show each BSSID with channel, width, RSSI, and vendor; tap any BSSID for full detail sheet
  • Detail sheet: signal arc gauge, band/channel/width/standard/speed, security capability tokens, live connection stats (IP, TX/RX speed) when connected
  • Auto-refresh every 10 seconds; sort by signal strength, SSID name, or channel

TLS Inspector

SSL/TLS certificate chain analysis for any TCP host.

  • Configurable host, port (default 443), and timeout (500–30 000 ms)
  • Full certificate chain: leaf, intermediates, and root
  • Per-certificate: subject/issuer CN & org, validity dates, SANs, serial number, signature algorithm, public key algorithm & bit length, SHA-256 fingerprint
  • Connection summary: TLS version, cipher suite, handshake time, chain trust status
  • Highlights expired certificates and self-signed certs
  • Works with any TCP host, not just HTTPS — does not send an HTTP request

Network Topology Discovery

SNMP-based network topology discovery via BFS traversal.

  • Seed IP discovery using SNMP v1, v2c, or v3 with configurable community string / credentials
  • Neighbours discovered via LLDP (IEEE 802.1AB) and CDP (Cisco Discovery Protocol)
  • Per-node data: sysDescr, sysName, sysLocation, uptime, vendor, model, firmware version
  • Interface enumeration with speed, MAC address, and operational status (UP/DOWN)
  • VLAN discovery via Cisco VTP MIB and IEEE 802.1Q standard MIB
  • Interactive force-layout canvas with pan/zoom gestures and node detail bottom sheet
  • Configurable max hops (1–10), timeout, and SNMP v3 auth/priv protocols (MD5/SHA, DES/AES128)

WHOIS Lookup

Domain and IP registration lookup via three-hop WHOIS referral chain.

  • Supports domain names, IPv4, IPv6, and ASN queries
  • Three-hop chain for domains: IANA referral → TLD registry → registrar
  • Two-hop chain for IPs/ASNs: ARIN → referred RIR if needed
  • Static TLD fallback map for common TLDs (.com, .net, .org, .io, .co.uk, .de, .fr, .app, .dev)
  • Parsed fields: registrar, registration/expiry/update dates, name servers, WHOIS status codes, DNSSEC, registrant org & country
  • Human-readable status code labels (e.g. "clientTransferProhibited" → "Transfer Locked")
  • Live relay-chain visualiser: animates each server node PENDING → QUERYING → DONE as the chain progresses
  • Optional raw response per hop for power users

HTTP Probe

Full HTTP/HTTPS request tester with security header analysis.

  • Supports GET, POST, PUT, PATCH, DELETE, HEAD, and OPTIONS methods
  • Custom request headers: add/remove key-value pairs dynamically
  • Request body editor (enabled for POST, PUT, PATCH) with monospace text input
  • Follow-redirects toggle with full redirect chain display
  • Response display across four tabs:
    • Overview: status code (color-coded 2xx/3xx/4xx/5xx), response time, final URL, redirect hops, body size, Content-Type
    • Headers: collapsible request and response header sections
    • Body: scrollable monospace response body with copy-to-clipboard; truncated at 512 KB with notice
    • Security: per-header pass/warn/fail ratings for HSTS, CSP, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, and Server header information disclosure

mDNS Service Browser

LAN service discovery via multicast DNS (RFC 6762 / DNS-SD RFC 6763).

  • Discovers all advertised services on the local network without prior knowledge of service types
  • Two-phase discovery: enumerates service types via _services._dns-sd._udp.local., then instances per type, then SRV/TXT/A/AAAA records per instance
  • Supported service examples: _http._tcp, _airplay._tcp, _ipp._tcp, _homekit._tcp, _spotify-connect._tcp, and any other DNS-SD service
  • Per-service details: display name, hostname, port, IP addresses (IPv4 and IPv6), and TXT record key-value pairs
  • Live streaming results: services appear as they are discovered, grouped by service type with animated list entries
  • Expandable service items show full TXT record details on tap
  • Configurable scan duration (8-second window); scan can be stopped at any time
  • Requires Wi-Fi multicast lock (CHANGE_WIFI_MULTICAST_STATE) for reliable reception on Android

Subnet Calculator

IPv4 subnet calculator with visual binary breakdown and multi-notation conversion.

  • Two input modes: CIDR / Mask and IP Range (finds the tightest subnet covering a given min–max IP pair)
  • CIDR mode accepts CIDR (192.168.1.0/24), dot-decimal mask (192.168.1.0/255.255.255.0), space-separated mask, or bare IP (assumes /32)
  • Computes: network address, broadcast, first/last usable host, total and usable host counts
  • Binary Breakdown card: colour-coded bit grid distinguishing network bits (blue) from host bits (orange) for IP address, subnet mask, and network address rows
  • Notation Equivalents card: CIDR, dot-decimal mask, wildcard mask, hex mask (0xFFFFFF00), and binary mask
  • Address Properties card: IP class (A/B/C/D/E), private/public scope badge (RFC 1918 + loopback + link-local), prefix and host bit counts
  • Quick example chips for common subnets (/8, /12, /16, /24, /30, /0)
  • Network alignment warning when the entered IP is not on a network boundary, showing the corrected network address

Speed Test

Internet connection speed test measuring latency, download, and upload throughput.

  • Three-phase sequence: latency (10 round-trip probes), download, then upload — each streamed live as it runs
  • Animated phase stepper, live circular speed gauge, and a live throughput-over-time chart per phase
  • Final results: latency min/avg/max/jitter, download/upload average & peak Mbps, and total data transferred, each with its own throughput chart
  • Share button exports a plain-text summary of the results
  • Powered by Cloudflare — measurement traffic is sent to and timed against speed.cloudflare.com (/__down and /__up), the same backend that powers Cloudflare's public speed test at https://speed.cloudflare.com. Net Swiss Knife is an independent app and is not affiliated with, sponsored by, or endorsed by Cloudflare, Inc.; "Cloudflare" and the Cloudflare logo are trademarks of Cloudflare, Inc. Full attribution is also shown in-app under Settings → Data Source Attributions.

Wake-on-LAN

Wake sleeping or powered-down machines on the local network with a UDP magic packet.

  • Accepts all common MAC notations: AA:BB:CC:DD:EE:FF, AA-BB-CC-DD-EE-FF, AABB.CCDD.EEFF, and bare AABBCCDDEEFF
  • Real-time MAC validation with inline error feedback
  • Advanced options: custom broadcast address (default 255.255.255.255) and UDP port (default 9)
  • Sends 3 duplicate packets per request for reliability over lossy UDP
  • Success card confirms target MAC, broadcast address, port, and packet count; in-app help explains BIOS/OS requirements

Module Layout

android-network-tools/
├── app/                     # Android app module (Compose UI, ViewModels, Navigation, Hilt)
├── core-domain/             # Pure Kotlin – use cases / orchestration (depends on core-network)
├── core-network/            # Pure Kotlin – networking primitives, protocols, utilities
├── .github/
│   └── workflows/
│       ├── ci.yml                  # Standard build & test CI
│       └── release.yml             # Sign & publish release APK/AAB
├── claude/
│   └── tool_instructions.md        # Instructions for Claude when adding new tools
└── README.md

:core-network

Pure Kotlin module (no Android SDK dependency). Contains:

  • Network result wrappers (NetworkResult)
  • Host/IP validation utilities (HostValidator)
  • Repository interfaces, models, and protocol implementations for each tool
  • All TDD unit tests

:core-domain

Pure Kotlin module that depends on :core-network. Contains:

  • Use cases that orchestrate :core-network logic
  • ValidateHostUseCase and similar helpers
  • Unit-tested independently

:app

Android module (Jetpack Compose, Material 3, Hilt). Contains:

  • Single-Activity architecture (MainActivity)
  • Navigation Compose with a bottom navigation bar and animated transitions
  • Screens and ViewModels for every tool
  • Hilt dependency injection wiring

Tech Stack

Layer Technology Notes
Language Kotlin 1.9.x JDK 21, Kotlin DSL everywhere
UI Jetpack Compose + Material 3 Animated, high-fidelity UI
Navigation Navigation Compose 2.7.x Bottom nav + animated transitions
DI Hilt 2.51.x @HiltViewModel, @AndroidEntryPoint
Async Coroutines + Flow viewModelScope, StateFlow
Testing JUnit 5 + MockK TDD (Red → Green → Refactor)
Build Gradle 8.x Kotlin DSL + Version Catalog gradle/libs.versions.toml
Min SDK 26 (Android 8.0) Target SDK 34

How to Build and Test

Prerequisites

  • JDK 21
  • Android SDK (API level 34)

Run unit tests (all modules)

./gradlew test

Run unit tests for a specific module

./gradlew :core-network:test
./gradlew :core-domain:test

Build the debug APK

./gradlew :app:assembleDebug

Build release APK / AAB (requires signing secrets)

./gradlew :app:assembleRelease
./gradlew :app:bundleRelease

Available Tools

Route Tool Status
home Home / Overview Implemented
ping Ping Implemented
traceroute Traceroute Implemented
ports Port Scanner Implemented
lan LAN Scanner Implemented
dns DNS Lookup Implemented
wifi_scan Wi-Fi Scanner Implemented
topology Network Topology Discovery Implemented
tls TLS Inspector Implemented
whois WHOIS Lookup Implemented
httprobe HTTP Probe Implemented
subnet Subnet Calculator Implemented
mdns mDNS Service Browser Implemented
speedtest Speed Test Implemented
wol Wake-on-LAN Implemented

CI & Automation

Standard CI (ci.yml)

Runs on every push to main and every PR targeting main:

  1. Sets up JDK 21 (Temurin)
  2. Caches Gradle
  3. Runs ./gradlew test
  4. Runs ./gradlew :app:assembleDebug

Release (release.yml)

Triggered by a v*.*.* tag push or manual dispatch. Signs and publishes the release APK and AAB to GitHub Releases.

Required GitHub Actions secrets:

Secret Description
RELEASE_KEYSTORE_BASE64 Base64-encoded .jks / .keystore file
RELEASE_KEYSTORE_PASSWORD Keystore password
RELEASE_KEY_ALIAS Key alias
RELEASE_KEY_PASSWORD Key password

Adding a New Tool

See claude/tool_instructions.md for the step-by-step guide.

About

Android app with multiple network tools in one shell. Swiss army knife of networking.

Topics

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages