{"id":20086977,"url":"https://github.com/stealthcopter/androidnetworktools","last_synced_at":"2025-04-11T22:28:13.450Z","repository":{"id":41431578,"uuid":"47718426","full_name":"stealthcopter/AndroidNetworkTools","owner":"stealthcopter","description":"Set of useful android network tools","archived":false,"fork":false,"pushed_at":"2024-06-13T12:00:17.000Z","size":502,"stargazers_count":1422,"open_issues_count":27,"forks_count":282,"subscribers_count":75,"default_branch":"main","last_synced_at":"2025-04-04T00:06:31.192Z","etag":null,"topics":["android","android-networking","java","networking","ping","port-scanning","subnet","wake-on-lan"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stealthcopter.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["stealthcopter"]}},"created_at":"2015-12-09T20:56:08.000Z","updated_at":"2025-04-01T10:01:36.000Z","dependencies_parsed_at":"2022-08-10T02:23:09.728Z","dependency_job_id":"778d6fa5-a0c5-4a8a-9df0-65d307328c9c","html_url":"https://github.com/stealthcopter/AndroidNetworkTools","commit_stats":{"total_commits":139,"total_committers":13,"mean_commits":"10.692307692307692","dds":"0.17266187050359716","last_synced_commit":"a82af8a530988f1ace4c0579762d7620aeea7561"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stealthcopter%2FAndroidNetworkTools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stealthcopter%2FAndroidNetworkTools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stealthcopter%2FAndroidNetworkTools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stealthcopter%2FAndroidNetworkTools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stealthcopter","download_url":"https://codeload.github.com/stealthcopter/AndroidNetworkTools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248489035,"owners_count":21112486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-networking","java","networking","ping","port-scanning","subnet","wake-on-lan"],"created_at":"2024-11-13T16:03:24.179Z","updated_at":"2025-04-11T22:28:13.418Z","avatar_url":"https://github.com/stealthcopter.png","language":"Java","readme":"# Android Network Tools ![image](./app/src/main/res/mipmap-xhdpi/ic_launcher.png)\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-AndroidNetworkTools-green.svg?style=true)](https://android-arsenal.com/details/1/3112)\n[![CircleCI](https://circleci.com/gh/stealthcopter/AndroidNetworkTools.svg?style=svg)](https://circleci.com/gh/stealthcopter/AndroidNetworkTools)\n\u003ca href=\"https://www.buymeacoffee.com/stealthcopter\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/arial-yellow.png\" height=\"20px\"\u003e\u003c/a\u003e\n\nDisappointed by the lack of good network apis in android / java I developed a collection of handy networking tools for everyday android development.\n\n* Port Scanning\n* Subnet Device Finder (discovers devices on local network)\n* Ping\n* Wake-On-Lan\n* \u0026 More :)\n\n## General info\n\nThe 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! :)\n\n# Support\nIf you love what I'm doing with Android Network Tools and my other projects, you can now support my work directly! By buying me a coffee ☕, you're not just fueling my caffeine needs – you're helping me dedicate more time to developing and improving these open source projects. Every coffee counts and brings more innovation to the cybersecurity world. Thank you for your support – it means the world to me and the open source community!\n\n\u003ca href=\"https://www.buymeacoffee.com/stealthcopter\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/arial-yellow.png\" height=\"50px\"\u003e\u003c/a\u003e\n\n### Sample app\n\nThe sample app is published on Google Play \u0026 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. \n \n[\u003cimg src=\"https://fdroid.gitlab.io/artwork/badge/get-it-on.png\"\n     alt=\"Get it on F-Droid\"\n     height=\"70\"\u003e](https://f-droid.org/packages/com.stealthcotper.networktools/)\n[\u003cimg src=\"https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png\"\n     alt=\"Get it on Google Play\"\n     height=\"70\"\u003e](https://play.google.com/store/apps/details?id=com.stealthcotper.networktools)\n\n## Usage\n\n### Add as dependency\nThis library is not yet released in Maven Central, until then you can add as a library module or use JitPack.io\n\nadd remote maven url\n\n```groovy\n\n    repositories {\n        maven {\n            url \"https://jitpack.io\"\n        }\n    }\n```\n    \nthen add a library dependency. **Remember** to check for latest release [here](https://github.com/stealthcopter/AndroidNetworkTools/releases/) \n\n```groovy\n    dependencies {\n        compile 'com.github.stealthcopter:AndroidNetworkTools:0.4.5.3'\n    }\n```\n\n### Add permission\nRequires internet permission (obviously...)\n```xml\n  \u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e\n```\n\n### Port Scanning\n\nA 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()\n\n```java\n    // Synchronously\n    ArrayList\u003cInteger\u003e openPorts = PortScan.onAddress(\"192.168.0.1\").setMethodUDP().setPort(21).doScan();\n\n    // Asynchronously\n    PortScan.onAddress(\"192.168.0.1\").setTimeOutMillis(1000).setPortsAll().setMethodTCP().doScan(new PortScan.PortListener() {\n      @Override\n      public void onResult(int portNo, boolean open) {\n        if (open) // Stub: found open port\n      }\n\n      @Override\n      public void onFinished(ArrayList\u003cInteger\u003e openPorts) {\n        // Stub: Finished scanning\n      }\n    });\n\n```\n\n### Subnet Devices\n\nFinds 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\\]\n\n```\n    // Asynchronously\n    SubnetDevices.fromLocalAddress().findDevices(new SubnetDevices.OnSubnetDeviceFound() {\n        @Override\n        public void onDeviceFound(Device device) {\n            // Stub: Found subnet device\n        }\n\n        @Override\n        public void onFinished(ArrayList\u003cDevice\u003e devicesFound) {\n            // Stub: Finished scanning\n        }\n    });\n\n```\n\n### Ping\n\nUses 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.\n\n```java\n     // Synchronously \n     PingResult pingResult = Ping.onAddress(\"192.168.0.1\").setTimeOutMillis(1000).doPing();\n     \n     // Asynchronously\n     Ping.onAddress(\"192.168.0.1\").setTimeOutMillis(1000).setTimes(5).doPing(new Ping.PingListener() {\n      @Override\n      public void onResult(PingResult pingResult) {\n        ...\n      }\n    });\n```\n\nNote: 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.\n\n\nNote: If you want a more advanced portscanner you should consider compiling nmap into your project and using that instead.\n\n### Wake-On-Lan\n\nSends a Wake-on-Lan packet to the IP / MAC address\n\n```java\n      String ipAddress = \"192.168.0.1\";\n      String macAddress = \"01:23:45:67:89:ab\";\n      WakeOnLan.sendWakeOnLan(ipAddress, macAddress);\n```\n\n### Misc\n\nOther useful methods:\n\n```java\n      // Get a MAC Address from an IP address in the ARP Cache\n      String ipAddress = \"192.168.0.1\";\n      String macAddress = ARPInfo.getMacFromArpCache(ipAddress);\n```\n\n## Building\n\nIt's a standard gradle project.\n\n# Contributing\n\nI welcome pull requests, issues and feedback.\n\n- Fork it\n- Create your feature branch (`git checkout -b my-new-feature`)\n- Commit your changes (`git commit -am 'Added some feature'`)\n- Push to the branch (`git push origin my-new-feature`)\n- Create new Pull Request\n","funding_links":["https://github.com/sponsors/stealthcopter","https://www.buymeacoffee.com/stealthcopter"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstealthcopter%2Fandroidnetworktools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstealthcopter%2Fandroidnetworktools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstealthcopter%2Fandroidnetworktools/lists"}