All Projects → stealthcopter → Androidnetworktools

stealthcopter / Androidnetworktools

Licence: apache-2.0
Set of useful android network tools

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Androidnetworktools

Powershell ipv4networkscanner
Powerful asynchronus IPv4 network scanner for PowerShell
Stars: ✭ 161 (-83.54%)
Mutual labels:  ping, subnet
Iptools
PHP Library for manipulating network addresses (IPv4 and IPv6)
Stars: ✭ 163 (-83.33%)
Mutual labels:  networking, subnet
Ineter
Fast Java library for working with IP addresses, ranges, and subnets
Stars: ✭ 39 (-96.01%)
Mutual labels:  networking, subnet
Ping
A PHP class to ping hosts.
Stars: ✭ 351 (-64.11%)
Mutual labels:  networking, ping
Go Ping
A simple ping library using ICMP echo requests.
Stars: ✭ 158 (-83.84%)
Mutual labels:  networking, ping
Netaddr
A network address manipulation library for Python
Stars: ✭ 648 (-33.74%)
Mutual labels:  networking, subnet
Metta
An information security preparedness tool to do adversarial simulation.
Stars: ✭ 867 (-11.35%)
Mutual labels:  networking
Workshops
Training Course for Ansible Automation Platform
Stars: ✭ 951 (-2.76%)
Mutual labels:  networking
Awareness
The new architecture of co-computation for data processing and machine learning.
Stars: ✭ 11 (-98.88%)
Mutual labels:  networking
Ubernet
Flexible networking library for Unity
Stars: ✭ 10 (-98.98%)
Mutual labels:  networking
Verwalter
A tool which manages cluster of services
Stars: ✭ 34 (-96.52%)
Mutual labels:  networking
Pingg
Ping latency graphing CLI
Stars: ✭ 33 (-96.63%)
Mutual labels:  ping
Libzmq
ZeroMQ core engine in C++, implements ZMTP/3.1
Stars: ✭ 7,418 (+658.49%)
Mutual labels:  networking
Quavo
An open source OSRS emulation server aimed to be fast and informative.
Stars: ✭ 12 (-98.77%)
Mutual labels:  networking
Asyncio
asyncio historical repository
Stars: ✭ 952 (-2.66%)
Mutual labels:  networking
Brmgr
Manage bridge devices and provide DHCP and DNS services to connected interfaces.
Stars: ✭ 11 (-98.88%)
Mutual labels:  networking
Network Programming
Small Projects on Socket Programming, Website Scanning, Wireless & Network Security
Stars: ✭ 33 (-96.63%)
Mutual labels:  networking
Sdn Handbook
SDN网络指南(SDN Handbook)
Stars: ✭ 856 (-12.47%)
Mutual labels:  networking
Bash Toolkit
Este proyecto esá destinado a ayudar a los sysadmin
Stars: ✭ 13 (-98.67%)
Mutual labels:  networking
Carrot
🥕 Build multi-device AR applications
Stars: ✭ 32 (-96.73%)
Mutual labels:  networking

⚠️ Not under active development: I am no longer actively developing this project as I have other priorities. However, I will still review and accept pull requests with bug fixes and enhancements.

Android Network Tools image

Android Arsenal CircleCI

Disappointed by the lack of good network apis in android / java I developed a collection of handy networking tools for everyday android development.

  • Port Scanning
  • Subnet Device Finder (discovers devices on local network)
  • Ping
  • Wake-On-Lan
  • & More :)

General info

The javadoc should provide all information needed to understand the methods, but if not feel free to add a issue in github and I'll address any questions! :)

Sample app

The sample app is published on Google Play & F-Droid to allow you to quickly and easier test the library. Enjoy! And please do feedback to us if your tests produce different results.

Get it on F-Droid Get it on Google Play

Usage

Add as dependency

This library is not yet released in Maven Central, until then you can add as a library module or use JitPack.io

add remote maven url

    repositories {
        maven {
            url "https://jitpack.io"
        }
    }

then add a library dependency. Remember to check for latest release here

    dependencies {
        compile 'com.github.stealthcopter:AndroidNetworkTools:0.4.5.3'
    }

Add permission

Requires internet permission (obviously...)

  <uses-permission android:name="android.permission.INTERNET" />

Port Scanning

A simple java based TCP / UDP port scanner, fast and easy to use. By default it will try and guess the best timeout and threads to use while scanning depending on if the address looks like localhost, local network or remote. You can override these yourself by calling setNoThreads() and setTimeoutMillis()

    // Synchronously
    ArrayList<Integer> openPorts = PortScan.onAddress("192.168.0.1").setMethodUDP().setPort(21).doScan();

    // Asynchronously
    PortScan.onAddress("192.168.0.1").setTimeOutMillis(1000).setPortsAll().setMethodTCP().doScan(new PortScan.PortListener() {
      @Override
      public void onResult(int portNo, boolean open) {
        if (open) // Stub: found open port
      }

      @Override
      public void onFinished(ArrayList<Integer> openPorts) {
        // Stub: Finished scanning
      }
    });

Subnet Devices

Finds devices that respond to ping that are on the same subnet as the current device. You can set the timeout for the ping with setTimeOutMillis() [default 2500] and the number of threads with setNoThreads() [default 255]

    // Asynchronously
    SubnetDevices.fromLocalAddress().findDevices(new SubnetDevices.OnSubnetDeviceFound() {
        @Override
        public void onDeviceFound(Device device) {
            // Stub: Found subnet device
        }

        @Override
        public void onFinished(ArrayList<Device> devicesFound) {
            // Stub: Finished scanning
        }
    });

Ping

Uses the native ping binary if available on the device (some devices come without it) and falls back to a TCP request on port 7 (echo request) if not.

     // Synchronously 
     PingResult pingResult = Ping.onAddress("192.168.0.1").setTimeOutMillis(1000).doPing();
     
     // Asynchronously
     Ping.onAddress("192.168.0.1").setTimeOutMillis(1000).setTimes(5).doPing(new Ping.PingListener() {
      @Override
      public void onResult(PingResult pingResult) {
        ...
      }
    });

Note: If we do have to fall back to using TCP port 7 (the java way) to detect devices we will find significantly less than with the native ping binary. If this is an issue you could consider adding a ping binary to your application or device so that it is always available.

Note: If you want a more advanced portscanner you should consider compiling nmap into your project and using that instead.

Wake-On-Lan

Sends a Wake-on-Lan packet to the IP / MAC address

      String ipAddress = "192.168.0.1";
      String macAddress = "01:23:45:67:89:ab";
      WakeOnLan.sendWakeOnLan(ipAddress, macAddress);

Misc

Other useful methods:

      // Get a MAC Address from an IP address in the ARP Cache
      String ipAddress = "192.168.0.1";
      String macAddress = ARPInfo.getMacFromArpCache(ipAddress);

Building

It's a standard gradle project.

Contributing

I welcome pull requests, issues and feedback.

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Added some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].